os/mm/devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxyAO.cpp
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: AudioOutput Proxy Active Object
19 #include "AudioOutput.h"
20 #include "AudioOutputMessageTypes.h"
22 #include "AudioOutputProxyAO.h"
23 #include <CustomCommandUtility.h>
24 #include <MAudioOutputObserver.h>
27 // Two-phased constructor.
28 CAudioOutputProxyAO* CAudioOutputProxyAO::NewL(CAudioOutput *aOutputProxy,MAudioOutputObserver& aObserver,MCustomCommand* aUtility)
30 CAudioOutputProxyAO* self = new(ELeave) CAudioOutputProxyAO(aOutputProxy,aObserver,aUtility);
31 CleanupStack::PushL(self);
33 CleanupStack::Pop(self);
38 CAudioOutputProxyAO::~CAudioOutputProxyAO()
43 // C++ default constructor can NOT contain any code, that
46 CAudioOutputProxyAO::CAudioOutputProxyAO(CAudioOutput *aOutputProxy,MAudioOutputObserver& aObserver,MCustomCommand* aUtility):
47 CActive(CActive::EPriorityStandard),
48 iAudioOutputProxy(aOutputProxy),
49 iCustomCommandUtility(aUtility),
54 void CAudioOutputProxyAO::ConstructL()
56 CActiveScheduler::Add(this);
59 // ---------------------------------------------------------
60 // CAudioOutputProxyAO::RunL
61 // ?implementation_description
62 // (other items were commented in a header).
63 // ---------------------------------------------------------
65 void CAudioOutputProxyAO::RunL()
68 RDebug::Print(_L("CAudioOutputProxyAO::RunL"));
70 if ( iRegistered != EFalse )
72 iCustomCommandUtility->CustomCommandAsync( *iDestination,iFunction,KNullDesC8,KNullDesC8,iCallbackData,iStatus );
74 iObserver->DefaultAudioOutputChanged(*iAudioOutputProxy,iCallbackData());
78 // ---------------------------------------------------------
79 // CAudioOutputProxyAO::DoCancel
80 // ?implementation_description
81 // (other items were commented in a header).
82 // ---------------------------------------------------------
84 void CAudioOutputProxyAO::DoCancel()
86 if ( iRegistered != EFalse )
88 iCustomCommandUtility->CustomCommandSync( *iDestination, EAofUnregisterObserver, KNullDesC8, KNullDesC8);
92 // ---------------------------------------------------------
93 // CAudioOutputProxyAO::SendAsyncMessage
94 // ?implementation_description
95 // (other items were commented in a header).
96 // ---------------------------------------------------------
98 void CAudioOutputProxyAO::SendAsyncMessage(const TMMFMessageDestinationPckg& aDestination,
101 iDestination = &aDestination;
102 iFunction = aFunction;
103 iCustomCommandUtility->CustomCommandAsync( aDestination,aFunction,KNullDesC8,KNullDesC8,iCallbackData,iStatus );
108 // ---------------------------------------------------------
109 // CAudioOutputProxyAO::SetRegisterFlag
110 // ?implementation_description
111 // (other items were commented in a header).
112 // ---------------------------------------------------------
114 void CAudioOutputProxyAO::SetRegisterFlag(TBool aFlag)
118 // ---------------------------------------------------------
119 // CAudioOutputProxyAO::SetObserver
120 // ?implementation_description
121 // (other items were commented in a header).
122 // ---------------------------------------------------------
124 void CAudioOutputProxyAO::SetObserver(MAudioOutputObserver& aObserver)
126 iObserver = &aObserver;