AudioPersistent.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef AUDIOPERSISTENT_H
  2. #define AUDIOPERSISTENT_H
  3. #include <QtGlobal>
  4. enum SpeakerSoundItem {
  5. SSI_Undefine = -1,
  6. SSI_PowerOn,
  7. SSI_PowerOff,
  8. };
  9. #define SpeakerSoundItem int
  10. enum MuteItem {
  11. MI_Undefine = -1,
  12. MI_Unmute,
  13. MI_Mute,
  14. };
  15. #define MuteItem int
  16. enum EqualizerItem {
  17. EI_Undefine = -1,
  18. EI_Standard,
  19. EI_Popular,
  20. EI_Classic,
  21. EI_Jazz,
  22. EI_Custom,
  23. };
  24. #define EqualizerItem int
  25. enum SoundItem {
  26. SI_Undefine = -1,
  27. SI_Master,
  28. SI_Slave,
  29. SI_RearLeft,
  30. SI_RearRight,
  31. SI_Custom,
  32. };
  33. #define SoundItem int
  34. enum AudioSource {
  35. AS_Undefine = -1,
  36. AS_Idle = 0,
  37. AS_Radio = 1,
  38. AS_Music = 2,
  39. AS_Video = 3,
  40. AS_CarplayMusic = 4,
  41. AS_CarplayPhone = 5,
  42. AS_AutoMusic = 6,
  43. AS_AutoPhone = 7,
  44. AS_CarlifeMusic = 8,
  45. AS_CarlifePhone = 9,
  46. AS_BluetoothMusic = 10,
  47. AS_BluetoothPhone = 11,
  48. AS_Aux = 12,
  49. AS_ECLinkMusic = 13,
  50. AS_ECLinkBluetoothMusic = 14,
  51. AS_HiCarMusic = 15,
  52. AS_HiCarBluetoothMusic = 16,
  53. AS_IccoaMusic = 17,
  54. AS_IccoaPhone = 18,
  55. AS_ECLinkPhone = 19
  56. };
  57. #define AudioSource int
  58. class AudioService;
  59. class AudioPersistent
  60. {
  61. Q_DISABLE_COPY(AudioPersistent)
  62. public:
  63. static void reset();
  64. static int getVolume(const bool reload = false);
  65. static int getEqualizerItem(const bool reload = false);
  66. static int getBassEqualizer(const bool reload = false);
  67. static int getMiddleEqualizer(const bool reload = false);
  68. static int getTrebleEqualizer(const bool reload = false);
  69. static void setEqualizerItem(const int item);
  70. static void setBassEqualizer(const int value);
  71. static void setMiddleEqualizer(const int value);
  72. static void setTrebleEqualizer(const int value);
  73. static int getSoundItem(const bool reload = false);
  74. static int getLeftSound(const bool reload = false);
  75. static int getRightSound(const bool reload = false);
  76. static void setSoundItem(const int item);
  77. static void setLeftSound(const int value);
  78. static void setRightSound(const int value);
  79. private:
  80. friend class AudioService;
  81. friend class AudioServicePrivate;
  82. static void setVolume(int value);
  83. };
  84. #endif // AUDIOPERSISTENT_H