summaryrefslogtreecommitdiffstats
path: root/demos/qmediaplayer/mediaplayer.h
blob: a1c3d92dae2d50277770238d14b5850e02076c24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
***************************************************************************/

#ifndef MEDIALAYER_H
#define MEDIAPLAYER_H

#include <QtGui/QWidget>
#include <QtGui/QApplication>
#include <QtCore/QTimerEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QIcon>

#include <Phonon/AudioOutput>
#include <Phonon/BackendCapabilities>
#include <Phonon/Effect>
#include <Phonon/EffectParameter>
#include <Phonon/EffectWidget>
#include <Phonon/MediaObject>
#include <Phonon/SeekSlider>
#include <Phonon/VideoWidget>
#include <Phonon/VolumeSlider>

QT_BEGIN_NAMESPACE
class QPushButton;
class QLabel;
class QSlider;
class QTextEdit;
class QMenu;
class Ui_settings;
QT_END_NAMESPACE

class MediaPlayer :
            public QWidget
{
    Q_OBJECT
public:
    MediaPlayer(const QString &,
                const bool hasSmallScreen);
    
    void dragEnterEvent(QDragEnterEvent *e);
    void dragMoveEvent(QDragMoveEvent *e);
    void dropEvent(QDropEvent *e);
    void handleDrop(QDropEvent *e);
    void setFile(const QString &text);
    void initVideoWindow();
    void initSettingsDialog();
    
public slots:
    void openFile();
    void rewind();
    void forward();
    void updateInfo();
    void updateTime();
    void finished();
    void playPause();
    void scaleChanged(QAction *);
    void aspectChanged(QAction *);

private slots:
    void setAspect(int);
    void setScale(int);
    void setSaturation(int);
    void setContrast(int);
    void setHue(int);
    void setBrightness(int);
    void stateChanged(Phonon::State newstate, Phonon::State oldstate);
    void effectChanged();
    void showSettingsDialog();
    void showContextMenu(const QPoint &);
    void bufferStatus(int percent);
    void openUrl();
    void configureEffect();
    void hasVideoChanged(bool);

private:
    void playPauseForDialog();

    QIcon playIcon;
    QIcon pauseIcon;
    QMenu *fileMenu;
    QPushButton *playButton;
    QPushButton *rewindButton;
    QPushButton *forwardButton;
    Phonon::SeekSlider *slider;
    QLabel *timeLabel;
    QLabel *progressLabel;
    Phonon::VolumeSlider *volume;
    QSlider *m_hueSlider;
    QSlider *m_satSlider;
    QSlider *m_contSlider;
    QLabel *info;
    Phonon::Effect *nextEffect;
    QDialog *settingsDialog;
    Ui_settings *ui;
        
    QWidget m_videoWindow;
    Phonon::MediaObject m_MediaObject;
    Phonon::AudioOutput m_AudioOutput;
    Phonon::VideoWidget *m_videoWidget;
    Phonon::Path m_audioOutputPath;
    const bool m_hasSmallScreen;
};

#endif //MEDIAPLAYER_H
ss='column1'>| | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Documented limitations of add/setLibraryPath(s) on Symbian OS Deployed QtMultimedia.dll on Symbian Fixed the URL of known issues wiki page in docs Fixing benchmark to be runnable on Symbian device Fixing test to be runnable on Symbian devices. Fixed no-timeout case for QProcess::waitForFinished in Symbian Add visibility-inlines-hidden for GCCE on Symbian OS Catch by reference rather than by value Fixing benchmark for Symbian Remove warning about Symbian DEF files when running configure for Windows List item margins are too small due to invalid pixel metric value Remove left over forward declarations Avoided the loss of preedit text when losing focus on Symbian. Added support for ifdeffing for manufacturer in generated pkg files Shortening and fixing previous fix for QTBUG-6371 Update default FPU flags on Symbian to be softvfp+vfpv2 Using RunFast mode for RVCT | | * Documented limitations of add/setLibraryPath(s) on Symbian OSMiikka Heikkinen2010-02-011-0/+8 | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian OS limits applications to loading libraries only from /sys/bin directory, so user defined library paths can only be useful for locating Qt extension plugin stubs. Task-number: QTBUG-7517 Reviewed-by: Janne Koskinen | | * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6Gareth Stockwell2010-02-017-21/+48 | | |\ | | | * Fixed the URL of known issues wiki page in docsMiikka Heikkinen2010-02-012-3/+3 | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the URL to be version independent. Task-number: QTBUG-7295 Reviewed-by: TrustMe | | | * Fixing benchmark to be runnable on Symbian deviceAleksandar Sasha Babic2010-02-012-1/+11 | | | | | | | | | | | | | | | | | | | | | | | | Deployment had to be done in proper way. Reviewed-by: TrustMe | | | * Fixing test to be runnable on Symbian devices.Aleksandar Sasha Babic2010-02-012-0/+10 | | | | | | | | | | | | | | | | | | | | | | | | One of the cases is using too much memory so it had to be trimmed down. Reviewed-by: TrustMe | | | * Fixed no-timeout case for QProcess::waitForFinished in SymbianMiikka Heikkinen2010-02-011-17/+24 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QProcess::waitForFinished was panicking in Symbian when timeout of -1 was supplied. Fixed it to disable timeout and block until process exit, as docs indicate it should. Task-number: QTBUG-7667 Reviewed-by: Janne Anttila | | * | Deployed QtMultimedia.dll on SymbianGareth Stockwell2010-02-011-0/+4 | | |/ | | | | | | | | | | | | Task-number: QT-2813 Reviewed-by: trustme | | * Add visibility-inlines-hidden for GCCE on Symbian OSIain2010-02-011-0/+1 | | | | | | | | | | | | Reviewed-by: axis | | * Catch by reference rather than by valueIain2010-02-011-1/+1 | | | | | | | | | | | | | | | | | | | | | | | | | | | Catching by value causes GCC to use the compiler support function __cxa_get_exception_ptr. This is not available in the compiler support libraries on Symbian OS prior to Symbian^3. Catching by reference avoids this problem. Reviewed-by: mread | | * Fixing benchmark for SymbianAleksandar Sasha Babic2010-01-292-1/+18 | | | | | | | | | | | | | | | | | | The bidi.txt has to be deployed in proper way. Reviewed-by: TrustMe | | * Remove warning about Symbian DEF files when running configure for WindowsIain2010-01-292-1/+1 | | | | | | | | | | | | | | | | | | | | | | | | Move SYMBIAN_DEFFILES definition in the dictionary into the Symbian specific section of configure Task-number: QTBUG-6556 Reviewed-by: Simon Hausmann | | * Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6Sami Merila2010-01-2970-116/+114 | | |\ | | | * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2010-01-298-26/+90 | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Remove left over forward declarations Avoided the loss of preedit text when losing focus on Symbian. Added support for ifdeffing for manufacturer in generated pkg files Shortening and fixing previous fix for QTBUG-6371 Update default FPU flags on Symbian to be softvfp+vfpv2 Using RunFast mode for RVCT | | * | | List item margins are too small due to invalid pixel metric valueSami Merila2010-01-292-15/+22 | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pixel metric values for PM_FocusFrameVMargin and PM_FocusFrameHMargin were based on AVKON grid layout. Apparently, AVKON has a major difference for text margin in lists and grids. List values are almost double of what is used in the grids. Original values were poor fit for list usability, it made the text items very close to each anothre. Task-number: QTBUG-7258 Reviewed-by: Alessandro Portale | | * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2010-01-288-26/+90 | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Remove left over forward declarations Avoided the loss of preedit text when losing focus on Symbian. Added support for ifdeffing for manufacturer in generated pkg files Shortening and fixing previous fix for QTBUG-6371 Update default FPU flags on Symbian to be softvfp+vfpv2 Using RunFast mode for RVCT | | | * | Remove left over forward declarationsAlessandro Portale2010-01-281-3/+0 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d8ad9ac86dac9489b553e6416329308ae7d823d0 fixing QTBUG-6408 made some of the forward declared classes unnecessary. Task-number: QTBUG-6408 Reviewed-by: Alessandro Portale | | | * | Avoided the loss of preedit text when losing focus on Symbian.axis2010-01-281-6/+2 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's annoying to lose preedit (e.g. underlined) text everytime a focus switch occurs, especially because it can sometimes happen while inside the FEP menus, such as "Insert symbol". Fixed by committing the text in reset() implementation, rather than discarding it. Task: QTBUG-7439 RevBy: Sami Merila | | | * | Added support for ifdeffing for manufacturer in generated pkg filesMiikka Heikkinen2010-01-282-1/+64 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DEPLOYMENT.manufacturers variable can be used to define manufacturer identifiers. DEPLOYMENT.manufacturers.fail_note variable can be used to define a file that contains the text to be shown in case of failed manufacturer check. Task-number: QTBUG-7695 Reviewed-by: Janne Koskinen | | | * | Shortening and fixing previous fix for QTBUG-6371Alessandro Portale2010-01-281-15/+7 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shortening: Use much mor code from CommonStyle Fixing: Subtract PM_Layout[Left|Right]Margin from desktop width. This fix is anyways not relly useful. It heals some Ui designs with sizeconstrains which do not fit into mobile screens. But it will fail In following situations: Widget, and a too-long combobox in a horizontal Layout. The combobox would be cropped to Desktop width but the widget(s) left and/or right of the Combobox are not considered. So, that the Ui still is too wide. The correct fix will be for set the size policy of the combobox to something less greedy. Task-number: QTBUG-6371 Reviewed-by: Sami Merila modified: gui/styles/qs60style.cpp | | | * | Update default FPU flags on Symbian to be softvfp+vfpv2Iain2010-01-282-1/+1 | | | | | | | | | | | | | | | | | | | | Reviewed-by: Aleksandar Sasha Babic | | | * | Using RunFast mode for RVCTAleksandar Sasha Babic2010-01-281-0/+16 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now when we detect, by looking into ARMFPU, that either vfpv2 or softvfp+vfpv2 option is used, we will force using "-fpmode = fast" switch as well. This should give not just some performance improvement, but improve execution stability when vfpv2 used. Task-number: QTBUG-4893 Reviewed-by: Jason Barron * | | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-02-02