CSound.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "WallpaperEngine/Core/Core.h"
  3. #include "WallpaperEngine/Core/CObject.h"
  4. #include "WallpaperEngine/Core/UserSettings/CUserSettingBoolean.h"
  5. namespace WallpaperEngine::Core::Objects
  6. {
  7. using json = nlohmann::json;
  8. using namespace WallpaperEngine::Core::UserSettings;
  9. class CSound : public CObject
  10. {
  11. friend class CObject;
  12. public:
  13. static CObject* fromJSON (
  14. CScene* scene,
  15. json data,
  16. CUserSettingBoolean* visible,
  17. uint32_t id,
  18. const std::string& name,
  19. CUserSettingVector3* origin,
  20. CUserSettingVector3* scale,
  21. const glm::vec3& angles
  22. );
  23. void insertSound (const std::string& filename);
  24. const std::vector<std::string>& getSounds () const;
  25. bool isRepeat () const;
  26. protected:
  27. CSound (
  28. CScene* scene,
  29. CUserSettingBoolean* visible,
  30. uint32_t id,
  31. std::string name,
  32. CUserSettingVector3* origin,
  33. CUserSettingVector3* scale,
  34. const glm::vec3& angles,
  35. bool repeat
  36. );
  37. static const std::string Type;
  38. private:
  39. bool m_repeat;
  40. std::vector<std::string> m_sounds;
  41. };
  42. }