1 /* |
1 /* |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 * Description: Implementation of CSAnimStartupCtrl class |
14 * Description: Implementation of CSAnimStartupCtrl class |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <aknappui.h> |
19 |
20 #include <aknsoundsystem.h> |
20 #include <eikappui.h> |
|
21 |
21 #include <centralrepository.h> |
22 #include <centralrepository.h> |
22 #include <featmgr.h> |
23 #include <featmgr.h> |
23 #include <MediatorDomainUIDs.h> |
24 #include <MediatorDomainUIDs.h> |
24 #include <Profile.hrh> |
25 #include <Profile.hrh> |
25 #include <ProfileEngineSDKCRKeys.h> |
26 #include <ProfileEngineSDKCRKeys.h> |
26 #include "sanimengine.h" |
27 #include "sanimengine.h" |
27 #include <secondarydisplay/SecondaryDisplayStartupAPI.h> |
28 #include <SecondaryDisplay/SecondaryDisplayStartupAPI.h> |
28 |
29 |
29 #include "sanimstartupctrl.h" |
30 #include "sanimstartupctrl.h" |
30 #include "trace.h" |
31 #include "trace.h" |
31 |
32 |
32 const TInt KMinVolume( 0 ); /** Minimum allowed volume level. */ |
33 const TInt KMinVolume( 0 ); /** Minimum allowed volume level. */ |
33 const TInt KMaxVolume( 10000 ); /** Maximum allowed volume level. */ |
34 const TInt KMaxVolume( 10000 ); /** Maximum allowed volume level. */ |
34 |
35 |
35 const TInt KDefaultRepeatCount( 1 ); /** Default repeat count for animation and tone. */ |
36 const TInt KDefaultRepeatCount( 1 ); /** Default repeat count for animation and tone. */ |
36 const TInt KDefaultVolumeRamp( 0 ); /** Default volume ramp value in microseconds. */ |
37 const TInt KDefaultVolumeRamp( 0 ); /** Default volume ramp value in microseconds. */ |
37 |
38 |
38 static const TInt KMediatorTimeout( 1000000 ); /** Default timeout for Mediator commands. */ |
39 //static const TInt KMediatorTimeout( 1000000 ); /** Default timeout for Mediator commands. */ |
39 |
40 |
40 // ======== LOCAL FUNCTIONS ======== |
41 // ======== LOCAL FUNCTIONS ======== |
41 |
42 |
42 // --------------------------------------------------------------------------- |
43 // --------------------------------------------------------------------------- |
43 // FileExists |
44 // FileExists |
195 User::RequestComplete( status, KErrNone ); |
196 User::RequestComplete( status, KErrNone ); |
196 } |
197 } |
197 else if ( iCommandInitiator ) |
198 else if ( iCommandInitiator ) |
198 { |
199 { |
199 INFO_1( "Secondary display data: %d", iSyncCommand ); |
200 INFO_1( "Secondary display data: %d", iSyncCommand ); |
200 |
201 |
201 iClientStatus = &aStatus; |
202 iClientStatus = &aStatus; |
202 iWaitingForSyncResponse = ETrue; |
203 iWaitingForSyncResponse = ETrue; |
203 TInt errorCode = iCommandInitiator->IssueCommand( |
204 TInt errorCode = iCommandInitiator->IssueCommand( |
204 KMediatorSecondaryDisplayDomain, |
205 KMediatorSecondaryDisplayDomain, |
205 SecondaryDisplay::KCatStartup, |
206 SecondaryDisplay::KCatStartup, |
312 aCommandId == SecondaryDisplay::ECmdStartupSync && |
313 aCommandId == SecondaryDisplay::ECmdStartupSync && |
313 iWaitingForSyncResponse ) |
314 iWaitingForSyncResponse ) |
314 { |
315 { |
315 iWaitingForSyncResponse = EFalse; |
316 iWaitingForSyncResponse = EFalse; |
316 StartAnimation(); |
317 StartAnimation(); |
317 } |
318 } |
318 } |
319 } |
319 |
320 |
320 |
321 |
321 // --------------------------------------------------------------------------- |
322 // --------------------------------------------------------------------------- |
322 // CSAnimStartupCtrl::CSAnimStartupCtrl |
323 // CSAnimStartupCtrl::CSAnimStartupCtrl |
347 FeatureManager::InitializeLibL(); |
348 FeatureManager::InitializeLibL(); |
348 TBool secondaryDisplaySupported = |
349 TBool secondaryDisplaySupported = |
349 FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); |
350 FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); |
350 FeatureManager::UnInitializeLib(); |
351 FeatureManager::UnInitializeLib(); |
351 |
352 |
352 if ( secondaryDisplaySupported ) |
353 |
353 { |
|
354 iCommandInitiator = CMediatorCommandInitiator::NewL( this ); |
|
355 iCommandResponder = CMediatorCommandResponder::NewL( this ); |
|
356 |
|
357 TInt errorCode = iCommandResponder->RegisterCommand( |
|
358 KMediatorSecondaryDisplayDomain, |
|
359 SecondaryDisplay::KCatStartup, |
|
360 SecondaryDisplay::ECmdStartupPhaseSkip, |
|
361 TVersion( 0, 0, 0 ), |
|
362 ECapabilitySwEvent, |
|
363 KMediatorTimeout ); |
|
364 ERROR( errorCode, "Failed to register command ECmdStartupPhaseSkip with mediator" ); |
|
365 User::LeaveIfError( errorCode ); |
|
366 } |
|
367 |
354 |
368 CSAnimCtrl::BaseConstructL( aRect, aContainer ); |
355 CSAnimCtrl::BaseConstructL( aRect, aContainer ); |
369 } |
356 } |
370 |
357 |
371 |
358 |
502 iBackgroundColour = iEngine->BackroundColour(); |
489 iBackgroundColour = iEngine->BackroundColour(); |
503 |
490 |
504 if ( iPlayDefaultBeep ) |
491 if ( iPlayDefaultBeep ) |
505 { |
492 { |
506 INFO( "Default startup beep requested" ); |
493 INFO( "Default startup beep requested" ); |
507 |
494 /* |
508 CAknAppUi* appUi = static_cast<CAknAppUi*>( iEikonEnv->EikAppUi() ); |
495 CAknAppUi* appUi = static_cast<CAknAppUi*>( iEikonEnv->EikAppUi() ); |
509 if ( appUi ) |
496 if ( appUi ) |
510 { |
497 { |
511 INFO( "Playing default startup beep" ); |
498 INFO( "Playing default startup beep" ); |
512 |
499 |
513 appUi->KeySounds()->PlaySound( EAvkonSIDPowerOnTone ); |
500 appUi->KeySounds()->PlaySound( EAvkonSIDPowerOnTone ); |
514 } |
501 } |
|
502 */ |
515 } |
503 } |
516 |
504 |
517 iEngine->Start( *iClientStatus ); |
505 iEngine->Start( *iClientStatus ); |
518 iClientStatus = NULL; |
506 iClientStatus = NULL; |
519 } |
507 } |