Source.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. /**
  2. * Copyright (c) 2006-2013 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::copy()
  35. {
  36. this->retain();
  37. return this;
  38. }
  39. void Source::play()
  40. {
  41. }
  42. void Source::stop()
  43. {
  44. }
  45. void Source::pause()
  46. {
  47. }
  48. void Source::resume()
  49. {
  50. }
  51. void Source::rewind()
  52. {
  53. }
  54. bool Source::isStopped() const
  55. {
  56. return true;
  57. }
  58. bool Source::isPaused() const
  59. {
  60. return false;
  61. }
  62. bool Source::isFinished() const
  63. {
  64. return true;
  65. }
  66. bool Source::update()
  67. {
  68. return false;
  69. }
  70. void Source::setPitch(float pitch)
  71. {
  72. this->pitch = pitch;
  73. }
  74. float Source::getPitch() const
  75. {
  76. return pitch;
  77. }
  78. void Source::setVolume(float volume)
  79. {
  80. this->volume = volume;
  81. }
  82. float Source::getVolume() const
  83. {
  84. return volume;
  85. }
  86. void Source::seek(float, Source::Unit)
  87. {
  88. }
  89. float Source::tell(Source::Unit)
  90. {
  91. return 0.0f;
  92. }
  93. void Source::setPosition(float *)
  94. {
  95. }
  96. void Source::getPosition(float *) const
  97. {
  98. }
  99. void Source::setVelocity(float *)
  100. {
  101. }
  102. void Source::getVelocity(float *) const
  103. {
  104. }
  105. void Source::setDirection(float *)
  106. {
  107. }
  108. void Source::getDirection(float *) const
  109. {
  110. }
  111. void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
  112. {
  113. coneInnerAngle = innerAngle;
  114. coneOuterAngle = outerAngle;
  115. coneOuterVolume = outerVolume;
  116. }
  117. void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) const
  118. {
  119. innerAngle = coneInnerAngle;
  120. outerAngle = coneOuterAngle;
  121. outerVolume = coneOuterVolume;
  122. }
  123. void Source::setRelativePosition(bool relative)
  124. {
  125. relativePosition = relative;
  126. }
  127. bool Source::hasRelativePosition() const
  128. {
  129. return relativePosition;
  130. }
  131. void Source::setLooping(bool looping)
  132. {
  133. this->looping = looping;
  134. }
  135. bool Source::isLooping() const
  136. {
  137. return looping;
  138. }
  139. bool Source::isStatic() const
  140. {
  141. return (type == TYPE_STATIC);
  142. }
  143. void Source::setMinVolume(float volume)
  144. {
  145. this->minVolume = volume;
  146. }
  147. float Source::getMinVolume() const
  148. {
  149. return this->minVolume;
  150. }
  151. void Source::setMaxVolume(float volume)
  152. {
  153. this->maxVolume = volume;
  154. }
  155. float Source::getMaxVolume() const
  156. {
  157. return this->maxVolume;
  158. }
  159. void Source::setReferenceDistance(float distance)
  160. {
  161. this->referenceDistance = distance;
  162. }
  163. float Source::getReferenceDistance() const
  164. {
  165. return this->referenceDistance;
  166. }
  167. void Source::setRolloffFactor(float factor)
  168. {
  169. this->rolloffFactor = factor;
  170. }
  171. float Source::getRolloffFactor() const
  172. {
  173. return this->rolloffFactor;
  174. }
  175. void Source::setMaxDistance(float distance)
  176. {
  177. this->maxDistance = distance;
  178. }
  179. float Source::getMaxDistance() const
  180. {
  181. return this->maxDistance;
  182. }
  183. } // null
  184. } // audio
  185. } // love