RPAudioProtocol.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // RPAudioProtocol.h
  3. // red_protocol
  4. //
  5. // Created by 杜家兑 on 2024/3/1.
  6. //
  7. #ifndef RPAudioProtocol_h
  8. #define RPAudioProtocol_h
  9. #include "RPMacros.h"
  10. #include <string>
  11. #include <cassert>
  12. #include <vector>
  13. NS_RP_BEGIN
  14. struct AudioParam
  15. {
  16. std::string name;
  17. float fValue1 = 0.f;
  18. float fValue2 = 0.f;
  19. float fValue3 = 0.f;
  20. std::string SValue1;
  21. std::string SValue2;
  22. std::string SValue3;
  23. };
  24. /***************************************************************************
  25. MARK: 实现的协议接口。
  26. ****************************************************************************/
  27. class AudioProtocol {
  28. public:
  29. /// 播放音频协议接口
  30. virtual void playAudio(const std::string& str) { assert(false); };
  31. virtual void playAudio(const std::string& str1, const std::string& str2) { assert(false); };
  32. virtual void playAudio(const std::string& str1, const std::string& str2, bool force, const std::vector<AudioParam>& audioParams) { assert(false); };
  33. AudioProtocol() = default;
  34. virtual ~AudioProtocol() = default;
  35. };
  36. NS_RP_END
  37. #endif /* RPAudioProtocol_h */