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 Play Session
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef __CDRMPLAYSESSION_H
|
sl@0
|
20 |
#define __CDRMPLAYSESSION_H
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
#include <e32base.h>
|
sl@0
|
24 |
#include <e32cons.h>
|
sl@0
|
25 |
#include <f32file.h>
|
sl@0
|
26 |
#include "DRMPlayServer.h"
|
sl@0
|
27 |
#include "DRMCustomCommandAsyncAO.h"
|
sl@0
|
28 |
#include <mdaaudiosampleplayer.h>
|
sl@0
|
29 |
#include <s32mem.h>
|
sl@0
|
30 |
#include <mmfcontrollerframeworkbase.h>
|
sl@0
|
31 |
|
sl@0
|
32 |
|
sl@0
|
33 |
class CDRMCustomCommandAsyncAO;
|
sl@0
|
34 |
class CDRMPlayServer;
|
sl@0
|
35 |
#ifdef RD_TSP_CLIENT_MAPPER
|
sl@0
|
36 |
class CTspClientMapper;
|
sl@0
|
37 |
#endif // #ifdef RD_TSP_CLIENT_MAPPER
|
sl@0
|
38 |
|
sl@0
|
39 |
class CDRMPlayServerSession : public CSession2,
|
sl@0
|
40 |
public MMdaAudioPlayerCallback,
|
sl@0
|
41 |
public MAudioLoadingObserver
|
sl@0
|
42 |
{
|
sl@0
|
43 |
friend class CDRMPlayServer;
|
sl@0
|
44 |
public:
|
sl@0
|
45 |
// construct/destruct
|
sl@0
|
46 |
CDRMPlayServerSession(CDRMPlayServer* aServer);
|
sl@0
|
47 |
static CDRMPlayServerSession* NewL(CDRMPlayServer* aServer, const RMessage2& aMessage );
|
sl@0
|
48 |
~CDRMPlayServerSession();
|
sl@0
|
49 |
//service request
|
sl@0
|
50 |
virtual void ServiceL(const RMessage2 &aMessage);
|
sl@0
|
51 |
TInt DispatchMessageL(const RMessage2 &aMessage);
|
sl@0
|
52 |
|
sl@0
|
53 |
//services available
|
sl@0
|
54 |
void NewFilePlayerL(const RMessage2 aMessage);
|
sl@0
|
55 |
void NewDesPlayerL(const RMessage2 aMessage);
|
sl@0
|
56 |
void NewDesPlayerReadOnlyL(const RMessage2 aMessage);
|
sl@0
|
57 |
void NewPlayerL(const RMessage2 aMessage);
|
sl@0
|
58 |
void OpenFileL(const RMessage2 &aMessage);
|
sl@0
|
59 |
void OpenFileByHandleL(const RMessage2 &aMessage);
|
sl@0
|
60 |
void OpenFileBySourceL(const RMessage2 &aMessage);
|
sl@0
|
61 |
void OpenDesL(const RMessage2 &aMessage);
|
sl@0
|
62 |
void OpenUrlL(const RMessage2 &aMessage);
|
sl@0
|
63 |
void Play();
|
sl@0
|
64 |
void Stop();
|
sl@0
|
65 |
void SetVolume(const RMessage2 &aMessage);
|
sl@0
|
66 |
void SetRepeats(const RMessage2 &aMessage);
|
sl@0
|
67 |
void SetVolumeRamp(const RMessage2 &aMessage);
|
sl@0
|
68 |
void Duration(const RMessage2&aMessage);
|
sl@0
|
69 |
TInt MaxVolume();
|
sl@0
|
70 |
|
sl@0
|
71 |
// API Additions since version 7.0
|
sl@0
|
72 |
TInt Pause();
|
sl@0
|
73 |
void Close();
|
sl@0
|
74 |
TInt GetPosition(const RMessage2 &aMessage);
|
sl@0
|
75 |
void SetPosition(const RMessage2 &aMessage);
|
sl@0
|
76 |
|
sl@0
|
77 |
TInt SetPriority(const RMessage2 &aMessage);
|
sl@0
|
78 |
TInt GetVolume(const RMessage2 &aMessage);
|
sl@0
|
79 |
TInt GetNumberOfMetaDataEntries(const RMessage2 &aMessage);
|
sl@0
|
80 |
void GetMetaDataEntryL(const RMessage2 &aMessage);
|
sl@0
|
81 |
TInt SetPlayWindow(const RMessage2 &aMessage);
|
sl@0
|
82 |
TInt ClearPlayWindow();
|
sl@0
|
83 |
TInt SetBalance(const RMessage2 &aMessage);
|
sl@0
|
84 |
TInt GetBalance(const RMessage2 &aMessage);
|
sl@0
|
85 |
TInt GetBitRate(const RMessage2 &aMessage);
|
sl@0
|
86 |
|
sl@0
|
87 |
void RegisterForAudioLoadingNotification(const RMessage2 &aMessage);
|
sl@0
|
88 |
void GetAudioLoadingProgressL(const RMessage2 &aMessage);
|
sl@0
|
89 |
void ControllerImplementationInformationL(const RMessage2 &aMessage);
|
sl@0
|
90 |
|
sl@0
|
91 |
void CustomCommandSyncL(const RMessage2 &aMessage);
|
sl@0
|
92 |
void CustomCommandAsyncStep1L(const RMessage2 &aMessage);
|
sl@0
|
93 |
void CustomCommandAsyncStep2L(const RMessage2 &aMessage);
|
sl@0
|
94 |
|
sl@0
|
95 |
void SetPriorityPreference(const RMessage2 &aMessage);
|
sl@0
|
96 |
void AsyncCustomCommandCompleted( CDRMCustomCommandAsyncAO* aObject );
|
sl@0
|
97 |
|
sl@0
|
98 |
|
sl@0
|
99 |
|
sl@0
|
100 |
protected:
|
sl@0
|
101 |
// panic the client
|
sl@0
|
102 |
void PanicClient(const RMessage2 &aMessage, TInt aPanic) const;
|
sl@0
|
103 |
|
sl@0
|
104 |
private:
|
sl@0
|
105 |
void ConstructL( const RMessage2& aMessage );
|
sl@0
|
106 |
|
sl@0
|
107 |
//MMdaAudioPlayerCallback
|
sl@0
|
108 |
void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
|
sl@0
|
109 |
void MapcPlayComplete(TInt aError);
|
sl@0
|
110 |
|
sl@0
|
111 |
//MAudioLoadingObserver
|
sl@0
|
112 |
void MaloLoadingStarted();
|
sl@0
|
113 |
void MaloLoadingComplete();
|
sl@0
|
114 |
|
sl@0
|
115 |
//Returns False if Destination CustomCommand needs to be blocked
|
sl@0
|
116 |
TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
|
sl@0
|
117 |
TBool CheckCustomInterfaceBuilderImplL(TDesC8& aParam);
|
sl@0
|
118 |
|
sl@0
|
119 |
private:
|
sl@0
|
120 |
enum{EIdle,EPlaying,EStopped};
|
sl@0
|
121 |
|
sl@0
|
122 |
CDRMPlayServer *iServer;
|
sl@0
|
123 |
CMdaAudioPlayerUtility* iPlayUtil;
|
sl@0
|
124 |
RMessage2 iMessage;
|
sl@0
|
125 |
RMessage2* iMessage2;
|
sl@0
|
126 |
CBufFlat* iMetaDataBuffer;
|
sl@0
|
127 |
//CAsyncCallback* iAsyncCallback;
|
sl@0
|
128 |
TErrorDurationStructPckgBuf iErrDurPckg;
|
sl@0
|
129 |
TAsyncCallbackStatePckgBuf iCallbackState;
|
sl@0
|
130 |
TInt iAsyncComplete;
|
sl@0
|
131 |
TInt iCount;
|
sl@0
|
132 |
TInt iState;
|
sl@0
|
133 |
TInt iPriority;
|
sl@0
|
134 |
TMdaPriorityPreference iPref;
|
sl@0
|
135 |
TBool iFileHandleUsed;
|
sl@0
|
136 |
RFile iFileHandle;
|
sl@0
|
137 |
#ifdef RD_TSP_CLIENT_MAPPER
|
sl@0
|
138 |
// Handle to TSP Client Mapper for Rem Con Framework
|
sl@0
|
139 |
CTspClientMapper* iTSPClientMapper;
|
sl@0
|
140 |
// Process id of client to DRM Session
|
sl@0
|
141 |
TProcessId iClientProcessId;
|
sl@0
|
142 |
#endif // RD_TSP_CLIENT_MAPPER
|
sl@0
|
143 |
RPointerArray<CDRMCustomCommandAsyncAO> iActiveAsyncCustomCommands;
|
sl@0
|
144 |
CDRMCustomCommandAsyncAO* iCDRMCustomCommandAsyncAO2Phase;
|
sl@0
|
145 |
};
|
sl@0
|
146 |
|
sl@0
|
147 |
#endif
|
sl@0
|
148 |
|
sl@0
|
149 |
// End of file
|