|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Implementation of audio buffer prefill custom interface pair |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef AUDIOBUFFERPREFILLCI_H |
|
19 #define AUDIOBUFFERPREFILLCI_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <mmf/common/mmfipc.h> |
|
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
24 #include <mmf/common/mmfipcserver.h> |
|
25 #endif |
|
26 #include <mmf/server/mmfdevsoundcustominterface.h> |
|
27 #include <mmf/server/mmfdevsoundcustomcommands.h> |
|
28 #include <mmf/server/devsoundstandardcustominterfaces.h> |
|
29 #include <mmf/plugin/mmfdevsoundcustominterface.hrh> |
|
30 |
|
31 /** |
|
32 Enum to represent the method called by this custom interface |
|
33 @internalComponent |
|
34 @prototype |
|
35 @file |
|
36 */ |
|
37 enum TMMFDevSoundCISampleBufferingCommands |
|
38 { |
|
39 EMMFDevSoundCIEnableSampleBufferingBeforePlayback, |
|
40 EMMFDevSoundCIDisableSampleBufferingBeforePlayback, |
|
41 EMMFDevSoundCINotifyPlayStarted, |
|
42 EMMFDevSoundCICancelNotifyPlayStarted |
|
43 }; |
|
44 |
|
45 |
|
46 /** |
|
47 Implementation of the Audio buffer prefill custom interface Mux |
|
48 @internalComponent |
|
49 @prototype |
|
50 @file |
|
51 */ |
|
52 class CMMFSampleBufferingMux : public CBase, |
|
53 public MMMFDevSoundCustomInterfaceMuxPlugin, |
|
54 public MMMFSampleBuffering |
|
55 { |
|
56 public: |
|
57 |
|
58 // from MMMFDevSoundCustomInterfaceMuxPlugin |
|
59 /** |
|
60 Attempt to open the interface. |
|
61 @param aInterfaceId |
|
62 The UID of the interface to open. |
|
63 @return one of the system wide error codes |
|
64 */ |
|
65 virtual TInt OpenInterface(TUid aInterfaceId); |
|
66 |
|
67 /** |
|
68 Equivalent to destructor. Called to destroy plugin. |
|
69 */ |
|
70 virtual void Release(); |
|
71 |
|
72 /** |
|
73 Pass destructor key. |
|
74 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
75 @param aDestructorKey |
|
76 The Uid returned by REComSession::CreateImplementationL() or similar |
|
77 */ |
|
78 virtual void PassDestructorKey(TUid aDestructorKey); |
|
79 |
|
80 /** |
|
81 Complete construction. |
|
82 Pass additional values from the construction phase, used subsequently by the plugin. |
|
83 @param aCustomUtility |
|
84 The custom interface utility used by the plugin to communicate with the remote |
|
85 server side DeMux plugin |
|
86 @leave This method may leave with one of the system-wide error codes. |
|
87 */ |
|
88 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility); |
|
89 |
|
90 /** |
|
91 Return the custom interface |
|
92 @param aInterfaceId |
|
93 The UID of the required custom interface |
|
94 @return the custom interface supported by this plugin |
|
95 */ |
|
96 virtual TAny* CustomInterface(TUid aInterfaceId); |
|
97 |
|
98 /** |
|
99 Instantiate a CI Mux class |
|
100 @return the pointer to the new class, cast to the Mux plugin mixin |
|
101 @leave This method may leave with one of the system-wide error codes. |
|
102 */ |
|
103 static MMMFDevSoundCustomInterfaceMuxPlugin* NewL(); |
|
104 |
|
105 // from MMMFSampleBuffering |
|
106 //@see MMMFSampleBuffering |
|
107 virtual TInt MmsbEnableSampleBufferingBeforePlayback(); |
|
108 //@see MMMFSampleBuffering |
|
109 virtual TInt MmsbDisableSampleBufferingBeforePlayback(); |
|
110 //@see MMMFSampleBuffering |
|
111 virtual void MmsbNotifyPlayStarted(TRequestStatus& aStatus); |
|
112 //@see MMMFSampleBuffering |
|
113 virtual void MmsbCancelNotifyPlayStarted(); |
|
114 |
|
115 protected: |
|
116 CMMFSampleBufferingMux(); |
|
117 ~CMMFSampleBufferingMux(); |
|
118 |
|
119 protected: |
|
120 TUid iKey; |
|
121 TInt iRemoteHandle; |
|
122 MMMFDevSoundCustomInterfaceMuxUtility* iUtility; |
|
123 |
|
124 private: |
|
125 TMMFDevSoundCustomInterfaceCommandPackage iCmdPkg; |
|
126 }; |
|
127 |
|
128 |
|
129 /** |
|
130 Implementation of the Audio buffer prefill custom interface DeMux |
|
131 @internalComponent |
|
132 @prototype |
|
133 @file |
|
134 */ |
|
135 class CMMFSampleBufferingDeMux : public CActive, |
|
136 public MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
137 { |
|
138 public: |
|
139 /** |
|
140 Instantiate a CMMFSampleBufferingDeMux class |
|
141 @return a pointer to the new class cast to the DeMux plugin mixin |
|
142 @leave This method may leave with one of the system-wide error codes. |
|
143 */ |
|
144 static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL(); |
|
145 |
|
146 /** |
|
147 Attempt to open the interface. |
|
148 @param aInterfaceId |
|
149 The UID of the interface to open. |
|
150 @return a handle to the remote plugin |
|
151 */ |
|
152 virtual TInt OpenInterface(TUid aInterfaceId); |
|
153 |
|
154 /** |
|
155 Equivalent to destructor. Called to destroy plugin. |
|
156 */ |
|
157 virtual void Release(); |
|
158 |
|
159 /** |
|
160 Pass destructor key. |
|
161 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
162 @param aDestructorKey |
|
163 The Uid returned by REComSession::CreateImplementationL() or similar |
|
164 */ |
|
165 virtual void PassDestructorKey(TUid aDestructorKey); |
|
166 |
|
167 /** |
|
168 Set the target of the custom interface call |
|
169 @param aTarget |
|
170 The DevSound to call the custom interface on. |
|
171 */ |
|
172 virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget); |
|
173 |
|
174 /** |
|
175 Complete construction. |
|
176 @param aUtility |
|
177 The DeMux utility to use |
|
178 @leave This method may leave with one of the system-wide error codes. |
|
179 */ |
|
180 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility); |
|
181 |
|
182 /** |
|
183 Refresh the current custom interface connections |
|
184 @leave This method may leave with one of the system-wide error codes. |
|
185 */ |
|
186 virtual void RefreshL(); |
|
187 |
|
188 // from MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
189 /** |
|
190 Open the slave |
|
191 @param aInterface |
|
192 The UID of the requested interface |
|
193 @param aPackageBuf |
|
194 A package of data that can be supplied for initialisation |
|
195 @return the result of the operation |
|
196 @leave This method may leave with one of the system-wide error codes. |
|
197 */ |
|
198 virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); |
|
199 |
|
200 /** |
|
201 Close the slave |
|
202 @param aHandle |
|
203 The handle of the slave plugin |
|
204 @leave This method may leave with one of the system-wide error codes. |
|
205 */ |
|
206 virtual void DoCloseSlaveL(TInt aHandle); |
|
207 |
|
208 /** |
|
209 Relay the synchronous custom command onto the slave |
|
210 @param aMessage |
|
211 The IPC message to be sent to the slave |
|
212 @return the result of the operation |
|
213 @leave This method may leave with one of the system-wide error codes. |
|
214 */ |
|
215 virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); |
|
216 |
|
217 /** |
|
218 Relay the synchronous custom command onto the slave and obtain a result |
|
219 @param aMessage |
|
220 The IPC message to be sent to the slave |
|
221 @return the result of the operation |
|
222 @leave This method may leave with one of the system-wide error codes. |
|
223 */ |
|
224 virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
225 |
|
226 /** |
|
227 Relay an asynchronous command onto the slave |
|
228 @param aMessage |
|
229 The IPC message to be sent to the slave |
|
230 @leave This method may leave with one of the system-wide error codes. |
|
231 */ |
|
232 virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); |
|
233 |
|
234 /** |
|
235 Relay an asynchronous command onto the slave and obtain a result |
|
236 @param aMessage |
|
237 The IPC message to be sent to the slave@param aMessage |
|
238 @leave This method may leave with one of the system-wide error codes. |
|
239 */ |
|
240 virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
241 |
|
242 // from CActive |
|
243 virtual void RunL(); |
|
244 virtual void DoCancel(); |
|
245 |
|
246 protected: |
|
247 ~CMMFSampleBufferingDeMux(); |
|
248 CMMFSampleBufferingDeMux(); |
|
249 |
|
250 // from mirror MMMFSampleBuffering method. |
|
251 TInt DoMmsbEnableSampleBufferingBeforePlaybackL(); |
|
252 TInt DoMmsbDisableSampleBufferingBeforePlaybackL(); |
|
253 void DoMmsbNotifyPlayStartedL(const RMmfIpcMessage& aMessage); |
|
254 void DoMmsbCancelNotifyPlayStartedL(); |
|
255 |
|
256 protected: |
|
257 MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility; |
|
258 MMMFDevSoundCustomInterfaceTarget* iTarget; |
|
259 TUid iKey; |
|
260 MMMFSampleBuffering* iInterfaceSampleBuffering; |
|
261 RMmfIpcMessage iStoredMessage; |
|
262 }; |
|
263 |
|
264 #endif |