author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:45 +0100 | |
branch | GCC_SURGE |
changeset 37 | 451b2e1545b2 |
parent 16 | f54ebcfc1b80 |
parent 32 | 189d20c34778 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "radiocontroleventlistener.h" |
|
19 |
#include "radioenginewrapper_p.h" |
|
20 |
#include "radioenginewrapperobserver.h" |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
21 |
#include "radioenginehandler.h" |
24 | 22 |
#include "radiologger.h" |
23 |
#include "cradioremcontarget.h" |
|
24 |
/*! |
|
25 |
* |
|
26 |
*/ |
|
27 |
RadioControlEventListener::RadioControlEventListener( RadioEngineWrapperPrivate& engine ) : |
|
28 |
mEngine( engine ) |
|
29 |
{ |
|
30 |
} |
|
31 |
||
32 |
/*! |
|
33 |
* |
|
34 |
*/ |
|
35 |
RadioControlEventListener::~RadioControlEventListener() |
|
36 |
{ |
|
37 |
} |
|
38 |
||
39 |
/*! |
|
40 |
* |
|
41 |
*/ |
|
42 |
void RadioControlEventListener::init() |
|
43 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
44 |
CRadioRemConTarget* target = NULL; |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
45 |
TRAPD( err, target = CRadioRemConTarget::NewL() ); |
24 | 46 |
LOG_ASSERT( !err, LOG_FORMAT( "RadioControlEventListener::init Failed with err, %d", err ) ); |
47 |
||
48 |
if ( !err ) { |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
49 |
mRemCon.reset( target ); |
24 | 50 |
mRemCon->SetControlEventObserver( this ); |
51 |
} |
|
52 |
} |
|
53 |
||
54 |
/*! |
|
55 |
* |
|
56 |
*/ |
|
57 |
void RadioControlEventListener::StepToChannelL( RadioEngine::TRadioTuneDirection DEBUGVAR( aDirection ) ) |
|
58 |
{ |
|
59 |
LOG_FORMAT( "RadioControlEventListener::StepToChannelL: direction: %d", aDirection ); |
|
60 |
} |
|
61 |
||
62 |
/*! |
|
63 |
* |
|
64 |
*/ |
|
65 |
void RadioControlEventListener::SetChannelL( TInt DEBUGVAR( aChannelId ) ) |
|
66 |
{ |
|
67 |
LOG_FORMAT( "RadioControlEventListener::SetChannelL: Channel: %d", aChannelId ); |
|
68 |
} |
|
69 |
||
70 |
/*! |
|
71 |
* |
|
72 |
*/ |
|
73 |
void RadioControlEventListener::SeekL( RadioEngine::TRadioTuneDirection aDirection ) |
|
74 |
{ |
|
75 |
LOG_FORMAT( "RadioControlEventListener::SeekL: Direction: %d", aDirection ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
76 |
mEngine.startSeeking( aDirection == RadioEngine::ERadioDown ? Seek::Down : Seek::Up ); |
24 | 77 |
} |
78 |
||
79 |
/*! |
|
80 |
* |
|
81 |
*/ |
|
82 |
void RadioControlEventListener::StepToFrequencyL( RadioEngine::TRadioTuneDirection DEBUGVAR( aDirection ) ) |
|
83 |
{ |
|
84 |
LOG_FORMAT( "RadioControlEventListener::StepToFrequencyL: Direction: %d", aDirection ); |
|
85 |
} |
|
86 |
||
87 |
/*! |
|
88 |
* |
|
89 |
*/ |
|
90 |
void RadioControlEventListener::SetFrequencyL( TUint32 DEBUGVAR( aFreq ) ) |
|
91 |
{ |
|
92 |
LOG_FORMAT( "RadioControlEventListener::SetFrequencyL: Frequency: %d", aFreq ); |
|
93 |
} |
|
94 |
||
95 |
/*! |
|
96 |
* |
|
97 |
*/ |
|
98 |
void RadioControlEventListener::AdjustVolumeL( RadioEngine::TRadioVolumeSetDirection DEBUGVAR( aDirection ) ) |
|
99 |
{ |
|
100 |
LOG_FORMAT( "RadioControlEventListener::AdjustVolumeL: Direction: %d", aDirection ); |
|
101 |
} |
|
102 |
||
103 |
/*! |
|
104 |
* |
|
105 |
*/ |
|
106 |
void RadioControlEventListener::MuteL( TBool aMute ) |
|
107 |
{ |
|
108 |
LOG_FORMAT( "RadioControlEventListener::MuteL: Mute: %d", aMute ); |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
109 |
mEngine.radioEnginehandler().setMute( aMute ); |
24 | 110 |
} |
111 |
||
112 |
/*! |
|
113 |
* |
|
114 |
*/ |
|
115 |
void RadioControlEventListener::PlayL( TBool aDownPressed ) |
|
116 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
117 |
if ( aDownPressed ) { |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
118 |
mEngine.radioEnginehandler().setMute( false ); |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
119 |
} |
24 | 120 |
} |
121 |
||
122 |
/*! |
|
123 |
* |
|
124 |
*/ |
|
125 |
void RadioControlEventListener::PauseL( TBool aDownPressed ) |
|
126 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
127 |
if ( aDownPressed ) { |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
128 |
mEngine.radioEnginehandler().setMute( true ); |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
129 |
} |
24 | 130 |
} |
131 |
||
132 |
/*! |
|
133 |
* |
|
134 |
*/ |
|
135 |
void RadioControlEventListener::PausePlayL( TBool aDownPressed ) |
|
136 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
137 |
if ( aDownPressed ) { |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
138 |
const bool muted = !mEngine.radioEnginehandler().isMuted(); |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
139 |
mEngine.radioEnginehandler().setMute( muted ); |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
140 |
} |
24 | 141 |
} |
142 |
||
143 |
/*! |
|
144 |
* |
|
145 |
*/ |
|
146 |
void RadioControlEventListener::StopL( TBool aDownPressed ) |
|
147 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
148 |
if ( aDownPressed ) { |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
149 |
mEngine.radioEnginehandler().setMute( true ); |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
150 |
} |
24 | 151 |
} |
152 |
||
153 |
/*! |
|
154 |
* |
|
155 |
*/ |
|
156 |
void RadioControlEventListener::ForwardL( TBool aDownPressed ) |
|
157 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
158 |
if ( aDownPressed ) { |
24 | 159 |
RUN_NOTIFY_LOOP( mEngine.observers(), skipNext() ); |
160 |
} |
|
161 |
} |
|
162 |
||
163 |
/*! |
|
164 |
* |
|
165 |
*/ |
|
166 |
void RadioControlEventListener::FastForwardL( TBool aDownPressed ) |
|
167 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
168 |
if ( aDownPressed ) { |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
169 |
mEngine.startSeeking( Seek::Up ); |
24 | 170 |
} |
171 |
} |
|
172 |
||
173 |
/*! |
|
174 |
* |
|
175 |
*/ |
|
176 |
void RadioControlEventListener::BackwardL( TBool aDownPressed ) |
|
177 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
178 |
if ( aDownPressed ) { |
24 | 179 |
RUN_NOTIFY_LOOP( mEngine.observers(), skipPrevious() ); |
180 |
} |
|
181 |
} |
|
182 |
||
183 |
/*! |
|
184 |
* |
|
185 |
*/ |
|
186 |
void RadioControlEventListener::RewindL( TBool aDownPressed ) |
|
187 |
{ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
188 |
if ( aDownPressed ) { |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
189 |
mEngine.startSeeking( Seek::Down ); |
24 | 190 |
} |
191 |
} |
|
192 |
||
193 |
/*! |
|
194 |
* |
|
195 |
*/ |
|
196 |
void RadioControlEventListener::ChannelUpL( TBool DEBUGVAR( aDownPressed ) ) |
|
197 |
{ |
|
198 |
LOG_FORMAT( "RadioControlEventListener::ChannelUpL: Down: %d", aDownPressed ); |
|
199 |
} |
|
200 |
||
201 |
/*! |
|
202 |
* |
|
203 |
*/ |
|
204 |
void RadioControlEventListener::ChannelDownL( TBool DEBUGVAR( aDownPressed ) ) |
|
205 |
{ |
|
206 |
LOG_FORMAT( "RadioControlEventListener::ChannelDownL: Down: %d", aDownPressed ); |
|
207 |
} |
|
208 |
||
209 |
/*! |
|
210 |
* |
|
211 |
*/ |
|
212 |
void RadioControlEventListener::VolumeUpL( TBool aDownPressed ) |
|
213 |
{ |
|
214 |
if ( aDownPressed ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
215 |
RUN_NOTIFY_LOOP( mEngine.observers(), increaseVolume() ); |
24 | 216 |
} |
217 |
} |
|
218 |
||
219 |
/*! |
|
220 |
* |
|
221 |
*/ |
|
222 |
void RadioControlEventListener::VolumeDownL( TBool aDownPressed ) |
|
223 |
{ |
|
224 |
if ( aDownPressed ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
225 |
RUN_NOTIFY_LOOP( mEngine.observers(), decreaseVolume() ); |
24 | 226 |
} |
227 |
} |
|
228 |
||
229 |
/*! |
|
230 |
* |
|
231 |
*/ |
|
232 |
void RadioControlEventListener::ChangeViewL( TUid DEBUGVAR( aViewId ), TBool DEBUGVAR( aForceChange ) ) |
|
233 |
{ |
|
234 |
LOG_FORMAT( "RadioControlEventListener::ChangeViewL: View: %d, Force: %d", aViewId, aForceChange ); |
|
235 |
} |
|
236 |
||
237 |
/*! |
|
238 |
* |
|
239 |
*/ |
|
240 |
void RadioControlEventListener::SetAudioRouteL( RadioEngine::TRadioAudioRoute DEBUGVAR( aRoute ) ) |
|
241 |
{ |
|
242 |
LOG_FORMAT( "RadioControlEventListener::SetAudioOutputDestinationL: Destinatio: %d", aRoute ); |
|
243 |
} |
|
244 |
||
245 |
/*! |
|
246 |
* |
|
247 |
*/ |
|
248 |
void RadioControlEventListener::AnswerEndCallL() |
|
249 |
{ |
|
250 |
RUN_NOTIFY_LOOP( mEngine.observers(), skipNext() ); |
|
251 |
} |