Audio.pkg 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 PauseSoundType(const String type);
  14. void ResumeSoundType(const String type);
  15. void ResumeAll();
  16. void SetListener(SoundListener* listener);
  17. void StopSound(Sound* sound);
  18. unsigned GetSampleSize() const;
  19. int GetMixRate() const;
  20. bool GetInterpolation() const;
  21. bool IsStereo() const;
  22. bool IsPlaying() const;
  23. bool IsInitialized() const;
  24. bool HasMasterGain(const String type) const;
  25. float GetMasterGain(const String type) const;
  26. bool IsSoundTypePaused(const String type) const;
  27. SoundListener* GetListener() const;
  28. const PODVector<SoundSource*>& GetSoundSources() const;
  29. void AddSoundSource(SoundSource* soundSource);
  30. void RemoveSoundSource(SoundSource* soundSource);
  31. void MixOutput(void *dest, unsigned samples);
  32. tolua_readonly tolua_property__get_set unsigned sampleSize;
  33. tolua_readonly tolua_property__get_set int mixRate;
  34. tolua_readonly tolua_property__get_set bool interpolation;
  35. tolua_readonly tolua_property__is_set bool stereo;
  36. tolua_readonly tolua_property__is_set bool playing;
  37. tolua_readonly tolua_property__is_set bool initialized;
  38. tolua_property__get_set SoundListener* listener;
  39. };
  40. Audio* GetAudio();
  41. tolua_readonly tolua_property__get_set Audio* audio;
  42. ${
  43. #define TOLUA_DISABLE_tolua_AudioLuaAPI_GetAudio00
  44. static int tolua_AudioLuaAPI_GetAudio00(lua_State* tolua_S)
  45. {
  46. return ToluaGetSubsystem<Audio>(tolua_S);
  47. }
  48. #define TOLUA_DISABLE_tolua_get_audio_ptr
  49. #define tolua_get_audio_ptr tolua_AudioLuaAPI_GetAudio00
  50. $}