225 // CMMFDevSoundSession::ServiceL |
225 // CMMFDevSoundSession::ServiceL |
226 // (other items were commented in a header). |
226 // (other items were commented in a header). |
227 // |
227 // |
228 void CMMFDevSoundSession::ServiceL(const RMmfIpcMessage& aMessage) |
228 void CMMFDevSoundSession::ServiceL(const RMmfIpcMessage& aMessage) |
229 { |
229 { |
230 SYMBIAN_DEBPRN2(_L("\nCMMFDevSoundSession[0x%x] NEW REQUEST %02x while pending=%d"), aMessage.Function(), iOperationCompletePending); |
230 SYMBIAN_DEBPRN2(_L("\nCMMFDevSoundSession[0x%x] NEW REQUEST %02x while pending=%d"), |
|
231 aMessage.Function(), iOperationCompletePending || iAsyncQueueStart->IsActive()); |
231 if( iOperationCompletePending || iAsyncQueueStart->IsActive()) |
232 if( iOperationCompletePending || iAsyncQueueStart->IsActive()) |
232 { |
233 { |
233 // if not possible to service now, then queue request |
234 // if not possible to service now, then queue request |
234 EnqueueRequest(aMessage); |
235 EnqueueRequest(aMessage); |
235 } |
236 } |
236 else |
237 else |
237 { |
238 { |
238 // If there is no oustanding operation service inmediately |
239 // If there is no oustanding operation service inmediately |
239 DoServiceRequestL(aMessage); |
240 TRAPD(err, DoServiceRequestL(aMessage)); |
|
241 if (err) |
|
242 { |
|
243 aMessage.Complete(err); // repeat normal ServiceL() behaviour since we may keep going |
|
244 } |
|
245 if (!iOperationCompletePending && iQueuedRequests.Count() != 0) |
|
246 { |
|
247 //dequeue next |
|
248 DequeueRequest(); |
|
249 } |
240 } |
250 } |
241 } |
251 } |
242 |
252 |
243 // |
253 // |
244 // CMMFDevSoundSession::DoServiceL |
254 // CMMFDevSoundSession::DoServiceL |
442 // If there's a CI extension, see if that handles this request |
452 // If there's a CI extension, see if that handles this request |
443 TInt err = KErrNotSupported; |
453 TInt err = KErrNotSupported; |
444 if (iCIExtension) |
454 if (iCIExtension) |
445 { |
455 { |
446 iOperationCompletePending = ETrue; |
456 iOperationCompletePending = ETrue; |
|
457 iHandlingExtdCI = ETrue; |
447 TRAPD(err2, err = iCIExtension->HandleMessageL(aMessage)); |
458 TRAPD(err2, err = iCIExtension->HandleMessageL(aMessage)); |
448 if (err2) |
459 if (err2) |
449 { |
460 { |
450 err = err2; |
461 err = err2; |
451 } |
462 } |
452 iOperationCompletePending = EFalse; |
463 iOperationCompletePending = EFalse; |
|
464 iHandlingExtdCI = EFalse; |
453 } |
465 } |
454 |
466 |
455 if (err != KErrNone) |
467 if (err != KErrNone) |
456 { |
468 { |
457 // Not been handled, the request is not supported |
469 // Not been handled, the request is not supported |
1697 // CMMFDevSoundSession::PreemptionFinishedCallbackReceived |
1709 // CMMFDevSoundSession::PreemptionFinishedCallbackReceived |
1698 // (other items were commented in a header). |
1710 // (other items were commented in a header). |
1699 // |
1711 // |
1700 void CMMFDevSoundSession::PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation) |
1712 void CMMFDevSoundSession::PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation) |
1701 { |
1713 { |
|
1714 if (iHandlingExtdCI) |
|
1715 { |
|
1716 // we are in the middle of handling a CI, so ignore - will handle later when unwinding |
|
1717 return; |
|
1718 } |
1702 iOperationCompletePending = EFalse; |
1719 iOperationCompletePending = EFalse; |
1703 if ( aCanStartNewOperation && iQueuedRequests.Count() != 0 ) |
1720 if ( aCanStartNewOperation && iQueuedRequests.Count() != 0 ) |
1704 { |
1721 { |
1705 DequeueRequest(); |
1722 DequeueRequest(); |
1706 } |
1723 } |
1707 } |
1724 } |
1708 |
1725 |
|
1726 // |
|
1727 // CMMFDevSoundSession::AdaptorControlsContext() |
|
1728 // |
|
1729 |
|
1730 TBool CMMFDevSoundSession::AdaptorControlsContext() const |
|
1731 { |
|
1732 return !iHandlingExtdCI; |
|
1733 } |
1709 |
1734 |
1710 MMMFDevSoundCustomInterfaceDeMuxPlugin* CMMFDevSoundSession::InterfaceFromUid(TUid aUid) |
1735 MMMFDevSoundCustomInterfaceDeMuxPlugin* CMMFDevSoundSession::InterfaceFromUid(TUid aUid) |
1711 { |
1736 { |
1712 TInt count = iCustomInterfaceArray.Count(); |
1737 TInt count = iCustomInterfaceArray.Count(); |
1713 TInt id = aUid.iUid; |
1738 TInt id = aUid.iUid; |
1738 __ASSERT_DEBUG(err == KErrNone, Panic(EMsgQueueFailedToSendMsg)); |
1763 __ASSERT_DEBUG(err == KErrNone, Panic(EMsgQueueFailedToSendMsg)); |
1739 } |
1764 } |
1740 |
1765 |
1741 void CMMFDevSoundSession::AsynchronousOperationComplete(TInt aError, TBool aCanStartNewOperation) |
1766 void CMMFDevSoundSession::AsynchronousOperationComplete(TInt aError, TBool aCanStartNewOperation) |
1742 { |
1767 { |
|
1768 __ASSERT_DEBUG(!iHandlingExtdCI, Panic(EUnexpectedAsyncOpCompleteHandlingCI)); |
|
1769 // when handling CIs we should not reach here |
|
1770 |
1743 switch (iRequestBeingServiced.Type()) |
1771 switch (iRequestBeingServiced.Type()) |
1744 { |
1772 { |
1745 case TMMFDevSoundRequest::ESessionEvents: |
1773 case TMMFDevSoundRequest::ESessionEvents: |
1746 { |
1774 { |
1747 SYMBIAN_DEBPRN0(_L("CMMFDevSoundSession[0x%x] ==== ClosingDueException ==== ")); |
1775 SYMBIAN_DEBPRN0(_L("CMMFDevSoundSession[0x%x] ==== ClosingDueException ==== ")); |
1837 iQueuedRequests.Remove(0); |
1867 iQueuedRequests.Remove(0); |
1838 DoProcessingError(); |
1868 DoProcessingError(); |
1839 } |
1869 } |
1840 |
1870 |
1841 } |
1871 } |
1842 else |
1872 |
|
1873 if (iQueuedRequests.Count()>0) |
1843 { |
1874 { |
1844 // Some rules about what request can be followed |
1875 // Some rules about what request can be followed |
1845 SYMBIAN_DEBPRN0(_L("\n CMMFDevSoundSession[0x%x]======== Flag can service new request\n")); |
1876 SYMBIAN_DEBPRN0(_L("\n CMMFDevSoundSession[0x%x]======== Flag can service new request\n")); |
1846 iAsyncQueueStart->CallBack(); |
1877 iAsyncQueueStart->CallBack(); |
1847 } |
1878 } |