author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:43:10 +0200 | |
changeset 3 | 41300fa6a67c |
parent 0 | 1918ee327afb |
child 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project. |
2 |
||
3 |
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
||
5 |
This library is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Lesser General Public License as published by |
|
7 |
the Free Software Foundation, either version 2.1 or 3 of the License. |
|
8 |
||
9 |
This library is distributed in the hope that it will be useful, |
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
GNU Lesser General Public License for more details. |
|
13 |
||
14 |
You should have received a copy of the GNU Lesser General Public License |
|
15 |
along with this library. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
||
17 |
*/ |
|
18 |
||
19 |
#ifndef PHONON_MMF_ABSTRACTMEDIAPLAYER_H |
|
20 |
#define PHONON_MMF_ABSTRACTMEDIAPLAYER_H |
|
21 |
||
22 |
#include <QTimer> |
|
23 |
#include <QScopedPointer> |
|
24 |
#include <e32std.h> |
|
25 |
#include "abstractplayer.h" |
|
26 |
||
27 |
class RFile; |
|
28 |
||
29 |
QT_BEGIN_NAMESPACE |
|
30 |
||
31 |
namespace Phonon |
|
32 |
{ |
|
33 |
namespace MMF |
|
34 |
{ |
|
35 |
class AudioOutput; |
|
36 |
||
37 |
/** |
|
38 |
* Interface via which MMF client APIs for both audio and video can be |
|
39 |
* accessed. |
|
40 |
*/ |
|
41 |
class AbstractMediaPlayer : public AbstractPlayer |
|
42 |
{ |
|
43 |
Q_OBJECT |
|
44 |
||
45 |
protected: |
|
46 |
AbstractMediaPlayer(); |
|
47 |
explicit AbstractMediaPlayer(const AbstractPlayer& player); |
|
48 |
||
49 |
public: |
|
50 |
// MediaObjectInterface |
|
51 |
virtual void play(); |
|
52 |
virtual void pause(); |
|
53 |
virtual void stop(); |
|
54 |
virtual void seek(qint64 milliseconds); |
|
55 |
virtual bool isSeekable() const; |
|
56 |
virtual MediaSource source() const; |
|
57 |
virtual void setFileSource(const Phonon::MediaSource&, RFile&); |
|
58 |
virtual void setNextSource(const MediaSource &source); |
|
59 |
virtual void volumeChanged(qreal volume); |
|
60 |
||
61 |
protected: |
|
62 |
// AbstractPlayer |
|
63 |
virtual void doSetTickInterval(qint32 interval); |
|
64 |
||
65 |
virtual void doPlay() = 0; |
|
66 |
virtual void doPause() = 0; |
|
67 |
virtual void doStop() = 0; |
|
68 |
virtual void doSeek(qint64 pos) = 0; |
|
69 |
virtual int setDeviceVolume(int mmfVolume) = 0; |
|
70 |
virtual int openFile(RFile& file) = 0; |
|
71 |
virtual void close() = 0; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
virtual void changeState(PrivateState newState); |
0 | 73 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
void updateMetaData(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
virtual int numberOfMetaDataEntries() const = 0; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
virtual QPair<QString, QString> metaDataEntry(int index) const = 0; |
0 | 77 |
|
78 |
protected: |
|
79 |
bool tickTimerRunning() const; |
|
80 |
void startTickTimer(); |
|
81 |
void stopTickTimer(); |
|
82 |
void maxVolumeChanged(int maxVolume); |
|
83 |
||
84 |
static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); |
|
85 |
||
86 |
private: |
|
87 |
void doVolumeChanged(); |
|
88 |
||
89 |
private Q_SLOTS: |
|
90 |
/** |
|
91 |
* Receives signal from m_tickTimer |
|
92 |
*/ |
|
93 |
void tick(); |
|
94 |
||
95 |
private: |
|
96 |
/** |
|
97 |
* This flag is set to true if play is called when the object is |
|
98 |
* in a Loading state. Once loading is complete, playback will |
|
99 |
* be started. |
|
100 |
*/ |
|
101 |
bool m_playPending; |
|
102 |
||
103 |
QScopedPointer<QTimer> m_tickTimer; |
|
104 |
||
105 |
int m_mmfMaxVolume; |
|
106 |
||
107 |
MediaSource m_source; |
|
108 |
MediaSource m_nextSource; |
|
109 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
QMultiMap<QString, QString> m_metaData; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
111 |
|
0 | 112 |
}; |
113 |
} |
|
114 |
} |
|
115 |
||
116 |
QT_END_NAMESPACE |
|
117 |
||
118 |
#endif |
|
119 |