os/mm/devsoundextensions/drmaudioplayer/DRMPlayUtility/src/drmaudioplayeradaptation.h
First public contribution.
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: DRM audio player adapatation class
18 #ifndef __DRM_AUDIOPLAYER_ADAPTATION_H
19 #define __DRM_AUDIOPLAYER_ADAPTATION_H
25 #include <DrmAudioSamplePlayer.h>
26 #include <mdaaudiosampleplayer.h>
29 class CDrmAudioPlayerAdaptation : public CBase,
30 public MMdaAudioPlayerCallback
32 public: // construct/destruct
33 CDrmAudioPlayerAdaptation( MDrmAudioPlayerCallback& aCallback );
35 static CDrmAudioPlayerAdaptation* NewL( MDrmAudioPlayerCallback& aCallback,
37 TMdaPriorityPreference aPref );
38 ~CDrmAudioPlayerAdaptation();
41 static CDrmAudioPlayerAdaptation* NewFilePlayerL(const TDesC& aFileName,
42 MDrmAudioPlayerCallback& aCallback,
44 TMdaPriorityPreference aPref);
46 static CDrmAudioPlayerAdaptation* NewDesPlayerL(const TDesC8& aData,
47 MDrmAudioPlayerCallback& aCallback,
49 TMdaPriorityPreference aPref);
51 static CDrmAudioPlayerAdaptation* NewDesPlayerReadOnlyL(const TDesC8& aData,
52 MDrmAudioPlayerCallback& aCallback,
54 TMdaPriorityPreference aPref);
56 void OpenFileL(const TDesC& aFileName);
57 void OpenFileL(const RFile& aFile);
58 void OpenFileL(const TMMSource& aSource);
59 void OpenDesL(const TDesC8& aDescriptor);
60 void OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType);
63 void SetVolume(const TInt aVolume );
64 void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
65 void SetVolumeRamp( const TTimeIntervalMicroSeconds& aRampDuration );
66 const TTimeIntervalMicroSeconds& Duration();
69 // API Additions since version 7.0
72 TInt GetPosition( TTimeIntervalMicroSeconds& aPosition );
73 void SetPosition( const TTimeIntervalMicroSeconds& aPosition );
75 TInt SetPriority( TInt aPriority, TMdaPriorityPreference aPref );
76 TInt GetVolume(TInt& aVolume);
77 TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
78 CMMFMetaDataEntry* GetMetaDataEntryL( TInt aMetaDataIndex );
79 TInt SetPlayWindow( const TTimeIntervalMicroSeconds& aStart,
80 const TTimeIntervalMicroSeconds& aEnd);
81 TInt ClearPlayWindow();
82 TInt SetBalance(const TInt aBalance);
83 TInt GetBalance(TInt& aBalance);
84 TInt GetBitRate(TUint& aBitRate);
86 void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
87 void GetAudioLoadingProgressL( TInt& aPercentageProgress );
88 const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
90 TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
92 const TDesC8& aDataTo1,
93 const TDesC8& aDataTo2,
96 TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
98 const TDesC8& aDataTo1,
99 const TDesC8& aDataTo2 );
101 void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
103 const TDesC8& aDataTo1,
104 const TDesC8& aDataTo2,
106 TRequestStatus& aStatus);
108 void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
110 const TDesC8& aDataTo1,
111 const TDesC8& aDataTo2,
112 TRequestStatus& aStatus);
115 void ConstructL( TInt aPriority, TMdaPriorityPreference aPref );
117 void ConstructNewFilePlayerL( const TDesC& aFileName,
119 TMdaPriorityPreference aPref );
121 void ConstructNewDesPlayerL( const TDesC8& aData,
123 TMdaPriorityPreference aPref );
125 void ConstructNewDesPlayerReadOnlyL( const TDesC8& aData,
127 TMdaPriorityPreference aPref );
130 //from MMdaAudioPlayerCallback
131 void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
132 void MapcPlayComplete(TInt aError);
134 //Returns False if Destination CustomCommand needs to be blocked
135 TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
136 TBool CheckCustomInterfaceBuilderImplL(const TDesC8& aParam);
140 CMdaAudioPlayerUtility* iMdaPlayUtil;
143 MDrmAudioPlayerCallback* iCallback;
146 #endif //__DRM_AUDIOPLAYER_ADAPTATION_H