M_SoundCFG.h 584 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <map>
  3. struct M_SoundCFGData
  4. {
  5. //声音ID
  6. int mSoundID;
  7. //声音名字
  8. std::string mSoundName;
  9. //声音路径
  10. std::string mSoundPath;
  11. //声音时间
  12. int mSoundTime;
  13. //声音优先级
  14. int mSoundPriority;
  15. };
  16. class M_SoundCFG
  17. {
  18. public:
  19. private:
  20. static std::auto_ptr<M_SoundCFG> msSingleton;
  21. public:
  22. int GetCount();
  23. const M_SoundCFGData* GetData(int SoundID);
  24. const std::map<int, M_SoundCFGData>& GetMapData();
  25. void Load();
  26. void LoadLua();
  27. void Reload();
  28. static M_SoundCFG* GetSingleton();
  29. static void Release();
  30. private:
  31. std::map<int, M_SoundCFGData> mMapData;
  32. };