os/mm/devsoundextensions/drmaudioplayer/DRMPlayUtility/src/drmaudioplayeradaptation.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-2006 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:   DRM audio player adapatation class
    15 *
    16 */
    17 
    18 #ifndef __DRM_AUDIOPLAYER_ADAPTATION_H
    19 #define __DRM_AUDIOPLAYER_ADAPTATION_H
    20 
    21 #include <e32base.h>
    22 #include <e32cons.h>
    23 #include <f32file.h>
    24 
    25 #include <DrmAudioSamplePlayer.h>
    26 #include <mdaaudiosampleplayer.h>
    27 
    28 
    29 class CDrmAudioPlayerAdaptation :   public CBase,
    30                                     public MMdaAudioPlayerCallback
    31 	{
    32 	public: // construct/destruct
    33 	    CDrmAudioPlayerAdaptation( MDrmAudioPlayerCallback& aCallback );
    34 
    35 	    static CDrmAudioPlayerAdaptation* NewL( MDrmAudioPlayerCallback& aCallback,
    36     		                                      TInt aPriority,
    37     		                                      TMdaPriorityPreference aPref );
    38 		~CDrmAudioPlayerAdaptation();
    39 
    40 		//Services provided:
    41 		static CDrmAudioPlayerAdaptation* NewFilePlayerL(const TDesC& aFileName,
    42 		                    MDrmAudioPlayerCallback& aCallback,
    43 		                    TInt aPriority,
    44 		                    TMdaPriorityPreference aPref);
    45 
    46 		static CDrmAudioPlayerAdaptation* NewDesPlayerL(const TDesC8& aData,
    47                             MDrmAudioPlayerCallback& aCallback,
    48                             TInt aPriority,
    49                             TMdaPriorityPreference aPref);
    50 
    51 		static CDrmAudioPlayerAdaptation* NewDesPlayerReadOnlyL(const TDesC8& aData,
    52                                                                 MDrmAudioPlayerCallback& aCallback,
    53                                                                 TInt aPriority,
    54                                                                 TMdaPriorityPreference aPref);
    55 
    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);
    61 		void Play();
    62 		void Stop();
    63 		void SetVolume(const TInt aVolume );
    64 		void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
    65 		void SetVolumeRamp( const TTimeIntervalMicroSeconds& aRampDuration );
    66 		const TTimeIntervalMicroSeconds& Duration();
    67 		TInt MaxVolume();
    68 
    69 		// API Additions since version 7.0
    70 		TInt Pause();
    71 		void Close();
    72 		TInt GetPosition( TTimeIntervalMicroSeconds& aPosition );
    73 		void SetPosition( const TTimeIntervalMicroSeconds& aPosition );
    74 
    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);
    85 
    86 		void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
    87 		void GetAudioLoadingProgressL( TInt& aPercentageProgress );
    88 		const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
    89 
    90 		TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
    91 		                        TInt aFunction,
    92 		                        const TDesC8& aDataTo1,
    93 		                        const TDesC8& aDataTo2,
    94 		                        TDes8& aDataFrom);
    95 
    96 		TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
    97 	                                TInt aFunction,
    98 	                                const TDesC8& aDataTo1,
    99 	                                const TDesC8& aDataTo2 );
   100 
   101 		void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
   102 		                                                   TInt aFunction,
   103 		                                                   const TDesC8& aDataTo1,
   104 		                                                   const TDesC8& aDataTo2,
   105 		                                                   TDes8& aDataFrom,
   106 		                                                   TRequestStatus& aStatus);
   107 
   108 		void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
   109 		                                                   TInt aFunction,
   110 		                                                   const TDesC8& aDataTo1,
   111 		                                                   const TDesC8& aDataTo2,
   112 		                                                   TRequestStatus& aStatus);
   113 
   114 	private:
   115     		void ConstructL( TInt aPriority, TMdaPriorityPreference aPref );
   116 
   117     		void ConstructNewFilePlayerL( const TDesC& aFileName,
   118     		                              TInt aPriority,
   119     		                              TMdaPriorityPreference aPref );
   120 
   121     		void ConstructNewDesPlayerL( const TDesC8& aData,
   122     		                             TInt aPriority,
   123     		                             TMdaPriorityPreference aPref );
   124 
   125     		void ConstructNewDesPlayerReadOnlyL( const TDesC8& aData,
   126                                                 TInt aPriority,
   127                                                 TMdaPriorityPreference aPref );
   128 
   129 
   130     		//from MMdaAudioPlayerCallback
   131     		void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
   132     		void MapcPlayComplete(TInt aError);
   133 
   134     		//Returns False if Destination CustomCommand needs to be blocked
   135     		TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
   136     		TBool CheckCustomInterfaceBuilderImplL(const TDesC8& aParam);
   137 
   138 
   139 	private:
   140 		CMdaAudioPlayerUtility* iMdaPlayUtil;
   141 
   142 		// NOT OWNED !
   143 		MDrmAudioPlayerCallback* iCallback;
   144 	};
   145 
   146 #endif //__DRM_AUDIOPLAYER_ADAPTATION_H
   147 
   148 // End of file