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 Play Session sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __CDRMPLAYSESSION_H sl@0: #define __CDRMPLAYSESSION_H sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "DRMPlayServer.h" sl@0: #include "DRMCustomCommandAsyncAO.h" sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: class CDRMCustomCommandAsyncAO; sl@0: class CDRMPlayServer; sl@0: #ifdef RD_TSP_CLIENT_MAPPER sl@0: class CTspClientMapper; sl@0: #endif // #ifdef RD_TSP_CLIENT_MAPPER sl@0: sl@0: class CDRMPlayServerSession : public CSession2, sl@0: public MMdaAudioPlayerCallback, sl@0: public MAudioLoadingObserver sl@0: { sl@0: friend class CDRMPlayServer; sl@0: public: sl@0: // construct/destruct sl@0: CDRMPlayServerSession(CDRMPlayServer* aServer); sl@0: static CDRMPlayServerSession* NewL(CDRMPlayServer* aServer, const RMessage2& aMessage ); sl@0: ~CDRMPlayServerSession(); sl@0: //service request sl@0: virtual void ServiceL(const RMessage2 &aMessage); sl@0: TInt DispatchMessageL(const RMessage2 &aMessage); sl@0: sl@0: //services available sl@0: void NewFilePlayerL(const RMessage2 aMessage); sl@0: void NewDesPlayerL(const RMessage2 aMessage); sl@0: void NewDesPlayerReadOnlyL(const RMessage2 aMessage); sl@0: void NewPlayerL(const RMessage2 aMessage); sl@0: void OpenFileL(const RMessage2 &aMessage); sl@0: void OpenFileByHandleL(const RMessage2 &aMessage); sl@0: void OpenFileBySourceL(const RMessage2 &aMessage); sl@0: void OpenDesL(const RMessage2 &aMessage); sl@0: void OpenUrlL(const RMessage2 &aMessage); sl@0: void Play(); sl@0: void Stop(); sl@0: void SetVolume(const RMessage2 &aMessage); sl@0: void SetRepeats(const RMessage2 &aMessage); sl@0: void SetVolumeRamp(const RMessage2 &aMessage); sl@0: void Duration(const RMessage2&aMessage); 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(const RMessage2 &aMessage); sl@0: void SetPosition(const RMessage2 &aMessage); sl@0: sl@0: TInt SetPriority(const RMessage2 &aMessage); sl@0: TInt GetVolume(const RMessage2 &aMessage); sl@0: TInt GetNumberOfMetaDataEntries(const RMessage2 &aMessage); sl@0: void GetMetaDataEntryL(const RMessage2 &aMessage); sl@0: TInt SetPlayWindow(const RMessage2 &aMessage); sl@0: TInt ClearPlayWindow(); sl@0: TInt SetBalance(const RMessage2 &aMessage); sl@0: TInt GetBalance(const RMessage2 &aMessage); sl@0: TInt GetBitRate(const RMessage2 &aMessage); sl@0: sl@0: void RegisterForAudioLoadingNotification(const RMessage2 &aMessage); sl@0: void GetAudioLoadingProgressL(const RMessage2 &aMessage); sl@0: void ControllerImplementationInformationL(const RMessage2 &aMessage); sl@0: sl@0: void CustomCommandSyncL(const RMessage2 &aMessage); sl@0: void CustomCommandAsyncStep1L(const RMessage2 &aMessage); sl@0: void CustomCommandAsyncStep2L(const RMessage2 &aMessage); sl@0: sl@0: void SetPriorityPreference(const RMessage2 &aMessage); sl@0: void AsyncCustomCommandCompleted( CDRMCustomCommandAsyncAO* aObject ); sl@0: sl@0: sl@0: sl@0: protected: sl@0: // panic the client sl@0: void PanicClient(const RMessage2 &aMessage, TInt aPanic) const; sl@0: sl@0: private: sl@0: void ConstructL( const RMessage2& aMessage ); sl@0: sl@0: //MMdaAudioPlayerCallback sl@0: void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); sl@0: void MapcPlayComplete(TInt aError); sl@0: sl@0: //MAudioLoadingObserver sl@0: void MaloLoadingStarted(); sl@0: void MaloLoadingComplete(); 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(TDesC8& aParam); sl@0: sl@0: private: sl@0: enum{EIdle,EPlaying,EStopped}; sl@0: sl@0: CDRMPlayServer *iServer; sl@0: CMdaAudioPlayerUtility* iPlayUtil; sl@0: RMessage2 iMessage; sl@0: RMessage2* iMessage2; sl@0: CBufFlat* iMetaDataBuffer; sl@0: //CAsyncCallback* iAsyncCallback; sl@0: TErrorDurationStructPckgBuf iErrDurPckg; sl@0: TAsyncCallbackStatePckgBuf iCallbackState; sl@0: TInt iAsyncComplete; sl@0: TInt iCount; sl@0: TInt iState; sl@0: TInt iPriority; sl@0: TMdaPriorityPreference iPref; sl@0: TBool iFileHandleUsed; sl@0: RFile iFileHandle; sl@0: #ifdef RD_TSP_CLIENT_MAPPER sl@0: // Handle to TSP Client Mapper for Rem Con Framework sl@0: CTspClientMapper* iTSPClientMapper; sl@0: // Process id of client to DRM Session sl@0: TProcessId iClientProcessId; sl@0: #endif // RD_TSP_CLIENT_MAPPER sl@0: RPointerArray iActiveAsyncCustomCommands; sl@0: CDRMCustomCommandAsyncAO* iCDRMCustomCommandAsyncAO2Phase; sl@0: }; sl@0: sl@0: #endif sl@0: sl@0: // End of file