Panda3D
audioSound.cxx
1 // Filename: audioSound.cxx
2 // Created by: skyler (June 6, 2001)
3 // Prior system by: cary
4 //
5 ////////////////////////////////////////////////////////////////////
6 //
7 // PANDA 3D SOFTWARE
8 // Copyright (c) Carnegie Mellon University. All rights reserved.
9 //
10 // All use of this software is subject to the terms of the revised BSD
11 // license. You should have received a copy of this license along
12 // with this source code in a file named "LICENSE."
13 //
14 ////////////////////////////////////////////////////////////////////
15 
16 #include "audioSound.h"
17 
18 TypeHandle AudioSound::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: AudioSound::Destructor
22 // Access: Published, Virtual
23 // Description:
24 ////////////////////////////////////////////////////////////////////
25 AudioSound::
26 ~AudioSound() {
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: AudioSound::Constructor
31 // Access: Protected
32 // Description:
33 ////////////////////////////////////////////////////////////////////
34 AudioSound::
35 AudioSound() {
36  // Intentionally blank.
37 }
38 
39 
40 void AudioSound::
41 set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
42  // Intentionally blank.
43 }
44 
45 void AudioSound::
46 get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
47  // Intentionally blank.
48 }
49 
50 void AudioSound::
51 set_3d_min_distance(PN_stdfloat dist) {
52  // Intentionally blank.
53 }
54 
55 PN_stdfloat AudioSound::
56 get_3d_min_distance() const {
57  // Intentionally blank.
58  return 0.0f;
59 }
60 
61 void AudioSound::
62 set_3d_max_distance(PN_stdfloat dist) {
63  // Intentionally blank.
64 }
65 
66 PN_stdfloat AudioSound::
67 get_3d_max_distance() const {
68  // Intentionally blank.
69  return 0.0f;
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function: AudioSound::get_speaker_mix
74 // Access: Published
75 // Description: For use only with FMOD.
76 ////////////////////////////////////////////////////////////////////
77 PN_stdfloat AudioSound::
78 get_speaker_mix(int speaker) {
79  // intentionally blank
80  return 0.0;
81 }
82 
83 ////////////////////////////////////////////////////////////////////
84 // Function: AudioSound::set_speaker_mix
85 // Access: Published
86 // Description: For use only with FMOD.
87 ////////////////////////////////////////////////////////////////////
88 void AudioSound::
89 set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright) {
90  // intentionally blank
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: AudioSound::get_speaker_level
95 // Access: Published
96 // Description: For use only with Miles.
97 ////////////////////////////////////////////////////////////////////
98 PN_stdfloat AudioSound::
99 get_speaker_level(int index) {
100  // intentionally blank
101  return 0.0;
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: AudioSound::set_speaker_levels
106 // Access: Published
107 // Description: For use only with Miles.
108 ////////////////////////////////////////////////////////////////////
109 void AudioSound::
110 set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2, PN_stdfloat level3, PN_stdfloat level4, PN_stdfloat level5, PN_stdfloat level6, PN_stdfloat level7, PN_stdfloat level8, PN_stdfloat level9) {
111  // intentionally blank
112 }
113 
114 ////////////////////////////////////////////////////////////////////
115 // Function: AudioSound::configure_filters
116 // Access: Published
117 // Description: Configure the local DSP filter chain.
118 //
119 // There is no guarantee that any given configuration
120 // will be supported by the implementation. The only
121 // way to find out what's supported is to call
122 // configure_filters. If it returns true, the
123 // configuration is supported.
124 ////////////////////////////////////////////////////////////////////
125 bool AudioSound::
127  const FilterProperties::ConfigVector &conf = config->get_config();
128  if (conf.empty()) {
129  return true;
130  } else {
131  return false;
132  }
133 }
134 
135 ////////////////////////////////////////////////////////////////////
136 // Function: AudioSound::get_priority
137 // Access: Published
138 // Description:
139 ////////////////////////////////////////////////////////////////////
140 int AudioSound::
141 get_priority() {
142  // intentionally blank
143  return 0;
144 }
145 
146 ////////////////////////////////////////////////////////////////////
147 // Function: AudioSound::set_priority
148 // Access: Published
149 // Description:
150 ////////////////////////////////////////////////////////////////////
151 void AudioSound::
152 set_priority(int priority) {
153  // intentionally blank
154  ;
155 }
156 
157 ////////////////////////////////////////////////////////////////////
158 // Function: AudioSound::output
159 // Access: Published, Virtual
160 // Description:
161 ////////////////////////////////////////////////////////////////////
162 void AudioSound::
163 output(ostream &out) const {
164  out << get_type() << " " << get_name() << " " << status();
165 }
166 
167 ////////////////////////////////////////////////////////////////////
168 // Function: AudioSound::write
169 // Access: Published, Virtual
170 // Description:
171 ////////////////////////////////////////////////////////////////////
172 void AudioSound::
173 write(ostream &out) const {
174  out << (*this) << "\n";
175 }
176 
177 ////////////////////////////////////////////////////////////////////
178 // Function: AudioSound::SoundStatus::output operator
179 // Description:
180 ////////////////////////////////////////////////////////////////////
181 ostream &
182 operator << (ostream &out, AudioSound::SoundStatus status) {
183  switch (status) {
184  case AudioSound::BAD:
185  return out << "BAD";
186 
187  case AudioSound::READY:
188  return out << "READY";
189 
190  case AudioSound::PLAYING:
191  return out << "PLAYING";
192  }
193 
194  return out << "**invalid AudioSound::SoundStatus(" << (int)status << ")**";
195 }
Stores a configuration for a set of audio DSP filters.
virtual void set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright)
For use only with FMOD.
Definition: audioSound.cxx:89
const ConfigVector & get_config()
Intended for use by AudioManager and AudioSound implementations: allows access to the config vector...
virtual bool configure_filters(FilterProperties *config)
Configure the local DSP filter chain.
Definition: audioSound.cxx:126
virtual PN_stdfloat get_speaker_mix(int speaker)
For use only with FMOD.
Definition: audioSound.cxx:78
virtual void set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2=-1.0f, PN_stdfloat level3=-1.0f, PN_stdfloat level4=-1.0f, PN_stdfloat level5=-1.0f, PN_stdfloat level6=-1.0f, PN_stdfloat level7=-1.0f, PN_stdfloat level8=-1.0f, PN_stdfloat level9=-1.0f)
For use only with Miles.
Definition: audioSound.cxx:110
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual PN_stdfloat get_speaker_level(int index)
For use only with Miles.
Definition: audioSound.cxx:99