|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of observer class for remote control keys |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <remconcoreapitarget.h> |
|
21 #include <remconinterfaceselector.h> |
|
22 #include <e32property.h> |
|
23 #include <e32debug.h> |
|
24 #include "audioclientstubremconobserver.h" |
|
25 #include "accremconpstypes.h" |
|
26 |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CAudioClientStubRemConObserver::CAudioClientStubRemConObserver |
|
32 // C++ default constructor can NOT contain any code, that |
|
33 // might leave. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CAudioClientStubRemConObserver::CAudioClientStubRemConObserver( ) |
|
37 : iInterfaceSelector( NULL ), |
|
38 iCoreTarget( NULL ) |
|
39 |
|
40 { |
|
41 // Nothing |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CAudioClientStubRemConObserver::ConstructL |
|
46 // Symbian 2nd phase constructor can leave. |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 void CAudioClientStubRemConObserver::ConstructL() |
|
50 { |
|
51 RDebug::Print( _L("CAudioClientStubRemConObserver::ConstructL") ) ; |
|
52 |
|
53 iInterfaceSelector = CRemConInterfaceSelector::NewL(); |
|
54 |
|
55 iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this ); |
|
56 |
|
57 iInterfaceSelector->OpenTargetL(); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CAudioClientStubRemConObserver::NewL |
|
62 // Two-phased constructor. |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 CAudioClientStubRemConObserver* CAudioClientStubRemConObserver::NewL() |
|
66 { |
|
67 RDebug::Print( _L("CAudioClientStubRemConObserver::NewL") ) ; |
|
68 |
|
69 CAudioClientStubRemConObserver* self = new( ELeave ) CAudioClientStubRemConObserver(); |
|
70 |
|
71 CleanupStack::PushL( self ); |
|
72 self->ConstructL(); |
|
73 CleanupStack::Pop( self ); |
|
74 |
|
75 return self; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CAudioClientStubRemConObserver::~CSysApRemConObserver |
|
80 // Destructor |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 CAudioClientStubRemConObserver::~CAudioClientStubRemConObserver() |
|
84 { |
|
85 RDebug::Print( _L("CAudioClientStubRemConObserver::~CAudioClientStubRemConObserver") ) ; |
|
86 delete iInterfaceSelector; // Internally deletes iCoreTarget |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CAudioClientStubRemConObserver::MrccatoCommand |
|
91 // Handles remote key event |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CAudioClientStubRemConObserver::MrccatoCommand( TRemConCoreApiOperationId aOperationId, |
|
95 TRemConCoreApiButtonAction aButtonAct ) |
|
96 { |
|
97 RDebug::Print( _L("CAudioClientStubRemConObserver::MrccatoCommand: aOperationId=%d, aButtonAct=%d"), aOperationId, aButtonAct ); |
|
98 |
|
99 TRemConClientKeyDataBuf keyDatabuf; |
|
100 TRemConClientKeyData keyData; |
|
101 keyData.iOperationId = aOperationId; |
|
102 keyData.iButtonAct = aButtonAct; |
|
103 keyDatabuf = keyData; |
|
104 |
|
105 TInt err = RProperty::Set( KTFRemConTestProperty, KTFRemConClientKey, keyDatabuf ); |
|
106 |
|
107 if ( err != KErrNone ) |
|
108 { |
|
109 RDebug::Print( _L("CAudioClientStubRemConObserver::MrccatoCommand: err=%d"), err ); |
|
110 } |
|
111 } |
|
112 |
|
113 // End of File |