1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the demonstration applications of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ***************************************************************************/
45 #include <QtGui/QWidget>
46 #include <QtGui/QApplication>
47 #include <QtCore/QTimerEvent>
48 #include <QtGui/QShowEvent>
49 #include <QtGui/QIcon>
50 #include <QtCore/QBasicTimer>
51 #include <QtGui/QAction>
53 #include <phonon/audiooutput.h>
54 #include <phonon/backendcapabilities.h>
55 #include <phonon/effect.h>
56 #include <phonon/effectparameter.h>
57 #include <phonon/effectwidget.h>
58 #include <phonon/mediaobject.h>
59 #include <phonon/seekslider.h>
60 #include <phonon/videowidget.h>
61 #include <phonon/volumeslider.h>
74 class MediaVideoWidget
: public Phonon::VideoWidget
79 MediaVideoWidget(MediaPlayer
*player
, QWidget
*parent
= 0);
82 // Over-riding non-virtual Phonon::VideoWidget slot
83 void setFullScreen(bool);
86 void fullScreenChanged(bool);
89 void mouseDoubleClickEvent(QMouseEvent
*e
);
90 void keyPressEvent(QKeyEvent
*e
);
91 bool event(QEvent
*e
);
92 void timerEvent(QTimerEvent
*e
);
93 void dropEvent(QDropEvent
*e
);
94 void dragEnterEvent(QDragEnterEvent
*e
);
97 MediaPlayer
*m_player
;
107 MediaPlayer(const QString
&,
108 const bool hasSmallScreen
);
110 void dragEnterEvent(QDragEnterEvent
*e
);
111 void dragMoveEvent(QDragMoveEvent
*e
);
112 void dropEvent(QDropEvent
*e
);
113 void handleDrop(QDropEvent
*e
);
114 void setFile(const QString
&text
);
115 void setLocation(const QString
&location
);
116 void initVideoWindow();
117 void initSettingsDialog();
127 void scaleChanged(QAction
*);
128 void aspectChanged(QAction
*);
133 void setSaturation(int);
134 void setContrast(int);
136 void setBrightness(int);
137 void stateChanged(Phonon::State newstate
, Phonon::State oldstate
);
138 void effectChanged();
139 void showSettingsDialog();
140 void showContextMenu(const QPoint
& point
);
141 void bufferStatus(int percent
);
144 void configureEffect();
145 void hasVideoChanged(bool);
148 bool playPauseForDialog();
153 QPushButton
*playButton
;
154 QPushButton
*rewindButton
;
155 QPushButton
*forwardButton
;
156 Phonon::SeekSlider
*slider
;
158 QLabel
*progressLabel
;
159 Phonon::VolumeSlider
*volume
;
160 QSlider
*m_hueSlider
;
161 QSlider
*m_satSlider
;
162 QSlider
*m_contSlider
;
164 Phonon::Effect
*nextEffect
;
165 QDialog
*settingsDialog
;
167 QAction
*m_fullScreenAction
;
169 QWidget m_videoWindow
;
170 Phonon::MediaObject m_MediaObject
;
171 Phonon::AudioOutput m_AudioOutput
;
172 MediaVideoWidget
*m_videoWidget
;
173 Phonon::Path m_audioOutputPath
;
174 const bool m_hasSmallScreen
;
177 #endif //MEDIAPLAYER_H