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.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:   DRM audio player adapatation class
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
#ifndef __DRM_AUDIOPLAYER_ADAPTATION_H
sl@0
    19
#define __DRM_AUDIOPLAYER_ADAPTATION_H
sl@0
    20
sl@0
    21
#include <e32base.h>
sl@0
    22
#include <e32cons.h>
sl@0
    23
#include <f32file.h>
sl@0
    24
sl@0
    25
#include <DrmAudioSamplePlayer.h>
sl@0
    26
#include <mdaaudiosampleplayer.h>
sl@0
    27
sl@0
    28
sl@0
    29
class CDrmAudioPlayerAdaptation :   public CBase,
sl@0
    30
                                    public MMdaAudioPlayerCallback
sl@0
    31
	{
sl@0
    32
	public: // construct/destruct
sl@0
    33
	    CDrmAudioPlayerAdaptation( MDrmAudioPlayerCallback& aCallback );
sl@0
    34
sl@0
    35
	    static CDrmAudioPlayerAdaptation* NewL( MDrmAudioPlayerCallback& aCallback,
sl@0
    36
    		                                      TInt aPriority,
sl@0
    37
    		                                      TMdaPriorityPreference aPref );
sl@0
    38
		~CDrmAudioPlayerAdaptation();
sl@0
    39
sl@0
    40
		//Services provided:
sl@0
    41
		static CDrmAudioPlayerAdaptation* NewFilePlayerL(const TDesC& aFileName,
sl@0
    42
		                    MDrmAudioPlayerCallback& aCallback,
sl@0
    43
		                    TInt aPriority,
sl@0
    44
		                    TMdaPriorityPreference aPref);
sl@0
    45
sl@0
    46
		static CDrmAudioPlayerAdaptation* NewDesPlayerL(const TDesC8& aData,
sl@0
    47
                            MDrmAudioPlayerCallback& aCallback,
sl@0
    48
                            TInt aPriority,
sl@0
    49
                            TMdaPriorityPreference aPref);
sl@0
    50
sl@0
    51
		static CDrmAudioPlayerAdaptation* NewDesPlayerReadOnlyL(const TDesC8& aData,
sl@0
    52
                                                                MDrmAudioPlayerCallback& aCallback,
sl@0
    53
                                                                TInt aPriority,
sl@0
    54
                                                                TMdaPriorityPreference aPref);
sl@0
    55
sl@0
    56
		void OpenFileL(const TDesC& aFileName);
sl@0
    57
		void OpenFileL(const RFile& aFile);
sl@0
    58
		void OpenFileL(const TMMSource& aSource);
sl@0
    59
		void OpenDesL(const TDesC8& aDescriptor);
sl@0
    60
		void OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType);
sl@0
    61
		void Play();
sl@0
    62
		void Stop();
sl@0
    63
		void SetVolume(const TInt aVolume );
sl@0
    64
		void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0
    65
		void SetVolumeRamp( const TTimeIntervalMicroSeconds& aRampDuration );
sl@0
    66
		const TTimeIntervalMicroSeconds& Duration();
sl@0
    67
		TInt MaxVolume();
sl@0
    68
sl@0
    69
		// API Additions since version 7.0
sl@0
    70
		TInt Pause();
sl@0
    71
		void Close();
sl@0
    72
		TInt GetPosition( TTimeIntervalMicroSeconds& aPosition );
sl@0
    73
		void SetPosition( const TTimeIntervalMicroSeconds& aPosition );
sl@0
    74
sl@0
    75
		TInt SetPriority( TInt aPriority, TMdaPriorityPreference aPref );
sl@0
    76
		TInt GetVolume(TInt& aVolume);
sl@0
    77
		TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
sl@0
    78
		CMMFMetaDataEntry* GetMetaDataEntryL( TInt aMetaDataIndex );
sl@0
    79
		TInt SetPlayWindow(   const TTimeIntervalMicroSeconds& aStart,
sl@0
    80
                            const TTimeIntervalMicroSeconds& aEnd);
sl@0
    81
		TInt ClearPlayWindow();
sl@0
    82
		TInt SetBalance(const TInt aBalance);
sl@0
    83
		TInt GetBalance(TInt& aBalance);
sl@0
    84
		TInt GetBitRate(TUint& aBitRate);
sl@0
    85
sl@0
    86
		void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
sl@0
    87
		void GetAudioLoadingProgressL( TInt& aPercentageProgress );
sl@0
    88
		const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
sl@0
    89
sl@0
    90
		TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
sl@0
    91
		                        TInt aFunction,
sl@0
    92
		                        const TDesC8& aDataTo1,
sl@0
    93
		                        const TDesC8& aDataTo2,
sl@0
    94
		                        TDes8& aDataFrom);
sl@0
    95
sl@0
    96
		TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination,
sl@0
    97
	                                TInt aFunction,
sl@0
    98
	                                const TDesC8& aDataTo1,
sl@0
    99
	                                const TDesC8& aDataTo2 );
sl@0
   100
sl@0
   101
		void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
sl@0
   102
		                                                   TInt aFunction,
sl@0
   103
		                                                   const TDesC8& aDataTo1,
sl@0
   104
		                                                   const TDesC8& aDataTo2,
sl@0
   105
		                                                   TDes8& aDataFrom,
sl@0
   106
		                                                   TRequestStatus& aStatus);
sl@0
   107
sl@0
   108
		void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination,
sl@0
   109
		                                                   TInt aFunction,
sl@0
   110
		                                                   const TDesC8& aDataTo1,
sl@0
   111
		                                                   const TDesC8& aDataTo2,
sl@0
   112
		                                                   TRequestStatus& aStatus);
sl@0
   113
sl@0
   114
	private:
sl@0
   115
    		void ConstructL( TInt aPriority, TMdaPriorityPreference aPref );
sl@0
   116
sl@0
   117
    		void ConstructNewFilePlayerL( const TDesC& aFileName,
sl@0
   118
    		                              TInt aPriority,
sl@0
   119
    		                              TMdaPriorityPreference aPref );
sl@0
   120
sl@0
   121
    		void ConstructNewDesPlayerL( const TDesC8& aData,
sl@0
   122
    		                             TInt aPriority,
sl@0
   123
    		                             TMdaPriorityPreference aPref );
sl@0
   124
sl@0
   125
    		void ConstructNewDesPlayerReadOnlyL( const TDesC8& aData,
sl@0
   126
                                                TInt aPriority,
sl@0
   127
                                                TMdaPriorityPreference aPref );
sl@0
   128
sl@0
   129
sl@0
   130
    		//from MMdaAudioPlayerCallback
sl@0
   131
    		void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
sl@0
   132
    		void MapcPlayComplete(TInt aError);
sl@0
   133
sl@0
   134
    		//Returns False if Destination CustomCommand needs to be blocked
sl@0
   135
    		TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
sl@0
   136
    		TBool CheckCustomInterfaceBuilderImplL(const TDesC8& aParam);
sl@0
   137
sl@0
   138
sl@0
   139
	private:
sl@0
   140
		CMdaAudioPlayerUtility* iMdaPlayUtil;
sl@0
   141
sl@0
   142
		// NOT OWNED !
sl@0
   143
		MDrmAudioPlayerCallback* iCallback;
sl@0
   144
	};
sl@0
   145
sl@0
   146
#endif //__DRM_AUDIOPLAYER_ADAPTATION_H
sl@0
   147
sl@0
   148
// End of file