Sound.pkg 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $#include "Sound.h"
  2. class Sound : public Resource
  3. {
  4. Sound();
  5. ~Sound();
  6. bool LoadRaw(Deserializer& source);
  7. bool LoadWav(Deserializer& source);
  8. bool LoadOggVorbis(Deserializer& source);
  9. void SetSize(unsigned dataSize);
  10. void SetData(const void* data, unsigned dataSize);
  11. void SetFormat(unsigned frequency, bool sixteenBit, bool stereo);
  12. void SetLooped(bool enable);
  13. void SetLoop(unsigned repeatOffset, unsigned endOffset);
  14. void FixInterpolation();
  15. float GetLength() const;
  16. unsigned GetDataSize() const;
  17. unsigned GetSampleSize() const;
  18. float GetFrequency();
  19. unsigned GetIntFrequency();
  20. bool IsLooped() const;
  21. bool IsSixteenBit() const;
  22. bool IsStereo() const;
  23. bool IsCompressed() const;
  24. tolua_readonly tolua_property__get_set float length;
  25. tolua_readonly tolua_property__get_set unsigned dataSize;
  26. tolua_readonly tolua_property__get_set unsigned sampleSize;
  27. tolua_readonly tolua_property__get_set float frequency;
  28. tolua_readonly tolua_property__get_set int intFrequency;
  29. tolua_property__is_set bool looped;
  30. tolua_readonly tolua_property__is_set bool sixteenBit;
  31. tolua_readonly tolua_property__is_set bool stereo;
  32. tolua_readonly tolua_property__is_set bool compressed;
  33. };
  34. ${
  35. #define TOLUA_DISABLE_tolua_AudioLuaAPI_Sound_new00
  36. static int tolua_AudioLuaAPI_Sound_new00(lua_State* tolua_S)
  37. {
  38. return ToluaNewObject<Sound>(tolua_S);
  39. }
  40. #define TOLUA_DISABLE_tolua_AudioLuaAPI_Sound_new00_local
  41. static int tolua_AudioLuaAPI_Sound_new00_local(lua_State* tolua_S)
  42. {
  43. return ToluaNewObjectGC<Sound>(tolua_S);
  44. }
  45. $}