sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "mmrcserverinfo.h"
|
sl@0
|
17 |
#include "mmrcserversession.h"
|
sl@0
|
18 |
#include "mmrcservercontroller.h"
|
sl@0
|
19 |
#include "mlogicalchain.h"
|
sl@0
|
20 |
#include "mmrcutil.h"
|
sl@0
|
21 |
#include <a3f/a3f_trace_utils.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
//------------------------------------------------------------------------------------
|
sl@0
|
25 |
//
|
sl@0
|
26 |
//------------------------------------------------------------------------------------
|
sl@0
|
27 |
/**
|
sl@0
|
28 |
* By default Symbian 2nd phase constructor is private.
|
sl@0
|
29 |
* @param CMMRCServerController& A reference on the MMRC Server controller
|
sl@0
|
30 |
*/
|
sl@0
|
31 |
CMMRCServerInfo::CMMRCServerInfo(CMMRCServerController& aServerController)
|
sl@0
|
32 |
: iMMRCServerController( aServerController)
|
sl@0
|
33 |
{
|
sl@0
|
34 |
TRACE_CREATE();
|
sl@0
|
35 |
DP_CONTEXT(----> CMMRCServerInfo::CMMRCServerInfo *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
36 |
DP_IN();
|
sl@0
|
37 |
|
sl@0
|
38 |
DP_OUT();
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
|
sl@0
|
42 |
/**
|
sl@0
|
43 |
* destructor
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
CMMRCServerInfo::~CMMRCServerInfo()
|
sl@0
|
46 |
{
|
sl@0
|
47 |
DP_CONTEXT(----> CMMRCServerInfo::~CMMRCServerInfo *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
48 |
DP_IN();
|
sl@0
|
49 |
|
sl@0
|
50 |
iMMRCAllocatedResourceContextsQueue.ResetAndDestroy();
|
sl@0
|
51 |
iMMRCContextsQueue.ResetAndDestroy();
|
sl@0
|
52 |
iMMRCAPRContextsQueue.ResetAndDestroy();
|
sl@0
|
53 |
iMMRCPausedContextsQueue.ResetAndDestroy();
|
sl@0
|
54 |
|
sl@0
|
55 |
DP_OUT();
|
sl@0
|
56 |
}
|
sl@0
|
57 |
|
sl@0
|
58 |
/**
|
sl@0
|
59 |
* Constructs, and returns a pointer to, a new CMMRCServerInfo object.
|
sl@0
|
60 |
* Leaves on failure.
|
sl@0
|
61 |
* @param CMMRCServerController& A reference on the MMRC Server controller
|
sl@0
|
62 |
* @return CMMRCServerInfo* A pointer to newly created utlitly object.
|
sl@0
|
63 |
*/
|
sl@0
|
64 |
CMMRCServerInfo* CMMRCServerInfo::NewL(CMMRCServerController& aServerController)
|
sl@0
|
65 |
{
|
sl@0
|
66 |
DP_STATIC_CONTEXT(----> CMMRCServerInfo::NewL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
67 |
DP_IN();
|
sl@0
|
68 |
|
sl@0
|
69 |
CMMRCServerInfo* self = NewLC(aServerController);
|
sl@0
|
70 |
CleanupStack::Pop(self);
|
sl@0
|
71 |
|
sl@0
|
72 |
DP0_RET(self, "self = 0x%x");
|
sl@0
|
73 |
}
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
* Constructs, leaves object on the cleanup stack, and returns a pointer
|
sl@0
|
77 |
* to, a new CMMRCServerInfo object.
|
sl@0
|
78 |
* Leaves on failure.
|
sl@0
|
79 |
* @param CMMRCServerController& A reference on the MMRC Server controller
|
sl@0
|
80 |
* @return CMMRCServerInfo* A pointer to newly created utlitly object.
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
CMMRCServerInfo* CMMRCServerInfo::NewLC(CMMRCServerController& aServerController)
|
sl@0
|
83 |
{
|
sl@0
|
84 |
DP_STATIC_CONTEXT(----> CMMRCServerInfo::NewLC *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
85 |
DP_IN();
|
sl@0
|
86 |
|
sl@0
|
87 |
CMMRCServerInfo* self=new(ELeave) CMMRCServerInfo(aServerController);
|
sl@0
|
88 |
CleanupStack::PushL(self);
|
sl@0
|
89 |
self->ConstructL( );
|
sl@0
|
90 |
|
sl@0
|
91 |
DP0_RET(self, "self = 0x%x");
|
sl@0
|
92 |
}
|
sl@0
|
93 |
|
sl@0
|
94 |
/**
|
sl@0
|
95 |
CMMRCServerInfo::ConstructL
|
sl@0
|
96 |
Symbian 2nd phase constructor can leave.
|
sl@0
|
97 |
*/
|
sl@0
|
98 |
void CMMRCServerInfo::ConstructL()
|
sl@0
|
99 |
{
|
sl@0
|
100 |
DP_CONTEXT(----> CMMRCServerInfo::ConstructL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
101 |
DP_IN();
|
sl@0
|
102 |
|
sl@0
|
103 |
DP_OUT();
|
sl@0
|
104 |
}
|
sl@0
|
105 |
|
sl@0
|
106 |
/**
|
sl@0
|
107 |
* Change the state of the server
|
sl@0
|
108 |
* @param TMMRCServerState aNewState
|
sl@0
|
109 |
*/
|
sl@0
|
110 |
void CMMRCServerInfo::SwitchServerState(TMMRCServerState aNewState, TUint64 aContextId)
|
sl@0
|
111 |
{
|
sl@0
|
112 |
DP_CONTEXT(----> CMMRCServerInfo::SwitchServerState *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
113 |
DP_IN();
|
sl@0
|
114 |
|
sl@0
|
115 |
iMMRCServerInfoState = aNewState;
|
sl@0
|
116 |
iLastTransactionContextId = aContextId;
|
sl@0
|
117 |
|
sl@0
|
118 |
DP_OUT();
|
sl@0
|
119 |
}
|
sl@0
|
120 |
|
sl@0
|
121 |
/**
|
sl@0
|
122 |
* return the current server state
|
sl@0
|
123 |
* @return TMMRCServerState& aServerState
|
sl@0
|
124 |
*/
|
sl@0
|
125 |
void CMMRCServerInfo::ServerState(TMMRCServerState& aServerState, TUint64& aContextId) const
|
sl@0
|
126 |
{
|
sl@0
|
127 |
DP_CONTEXT(----> CMMRCServerInfo::ServerState *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
128 |
DP_IN();
|
sl@0
|
129 |
|
sl@0
|
130 |
aContextId = iLastTransactionContextId;
|
sl@0
|
131 |
aServerState = iMMRCServerInfoState;
|
sl@0
|
132 |
|
sl@0
|
133 |
DP_OUT();
|
sl@0
|
134 |
}
|
sl@0
|
135 |
|
sl@0
|
136 |
//------------------------------------------------------------------------------------
|
sl@0
|
137 |
//
|
sl@0
|
138 |
//------------------------------------------------------------------------------------
|
sl@0
|
139 |
|
sl@0
|
140 |
/**
|
sl@0
|
141 |
* Push an Context on the Context queue in parameter
|
sl@0
|
142 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
143 |
* @param CMMRCServerSession& aServerSession
|
sl@0
|
144 |
* @leave in case of memory error
|
sl@0
|
145 |
*/
|
sl@0
|
146 |
void CMMRCServerInfo::PushContextL(RMMRCContextsQueueTD& aContextsQueue, const CMMRCServerSession& aServerSession )
|
sl@0
|
147 |
{
|
sl@0
|
148 |
DP_CONTEXT(----> CMMRCServerInfo::PushContextL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
149 |
DP_IN();
|
sl@0
|
150 |
|
sl@0
|
151 |
aContextsQueue.PushL(&aServerSession);
|
sl@0
|
152 |
|
sl@0
|
153 |
DP_OUT();
|
sl@0
|
154 |
}
|
sl@0
|
155 |
|
sl@0
|
156 |
/**
|
sl@0
|
157 |
* Pop and remove the first Context of the highest priority from the Context queue in parameter
|
sl@0
|
158 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
159 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
160 |
*/
|
sl@0
|
161 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstContext(RMMRCContextsQueueTD& aContextsQueue)
|
sl@0
|
162 |
{
|
sl@0
|
163 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
164 |
DP_IN();
|
sl@0
|
165 |
|
sl@0
|
166 |
CMMRCServerSession* serverSession = 0;
|
sl@0
|
167 |
//PopAndRemove return null if the queue is empty;
|
sl@0
|
168 |
serverSession = aContextsQueue.PopAndRemove();
|
sl@0
|
169 |
|
sl@0
|
170 |
DP0_RET(serverSession, "serverSession = 0x%x");
|
sl@0
|
171 |
}
|
sl@0
|
172 |
|
sl@0
|
173 |
/**
|
sl@0
|
174 |
* Pop and remove the first Context from the Context queue in parameter by contextId
|
sl@0
|
175 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
176 |
* @param const TAudioContextId& aContextId
|
sl@0
|
177 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
178 |
*/
|
sl@0
|
179 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstContextByContextId(RMMRCContextsQueueTD& aContextsQueue, const TAudioContextId& aContextId )
|
sl@0
|
180 |
{
|
sl@0
|
181 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstContextByContextId *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
182 |
DP_IN();
|
sl@0
|
183 |
|
sl@0
|
184 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
185 |
|
sl@0
|
186 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
187 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
188 |
{
|
sl@0
|
189 |
serverSession = aContextsQueue[i];
|
sl@0
|
190 |
|
sl@0
|
191 |
TAudioContextId contextId = serverSession->ContextId();
|
sl@0
|
192 |
if( aContextId == contextId )
|
sl@0
|
193 |
{
|
sl@0
|
194 |
aContextsQueue.PopAndRemove(i);
|
sl@0
|
195 |
break;
|
sl@0
|
196 |
}
|
sl@0
|
197 |
else
|
sl@0
|
198 |
{
|
sl@0
|
199 |
serverSession = NULL;
|
sl@0
|
200 |
}
|
sl@0
|
201 |
}
|
sl@0
|
202 |
|
sl@0
|
203 |
DP0_RET(serverSession, "serverSession = 0x%x");
|
sl@0
|
204 |
}
|
sl@0
|
205 |
|
sl@0
|
206 |
|
sl@0
|
207 |
/**
|
sl@0
|
208 |
* Pop and remove the first Context of the highest priority from the Context queue in parameter
|
sl@0
|
209 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
210 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
211 |
*/
|
sl@0
|
212 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveContextFirstHighestPriority(RMMRCContextsQueueTD& aContextsQueue)
|
sl@0
|
213 |
{
|
sl@0
|
214 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveContextFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
215 |
DP_IN();
|
sl@0
|
216 |
|
sl@0
|
217 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
218 |
if( 0 == nbContexts )
|
sl@0
|
219 |
{
|
sl@0
|
220 |
return NULL;
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
TInt highestPriority = 0;
|
sl@0
|
224 |
TInt sessionIdx = 0;
|
sl@0
|
225 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
226 |
{
|
sl@0
|
227 |
const CMMRCServerSession* srvSession = aContextsQueue[i];
|
sl@0
|
228 |
// LogicalChainLastCommited or LogicalChainRequested is not null necesseraly
|
sl@0
|
229 |
const MLogicalChain* logicalChain = srvSession->LogicalChainRequested();
|
sl@0
|
230 |
if(!logicalChain)
|
sl@0
|
231 |
{
|
sl@0
|
232 |
logicalChain = srvSession->LogicalChainLastCommited();
|
sl@0
|
233 |
}
|
sl@0
|
234 |
if(!logicalChain)
|
sl@0
|
235 |
{
|
sl@0
|
236 |
return NULL;
|
sl@0
|
237 |
}
|
sl@0
|
238 |
// AM Getting the priority
|
sl@0
|
239 |
TInt currentChainPriority = (const_cast<MLogicalChain*>(logicalChain))->Priority();
|
sl@0
|
240 |
if( currentChainPriority > highestPriority )
|
sl@0
|
241 |
{
|
sl@0
|
242 |
highestPriority = currentChainPriority;
|
sl@0
|
243 |
sessionIdx = i;
|
sl@0
|
244 |
}
|
sl@0
|
245 |
|
sl@0
|
246 |
|
sl@0
|
247 |
// JIn edited as these settings have been removed
|
sl@0
|
248 |
/* TAudioTypeSettings audioTypeSettings = (logicalChain->ChainConfiguration()).iAudioTypeSettings;
|
sl@0
|
249 |
if( audioTypeSettings.iPriority > highestPriority )
|
sl@0
|
250 |
{
|
sl@0
|
251 |
highestPriority = audioTypeSettings.iPriority;
|
sl@0
|
252 |
sessionIdx = i;
|
sl@0
|
253 |
}
|
sl@0
|
254 |
*/
|
sl@0
|
255 |
|
sl@0
|
256 |
// AM
|
sl@0
|
257 |
// highestPriority = 5;
|
sl@0
|
258 |
// sessionIdx = i;
|
sl@0
|
259 |
|
sl@0
|
260 |
//EOJin
|
sl@0
|
261 |
}
|
sl@0
|
262 |
CMMRCServerSession* serverSession = aContextsQueue.PopAndRemove(sessionIdx);
|
sl@0
|
263 |
|
sl@0
|
264 |
DP0_RET(serverSession, "serverSession=0x%x");
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
/**
|
sl@0
|
268 |
* Pop and remove the first Context of the highest priority and more than aPriority
|
sl@0
|
269 |
* from the Context queue in parameter
|
sl@0
|
270 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
271 |
* @param TInt aPriority
|
sl@0
|
272 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
273 |
*/
|
sl@0
|
274 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveContextFirstHighestPriority(RMMRCContextsQueueTD& aContextsQueue, TInt /*aPriority*/ )
|
sl@0
|
275 |
{
|
sl@0
|
276 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveContextFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
277 |
DP_IN();
|
sl@0
|
278 |
|
sl@0
|
279 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
280 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
281 |
if( 0 == nbContexts )
|
sl@0
|
282 |
{
|
sl@0
|
283 |
return NULL;
|
sl@0
|
284 |
}
|
sl@0
|
285 |
|
sl@0
|
286 |
TInt highestPriority = 0;
|
sl@0
|
287 |
TInt sessionIdx = 0;
|
sl@0
|
288 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
289 |
{
|
sl@0
|
290 |
const CMMRCServerSession* srvSession = aContextsQueue[i];
|
sl@0
|
291 |
// LogicalChainLastCommited or LogicalChainRequested is not null necesseraly
|
sl@0
|
292 |
const MLogicalChain* logicalChain = srvSession->LogicalChainRequested();
|
sl@0
|
293 |
if(!logicalChain)
|
sl@0
|
294 |
{
|
sl@0
|
295 |
return NULL;
|
sl@0
|
296 |
}
|
sl@0
|
297 |
|
sl@0
|
298 |
// AM Getting the priority
|
sl@0
|
299 |
TInt currentChainPriority = (const_cast<MLogicalChain*>(logicalChain))->Priority();
|
sl@0
|
300 |
if( currentChainPriority > highestPriority )
|
sl@0
|
301 |
{
|
sl@0
|
302 |
highestPriority = currentChainPriority;
|
sl@0
|
303 |
sessionIdx = i;
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
|
sl@0
|
307 |
|
sl@0
|
308 |
// EOJin
|
sl@0
|
309 |
}
|
sl@0
|
310 |
|
sl@0
|
311 |
if( sessionIdx < nbContexts )
|
sl@0
|
312 |
{
|
sl@0
|
313 |
serverSession = aContextsQueue.PopAndRemove(sessionIdx);
|
sl@0
|
314 |
}
|
sl@0
|
315 |
|
sl@0
|
316 |
DP0_RET(serverSession, "serverSession=0x%x");
|
sl@0
|
317 |
}
|
sl@0
|
318 |
|
sl@0
|
319 |
/**
|
sl@0
|
320 |
* Pop the first Context from the Context queue in parameter
|
sl@0
|
321 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
322 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
323 |
*/
|
sl@0
|
324 |
CMMRCServerSession* CMMRCServerInfo::PopFirstContext(const RMMRCContextsQueueTD& aContextsQueue) const
|
sl@0
|
325 |
{
|
sl@0
|
326 |
DP_CONTEXT(----> CMMRCServerInfo::PopFirstContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
327 |
DP_IN();
|
sl@0
|
328 |
|
sl@0
|
329 |
CMMRCServerSession* serverSession = 0;
|
sl@0
|
330 |
//PopAndRemove return null if the queue is empty;
|
sl@0
|
331 |
serverSession = aContextsQueue.Pop();
|
sl@0
|
332 |
|
sl@0
|
333 |
DP0_RET(serverSession, "serverSession=0x%x");
|
sl@0
|
334 |
}
|
sl@0
|
335 |
|
sl@0
|
336 |
/**
|
sl@0
|
337 |
* Pop the first Context of the highest priority from the Context queue in parameter
|
sl@0
|
338 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
339 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
340 |
*/
|
sl@0
|
341 |
CMMRCServerSession* CMMRCServerInfo::PopContextFirstHighestPriority(const RMMRCContextsQueueTD& aContextsQueue) const
|
sl@0
|
342 |
{
|
sl@0
|
343 |
DP_CONTEXT(----> CMMRCServerInfo::PopContextFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
344 |
DP_IN();
|
sl@0
|
345 |
|
sl@0
|
346 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
347 |
if( 0 == nbContexts )
|
sl@0
|
348 |
{
|
sl@0
|
349 |
return NULL;
|
sl@0
|
350 |
}
|
sl@0
|
351 |
|
sl@0
|
352 |
TInt highestPriority = 0;
|
sl@0
|
353 |
TInt sessionIdx = 0;
|
sl@0
|
354 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
355 |
{
|
sl@0
|
356 |
const CMMRCServerSession* srvSession = aContextsQueue[i];
|
sl@0
|
357 |
// LogicalChainLastCommited or LogicalChainRequested is not null necesseraly
|
sl@0
|
358 |
const MLogicalChain* logicalChain = srvSession->LogicalChainRequested();
|
sl@0
|
359 |
if(!logicalChain)
|
sl@0
|
360 |
{
|
sl@0
|
361 |
logicalChain = srvSession->LogicalChainLastCommited();
|
sl@0
|
362 |
}
|
sl@0
|
363 |
if(!logicalChain)
|
sl@0
|
364 |
{
|
sl@0
|
365 |
return NULL;
|
sl@0
|
366 |
}
|
sl@0
|
367 |
|
sl@0
|
368 |
// Jin edited to remove dependency on missing element
|
sl@0
|
369 |
/*
|
sl@0
|
370 |
TAudioTypeSettings audioTypeSettings = (logicalChain->ChainConfiguration()).iAudioTypeSettings;
|
sl@0
|
371 |
if( audioTypeSettings.iPriority > highestPriority )
|
sl@0
|
372 |
{
|
sl@0
|
373 |
highestPriority = audioTypeSettings.iPriority;
|
sl@0
|
374 |
sessionIdx = i;
|
sl@0
|
375 |
}
|
sl@0
|
376 |
*/
|
sl@0
|
377 |
// AM
|
sl@0
|
378 |
/* highestPriority = 5;
|
sl@0
|
379 |
sessionIdx = i;
|
sl@0
|
380 |
|
sl@0
|
381 |
*/
|
sl@0
|
382 |
// AM Getting the priority
|
sl@0
|
383 |
TInt currentChainPriority = (const_cast<MLogicalChain*>(logicalChain))->Priority();
|
sl@0
|
384 |
if( currentChainPriority > highestPriority )
|
sl@0
|
385 |
{
|
sl@0
|
386 |
highestPriority = currentChainPriority;
|
sl@0
|
387 |
sessionIdx = i;
|
sl@0
|
388 |
}
|
sl@0
|
389 |
|
sl@0
|
390 |
// EOJIn
|
sl@0
|
391 |
}
|
sl@0
|
392 |
CMMRCServerSession* serverSession = aContextsQueue.Pop(sessionIdx);
|
sl@0
|
393 |
|
sl@0
|
394 |
DP0_RET(serverSession, "serverSession=0x%x");
|
sl@0
|
395 |
}
|
sl@0
|
396 |
|
sl@0
|
397 |
/**
|
sl@0
|
398 |
* Pop the first Context of the highest priority and more than aPriority
|
sl@0
|
399 |
* from the Context queue in parameter
|
sl@0
|
400 |
* @param RMMRCContextsQueueTD& aContextsQueue
|
sl@0
|
401 |
* @param TInt aPriority
|
sl@0
|
402 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
403 |
*/
|
sl@0
|
404 |
CMMRCServerSession* CMMRCServerInfo::PopContextFirstHighestPriority(const RMMRCContextsQueueTD& aContextsQueue, TInt /*aPriority*/ ) const
|
sl@0
|
405 |
{
|
sl@0
|
406 |
DP_CONTEXT(----> CMMRCServerInfo::PopContextFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
407 |
DP_IN();
|
sl@0
|
408 |
|
sl@0
|
409 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
410 |
if( 0 == nbContexts )
|
sl@0
|
411 |
{
|
sl@0
|
412 |
return NULL;
|
sl@0
|
413 |
}
|
sl@0
|
414 |
|
sl@0
|
415 |
TInt highestPriority = 0;
|
sl@0
|
416 |
TInt sessionIdx = 0;
|
sl@0
|
417 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
418 |
{
|
sl@0
|
419 |
const CMMRCServerSession* srvSession = aContextsQueue[i];
|
sl@0
|
420 |
// LogicalChainLastCommited or LogicalChainRequested is not null necesseraly
|
sl@0
|
421 |
const MLogicalChain* logicalChain = srvSession->LogicalChainRequested();
|
sl@0
|
422 |
if(!logicalChain)
|
sl@0
|
423 |
{
|
sl@0
|
424 |
logicalChain = srvSession->LogicalChainLastCommited();
|
sl@0
|
425 |
}
|
sl@0
|
426 |
if(!logicalChain)
|
sl@0
|
427 |
{
|
sl@0
|
428 |
return NULL;
|
sl@0
|
429 |
}
|
sl@0
|
430 |
|
sl@0
|
431 |
// JIn edited to remove dependency
|
sl@0
|
432 |
/*
|
sl@0
|
433 |
TAudioTypeSettings audioTypeSettings = (logicalChain->ChainConfiguration()).iAudioTypeSettings;
|
sl@0
|
434 |
if( audioTypeSettings.iPriority > aPriority && audioTypeSettings.iPriority > highestPriority )
|
sl@0
|
435 |
{
|
sl@0
|
436 |
highestPriority = audioTypeSettings.iPriority;
|
sl@0
|
437 |
sessionIdx = i;
|
sl@0
|
438 |
}
|
sl@0
|
439 |
*/
|
sl@0
|
440 |
|
sl@0
|
441 |
// AM New way to access
|
sl@0
|
442 |
// highestPriority = 5;
|
sl@0
|
443 |
// sessionIdx = i;
|
sl@0
|
444 |
|
sl@0
|
445 |
// AM Getting the priority
|
sl@0
|
446 |
TInt currentChainPriority = (const_cast<MLogicalChain*>(logicalChain))->Priority();
|
sl@0
|
447 |
if( currentChainPriority > highestPriority )
|
sl@0
|
448 |
{
|
sl@0
|
449 |
highestPriority = currentChainPriority;
|
sl@0
|
450 |
sessionIdx = i;
|
sl@0
|
451 |
}
|
sl@0
|
452 |
// EOJIn
|
sl@0
|
453 |
}
|
sl@0
|
454 |
|
sl@0
|
455 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
456 |
if( sessionIdx < nbContexts )
|
sl@0
|
457 |
{
|
sl@0
|
458 |
serverSession = aContextsQueue.Pop(sessionIdx);
|
sl@0
|
459 |
}
|
sl@0
|
460 |
|
sl@0
|
461 |
DP0_RET(serverSession, "serverSession=0x%x");
|
sl@0
|
462 |
}
|
sl@0
|
463 |
|
sl@0
|
464 |
//------------------------------------------------------------------------------------
|
sl@0
|
465 |
//
|
sl@0
|
466 |
//------------------------------------------------------------------------------------
|
sl@0
|
467 |
|
sl@0
|
468 |
/**
|
sl@0
|
469 |
* Push an Context on the Context queue
|
sl@0
|
470 |
* @param CMMRCServerSession& aServerSession
|
sl@0
|
471 |
* @leave in case of memory error
|
sl@0
|
472 |
*/
|
sl@0
|
473 |
void CMMRCServerInfo::PushRequestL(const CMMRCServerSession& aServerSession )
|
sl@0
|
474 |
{
|
sl@0
|
475 |
DP_CONTEXT(----> CMMRCServerInfo::PushRequestL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
476 |
DP_IN();
|
sl@0
|
477 |
|
sl@0
|
478 |
PushContextL(iMMRCContextsQueue, aServerSession);
|
sl@0
|
479 |
|
sl@0
|
480 |
DP_OUT();
|
sl@0
|
481 |
}
|
sl@0
|
482 |
|
sl@0
|
483 |
/**
|
sl@0
|
484 |
* Pop and remove the first Context from the Context queue
|
sl@0
|
485 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
486 |
*/
|
sl@0
|
487 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstRequest()
|
sl@0
|
488 |
{
|
sl@0
|
489 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstRequest *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
490 |
DP_IN();
|
sl@0
|
491 |
|
sl@0
|
492 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContext(iMMRCContextsQueue);
|
sl@0
|
493 |
|
sl@0
|
494 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
495 |
}
|
sl@0
|
496 |
|
sl@0
|
497 |
/**
|
sl@0
|
498 |
* Pop and remove the first Context from the Context queue by contextId
|
sl@0
|
499 |
* @param const TAudioContextId& aContextId
|
sl@0
|
500 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
501 |
*/
|
sl@0
|
502 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstRequestByContextId(const TAudioContextId& aContextId )
|
sl@0
|
503 |
{
|
sl@0
|
504 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstRequestByContextId *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
505 |
DP_IN();
|
sl@0
|
506 |
|
sl@0
|
507 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContextByContextId(iMMRCContextsQueue, aContextId);
|
sl@0
|
508 |
|
sl@0
|
509 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
510 |
}
|
sl@0
|
511 |
|
sl@0
|
512 |
|
sl@0
|
513 |
/**
|
sl@0
|
514 |
* Pop and remove the first Context of the highest priority from the Context queue
|
sl@0
|
515 |
* @param TInt aPriority
|
sl@0
|
516 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
517 |
*/
|
sl@0
|
518 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveRequestFirstHighestPriority()
|
sl@0
|
519 |
{
|
sl@0
|
520 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveRequestFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
521 |
DP_IN();
|
sl@0
|
522 |
|
sl@0
|
523 |
CMMRCServerSession* mmrcSession = PopAndRemoveContextFirstHighestPriority(iMMRCContextsQueue);
|
sl@0
|
524 |
|
sl@0
|
525 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
526 |
}
|
sl@0
|
527 |
|
sl@0
|
528 |
/**
|
sl@0
|
529 |
* Pop and remove the first Context of the highest priority and more than aPriority
|
sl@0
|
530 |
* from the Context queue
|
sl@0
|
531 |
* @param TInt aPriority
|
sl@0
|
532 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
533 |
*/
|
sl@0
|
534 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveRequestFirstHighestPriority( TInt aPriority )
|
sl@0
|
535 |
{
|
sl@0
|
536 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveRequestFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
537 |
DP_IN();
|
sl@0
|
538 |
|
sl@0
|
539 |
CMMRCServerSession* mmrcSession = PopAndRemoveContextFirstHighestPriority(iMMRCContextsQueue, aPriority);
|
sl@0
|
540 |
|
sl@0
|
541 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
542 |
}
|
sl@0
|
543 |
|
sl@0
|
544 |
/**
|
sl@0
|
545 |
* Pop the first Context from the Context queue
|
sl@0
|
546 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
547 |
*/
|
sl@0
|
548 |
CMMRCServerSession* CMMRCServerInfo::PopFirstRequest() const
|
sl@0
|
549 |
{
|
sl@0
|
550 |
DP_CONTEXT(----> CMMRCServerInfo::PopFirstRequest *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
551 |
DP_IN();
|
sl@0
|
552 |
|
sl@0
|
553 |
CMMRCServerSession* mmrcSession = PopFirstContext(iMMRCContextsQueue);
|
sl@0
|
554 |
|
sl@0
|
555 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
556 |
}
|
sl@0
|
557 |
|
sl@0
|
558 |
/**
|
sl@0
|
559 |
* Pop the first Context of the highest priority from the Context queue
|
sl@0
|
560 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
561 |
*/
|
sl@0
|
562 |
CMMRCServerSession* CMMRCServerInfo::PopRequestFirstHighestPriority() const
|
sl@0
|
563 |
{
|
sl@0
|
564 |
DP_CONTEXT(----> CMMRCServerInfo::PopRequestFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
565 |
DP_IN();
|
sl@0
|
566 |
|
sl@0
|
567 |
CMMRCServerSession* mmrcSession = PopContextFirstHighestPriority(iMMRCContextsQueue);
|
sl@0
|
568 |
|
sl@0
|
569 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
570 |
}
|
sl@0
|
571 |
|
sl@0
|
572 |
/**
|
sl@0
|
573 |
* Pop the first Context of the highest priority and more than aPriority
|
sl@0
|
574 |
* from the Context queue
|
sl@0
|
575 |
* @param TInt aPriority
|
sl@0
|
576 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
577 |
*/
|
sl@0
|
578 |
CMMRCServerSession* CMMRCServerInfo::PopRequestFirstHighestPriority(TInt aPriority ) const
|
sl@0
|
579 |
{
|
sl@0
|
580 |
DP_CONTEXT(----> CMMRCServerInfo::PopRequestFirstHighestPriority *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
581 |
DP_IN();
|
sl@0
|
582 |
|
sl@0
|
583 |
CMMRCServerSession* mmrcSession = PopContextFirstHighestPriority(iMMRCContextsQueue, aPriority);
|
sl@0
|
584 |
|
sl@0
|
585 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
586 |
}
|
sl@0
|
587 |
|
sl@0
|
588 |
//------------------------------------------------------------------------------------
|
sl@0
|
589 |
//
|
sl@0
|
590 |
//------------------------------------------------------------------------------------
|
sl@0
|
591 |
|
sl@0
|
592 |
/**
|
sl@0
|
593 |
* Push an Context on the in-process Context queue
|
sl@0
|
594 |
* @param CMMRCServerSession& aServerSession
|
sl@0
|
595 |
* @leave in case of memory error
|
sl@0
|
596 |
*/
|
sl@0
|
597 |
void CMMRCServerInfo::PushAllocatedResourceContextL(const CMMRCServerSession& aServerSession )
|
sl@0
|
598 |
{
|
sl@0
|
599 |
DP_CONTEXT(----> CMMRCServerInfo::PushAllocatedResourceContextL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
600 |
DP_IN();
|
sl@0
|
601 |
|
sl@0
|
602 |
PushContextL(iMMRCAllocatedResourceContextsQueue, aServerSession);
|
sl@0
|
603 |
|
sl@0
|
604 |
DP_OUT();
|
sl@0
|
605 |
}
|
sl@0
|
606 |
|
sl@0
|
607 |
/**
|
sl@0
|
608 |
* Pop and remove the first Context of the highest priority from the in-process Context queue
|
sl@0
|
609 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
610 |
*/
|
sl@0
|
611 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstAllocatedResourceContext()
|
sl@0
|
612 |
{
|
sl@0
|
613 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstAllocatedResourceContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
614 |
DP_IN();
|
sl@0
|
615 |
|
sl@0
|
616 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContext(iMMRCAllocatedResourceContextsQueue);
|
sl@0
|
617 |
|
sl@0
|
618 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
619 |
}
|
sl@0
|
620 |
|
sl@0
|
621 |
/**
|
sl@0
|
622 |
* Pop and remove the first Context from the in-process Context queue by contextId
|
sl@0
|
623 |
* @param const TAudioContextId& aContextId
|
sl@0
|
624 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
625 |
*/
|
sl@0
|
626 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstAllocatedResourceContextByContextId(const TAudioContextId& aContextId )
|
sl@0
|
627 |
{
|
sl@0
|
628 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstAllocatedResourceContextByContextId *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
629 |
DP_IN();
|
sl@0
|
630 |
|
sl@0
|
631 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContextByContextId(iMMRCAllocatedResourceContextsQueue, aContextId);
|
sl@0
|
632 |
|
sl@0
|
633 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
634 |
}
|
sl@0
|
635 |
|
sl@0
|
636 |
/**
|
sl@0
|
637 |
* Pop the first Context from the in-process Context queue
|
sl@0
|
638 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
639 |
*/
|
sl@0
|
640 |
CMMRCServerSession* CMMRCServerInfo::PopFirstAllocatedResourceContext() const
|
sl@0
|
641 |
{
|
sl@0
|
642 |
DP_CONTEXT(----> CMMRCServerInfo::PopFirstAllocatedResourceContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
643 |
DP_IN();
|
sl@0
|
644 |
|
sl@0
|
645 |
CMMRCServerSession* mmrcSession = PopFirstContext(iMMRCAllocatedResourceContextsQueue);
|
sl@0
|
646 |
|
sl@0
|
647 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
648 |
}
|
sl@0
|
649 |
|
sl@0
|
650 |
//------------------------------------------------------------------------------------
|
sl@0
|
651 |
//
|
sl@0
|
652 |
//------------------------------------------------------------------------------------
|
sl@0
|
653 |
|
sl@0
|
654 |
/**
|
sl@0
|
655 |
* Push an Context on the in-process Context queue
|
sl@0
|
656 |
* @param CMMRCServerSession& aServerSession
|
sl@0
|
657 |
* @leave in case of memory error
|
sl@0
|
658 |
*/
|
sl@0
|
659 |
void CMMRCServerInfo::PushPausedContextL(const CMMRCServerSession& aServerSession )
|
sl@0
|
660 |
{
|
sl@0
|
661 |
DP_CONTEXT(----> CMMRCServerInfo::PushPausedContextL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
662 |
DP_IN();
|
sl@0
|
663 |
|
sl@0
|
664 |
PushContextInOrderL(iMMRCPausedContextsQueue, aServerSession);
|
sl@0
|
665 |
|
sl@0
|
666 |
DP_OUT();
|
sl@0
|
667 |
}
|
sl@0
|
668 |
|
sl@0
|
669 |
/**
|
sl@0
|
670 |
* Pop and remove the first Context of the highest priority from the in-process Context queue
|
sl@0
|
671 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
672 |
*/
|
sl@0
|
673 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstPausedContext()
|
sl@0
|
674 |
{
|
sl@0
|
675 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstPausedContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
676 |
DP_IN();
|
sl@0
|
677 |
|
sl@0
|
678 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContextForPause(iMMRCPausedContextsQueue);
|
sl@0
|
679 |
|
sl@0
|
680 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
681 |
}
|
sl@0
|
682 |
/**
|
sl@0
|
683 |
* Pop and remove the first Context from the in-process Context queue by contextId
|
sl@0
|
684 |
* @param const TAudioContextId& aContextId
|
sl@0
|
685 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
686 |
*/
|
sl@0
|
687 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemovePausedContext(const TAudioContextId& aContextId )
|
sl@0
|
688 |
{
|
sl@0
|
689 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemovePausedContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
690 |
DP_IN();
|
sl@0
|
691 |
|
sl@0
|
692 |
CMMRCServerSession* mmrcSession = PopAndRemoveContextIdForPause(iMMRCPausedContextsQueue, aContextId);
|
sl@0
|
693 |
|
sl@0
|
694 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
695 |
}
|
sl@0
|
696 |
/**
|
sl@0
|
697 |
* Pop the Context from the in-process Context queue
|
sl@0
|
698 |
* @param const TAudioContextId& aContextId
|
sl@0
|
699 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
700 |
*/
|
sl@0
|
701 |
CMMRCServerSession* CMMRCServerInfo::PausedContextByIndex(TInt aIndex)
|
sl@0
|
702 |
{
|
sl@0
|
703 |
DP_CONTEXT(----> CMMRCServerInfo::PausedContextByIndex *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
704 |
DP_IN();
|
sl@0
|
705 |
|
sl@0
|
706 |
CMMRCServerSession* mmrcSession = PausedContextByIndexForPause(iMMRCPausedContextsQueue, aIndex);
|
sl@0
|
707 |
|
sl@0
|
708 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
709 |
}
|
sl@0
|
710 |
|
sl@0
|
711 |
|
sl@0
|
712 |
//------------------------------------------------------------------------------------
|
sl@0
|
713 |
//
|
sl@0
|
714 |
//------------------------------------------------------------------------------------
|
sl@0
|
715 |
|
sl@0
|
716 |
/**
|
sl@0
|
717 |
* Push an Context on the in-process Context queue
|
sl@0
|
718 |
* @param CMMRCServerSession& aServerSession
|
sl@0
|
719 |
* @leave in case of memory error
|
sl@0
|
720 |
*/
|
sl@0
|
721 |
void CMMRCServerInfo::PushAPRContextL(const CMMRCServerSession& aServerSession )
|
sl@0
|
722 |
{
|
sl@0
|
723 |
DP_CONTEXT(----> CMMRCServerInfo::PushAPRContextL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
724 |
DP_IN();
|
sl@0
|
725 |
|
sl@0
|
726 |
PushContextL(iMMRCAPRContextsQueue, aServerSession);
|
sl@0
|
727 |
|
sl@0
|
728 |
DP_OUT();
|
sl@0
|
729 |
}
|
sl@0
|
730 |
|
sl@0
|
731 |
/**
|
sl@0
|
732 |
* Pop and remove the first Context of the highest priority from the in-process Context queue
|
sl@0
|
733 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
734 |
*/
|
sl@0
|
735 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstAPRContext()
|
sl@0
|
736 |
{
|
sl@0
|
737 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstAPRContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
738 |
DP_IN();
|
sl@0
|
739 |
|
sl@0
|
740 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContext(iMMRCAPRContextsQueue);
|
sl@0
|
741 |
|
sl@0
|
742 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
743 |
}
|
sl@0
|
744 |
/**
|
sl@0
|
745 |
* Pop and remove the first Context from the in-process Context queue by contextId
|
sl@0
|
746 |
* @param const TAudioContextId& aContextId
|
sl@0
|
747 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
748 |
*/
|
sl@0
|
749 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstAPRContextByContextId(const TAudioContextId& aContextId )
|
sl@0
|
750 |
{
|
sl@0
|
751 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstAPRContextByContextId *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
752 |
DP_IN();
|
sl@0
|
753 |
|
sl@0
|
754 |
CMMRCServerSession* mmrcSession = PopAndRemoveFirstContextByContextId(iMMRCAPRContextsQueue, aContextId);
|
sl@0
|
755 |
|
sl@0
|
756 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
757 |
}
|
sl@0
|
758 |
/**
|
sl@0
|
759 |
* Pop the first Context from the in-process Context queue
|
sl@0
|
760 |
* @return CMMRCServerSession* the session of the Context
|
sl@0
|
761 |
*/
|
sl@0
|
762 |
CMMRCServerSession* CMMRCServerInfo::PopFirstAPRContext() const
|
sl@0
|
763 |
{
|
sl@0
|
764 |
DP_CONTEXT(----> CMMRCServerInfo::PopFirstAPRContext *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
765 |
DP_IN();
|
sl@0
|
766 |
|
sl@0
|
767 |
CMMRCServerSession* mmrcSession = PopFirstContext(iMMRCAPRContextsQueue);
|
sl@0
|
768 |
|
sl@0
|
769 |
DP0_RET(mmrcSession, "mmrcSession = 0x%x");
|
sl@0
|
770 |
}
|
sl@0
|
771 |
|
sl@0
|
772 |
/**
|
sl@0
|
773 |
|
sl@0
|
774 |
*/
|
sl@0
|
775 |
TBool CMMRCServerInfo::IsOnAPRList(TAudioContextId aId)
|
sl@0
|
776 |
{
|
sl@0
|
777 |
DP_CONTEXT(----> CMMRCServerInfo::IsOnAPRList *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
778 |
DP_IN();
|
sl@0
|
779 |
TBool iIsContain = EFalse;
|
sl@0
|
780 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
781 |
|
sl@0
|
782 |
TInt nbContexts = iMMRCAPRContextsQueue.Count();
|
sl@0
|
783 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
784 |
{
|
sl@0
|
785 |
serverSession = iMMRCAPRContextsQueue[i];
|
sl@0
|
786 |
|
sl@0
|
787 |
TAudioContextId contextId = serverSession->ContextId();
|
sl@0
|
788 |
if( aId == contextId )
|
sl@0
|
789 |
{
|
sl@0
|
790 |
iIsContain = ETrue;
|
sl@0
|
791 |
break;
|
sl@0
|
792 |
}
|
sl@0
|
793 |
}
|
sl@0
|
794 |
|
sl@0
|
795 |
DP0_RET(iIsContain, "%d");
|
sl@0
|
796 |
}
|
sl@0
|
797 |
|
sl@0
|
798 |
/**
|
sl@0
|
799 |
|
sl@0
|
800 |
*/
|
sl@0
|
801 |
void CMMRCServerInfo::PushContextInOrderL(RMMRCContextsQueueOrderTD& aContextsQueue, const CMMRCServerSession& aServerSession )
|
sl@0
|
802 |
{
|
sl@0
|
803 |
DP_CONTEXT(----> CMMRCServerInfo::PushContextInOrderL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
804 |
DP_IN();
|
sl@0
|
805 |
|
sl@0
|
806 |
aContextsQueue.PushL(&aServerSession);
|
sl@0
|
807 |
|
sl@0
|
808 |
DP_OUT();
|
sl@0
|
809 |
}
|
sl@0
|
810 |
|
sl@0
|
811 |
|
sl@0
|
812 |
/**
|
sl@0
|
813 |
|
sl@0
|
814 |
*/
|
sl@0
|
815 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveFirstContextForPause(RMMRCContextsQueueOrderTD& aContextsQueue)
|
sl@0
|
816 |
{
|
sl@0
|
817 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveFirstContextForPause *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
818 |
DP_IN();
|
sl@0
|
819 |
|
sl@0
|
820 |
CMMRCServerSession* serverSession = 0;
|
sl@0
|
821 |
//PopAndRemove return null if the queue is empty;
|
sl@0
|
822 |
serverSession = aContextsQueue.PopAndRemoveForPause(0);
|
sl@0
|
823 |
|
sl@0
|
824 |
DP0_RET(serverSession, "serverSession = 0x%x");
|
sl@0
|
825 |
}
|
sl@0
|
826 |
|
sl@0
|
827 |
/**
|
sl@0
|
828 |
|
sl@0
|
829 |
*/
|
sl@0
|
830 |
CMMRCServerSession* CMMRCServerInfo::PopAndRemoveContextIdForPause(RMMRCContextsQueueOrderTD& aContextsQueue, const TAudioContextId& aContextId )
|
sl@0
|
831 |
{
|
sl@0
|
832 |
DP_CONTEXT(----> CMMRCServerInfo::PopAndRemoveContextIdForPause *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
833 |
DP_IN();
|
sl@0
|
834 |
|
sl@0
|
835 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
836 |
|
sl@0
|
837 |
TInt nbContexts = aContextsQueue.Count();
|
sl@0
|
838 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
839 |
{
|
sl@0
|
840 |
serverSession = aContextsQueue[i];
|
sl@0
|
841 |
|
sl@0
|
842 |
TAudioContextId contextId = serverSession->ContextId();
|
sl@0
|
843 |
if( aContextId == contextId )
|
sl@0
|
844 |
{
|
sl@0
|
845 |
aContextsQueue.PopAndRemoveForPause(i);
|
sl@0
|
846 |
break;
|
sl@0
|
847 |
}
|
sl@0
|
848 |
else
|
sl@0
|
849 |
{
|
sl@0
|
850 |
serverSession = NULL;
|
sl@0
|
851 |
}
|
sl@0
|
852 |
}
|
sl@0
|
853 |
|
sl@0
|
854 |
DP0_RET(serverSession, "serverSession = 0x%x");
|
sl@0
|
855 |
}
|
sl@0
|
856 |
|
sl@0
|
857 |
|
sl@0
|
858 |
/**
|
sl@0
|
859 |
|
sl@0
|
860 |
*/
|
sl@0
|
861 |
CMMRCServerSession* CMMRCServerInfo::PausedContextByIndexForPause(RMMRCContextsQueueOrderTD& aContextsQueue, TInt aIndex)
|
sl@0
|
862 |
{
|
sl@0
|
863 |
DP_CONTEXT(----> CMMRCServerInfo::PausedContextByIndexForPause *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
864 |
DP_IN();
|
sl@0
|
865 |
|
sl@0
|
866 |
CMMRCServerSession* serverSession = 0;
|
sl@0
|
867 |
//PopAndRemove return null if the queue is empty;
|
sl@0
|
868 |
serverSession = aContextsQueue[aIndex];
|
sl@0
|
869 |
|
sl@0
|
870 |
DP0_RET(serverSession, "serverSession = 0x%x");
|
sl@0
|
871 |
}
|
sl@0
|
872 |
|
sl@0
|
873 |
|
sl@0
|
874 |
|
sl@0
|
875 |
/**
|
sl@0
|
876 |
|
sl@0
|
877 |
*/
|
sl@0
|
878 |
TBool CMMRCServerInfo::IsOnPauseList(TAudioContextId aId)
|
sl@0
|
879 |
{
|
sl@0
|
880 |
DP_CONTEXT(----> CMMRCServerInfo::IsOnAPRList *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
881 |
DP_IN();
|
sl@0
|
882 |
TBool iIsContain = EFalse;
|
sl@0
|
883 |
CMMRCServerSession* serverSession = NULL;
|
sl@0
|
884 |
|
sl@0
|
885 |
TInt nbContexts = iMMRCPausedContextsQueue.Count();
|
sl@0
|
886 |
for( TInt i = 0 ; i < nbContexts ; i++ )
|
sl@0
|
887 |
{
|
sl@0
|
888 |
serverSession = iMMRCPausedContextsQueue[i];
|
sl@0
|
889 |
|
sl@0
|
890 |
TAudioContextId contextId = serverSession->ContextId();
|
sl@0
|
891 |
if( aId == contextId )
|
sl@0
|
892 |
{
|
sl@0
|
893 |
iIsContain = ETrue;
|
sl@0
|
894 |
break;
|
sl@0
|
895 |
}
|
sl@0
|
896 |
}
|
sl@0
|
897 |
|
sl@0
|
898 |
DP0_RET(iIsContain, "%d");
|
sl@0
|
899 |
}
|
sl@0
|
900 |
|
sl@0
|
901 |
|
sl@0
|
902 |
|
sl@0
|
903 |
|
sl@0
|
904 |
TInt CMMRCServerInfo::RequestsCount()
|
sl@0
|
905 |
{ return iMMRCContextsQueue.Count(); }
|
sl@0
|
906 |
TInt CMMRCServerInfo::AllocatedResourceContextsCount()
|
sl@0
|
907 |
{ return iMMRCAllocatedResourceContextsQueue.Count(); }
|
sl@0
|
908 |
TInt CMMRCServerInfo::AllocatedAPRContextsCount()
|
sl@0
|
909 |
{ return iMMRCAPRContextsQueue.Count(); }
|
sl@0
|
910 |
TInt CMMRCServerInfo::AllocatedPausedContextsCount()
|
sl@0
|
911 |
{ return iMMRCPausedContextsQueue.Count(); }
|
sl@0
|
912 |
|
sl@0
|
913 |
//EOF
|