00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VOLUMECONTROL_P_H
00021 #define VOLUMECONTROL_P_H
00022
00023 #include <QObject>
00024 #include "qmmp.h"
00025 #include "volume.h"
00026 #include "buffer.h"
00027
00028 class QTimer;
00029 class SoftwareVolume;
00030
00035 class VolumeControl : public QObject
00036 {
00037 Q_OBJECT
00038 public:
00043 VolumeControl(QObject *parent = 0);
00047 ~VolumeControl();
00054 void setVolume(int left, int right);
00058 void changeVolume(int delta);
00063 void setVolume(int volume);
00068 void setBalance(int balance);
00072 int left() const;
00076 int right() const;
00080 int volume() const;
00084 int balance() const;
00085
00086
00087 signals:
00093 void volumeChanged(int left, int right);
00098 void volumeChanged(int volume);
00103 void balanceChanged(int balance);
00104
00105 public slots:
00109 void checkVolume();
00113 void reload();
00114
00115 private:
00116 int m_left, m_right;
00117 bool m_prev_block;
00118 Volume *m_volume;
00119 QTimer *m_timer;
00120
00121 };
00126 class SoftwareVolume : public Volume
00127 {
00128 public:
00129 SoftwareVolume();
00130 ~SoftwareVolume();
00131
00132 void setVolume(const VolumeSettings &v);
00133 VolumeSettings volume() const;
00134 void changeVolume(Buffer *b, int chan);
00135
00136 static SoftwareVolume *instance();
00137
00138 private:
00139 int m_left, m_right;
00140 double m_scaleLeft, m_scaleRight;
00141 static SoftwareVolume *m_instance;
00142 };
00143
00144 #endif