Audio.pkg 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $#include "Audio/Audio.h"
  2. static const String SOUND_MASTER;
  3. static const String SOUND_EFFECT;
  4. static const String SOUND_AMBIENT;
  5. static const String SOUND_VOICE;
  6. static const String SOUND_MUSIC;
  7. class Audio : public Object
  8. {
  9. bool SetMode(int bufferLengthMSec, int mixRate, bool stereo, bool interpolation = true);
  10. bool Play();
  11. void Stop();
  12. void SetMasterGain(const String type, float gain);
  13. void SetListener(SoundListener* listener);
  14. void StopSound(Sound* sound);
  15. unsigned GetSampleSize() const;
  16. int GetMixRate() const;
  17. bool GetInterpolation() const;
  18. bool IsStereo() const;
  19. bool IsPlaying() const;
  20. bool IsInitialized() const;
  21. bool HasMasterGain(const String type) const;
  22. float GetMasterGain(const String type) const;
  23. SoundListener* GetListener() const;
  24. const PODVector<SoundSource*>& GetSoundSources() const;
  25. void AddSoundSource(SoundSource* soundSource);
  26. void RemoveSoundSource(SoundSource* soundSource);
  27. void MixOutput(void *dest, unsigned samples);
  28. tolua_readonly tolua_property__get_set unsigned sampleSize;
  29. tolua_readonly tolua_property__get_set int mixRate;
  30. tolua_readonly tolua_property__get_set bool interpolation;
  31. tolua_readonly tolua_property__is_set bool stereo;
  32. tolua_readonly tolua_property__is_set bool playing;
  33. tolua_readonly tolua_property__is_set bool initialized;
  34. tolua_property__get_set SoundListener* listener;
  35. };
  36. Audio* GetAudio();
  37. tolua_readonly tolua_property__get_set Audio* audio;
  38. ${
  39. #define TOLUA_DISABLE_tolua_AudioLuaAPI_GetAudio00
  40. static int tolua_AudioLuaAPI_GetAudio00(lua_State* tolua_S)
  41. {
  42. return ToluaGetSubsystem<Audio>(tolua_S);
  43. }
  44. #define TOLUA_DISABLE_tolua_get_audio_ptr
  45. #define tolua_get_audio_ptr tolua_AudioLuaAPI_GetAudio00
  46. $}