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 Play Session
19 #ifndef __CDRMPLAYSESSION_H
20 #define __CDRMPLAYSESSION_H
26 #include "DRMPlayServer.h"
27 #include "DRMCustomCommandAsyncAO.h"
28 #include <mdaaudiosampleplayer.h>
30 #include <mmfcontrollerframeworkbase.h>
33 class CDRMCustomCommandAsyncAO;
35 #ifdef RD_TSP_CLIENT_MAPPER
36 class CTspClientMapper;
37 #endif // #ifdef RD_TSP_CLIENT_MAPPER
39 class CDRMPlayServerSession : public CSession2,
40 public MMdaAudioPlayerCallback,
41 public MAudioLoadingObserver
43 friend class CDRMPlayServer;
46 CDRMPlayServerSession(CDRMPlayServer* aServer);
47 static CDRMPlayServerSession* NewL(CDRMPlayServer* aServer, const RMessage2& aMessage );
48 ~CDRMPlayServerSession();
50 virtual void ServiceL(const RMessage2 &aMessage);
51 TInt DispatchMessageL(const RMessage2 &aMessage);
54 void NewFilePlayerL(const RMessage2 aMessage);
55 void NewDesPlayerL(const RMessage2 aMessage);
56 void NewDesPlayerReadOnlyL(const RMessage2 aMessage);
57 void NewPlayerL(const RMessage2 aMessage);
58 void OpenFileL(const RMessage2 &aMessage);
59 void OpenFileByHandleL(const RMessage2 &aMessage);
60 void OpenFileBySourceL(const RMessage2 &aMessage);
61 void OpenDesL(const RMessage2 &aMessage);
62 void OpenUrlL(const RMessage2 &aMessage);
65 void SetVolume(const RMessage2 &aMessage);
66 void SetRepeats(const RMessage2 &aMessage);
67 void SetVolumeRamp(const RMessage2 &aMessage);
68 void Duration(const RMessage2&aMessage);
71 // API Additions since version 7.0
74 TInt GetPosition(const RMessage2 &aMessage);
75 void SetPosition(const RMessage2 &aMessage);
77 TInt SetPriority(const RMessage2 &aMessage);
78 TInt GetVolume(const RMessage2 &aMessage);
79 TInt GetNumberOfMetaDataEntries(const RMessage2 &aMessage);
80 void GetMetaDataEntryL(const RMessage2 &aMessage);
81 TInt SetPlayWindow(const RMessage2 &aMessage);
82 TInt ClearPlayWindow();
83 TInt SetBalance(const RMessage2 &aMessage);
84 TInt GetBalance(const RMessage2 &aMessage);
85 TInt GetBitRate(const RMessage2 &aMessage);
87 void RegisterForAudioLoadingNotification(const RMessage2 &aMessage);
88 void GetAudioLoadingProgressL(const RMessage2 &aMessage);
89 void ControllerImplementationInformationL(const RMessage2 &aMessage);
91 void CustomCommandSyncL(const RMessage2 &aMessage);
92 void CustomCommandAsyncStep1L(const RMessage2 &aMessage);
93 void CustomCommandAsyncStep2L(const RMessage2 &aMessage);
95 void SetPriorityPreference(const RMessage2 &aMessage);
96 void AsyncCustomCommandCompleted( CDRMCustomCommandAsyncAO* aObject );
102 void PanicClient(const RMessage2 &aMessage, TInt aPanic) const;
105 void ConstructL( const RMessage2& aMessage );
107 //MMdaAudioPlayerCallback
108 void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
109 void MapcPlayComplete(TInt aError);
111 //MAudioLoadingObserver
112 void MaloLoadingStarted();
113 void MaloLoadingComplete();
115 //Returns False if Destination CustomCommand needs to be blocked
116 TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
117 TBool CheckCustomInterfaceBuilderImplL(TDesC8& aParam);
120 enum{EIdle,EPlaying,EStopped};
122 CDRMPlayServer *iServer;
123 CMdaAudioPlayerUtility* iPlayUtil;
125 RMessage2* iMessage2;
126 CBufFlat* iMetaDataBuffer;
127 //CAsyncCallback* iAsyncCallback;
128 TErrorDurationStructPckgBuf iErrDurPckg;
129 TAsyncCallbackStatePckgBuf iCallbackState;
134 TMdaPriorityPreference iPref;
135 TBool iFileHandleUsed;
137 #ifdef RD_TSP_CLIENT_MAPPER
138 // Handle to TSP Client Mapper for Rem Con Framework
139 CTspClientMapper* iTSPClientMapper;
140 // Process id of client to DRM Session
141 TProcessId iClientProcessId;
142 #endif // RD_TSP_CLIENT_MAPPER
143 RPointerArray<CDRMCustomCommandAsyncAO> iActiveAsyncCustomCommands;
144 CDRMCustomCommandAsyncAO* iCDRMCustomCommandAsyncAO2Phase;