summaryrefslogtreecommitdiffstats
path: root/demos/qmediaplayer/mediaplayer.h
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-18 16:50:53 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-19 09:56:27 (GMT)
commit20679e140afc2cea8ff16043d40a0da1145e4165 (patch)
tree16e1617ea1ca24d8ac8bc69fab673a8148134c07 /demos/qmediaplayer/mediaplayer.h
parenta599898061b8b76bbd313d7b3ea0a4e0e9a6e8ed (diff)
downloadQt-20679e140afc2cea8ff16043d40a0da1145e4165.zip
Qt-20679e140afc2cea8ff16043d40a0da1145e4165.tar.gz
Qt-20679e140afc2cea8ff16043d40a0da1145e4165.tar.bz2
Added 'fullscreen video' menu option to media player
Task-number: QTBUG-5586 Reviewed-by: Frans Englich
Diffstat (limited to 'demos/qmediaplayer/mediaplayer.h')
-rw-r--r--demos/qmediaplayer/mediaplayer.h43
1 files changed, 38 insertions, 5 deletions
diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h
index c181e37..00f9b54 100644
--- a/demos/qmediaplayer/mediaplayer.h
+++ b/demos/qmediaplayer/mediaplayer.h
@@ -47,6 +47,8 @@
#include <QtCore/QTimerEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QIcon>
+#include <QtCore/QBasicTimer>
+#include <QtGui/QAction>
#include <Phonon/AudioOutput>
#include <Phonon/BackendCapabilities>
@@ -67,6 +69,36 @@ class QMenu;
class Ui_settings;
QT_END_NAMESPACE
+class MediaPlayer;
+
+class MediaVideoWidget : public Phonon::VideoWidget
+{
+ Q_OBJECT
+
+public:
+ MediaVideoWidget(MediaPlayer *player, QWidget *parent = 0);
+
+public slots:
+ // Over-riding non-virtual Phonon::VideoWidget slot
+ void setFullScreen(bool);
+
+signals:
+ void fullScreenChanged(bool);
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent *e);
+ void keyPressEvent(QKeyEvent *e);
+ bool event(QEvent *e);
+ void timerEvent(QTimerEvent *e);
+ void dropEvent(QDropEvent *e);
+ void dragEnterEvent(QDragEnterEvent *e);
+
+private:
+ MediaPlayer *m_player;
+ QBasicTimer m_timer;
+ QAction m_action;
+};
+
class MediaPlayer :
public QWidget
{
@@ -74,7 +106,7 @@ class MediaPlayer :
public:
MediaPlayer(const QString &,
const bool hasSmallScreen);
-
+
void dragEnterEvent(QDragEnterEvent *e);
void dragMoveEvent(QDragMoveEvent *e);
void dropEvent(QDropEvent *e);
@@ -82,7 +114,7 @@ public:
void setFile(const QString &text);
void initVideoWindow();
void initSettingsDialog();
-
+
public slots:
void openFile();
void rewind();
@@ -104,7 +136,7 @@ private slots:
void stateChanged(Phonon::State newstate, Phonon::State oldstate);
void effectChanged();
void showSettingsDialog();
- void showContextMenu(const QPoint &);
+ void showContextMenu(const QPoint& point);
void bufferStatus(int percent);
void openUrl();
void configureEffect();
@@ -130,11 +162,12 @@ private:
Phonon::Effect *nextEffect;
QDialog *settingsDialog;
Ui_settings *ui;
-
+ QAction *m_fullScreenAction;
+
QWidget m_videoWindow;
Phonon::MediaObject m_MediaObject;
Phonon::AudioOutput m_AudioOutput;
- Phonon::VideoWidget *m_videoWidget;
+ MediaVideoWidget *m_videoWidget;
Phonon::Path m_audioOutputPath;
const bool m_hasSmallScreen;
};