Source.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /**
  2. * Copyright (c) 2006-2024 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 "Source.h"
  21. namespace love
  22. {
  23. namespace audio
  24. {
  25. namespace null
  26. {
  27. Source::Source()
  28. : love::audio::Source(Source::TYPE_STATIC)
  29. {
  30. }
  31. Source::~Source()
  32. {
  33. }
  34. love::audio::Source *Source::clone()
  35. {
  36. this->retain();
  37. return this;
  38. }
  39. bool Source::play()
  40. {
  41. return false;
  42. }
  43. void Source::stop()
  44. {
  45. }
  46. void Source::pause()
  47. {
  48. }
  49. bool Source::isPlaying() const
  50. {
  51. return false;
  52. }
  53. bool Source::isFinished() const
  54. {
  55. return true;
  56. }
  57. bool Source::update()
  58. {
  59. return false;
  60. }
  61. void Source::setPitch(float pitch)
  62. {
  63. this->pitch = pitch;
  64. }
  65. float Source::getPitch() const
  66. {
  67. return pitch;
  68. }
  69. void Source::setVolume(float volume)
  70. {
  71. this->volume = volume;
  72. }
  73. float Source::getVolume() const
  74. {
  75. return volume;
  76. }
  77. void Source::seek(double, Source::Unit)
  78. {
  79. }
  80. double Source::tell(Source::Unit)
  81. {
  82. return 0.0f;
  83. }
  84. double Source::getDuration(Unit)
  85. {
  86. return -1.0f;
  87. }
  88. void Source::setPosition(float *)
  89. {
  90. }
  91. void Source::getPosition(float *) const
  92. {
  93. }
  94. void Source::setVelocity(float *)
  95. {
  96. }
  97. void Source::getVelocity(float *) const
  98. {
  99. }
  100. void Source::setDirection(float *)
  101. {
  102. }
  103. void Source::getDirection(float *) const
  104. {
  105. }
  106. void Source::setCone(float innerAngle, float outerAngle, float outerVolume, float outerHighGain)
  107. {
  108. coneInnerAngle = innerAngle;
  109. coneOuterAngle = outerAngle;
  110. coneOuterVolume = outerVolume;
  111. coneOuterHighGain = outerHighGain;
  112. }
  113. void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume, float &outerHighGain) const
  114. {
  115. innerAngle = coneInnerAngle;
  116. outerAngle = coneOuterAngle;
  117. outerVolume = coneOuterVolume;
  118. outerHighGain = coneOuterHighGain;
  119. }
  120. void Source::setRelative(bool enable)
  121. {
  122. relative = enable;
  123. }
  124. bool Source::isRelative() const
  125. {
  126. return relative;
  127. }
  128. void Source::setLooping(bool looping)
  129. {
  130. this->looping = looping;
  131. }
  132. bool Source::isLooping() const
  133. {
  134. return looping;
  135. }
  136. void Source::setMinVolume(float volume)
  137. {
  138. this->minVolume = volume;
  139. }
  140. float Source::getMinVolume() const
  141. {
  142. return this->minVolume;
  143. }
  144. void Source::setMaxVolume(float volume)
  145. {
  146. this->maxVolume = volume;
  147. }
  148. float Source::getMaxVolume() const
  149. {
  150. return this->maxVolume;
  151. }
  152. void Source::setReferenceDistance(float distance)
  153. {
  154. this->referenceDistance = distance;
  155. }
  156. float Source::getReferenceDistance() const
  157. {
  158. return this->referenceDistance;
  159. }
  160. void Source::setRolloffFactor(float factor)
  161. {
  162. this->rolloffFactor = factor;
  163. }
  164. float Source::getRolloffFactor() const
  165. {
  166. return this->rolloffFactor;
  167. }
  168. void Source::setMaxDistance(float distance)
  169. {
  170. this->maxDistance = distance;
  171. }
  172. float Source::getMaxDistance() const
  173. {
  174. return this->maxDistance;
  175. }
  176. void Source::setAirAbsorptionFactor(float factor)
  177. {
  178. absorptionFactor = factor;
  179. }
  180. float Source::getAirAbsorptionFactor() const
  181. {
  182. return absorptionFactor;
  183. }
  184. int Source::getChannelCount() const
  185. {
  186. return 2;
  187. }
  188. int Source::getFreeBufferCount() const
  189. {
  190. return 0;
  191. }
  192. bool Source::queue(void *, size_t, int, int, int)
  193. {
  194. return false;
  195. }
  196. bool Source::setFilter(const std::map<Filter::Parameter, float> &)
  197. {
  198. return false;
  199. }
  200. bool Source::setFilter()
  201. {
  202. return false;
  203. }
  204. bool Source::getFilter(std::map<Filter::Parameter, float> &)
  205. {
  206. return false;
  207. }
  208. bool Source::setEffect(const char *)
  209. {
  210. return false;
  211. }
  212. bool Source::setEffect(const char *, const std::map<Filter::Parameter, float> &)
  213. {
  214. return false;
  215. }
  216. bool Source::unsetEffect(const char *)
  217. {
  218. return false;
  219. }
  220. bool Source::getEffect(const char *, std::map<Filter::Parameter, float> &)
  221. {
  222. return false;
  223. }
  224. bool Source::getActiveEffects(std::vector<std::string> &) const
  225. {
  226. return false;
  227. }
  228. } // null
  229. } // audio
  230. } // love