author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:09:15 +0300 | |
branch | RCL_3 |
changeset 38 | ac48f0cc9f9c |
parent 33 | bc78a40cd63c |
child 41 | 755f0370535b |
permissions | -rw-r--r-- |
33 | 1 |
/* |
2 |
* Copyright (c) 2005 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: The MUS application's UI class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#include "musuiclipsharingview.h" |
|
21 |
#include "musuiclipsharingviewcontainer.h" |
|
22 |
#include "musuibackgroundviewcontainer.h" |
|
23 |
#include "musuiclipsharingcontroller.h" |
|
24 |
#include "musuiactivitymanger.h" |
|
25 |
#include "musuiappui.h" |
|
26 |
#include "musuistatuspanehandler.h" |
|
27 |
#include "musui.hrh" |
|
28 |
#include "musuidefinitions.h" |
|
29 |
#include "muslogger.h" // debug logging |
|
30 |
#include <musui.rsg> |
|
31 |
#include <musui.mbg> |
|
32 |
#include "musuidialogutil.h" |
|
33 |
||
34 |
#include <aknViewAppUi.h> |
|
35 |
#include <avkon.hrh> |
|
36 |
#include <eikmenup.h> |
|
37 |
#include <eikbtgpc.h> |
|
38 |
#include <akntoolbar.h> |
|
39 |
||
40 |
||
41 |
const TInt KMusUiContainerHeight = 50; |
|
42 |
const TInt KDefaultResolutionHeight = 640; |
|
43 |
||
44 |
// ----------------------------------------------------------------------------- |
|
45 |
// EPOC two-phased constructor |
|
46 |
// ----------------------------------------------------------------------------- |
|
47 |
// |
|
48 |
void CMusUiClipSharingView::ConstructL() |
|
49 |
{ |
|
50 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::ConstructL" ); |
|
51 |
||
52 |
CMusUiSendView::ConstructL(); |
|
53 |
||
54 |
Toolbar()->SetToolbarObserver( this ); |
|
55 |
Toolbar()->UpdateBackground(); |
|
56 |
||
57 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::ConstructL" ); |
|
58 |
} |
|
59 |
||
60 |
||
61 |
// ----------------------------------------------------------------------------- |
|
62 |
// Destructor |
|
63 |
// ----------------------------------------------------------------------------- |
|
64 |
// |
|
65 |
CMusUiClipSharingView::~CMusUiClipSharingView() |
|
66 |
{ |
|
67 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::~CMusUiClipSharingView" ); |
|
68 |
if ( iContainer ) |
|
69 |
{ |
|
70 |
AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
71 |
} |
|
72 |
delete iContainer; |
|
73 |
||
74 |
delete iController; |
|
75 |
||
76 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::~CMusUiClipSharingView" ); |
|
77 |
} |
|
78 |
||
79 |
||
80 |
// ----------------------------------------------------------------------------- |
|
81 |
// |
|
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// |
|
84 |
TUid CMusUiClipSharingView::Id() const |
|
85 |
{ |
|
86 |
return KMusUidClipSharingView; |
|
87 |
} |
|
88 |
||
89 |
// ----------------------------------------------------------------------------- |
|
90 |
// From MEikMenuObserver, Called by framework before constructing menupane |
|
91 |
// ----------------------------------------------------------------------------- |
|
92 |
// |
|
93 |
void CMusUiClipSharingView::DynInitMenuPaneL( TInt aResourceId, |
|
94 |
CEikMenuPane* aMenuPane ) |
|
95 |
{ |
|
96 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DynInitMenuPaneL" ); |
|
97 |
||
98 |
||
99 |
// Base class initiated initialization first |
|
100 |
CMusUiGeneralView::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
101 |
||
102 |
if(! MUS_NO_TOOLBAR ) |
|
103 |
{ |
|
104 |
SetInitialFocusedItemL(); |
|
105 |
} |
|
106 |
||
107 |
if ( aResourceId == R_MUSUI_VIEW_MENU ) |
|
108 |
{ |
|
109 |
||
110 |
// Delete items not related to clip sharing: |
|
111 |
aMenuPane->DeleteMenuItem( EMusuiCmdRecord ); |
|
112 |
aMenuPane->DeleteMenuItem( EMusuiCmdStopRecording ); |
|
113 |
||
114 |
aMenuPane->DeleteMenuItem( EMusuiCmdToolbarZoom ); |
|
115 |
aMenuPane->DeleteMenuItem( EMusuiCmdToolbarBrightness ); |
|
116 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewZoom ); |
|
117 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewBrightness ); |
|
118 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewFullScreen ); |
|
119 |
||
120 |
// Delete EMusuiCmdViewAudioNormal or EMusuiCmdViewAudioMute |
|
121 |
// depending on the audio state of the clip: |
|
122 |
if ( iController->ClipContainsAudioL() ) |
|
123 |
{ |
|
124 |
aMenuPane->DeleteMenuItem( iController->ClipMutedL() ? |
|
125 |
EMusuiCmdViewAudioMute : |
|
126 |
EMusuiCmdViewAudioNormal ); |
|
127 |
} |
|
128 |
else |
|
129 |
{ |
|
130 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioMute ); |
|
131 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioNormal ); |
|
132 |
} |
|
133 |
||
134 |
// Delete "Replay" item, if the end of the clip not reached: |
|
135 |
if ( !iController->ClipEnded() ) |
|
136 |
{ |
|
137 |
aMenuPane->DeleteMenuItem( EMusuiCmdViewReplay ); |
|
138 |
} |
|
139 |
||
140 |
} |
|
141 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DynInitMenuPaneL" ); |
|
142 |
} |
|
143 |
||
144 |
||
145 |
// ----------------------------------------------------------------------------- |
|
146 |
// |
|
147 |
// ----------------------------------------------------------------------------- |
|
148 |
// |
|
149 |
void CMusUiClipSharingView::HandleToolbarCommandL( TInt aCommand ) |
|
150 |
{ |
|
151 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::HandleToolbarCommandL" ); |
|
152 |
||
153 |
__ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); |
|
154 |
||
155 |
switch ( aCommand ) |
|
156 |
{ |
|
157 |
case EKeyLeftArrow: |
|
158 |
{ |
|
159 |
HandleCommandL( |
|
160 |
iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : |
|
161 |
iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastReverse : |
|
162 |
EMusUiCmdToolbarLastIndex ); |
|
163 |
break; |
|
164 |
} |
|
165 |
case EKeyRightArrow: |
|
166 |
{ |
|
167 |
HandleCommandL( |
|
168 |
iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : |
|
169 |
iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastForward : |
|
170 |
EMusUiCmdToolbarLastIndex ); |
|
171 |
break; |
|
172 |
} |
|
173 |
case EKeyUpArrow: |
|
174 |
{ |
|
175 |
HandleCommandL( |
|
176 |
iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : |
|
177 |
iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastForward : |
|
178 |
EMusUiCmdToolbarLastIndex ); |
|
179 |
break; |
|
180 |
} |
|
181 |
case EKeyDownArrow: |
|
182 |
{ |
|
183 |
HandleCommandL( |
|
184 |
iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : |
|
185 |
iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastReverse : |
|
186 |
EMusUiCmdToolbarLastIndex ); |
|
187 |
break; |
|
188 |
} |
|
189 |
case EMusuiCmdViewVolumeDown: |
|
190 |
{ |
|
191 |
HandleCommandL( EMusuiCmdViewVolumeDown ); |
|
192 |
break; |
|
193 |
} |
|
194 |
case EMusuiCmdViewVolumeUp: |
|
195 |
{ |
|
196 |
HandleCommandL( EMusuiCmdViewVolumeUp ); |
|
197 |
break; |
|
198 |
} |
|
199 |
default: |
|
200 |
{ |
|
201 |
break; |
|
202 |
} |
|
203 |
} |
|
204 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::HandleToolbarCommandL" ); |
|
205 |
} |
|
206 |
||
207 |
||
208 |
// ----------------------------------------------------------------------------- |
|
209 |
// |
|
210 |
// ----------------------------------------------------------------------------- |
|
211 |
// |
|
212 |
void CMusUiClipSharingView::HandleKeyUpEvent( TInt /*aKeyCode*/ ) |
|
213 |
{ |
|
214 |
TRAP_IGNORE( iController->StopWindingL() ) |
|
215 |
} |
|
216 |
||
217 |
||
218 |
// ----------------------------------------------------------------------------- |
|
219 |
// |
|
220 |
// ----------------------------------------------------------------------------- |
|
221 |
// |
|
222 |
void CMusUiClipSharingView::SetInitialFocusedItemL() |
|
223 |
{ |
|
224 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::SetInitialFocusedItemL" ); |
|
225 |
||
226 |
__ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); |
|
227 |
||
228 |
if ( iOperatorSpecificFunctionality && !AknLayoutUtils::PenEnabled() ) |
|
229 |
{ |
|
230 |
MUS_LOG( "Focus changed in OPERATOR mode !!!!!!!!!!!!!" ); |
|
231 |
||
232 |
if ( !( iController->DeviceHasDedicatedVolumeKeys() ) ) |
|
233 |
{ |
|
234 |
Toolbar()->SetFocusedItemL( EMusuiCmdToolbarVolume ); |
|
235 |
} |
|
236 |
else |
|
237 |
{ |
|
238 |
||
239 |
Toolbar()->SetFocusedItemL( EventControllerL().IsMicMutedL() ? |
|
240 |
EMusuiCmdToolbarUnmute : |
|
241 |
EMusuiCmdToolbarMute ); |
|
242 |
} |
|
243 |
||
244 |
} |
|
245 |
||
246 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::SetInitialFocusedItemL" ); |
|
247 |
} |
|
248 |
||
249 |
// ----------------------------------------------------------------------------- |
|
250 |
// |
|
251 |
// ----------------------------------------------------------------------------- |
|
252 |
// |
|
253 |
void CMusUiClipSharingView::DynInitToolbarL( TInt aResourceId, |
|
254 |
CAknToolbar* aToolbar ) |
|
255 |
{ |
|
256 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DynInitToolbarL" ); |
|
257 |
||
258 |
// Items to be removed in Clip Sharing View: |
|
259 |
||
260 |
||
261 |
if (!AknLayoutUtils::PenEnabled())//(aResourceId == R_MUS_TOOLBAR_NONTOUCH)// |
|
262 |
{ |
|
263 |
if ( iController->DeviceHasDedicatedVolumeKeys() ) |
|
264 |
{ |
|
265 |
aToolbar->RemoveItem( EMusuiCmdToolbarVolume ); |
|
266 |
} |
|
267 |
else |
|
268 |
{ |
|
269 |
aToolbar->SetFocusedItemL( EMusuiCmdToolbarVolume ); |
|
270 |
} |
|
271 |
||
272 |
aToolbar->RemoveItem( EMusuiCmdToolbarZoom ); |
|
273 |
aToolbar->RemoveItem( EMusuiCmdToolbarBrightness ); |
|
274 |
} |
|
275 |
||
276 |
Toolbar()->RemoveItem( EMusuiCmdToolbarPauseLive ); |
|
277 |
Toolbar()->RemoveItem( EMusuiCmdToolbarUnPauseLive ); |
|
278 |
Toolbar()->RemoveItem( EMusuiCmdToolbarFullScreen ); |
|
279 |
||
280 |
||
281 |
if ( iOperatorSpecificFunctionality ) |
|
282 |
{ |
|
283 |
// Remove pause/unpause functionality in operator variant case |
|
284 |
Toolbar()->RemoveItem( EMusuiCmdToolbarPause ); |
|
285 |
Toolbar()->RemoveItem( EMusuiCmdToolbarUnPause ); |
|
286 |
||
287 |
if ( aToolbar->FocusedItem() == KErrNotFound && |
|
288 |
!AknLayoutUtils::PenEnabled() ) |
|
289 |
{ |
|
290 |
aToolbar->SetFocusedItemL( EventControllerL().IsMicMutedL() ? |
|
291 |
EMusuiCmdToolbarUnmute : |
|
292 |
EMusuiCmdToolbarMute ); |
|
293 |
} |
|
294 |
||
295 |
} |
|
296 |
else |
|
297 |
{ |
|
298 |
// Toggled items to be hidden: |
|
299 |
Toolbar()->HideItem( iPauseSelected ? |
|
300 |
EMusuiCmdToolbarPause : |
|
301 |
EMusuiCmdToolbarUnPause, |
|
302 |
ETrue, |
|
303 |
ETrue ); |
|
304 |
if ( aToolbar->FocusedItem() == KErrNotFound && |
|
305 |
!AknLayoutUtils::PenEnabled() ) |
|
306 |
{ |
|
307 |
aToolbar->SetFocusedItemL( EMusuiCmdToolbarPause ); |
|
308 |
} |
|
309 |
Toolbar()->RemoveItem( EMusuiCmdToolbarBlank ); |
|
310 |
} |
|
311 |
||
312 |
// Last generic base class functionality |
|
313 |
CMusUiGeneralView::DynInitToolbarL( aResourceId, aToolbar ); |
|
314 |
||
315 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DynInitToolbarL" ); |
|
316 |
} |
|
317 |
||
318 |
||
319 |
// ----------------------------------------------------------------------------- |
|
320 |
// |
|
321 |
// ----------------------------------------------------------------------------- |
|
322 |
// |
|
323 |
void CMusUiClipSharingView::RunFetchDialogL() |
|
324 |
{ |
|
325 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::RunFetchDialogL" ); |
|
326 |
iContainer->RunFetchDialogL(); |
|
327 |
if ( iContainer->FileSelected() ) |
|
328 |
{ |
|
329 |
iController->SetFileNameL( iContainer->FetchedFileName() ); |
|
330 |
RefreshView(); |
|
331 |
} |
|
332 |
else |
|
333 |
{ |
|
334 |
if ( SendController() && SendController()->IsAudioRoutingLoudSpeaker() ) |
|
335 |
{ |
|
336 |
MusUiDialogUtil::ShowGlobalInformationDialogL( |
|
337 |
R_MUS_NOTE_HF_DEACTIVATED ); |
|
338 |
} |
|
339 |
MusAppUi()->HandleExit(); |
|
340 |
} |
|
341 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::RunFetchDialogL" ); |
|
342 |
} |
|
343 |
||
344 |
||
345 |
// ----------------------------------------------------------------------------- |
|
346 |
// |
|
347 |
// ----------------------------------------------------------------------------- |
|
348 |
// |
|
349 |
void CMusUiClipSharingView::ShowTranscodingProgressDialogL() |
|
350 |
{ |
|
351 |
iContainer->ShowTranscodingProgressDialogL(); |
|
352 |
} |
|
353 |
||
354 |
||
355 |
// ----------------------------------------------------------------------------- |
|
356 |
// |
|
357 |
// ----------------------------------------------------------------------------- |
|
358 |
// |
|
359 |
void CMusUiClipSharingView::UpdateClipTranscodingPercentageL( TInt aPercetage ) |
|
360 |
{ |
|
361 |
iContainer->UpdateClipTranscodingPercentageL( aPercetage ); |
|
362 |
} |
|
363 |
||
364 |
||
365 |
// ----------------------------------------------------------------------------- |
|
366 |
// |
|
367 |
// ----------------------------------------------------------------------------- |
|
368 |
// |
|
369 |
void CMusUiClipSharingView::CancelTranscodingDialogL() |
|
370 |
{ |
|
371 |
iContainer->CancelTranscodingL(); |
|
372 |
} |
|
373 |
||
374 |
||
375 |
// ----------------------------------------------------------------------------- |
|
376 |
// |
|
377 |
// ----------------------------------------------------------------------------- |
|
378 |
// |
|
379 |
void CMusUiClipSharingView::UpdateClipPositionL( |
|
380 |
TInt aPositionInSeconds, |
|
381 |
const TDesC& aFormattedPosition ) |
|
382 |
{ |
|
383 |
MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiClipSharingView::UpdateClipPositionL: ", |
|
384 |
aFormattedPosition ); |
|
385 |
||
386 |
MusAppUi()->MusStatusPane()->SetRightLabelL( aFormattedPosition ); |
|
387 |
iContainer->SetPositionValueL( aPositionInSeconds ); |
|
388 |
||
389 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::UpdateClipPositionL" ); |
|
390 |
} |
|
391 |
||
392 |
||
393 |
// ----------------------------------------------------------------------------- |
|
394 |
// |
|
395 |
// ----------------------------------------------------------------------------- |
|
396 |
// |
|
397 |
void CMusUiClipSharingView::SetDurationValue( TInt aDurationValue ) |
|
398 |
{ |
|
399 |
iContainer->SetDurationValue( aDurationValue ); |
|
400 |
} |
|
401 |
||
402 |
||
403 |
// ----------------------------------------------------------------------------- |
|
404 |
// |
|
405 |
// ----------------------------------------------------------------------------- |
|
406 |
// |
|
407 |
void CMusUiClipSharingView::SetPositionValueL( TInt aDurationValue ) |
|
408 |
{ |
|
409 |
iContainer->SetPositionValueL( aDurationValue ); |
|
410 |
} |
|
411 |
||
412 |
||
413 |
// ----------------------------------------------------------------------------- |
|
414 |
// |
|
415 |
// ----------------------------------------------------------------------------- |
|
416 |
// |
|
417 |
void CMusUiClipSharingView::SetDurationVisible() |
|
418 |
{ |
|
419 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetDurationVisible: %d", |
|
420 |
iToolbarItemSelected ); |
|
421 |
if ( !iToolbarItemSelected ) |
|
422 |
{ |
|
423 |
iContainer->SetDurationIndicatorVisible( ETrue ); |
|
424 |
} |
|
425 |
else |
|
426 |
{ |
|
427 |
iContainer->SetDurationIndicatorVisible( EFalse ); |
|
428 |
} |
|
429 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetDurationVisible" ); |
|
430 |
} |
|
431 |
||
432 |
||
433 |
// ----------------------------------------------------------------------------- |
|
434 |
// |
|
435 |
// ----------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
void CMusUiClipSharingView::ReplaceToolbarCommand( TInt aOldCommand, |
|
438 |
TInt aNewCommand, |
|
439 |
TBool aSetNewCommandFocused ) |
|
440 |
{ |
|
441 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingView::ReplaceToolbarCommand: %d", |
|
442 |
aOldCommand ); |
|
443 |
switch ( aOldCommand ) |
|
444 |
{ |
|
445 |
case EMusuiCmdToolbarPause: |
|
446 |
{ |
|
447 |
iPauseSelected = ETrue; |
|
448 |
break; |
|
449 |
} |
|
450 |
case EMusuiCmdToolbarUnPause: |
|
451 |
{ |
|
452 |
iPauseSelected = EFalse; |
|
453 |
break; |
|
454 |
} |
|
455 |
default: |
|
456 |
{ |
|
457 |
break; |
|
458 |
} |
|
459 |
||
460 |
} |
|
461 |
||
462 |
// Call base class version for generic part |
|
463 |
||
464 |
CMusUiGeneralView::ReplaceToolbarCommand( aOldCommand, |
|
465 |
aNewCommand, |
|
466 |
aSetNewCommandFocused ); |
|
467 |
||
468 |
MUS_LOG1( "mus: [MUSUI ] <- CMusUiClipSharingView::ReplaceToolbarCommand: %d", |
|
469 |
aOldCommand ); |
|
470 |
} |
|
471 |
||
472 |
||
473 |
// ----------------------------------------------------------------------------- |
|
474 |
// |
|
475 |
// ----------------------------------------------------------------------------- |
|
476 |
// |
|
477 |
void CMusUiClipSharingView::RefreshView() |
|
478 |
{ |
|
479 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::RefreshView" ); |
|
480 |
||
481 |
RefreshBackgroundContainer(); |
|
482 |
||
483 |
if ( iContainer ) |
|
484 |
{ |
|
485 |
TInt height = MusAppUi()->ApplicationRect().Height(); |
|
486 |
MUS_LOG1( "mus: [MUSUI ] -> application rect height: %d", height ); |
|
487 |
TInt containerHeight = (KMusUiContainerHeight * height) / KDefaultResolutionHeight; |
|
488 |
||
489 |
MUS_LOG1( "mus: [MUSUI ] -> container rect height: %d", containerHeight ); |
|
490 |
TRect containerRect( |
|
491 |
ClientRect().iTl.iX, |
|
492 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() |
|
493 |
- containerHeight,//KMusUiContainerHeight, |
|
494 |
ClientRect().iBr.iX, |
|
495 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); |
|
496 |
||
497 |
if (!AknLayoutUtils::PenEnabled()) |
|
498 |
{ |
|
499 |
containerRect = TRect( |
|
500 |
ClientRect().iTl.iX, |
|
501 |
ClientRect().iTl.iY, |
|
502 |
ClientRect().iBr.iX, |
|
503 |
ClientRect().iTl.iY + containerHeight ); |
|
504 |
} |
|
505 |
iContainer->SetRect( containerRect ); |
|
506 |
||
507 |
if ( iController ) |
|
508 |
{ |
|
509 |
||
510 |
TRect videoRect( ClientRect().iTl.iX, |
|
511 |
ClientRect().iTl.iY, |
|
512 |
ClientRect().iBr.iX, |
|
513 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() |
|
514 |
- iContainer->Size().iHeight ); |
|
515 |
||
516 |
if (!AknLayoutUtils::PenEnabled()) |
|
517 |
{ |
|
518 |
TInt dy = iContainer->Size().iHeight; |
|
519 |
videoRect.Move(0, dy); |
|
520 |
} |
|
521 |
iController->SetRect( videoRect ); |
|
522 |
||
523 |
} |
|
524 |
} |
|
525 |
||
526 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::RefreshView" ); |
|
527 |
} |
|
528 |
||
529 |
||
530 |
// ----------------------------------------------------------------------------- |
|
531 |
// |
|
532 |
// ----------------------------------------------------------------------------- |
|
533 |
// |
|
534 |
void CMusUiClipSharingView::CancelTranscodingL() |
|
535 |
{ |
|
536 |
if ( iController ) |
|
537 |
{ |
|
538 |
iController->CancelTranscodingL(); |
|
539 |
} |
|
540 |
} |
|
541 |
||
542 |
||
543 |
// ----------------------------------------------------------------------------- |
|
544 |
// |
|
545 |
// ----------------------------------------------------------------------------- |
|
546 |
// |
|
547 |
CMusUiSendController* CMusUiClipSharingView::SendController() const |
|
548 |
{ |
|
549 |
return iController; |
|
550 |
} |
|
551 |
||
552 |
||
553 |
// ----------------------------------------------------------------------------- |
|
554 |
// |
|
555 |
// ----------------------------------------------------------------------------- |
|
556 |
// |
|
557 |
CMusUiSendViewContainer* CMusUiClipSharingView::SendContainer() const |
|
558 |
{ |
|
559 |
return iContainer; |
|
560 |
} |
|
561 |
||
562 |
||
563 |
// ----------------------------------------------------------------------------- |
|
564 |
// From CAknView, Gets called from framework when activating this view |
|
565 |
// ----------------------------------------------------------------------------- |
|
566 |
// |
|
567 |
void CMusUiClipSharingView::DoActivateL( const TVwsViewId& aPrevViewId, |
|
568 |
TUid aCustomMessageId, |
|
569 |
const TDesC8& aCustomMessage ) |
|
570 |
{ |
|
571 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DoActivateL" ); |
|
572 |
||
573 |
// Base class activation first |
|
574 |
CMusUiSendView::DoActivateL( aPrevViewId, |
|
575 |
aCustomMessageId, |
|
576 |
aCustomMessage ); |
|
577 |
||
578 |
TInt height = MusAppUi()->ApplicationRect().Height(); |
|
579 |
MUS_LOG1( "mus: [MUSUI ] -> application rect height: %d", height ); |
|
580 |
TInt containerHeight = (KMusUiContainerHeight * height) / KDefaultResolutionHeight; |
|
581 |
||
582 |
MUS_LOG1( "mus: [MUSUI ] -> container rect height: %d", containerHeight ); |
|
583 |
TRect containerRect( |
|
584 |
ClientRect().iTl.iX, |
|
585 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() |
|
586 |
- containerHeight,//KMusUiContainerHeight, |
|
587 |
ClientRect().iBr.iX, |
|
588 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); |
|
589 |
||
590 |
if (!AknLayoutUtils::PenEnabled()) |
|
591 |
{ |
|
592 |
containerRect = TRect( |
|
593 |
ClientRect().iTl.iX, |
|
594 |
ClientRect().iTl.iY, |
|
595 |
ClientRect().iBr.iX, |
|
596 |
ClientRect().iTl.iY + containerHeight ); |
|
597 |
} |
|
598 |
||
599 |
if ( !iContainer ) |
|
600 |
{ |
|
601 |
MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingView::DoActivateL: !iContainer" ); |
|
602 |
iContainer = new ( ELeave ) CMusUiClipSharingViewContainer(); |
|
603 |
iContainer->SetMopParent( this ); |
|
604 |
iContainer->ConstructL( this, containerRect ); |
|
605 |
AppUi()->AddToViewStackL( *this, iContainer ); |
|
606 |
} |
|
607 |
||
608 |
/* Increase the ordinal position of background container |
|
609 |
* So that other control will be drawn first. |
|
610 |
*/ |
|
611 |
UpdateBackgroundOrdinalPosition( ETrue ); |
|
612 |
||
613 |
TRect videoRect( ClientRect().iTl.iX, |
|
614 |
ClientRect().iTl.iY, |
|
615 |
ClientRect().iBr.iX, |
|
616 |
ClientRect().iBr.iY - ToolbarPlaceHolderHeight() |
|
617 |
- iContainer->Size().iHeight ); |
|
618 |
||
619 |
if (!AknLayoutUtils::PenEnabled()) |
|
620 |
{ |
|
621 |
TInt dy = iContainer->Size().iHeight; |
|
622 |
videoRect.Move(0, dy); |
|
623 |
} |
|
624 |
if ( !iController ) |
|
625 |
{ |
|
626 |
MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingView::DoActivateL: !iController" ); |
|
627 |
iController = CMusUiClipSharingController::NewL( *MusAppUi(), |
|
628 |
*this, |
|
629 |
*this, |
|
630 |
*this, |
|
631 |
videoRect ); |
|
632 |
} |
|
38
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
633 |
iBackgroundContainer->SetUiEventController( EventController() ); |
33 | 634 |
|
635 |
iContainer->SetController( iController ); |
|
636 |
||
637 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DoActivateL" ); |
|
638 |
} |
|
639 |
||
640 |
||
641 |
// ----------------------------------------------------------------------------- |
|
642 |
// From AknView, Gets called from framework when deactivating this view |
|
643 |
// ----------------------------------------------------------------------------- |
|
644 |
// |
|
645 |
void CMusUiClipSharingView::DoDeactivate() |
|
646 |
{ |
|
647 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DoDeactivate" ); |
|
648 |
||
649 |
CMusUiSendView::DoDeactivate(); // Base class deactivation first |
|
650 |
||
651 |
if ( iContainer ) |
|
652 |
{ |
|
653 |
AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
654 |
delete iContainer; |
|
655 |
iContainer = NULL; |
|
656 |
} |
|
657 |
||
658 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DoDeactivate" ); |
|
659 |
} |
|
660 |
||
661 |
// ----------------------------------------------------------------------------- |
|
662 |
// When Mmc is removed, dimmed the pause icon on toolbar |
|
663 |
// ----------------------------------------------------------------------------- |
|
664 |
// |
|
665 |
void CMusUiClipSharingView::InvalidVideoFrame( TBool aInvalid ) |
|
666 |
{ |
|
667 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::InvalidVideoFrame" ); |
|
668 |
Toolbar()->SetItemDimmed( iPauseSelected ? |
|
669 |
EMusuiCmdToolbarUnPause : |
|
670 |
EMusuiCmdToolbarPause, |
|
671 |
aInvalid ? |
|
672 |
ETrue : |
|
673 |
EFalse, |
|
674 |
ETrue ); |
|
675 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::InvalidVideoFrame" ); |
|
676 |
} |
|
677 |
||
678 |
// end of file |