Source.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /**
  2. * Copyright (c) 2006-2017 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(float, Source::Unit)
  78. {
  79. }
  80. float 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)
  107. {
  108. coneInnerAngle = innerAngle;
  109. coneOuterAngle = outerAngle;
  110. coneOuterVolume = outerVolume;
  111. }
  112. void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) const
  113. {
  114. innerAngle = coneInnerAngle;
  115. outerAngle = coneOuterAngle;
  116. outerVolume = coneOuterVolume;
  117. }
  118. void Source::setRelative(bool enable)
  119. {
  120. relative = enable;
  121. }
  122. bool Source::isRelative() const
  123. {
  124. return relative;
  125. }
  126. void Source::setLooping(bool looping)
  127. {
  128. this->looping = looping;
  129. }
  130. bool Source::isLooping() const
  131. {
  132. return looping;
  133. }
  134. void Source::setMinVolume(float volume)
  135. {
  136. this->minVolume = volume;
  137. }
  138. float Source::getMinVolume() const
  139. {
  140. return this->minVolume;
  141. }
  142. void Source::setMaxVolume(float volume)
  143. {
  144. this->maxVolume = volume;
  145. }
  146. float Source::getMaxVolume() const
  147. {
  148. return this->maxVolume;
  149. }
  150. void Source::setReferenceDistance(float distance)
  151. {
  152. this->referenceDistance = distance;
  153. }
  154. float Source::getReferenceDistance() const
  155. {
  156. return this->referenceDistance;
  157. }
  158. void Source::setRolloffFactor(float factor)
  159. {
  160. this->rolloffFactor = factor;
  161. }
  162. float Source::getRolloffFactor() const
  163. {
  164. return this->rolloffFactor;
  165. }
  166. void Source::setMaxDistance(float distance)
  167. {
  168. this->maxDistance = distance;
  169. }
  170. float Source::getMaxDistance() const
  171. {
  172. return this->maxDistance;
  173. }
  174. int Source::getChannels() const
  175. {
  176. return 2;
  177. }
  178. int Source::getFreeBufferCount() const
  179. {
  180. return 0;
  181. }
  182. bool Source::queue(void *, size_t, int, int, int)
  183. {
  184. return false;
  185. }
  186. bool Source::setFilter(love::audio::Filter::Type, std::vector<float> &)
  187. {
  188. return false;
  189. }
  190. bool Source::setFilter()
  191. {
  192. return false;
  193. }
  194. bool Source::getFilter(love::audio::Filter::Type &, std::vector<float> &)
  195. {
  196. return false;
  197. }
  198. } // null
  199. } // audio
  200. } // love