AudioPersistent.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. };
  54. #define AudioSource int
  55. class AudioService;
  56. class AudioPersistent
  57. {
  58. Q_DISABLE_COPY(AudioPersistent)
  59. public:
  60. static void reset();
  61. static int getVolume(const bool reload = false);
  62. static int getEqualizerItem(const bool reload = false);
  63. static int getBassEqualizer(const bool reload = false);
  64. static int getMiddleEqualizer(const bool reload = false);
  65. static int getTrebleEqualizer(const bool reload = false);
  66. static void setEqualizerItem(const int item);
  67. static void setBassEqualizer(const int value);
  68. static void setMiddleEqualizer(const int value);
  69. static void setTrebleEqualizer(const int value);
  70. static int getSoundItem(const bool reload = false);
  71. static int getLeftSound(const bool reload = false);
  72. static int getRightSound(const bool reload = false);
  73. static void setSoundItem(const int item);
  74. static void setLeftSound(const int value);
  75. static void setRightSound(const int value);
  76. private:
  77. friend class AudioService;
  78. friend class AudioServicePrivate;
  79. static void setVolume(int value);
  80. };
  81. #endif // AUDIOPERSISTENT_H