sl@0: /* sl@0: * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: DRM audio player adapatation class sl@0: * sl@0: */ sl@0: sl@0: #ifndef __DRM_AUDIOPLAYER_ADAPTATION_H sl@0: #define __DRM_AUDIOPLAYER_ADAPTATION_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: class CDrmAudioPlayerAdaptation : public CBase, sl@0: public MMdaAudioPlayerCallback sl@0: { sl@0: public: // construct/destruct sl@0: CDrmAudioPlayerAdaptation( MDrmAudioPlayerCallback& aCallback ); sl@0: sl@0: static CDrmAudioPlayerAdaptation* NewL( MDrmAudioPlayerCallback& aCallback, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref ); sl@0: ~CDrmAudioPlayerAdaptation(); sl@0: sl@0: //Services provided: sl@0: static CDrmAudioPlayerAdaptation* NewFilePlayerL(const TDesC& aFileName, sl@0: MDrmAudioPlayerCallback& aCallback, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref); sl@0: sl@0: static CDrmAudioPlayerAdaptation* NewDesPlayerL(const TDesC8& aData, sl@0: MDrmAudioPlayerCallback& aCallback, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref); sl@0: sl@0: static CDrmAudioPlayerAdaptation* NewDesPlayerReadOnlyL(const TDesC8& aData, sl@0: MDrmAudioPlayerCallback& aCallback, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref); sl@0: sl@0: void OpenFileL(const TDesC& aFileName); sl@0: void OpenFileL(const RFile& aFile); sl@0: void OpenFileL(const TMMSource& aSource); sl@0: void OpenDesL(const TDesC8& aDescriptor); sl@0: void OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType); sl@0: void Play(); sl@0: void Stop(); sl@0: void SetVolume(const TInt aVolume ); sl@0: void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence); sl@0: void SetVolumeRamp( const TTimeIntervalMicroSeconds& aRampDuration ); sl@0: const TTimeIntervalMicroSeconds& Duration(); sl@0: TInt MaxVolume(); sl@0: sl@0: // API Additions since version 7.0 sl@0: TInt Pause(); sl@0: void Close(); sl@0: TInt GetPosition( TTimeIntervalMicroSeconds& aPosition ); sl@0: void SetPosition( const TTimeIntervalMicroSeconds& aPosition ); sl@0: sl@0: TInt SetPriority( TInt aPriority, TMdaPriorityPreference aPref ); sl@0: TInt GetVolume(TInt& aVolume); sl@0: TInt GetNumberOfMetaDataEntries(TInt& aNumEntries); sl@0: CMMFMetaDataEntry* GetMetaDataEntryL( TInt aMetaDataIndex ); sl@0: TInt SetPlayWindow( const TTimeIntervalMicroSeconds& aStart, sl@0: const TTimeIntervalMicroSeconds& aEnd); sl@0: TInt ClearPlayWindow(); sl@0: TInt SetBalance(const TInt aBalance); sl@0: TInt GetBalance(TInt& aBalance); sl@0: TInt GetBitRate(TUint& aBitRate); sl@0: sl@0: void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback); sl@0: void GetAudioLoadingProgressL( TInt& aPercentageProgress ); sl@0: const CMMFControllerImplementationInformation& ControllerImplementationInformationL(); sl@0: sl@0: TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, sl@0: TInt aFunction, sl@0: const TDesC8& aDataTo1, sl@0: const TDesC8& aDataTo2, sl@0: TDes8& aDataFrom); sl@0: sl@0: TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, sl@0: TInt aFunction, sl@0: const TDesC8& aDataTo1, sl@0: const TDesC8& aDataTo2 ); sl@0: sl@0: void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, sl@0: TInt aFunction, sl@0: const TDesC8& aDataTo1, sl@0: const TDesC8& aDataTo2, sl@0: TDes8& aDataFrom, sl@0: TRequestStatus& aStatus); sl@0: sl@0: void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, sl@0: TInt aFunction, sl@0: const TDesC8& aDataTo1, sl@0: const TDesC8& aDataTo2, sl@0: TRequestStatus& aStatus); sl@0: sl@0: private: sl@0: void ConstructL( TInt aPriority, TMdaPriorityPreference aPref ); sl@0: sl@0: void ConstructNewFilePlayerL( const TDesC& aFileName, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref ); sl@0: sl@0: void ConstructNewDesPlayerL( const TDesC8& aData, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref ); sl@0: sl@0: void ConstructNewDesPlayerReadOnlyL( const TDesC8& aData, sl@0: TInt aPriority, sl@0: TMdaPriorityPreference aPref ); sl@0: sl@0: sl@0: //from MMdaAudioPlayerCallback sl@0: void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); sl@0: void MapcPlayComplete(TInt aError); sl@0: sl@0: //Returns False if Destination CustomCommand needs to be blocked sl@0: TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam); sl@0: TBool CheckCustomInterfaceBuilderImplL(const TDesC8& aParam); sl@0: sl@0: sl@0: private: sl@0: CMdaAudioPlayerUtility* iMdaPlayUtil; sl@0: sl@0: // NOT OWNED ! sl@0: MDrmAudioPlayerCallback* iCallback; sl@0: }; sl@0: sl@0: #endif //__DRM_AUDIOPLAYER_ADAPTATION_H sl@0: sl@0: // End of file