1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This class is used for playing MIDI. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMADRMAUDIOPLAYER_H |
|
20 #define CMMADRMAUDIOPLAYER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "cmmaaudioplayer.h" |
|
24 #include <DrmAudioSamplePlayer.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 // CONSTANTS |
|
28 _LIT(KMMADRMPlayer, "DRMPlayer"); |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MMAFunctionServer; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * This class is used for playing DRM Audio. |
|
36 * |
|
37 */ |
|
38 |
|
39 NONSHARABLE_CLASS(CMMADRMAudioPlayer): public CMMAPlayer, |
|
40 public MDrmAudioPlayerCallback |
|
41 |
|
42 { |
|
43 public: // Construction |
|
44 static CMMADRMAudioPlayer* NewLC(const TDesC& aContentType, |
|
45 TFileName aFileName); |
|
46 |
|
47 // Destructor |
|
48 ~CMMADRMAudioPlayer(); |
|
49 |
|
50 protected: |
|
51 // C++ constructor |
|
52 CMMADRMAudioPlayer(TFileName aFileName); |
|
53 void ConstructL(const TDesC& aContentType); |
|
54 |
|
55 public: // new methods |
|
56 CDrmPlayerUtility* DRMUtility() const; |
|
57 |
|
58 public: // from CMMAPlayer |
|
59 void StartL(); |
|
60 void StopL(TBool aPostEvent); |
|
61 void RealizeL(); |
|
62 void PrefetchL(); |
|
63 void DeallocateL(); |
|
64 void GetDuration(TInt64* aDuration); |
|
65 void SetMediaTimeL(TInt64* aTime); |
|
66 void GetMediaTime(TInt64* aMediaTime); |
|
67 void CloseL(); |
|
68 const TDesC& Type(); |
|
69 |
|
70 public: // from CMMAPlayer |
|
71 void PlayCompleteL(TInt aError); |
|
72 |
|
73 public: // from MDrmAudioPlayerCallback |
|
74 void MdapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); |
|
75 void MdapcPlayComplete(TInt aError); |
|
76 |
|
77 protected: |
|
78 void CloseClientUtility(); |
|
79 void ErrorPlaybackComplete(TInt aError); |
|
80 |
|
81 private: // Data |
|
82 CDrmPlayerUtility* iUtility; |
|
83 |
|
84 TFileName iFileName; |
|
85 }; |
|
86 |
|
87 #endif // CMMADRMAUDIOPLAYER_H |
|