SoundSource.pkg 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $#include "SoundSource.h"
  2. enum SoundType{};
  3. class SoundSource : public Component
  4. {
  5. public:
  6. void Play(Sound* sound);
  7. void Play(Sound* sound, float frequency);
  8. void Play(Sound* sound, float frequency, float gain);
  9. void Play(Sound* sound, float frequency, float gain, float panning);
  10. void Stop();
  11. void SetSoundType(SoundType type);
  12. void SetFrequency(float frequency);
  13. void SetGain(float gain);
  14. void SetAttenuation(float attenuation);
  15. void SetPanning(float panning);
  16. void SetAutoRemove(bool enable);
  17. // void SetPlayPosition(signed char* pos);
  18. Sound* GetSound() const;
  19. // volatile signed char* GetPlayPosition() const;
  20. SoundType GetSoundType() const;
  21. float GetTimePosition() const;
  22. float GetFrequency() const;
  23. float GetGain() const;
  24. float GetAttenuation() const;
  25. float GetPanning() const;
  26. bool GetAutoRemove() const;
  27. bool IsPlaying() const;
  28. void PlayLockless(Sound* sound);
  29. void StopLockless();
  30. void SetPlayPositionLockless(signed char* position);
  31. void Mix(int* dest, unsigned samples, int mixRate, bool stereo, bool interpolation);
  32. tolua_readonly tolua_property__get_set Sound* sound;
  33. tolua_property__get_set SoundType soundType;
  34. tolua_readonly tolua_property__get_set float timePosition;
  35. tolua_property__get_set float frequency;
  36. tolua_property__get_set float gain;
  37. tolua_property__get_set float attenuation;
  38. tolua_property__get_set float panning;
  39. tolua_property__get_set bool autoRemove;
  40. tolua_readonly tolua_property__is_set bool playing;
  41. };