Audio.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /**
  2. * Copyright (c) 2006-2022 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #include "Audio.h"
  21. namespace love
  22. {
  23. namespace audio
  24. {
  25. namespace null
  26. {
  27. Audio::Audio()
  28. : distanceModel(DISTANCE_NONE)
  29. {
  30. }
  31. Audio::~Audio()
  32. {
  33. }
  34. const char *Audio::getName() const
  35. {
  36. return "love.audio.null";
  37. }
  38. love::audio::Source *Audio::newSource(love::sound::Decoder *)
  39. {
  40. return new Source();
  41. }
  42. love::audio::Source *Audio::newSource(love::sound::SoundData *)
  43. {
  44. return new Source();
  45. }
  46. love::audio::Source *Audio::newSource(int, int, int, int)
  47. {
  48. return new Source();
  49. }
  50. int Audio::getActiveSourceCount() const
  51. {
  52. return 0;
  53. }
  54. int Audio::getMaxSources() const
  55. {
  56. return 0;
  57. }
  58. bool Audio::play(love::audio::Source *)
  59. {
  60. return false;
  61. }
  62. bool Audio::play(const std::vector<love::audio::Source*>&)
  63. {
  64. return false;
  65. }
  66. void Audio::stop(love::audio::Source *)
  67. {
  68. }
  69. void Audio::stop(const std::vector<love::audio::Source*>&)
  70. {
  71. }
  72. void Audio::stop()
  73. {
  74. }
  75. void Audio::pause(love::audio::Source *)
  76. {
  77. }
  78. void Audio::pause(const std::vector<love::audio::Source*>&)
  79. {
  80. }
  81. std::vector<love::audio::Source*> Audio::pause()
  82. {
  83. return {};
  84. }
  85. void Audio::setVolume(float volume)
  86. {
  87. this->volume = volume;
  88. }
  89. float Audio::getVolume() const
  90. {
  91. return volume;
  92. }
  93. void Audio::getPosition(float *) const
  94. {
  95. }
  96. void Audio::setPosition(float *)
  97. {
  98. }
  99. void Audio::getOrientation(float *) const
  100. {
  101. }
  102. void Audio::setOrientation(float *)
  103. {
  104. }
  105. void Audio::getVelocity(float *) const
  106. {
  107. }
  108. void Audio::setVelocity(float *)
  109. {
  110. }
  111. void Audio::setDopplerScale(float)
  112. {
  113. }
  114. float Audio::getDopplerScale() const
  115. {
  116. return 1.0f;
  117. }
  118. /*
  119. void setMeter(float)
  120. {
  121. }
  122. float getMeter() const
  123. {
  124. return 1.0f;
  125. }
  126. */
  127. const std::vector<love::audio::RecordingDevice*> &Audio::getRecordingDevices()
  128. {
  129. return capture;
  130. }
  131. Audio::DistanceModel Audio::getDistanceModel() const
  132. {
  133. return this->distanceModel;
  134. }
  135. void Audio::setDistanceModel(DistanceModel distanceModel)
  136. {
  137. this->distanceModel = distanceModel;
  138. }
  139. bool Audio::setEffect(const char *, std::map<Effect::Parameter, float> &)
  140. {
  141. return false;
  142. }
  143. bool Audio::unsetEffect(const char *)
  144. {
  145. return false;
  146. }
  147. bool Audio::getEffect(const char *, std::map<Effect::Parameter, float> &)
  148. {
  149. return false;
  150. }
  151. bool Audio::getActiveEffects(std::vector<std::string> &) const
  152. {
  153. return false;
  154. }
  155. int Audio::getMaxSceneEffects() const
  156. {
  157. return 0;
  158. }
  159. int Audio::getMaxSourceEffects() const
  160. {
  161. return 0;
  162. }
  163. bool Audio::isEFXsupported() const
  164. {
  165. return false;
  166. }
  167. void Audio::pauseContext()
  168. {
  169. }
  170. void Audio::resumeContext()
  171. {
  172. }
  173. std::string Audio::getPlaybackDevice()
  174. {
  175. return "";
  176. }
  177. void Audio::getPlaybackDevices(std::vector<std::string> &/*list*/)
  178. {
  179. }
  180. } // null
  181. } // audio
  182. } // love