Source.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * Copyright (c) 2006-2011 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. #ifndef LOVE_AUDIO_NULL_SOURCE_H
  21. #define LOVE_AUDIO_NULL_SOURCE_H
  22. // LOVE
  23. #include <common/Object.h>
  24. #include <audio/Source.h>
  25. namespace love
  26. {
  27. namespace audio
  28. {
  29. namespace null
  30. {
  31. class Source : public love::audio::Source
  32. {
  33. private:
  34. float pitch;
  35. float volume;
  36. bool looping;
  37. public:
  38. Source();
  39. virtual ~Source();
  40. virtual love::audio::Source * copy();
  41. virtual void play();
  42. virtual void stop();
  43. virtual void pause();
  44. virtual void resume();
  45. virtual void rewind();
  46. virtual bool isStopped() const;
  47. virtual bool isPaused() const;
  48. virtual bool isFinished() const;
  49. virtual void update();
  50. virtual void setPitch(float pitch);
  51. virtual float getPitch() const;
  52. virtual void setVolume(float volume);
  53. virtual float getVolume() const;
  54. virtual void seek(float offset, Unit unit);
  55. virtual float tell(Unit unit);
  56. virtual void setPosition(float * v);
  57. virtual void getPosition(float * v) const;
  58. virtual void setVelocity(float * v);
  59. virtual void getVelocity(float * v) const;
  60. virtual void setDirection(float * v);
  61. virtual void getDirection(float * v) const;
  62. void setLooping(bool looping);
  63. bool isLooping() const;
  64. bool isStatic() const;
  65. }; // Source
  66. } // null
  67. } // audio
  68. } // love
  69. #endif // LOVE_AUDIO_NULL_SOURCE_H