| 1 | /**************************************************************************** | 
|---|
| 2 | ** | 
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). | 
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com) | 
|---|
| 5 | ** | 
|---|
| 6 | ** This file is part of the demonstration applications of the Qt Toolkit. | 
|---|
| 7 | ** | 
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | 
|---|
| 9 | ** Commercial Usage | 
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in | 
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the | 
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
|---|
| 13 | ** a written agreement between you and Nokia. | 
|---|
| 14 | ** | 
|---|
| 15 | ** GNU Lesser General Public License Usage | 
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software | 
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
|---|
| 19 | ** packaging of this file.  Please review the following information to | 
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | 
|---|
| 22 | ** | 
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain | 
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL | 
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this | 
|---|
| 26 | ** package. | 
|---|
| 27 | ** | 
|---|
| 28 | ** GNU General Public License Usage | 
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU | 
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software | 
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 32 | ** packaging of this file.  Please review the following information to | 
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be | 
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html. | 
|---|
| 35 | ** | 
|---|
| 36 | ** If you are unsure which license is appropriate for your use, please | 
|---|
| 37 | ** contact the sales department at qt-sales@nokia.com. | 
|---|
| 38 | ** $QT_END_LICENSE$ | 
|---|
| 39 | ** | 
|---|
| 40 | ***************************************************************************/ | 
|---|
| 41 |  | 
|---|
| 42 | #ifndef MEDIALAYER_H | 
|---|
| 43 | #define MEDIAPLAYER_H | 
|---|
| 44 |  | 
|---|
| 45 | #include <QtGui/QWidget> | 
|---|
| 46 | #include <QtGui/QApplication> | 
|---|
| 47 | #include <QtCore/QTimerEvent> | 
|---|
| 48 | #include <QtGui/QShowEvent> | 
|---|
| 49 | #include <QtGui/QIcon> | 
|---|
| 50 |  | 
|---|
| 51 | #include <Phonon/AudioOutput> | 
|---|
| 52 | #include <Phonon/BackendCapabilities> | 
|---|
| 53 | #include <Phonon/Effect> | 
|---|
| 54 | #include <Phonon/EffectParameter> | 
|---|
| 55 | #include <Phonon/EffectWidget> | 
|---|
| 56 | #include <Phonon/MediaObject> | 
|---|
| 57 | #include <Phonon/SeekSlider> | 
|---|
| 58 | #include <Phonon/VideoWidget> | 
|---|
| 59 | #include <Phonon/VolumeSlider> | 
|---|
| 60 |  | 
|---|
| 61 | QT_BEGIN_NAMESPACE | 
|---|
| 62 | class QPushButton; | 
|---|
| 63 | class QLabel; | 
|---|
| 64 | class QSlider; | 
|---|
| 65 | class QTextEdit; | 
|---|
| 66 | class QMenu; | 
|---|
| 67 | class Ui_settings; | 
|---|
| 68 | QT_END_NAMESPACE | 
|---|
| 69 |  | 
|---|
| 70 | class MediaPlayer : | 
|---|
| 71 | public QWidget | 
|---|
| 72 | { | 
|---|
| 73 | Q_OBJECT | 
|---|
| 74 | public: | 
|---|
| 75 | MediaPlayer(const QString &); | 
|---|
| 76 |  | 
|---|
| 77 | void dragEnterEvent(QDragEnterEvent *e); | 
|---|
| 78 | void dragMoveEvent(QDragMoveEvent *e); | 
|---|
| 79 | void dropEvent(QDropEvent *e); | 
|---|
| 80 | void handleDrop(QDropEvent *e); | 
|---|
| 81 | void setFile(const QString &text); | 
|---|
| 82 | void initVideoWindow(); | 
|---|
| 83 | void initSettingsDialog(); | 
|---|
| 84 |  | 
|---|
| 85 | public slots: | 
|---|
| 86 | void openFile(); | 
|---|
| 87 | void rewind(); | 
|---|
| 88 | void forward(); | 
|---|
| 89 | void updateInfo(); | 
|---|
| 90 | void updateTime(); | 
|---|
| 91 | void finished(); | 
|---|
| 92 | void playPause(); | 
|---|
| 93 | void scaleChanged(QAction *); | 
|---|
| 94 | void aspectChanged(QAction *); | 
|---|
| 95 |  | 
|---|
| 96 | private slots: | 
|---|
| 97 | void setAspect(int); | 
|---|
| 98 | void setScale(int); | 
|---|
| 99 | void setSaturation(int); | 
|---|
| 100 | void setContrast(int); | 
|---|
| 101 | void setHue(int); | 
|---|
| 102 | void setBrightness(int); | 
|---|
| 103 | void stateChanged(Phonon::State newstate, Phonon::State oldstate); | 
|---|
| 104 | void effectChanged(); | 
|---|
| 105 | void showSettingsDialog(); | 
|---|
| 106 | void showContextMenu(const QPoint &); | 
|---|
| 107 | void bufferStatus(int percent); | 
|---|
| 108 | void openUrl(); | 
|---|
| 109 | void configureEffect(); | 
|---|
| 110 |  | 
|---|
| 111 | private: | 
|---|
| 112 | QIcon playIcon; | 
|---|
| 113 | QIcon pauseIcon; | 
|---|
| 114 | QMenu *fileMenu; | 
|---|
| 115 | QPushButton *playButton; | 
|---|
| 116 | QPushButton *rewindButton; | 
|---|
| 117 | QPushButton *forwardButton; | 
|---|
| 118 | Phonon::SeekSlider *slider; | 
|---|
| 119 | QLabel *timeLabel; | 
|---|
| 120 | QLabel *progressLabel; | 
|---|
| 121 | Phonon::VolumeSlider *volume; | 
|---|
| 122 | QSlider *m_hueSlider; | 
|---|
| 123 | QSlider *m_satSlider; | 
|---|
| 124 | QSlider *m_contSlider; | 
|---|
| 125 | QLabel *info; | 
|---|
| 126 | Phonon::Effect *nextEffect; | 
|---|
| 127 | QDialog *settingsDialog; | 
|---|
| 128 | Ui_settings *ui; | 
|---|
| 129 |  | 
|---|
| 130 | QWidget m_videoWindow; | 
|---|
| 131 | Phonon::MediaObject m_MediaObject; | 
|---|
| 132 | Phonon::AudioOutput m_AudioOutput; | 
|---|
| 133 | Phonon::VideoWidget *m_videoWidget; | 
|---|
| 134 | Phonon::Path m_audioOutputPath; | 
|---|
| 135 | }; | 
|---|
| 136 |  | 
|---|
| 137 | #endif //MEDIAPLAYER_H | 
|---|