M_SoundCFG.h 636 B

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