source: smplayer/trunk/src/skingui/mediapanel.h@ 156

Last change on this file since 156 was 156, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to 0.8.6

File size: 3.7 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
3 umplayer, Copyright (C) 2010 Ori Rejwan
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20
21#ifndef MEDIAPANEL_H
22#define MEDIAPANEL_H
23
24#include <QtGui/QWidget>
25#include <QPixmap>
26#include <QLabel>
27#include "ui_mediapanel.h"
28#include "mybutton.h"
29#include "panelseeker.h"
30
31class QGridLayout;
32
33class ScrollingLabel : public QWidget
34{
35 Q_OBJECT
36
37public:
38 ScrollingLabel(QWidget* parent=0);
39 ~ScrollingLabel(){}
40 QString text() { return mText; }
41 void setText( QString text);
42
43private:
44 QString mText;
45 void updateLabel();
46 int scrollPos;
47 int timerId;
48 QRect textRect;
49 static const int gap = 10;
50
51protected:
52 void paintEvent(QPaintEvent *);
53 void changeEvent(QEvent *);
54 void resizeEvent(QResizeEvent *);
55 QSize sizeHint() const;
56
57private slots:
58 void timerEvent(QTimerEvent *);
59};
60
61class MediaPanel : public QWidget
62{
63 Q_OBJECT
64 Q_PROPERTY(QPixmap bgLeft READ bgLeftPix WRITE setBgLeftPix)
65 Q_PROPERTY(QPixmap bgRight READ bgRightPix WRITE setBgRightPix)
66 Q_PROPERTY(QPixmap bgCenter READ bgCenterPix WRITE setBgCenterPix)
67
68public:
69 MediaPanel(QWidget *parent = 0);
70 ~MediaPanel();
71 QPixmap bgLeftPix() { return leftBackground ;}
72 void setBgLeftPix( QPixmap pix){ leftBackground = pix; }
73 QPixmap bgRightPix() { return rightBackground ;}
74 void setBgRightPix( QPixmap pix){ rightBackground = pix; }
75 QPixmap bgCenterPix() { return centerBackground ;}
76 void setBgCenterPix( QPixmap pix){ centerBackground = pix; }
77 void setShuffleIcon( MyIcon icon );
78 void setRepeatIcon(MyIcon icon);
79 void setElapsedText(QString text) {
80 elapsedLabel->setText(text);
81 if(seeker->states().testFlag(PanelSeeker::Buffering))
82 setBuffering(false);
83 }
84 void setTotalText( QString text) { totalLabel->setText(text); }
85 void setActionCollection(QList<QAction*> actions);
86 void setMplayerState(int state);
87 void setDuration(int duration);
88 void setMediaLabelText(QString text);
89 void setResolutionLabelText(QString text);
90 void setStatusText(QString text, int time = 2000);
91 void setBuffering(bool enable);
92 bool eventFilter(QObject *object, QEvent *event);
93
94public slots:
95 void setSeeker(int v);
96 void setResolutionVisible(bool b);
97
98private:
99 Ui::MediaPanelClass ui;
100 QGridLayout * layout;
101 QPixmap leftBackground;
102 QPixmap centerBackground;
103 QPixmap rightBackground;
104 ScrollingLabel* mediaLabel;
105 QLabel *resolutionLabel;
106 PanelSeeker* seeker;
107 MyButton* repeatButton;
108 MyButton* shuffleButton;
109 QLabel* elapsedLabel;
110 QLabel* totalLabel;
111 QString originalTitle;
112 QTimer* timer;
113 int duration;
114
115private slots:
116 void reverseStatus();
117 void rearrangeWidgets(bool resolution_visible);
118
119protected:
120 void paintEvent(QPaintEvent *);
121 virtual void changeEvent (QEvent * event);
122 virtual void retranslateStrings();
123
124signals:
125 void seekerChanged(int);
126
127public:
128 friend class IconSetter;
129};
130
131#endif // MEDIAPANEL_H
Note: See TracBrowser for help on using the repository browser.