source: smplayer/trunk/src/skingui/volumecontrolpanel.h@ 188

Last change on this file since 188 was 142, checked in by Silvan Scherrer, 12 years ago

SMPlayer: update trunk to 0.8.5

File size: 3.6 KB
Line 
1/* umplayer, GUI front-end for mplayer.
2 Copyright (C) 2010 Ori Rejwan
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#ifndef VOLUMECONTROLPANEL_H
20#define VOLUMECONTROLPANEL_H
21
22#include <QWidget>
23#include "mybutton.h"
24#include "panelseeker.h"
25
26class VolumeControlPanel : public QWidget
27{
28Q_OBJECT
29Q_PROPERTY( QPixmap mute READ muteIcon WRITE setMuteIcon )
30Q_PROPERTY( QPixmap max READ maxIcon WRITE setMaxIcon )
31Q_PROPERTY( QPixmap fullscreen READ fullscreenIcon WRITE setFullscreenIcon)
32Q_PROPERTY( QPixmap playlist READ playlistIcon WRITE setPlaylistIcon)
33Q_PROPERTY( QPixmap equalizer READ equalizerIcon WRITE setEqualizerIcon)
34Q_PROPERTY( QPixmap volumebar READ volumebarPix WRITE setVolumebarPix)
35Q_PROPERTY( QPixmap volumebarProgress READ volumebarProgressPix WRITE setVolumebarProgressPix)
36Q_PROPERTY( QPixmap volumeKnob READ volumeKnobPix WRITE setVolumeKnobPix)
37
38private:
39 MyButton* muteButton;
40 MyButton* maxButton;
41 MyButton* fullscreenButton;
42 MyButton* playlistButton;
43 MyButton* equalizerButton;
44 PanelSeeker* volumeBar;
45 void setButtonIcons( MyButton* button, QPixmap pix);
46
47public:
48 explicit VolumeControlPanel(QWidget *parent = 0);
49 QPixmap muteIcon() { return muteButton->myIcon().pixmap(MyIcon::Normal, MyIcon::Off); }
50 QPixmap maxIcon() { return maxButton->myIcon().pixmap(MyIcon::Normal, MyIcon::Off); }
51 QPixmap fullscreenIcon() { return fullscreenButton->myIcon().pixmap(MyIcon::Normal, MyIcon::Off); }
52 QPixmap playlistIcon() { return playlistButton->myIcon().pixmap(MyIcon::Normal, MyIcon::Off); }
53 QPixmap equalizerIcon() { return equalizerButton->myIcon().pixmap(MyIcon::Normal, MyIcon::Off); }
54 QPixmap volumebarPix() { return volumeBar->centerIcon(); }
55 QPixmap volumebarProgressPix() { return volumeBar->progressIcon(); }
56 QPixmap volumeKnobPix() { return volumeBar->knobIcon(); }
57
58 void setMuteIcon( QPixmap pix) { setButtonIcons(muteButton, pix);}
59 void setMaxIcon( QPixmap pix) { setButtonIcons(maxButton, pix);}
60 void setFullscreenIcon( QPixmap pix) {setButtonIcons(fullscreenButton, pix);}
61 void setPlaylistIcon( QPixmap pix) {setButtonIcons(playlistButton, pix);}
62 void setEqualizerIcon( QPixmap pix) {setButtonIcons(equalizerButton, pix);}
63 void setVolumebarPix(QPixmap pix) { volumeBar->setCenterIcon(pix);}
64 void setVolumebarProgressPix(QPixmap pix) { volumeBar->setProgressIcon(pix);}
65 void setVolumeKnobPix(QPixmap pix) { volumeBar->setKnobIcon(pix); }
66 void setActionCollection(QList<QAction*> actions);
67 /* bool eventFilter(QObject *watched, QEvent *event); */
68
69signals:
70 void volumeChanged(int);
71 void volumeSliderMoved(int);
72
73public slots:
74 void setVolumeMax() { volumeBar->setValue( volumeBar->maximum()); }
75 void setVolumeMin() { volumeBar->setValue( volumeBar->minimum()); }
76 void setVolume(int value);
77
78protected:
79 virtual void changeEvent (QEvent * event);
80 virtual void retranslateStrings();
81};
82
83#endif // VOLUMECONTROLPANEL_H
Note: See TracBrowser for help on using the repository browser.