source: trunk/src/3rdparty/phonon/mmf/audioplayer.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 3.3 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#ifndef PHONON_MMF_AUDIOPLAYER_H
20#define PHONON_MMF_AUDIOPLAYER_H
21
22#include "abstractmediaplayer.h"
23
24class CDrmPlayerUtility;
25class TTimeIntervalMicroSeconds;
26
27#ifdef QT_PHONON_MMF_AUDIO_DRM
28#include <drmaudiosampleplayer.h>
29typedef MDrmAudioPlayerCallback NativePlayerObserver;
30#else
31#include <mdaaudiosampleplayer.h>
32typedef MMdaAudioPlayerCallback NativePlayerObserver;
33#endif
34
35QT_BEGIN_NAMESPACE
36
37namespace Phonon
38{
39namespace MMF
40{
41/**
42 * @short Wrapper over MMF audio client utility
43 */
44class AudioPlayer : public AbstractMediaPlayer
45 , public NativePlayerObserver
46 , public MAudioLoadingObserver
47{
48 Q_OBJECT
49
50public:
51 AudioPlayer(MediaObject *parent = 0, const AbstractPlayer *player = 0);
52 virtual ~AudioPlayer();
53
54#ifdef QT_PHONON_MMF_AUDIO_DRM
55typedef CDrmPlayerUtility NativePlayer;
56#else
57typedef CMdaAudioPlayerUtility NativePlayer;
58#endif
59
60 NativePlayer *nativePlayer() const;
61
62 // AbstractMediaPlayer
63 virtual void doPlay();
64 virtual void doPause();
65 virtual void doStop();
66 virtual void doSeek(qint64 milliseconds);
67 virtual int setDeviceVolume(int mmfVolume);
68 virtual int openFile(const QString &fileName);
69 virtual int openFile(RFile& file);
70 virtual int openUrl(const QString& url, int iap);
71 virtual int openDescriptor(const TDesC8 &des);
72 virtual int bufferStatus() const;
73 virtual void doClose();
74
75 // MediaObjectInterface
76 virtual bool hasVideo() const;
77 virtual qint64 totalTime() const;
78
79 // AbstractMediaPlayer
80 virtual qint64 getCurrentTime() const;
81 virtual int numberOfMetaDataEntries() const;
82 virtual QPair<QString, QString> metaDataEntry(int index) const;
83
84 /**
85 * This class owns the pointer.
86 */
87 NativePlayer *player() const;
88
89private:
90 void construct();
91
92private:
93#ifdef QT_PHONON_MMF_AUDIO_DRM
94 // MDrmAudioPlayerCallback
95 virtual void MdapcInitComplete(TInt aError,
96 const TTimeIntervalMicroSeconds &aDuration);
97 virtual void MdapcPlayComplete(TInt aError);
98#else
99 // MMdaAudioPlayerCallback
100 virtual void MapcInitComplete(TInt aError,
101 const TTimeIntervalMicroSeconds &aDuration);
102 virtual void MapcPlayComplete(TInt aError);
103#endif
104
105 // MAudioLoadingObserver
106 virtual void MaloLoadingStarted();
107 virtual void MaloLoadingComplete();
108
109private:
110 /**
111 * Using CPlayerType typedef in order to be able to easily switch between
112 * CMdaAudioPlayerUtility and CDrmPlayerUtility
113 */
114 QScopedPointer<NativePlayer> m_player;
115
116 qint64 m_totalTime;
117
118};
119}
120}
121
122QT_END_NAMESPACE
123
124#endif
Note: See TracBrowser for help on using the repository browser.