alarmui/src/alarmutils.cpp
changeset 23 fd30d51f876b
parent 18 c198609911f9
child 32 ea672fcb0ea0
equal deleted inserted replaced
18:c198609911f9 23:fd30d51f876b
   275 void CAlarmUtils::PlayAlarmSound()
   275 void CAlarmUtils::PlayAlarmSound()
   276     {
   276     {
   277     TRACE_ENTRY_POINT;
   277     TRACE_ENTRY_POINT;
   278     StopAlarmSound();
   278     StopAlarmSound();
   279     PIM_TRAPD_ASSERT( iAlarmPlayer = CAlmAlarmPlayer::NewL( this ); )
   279     PIM_TRAPD_ASSERT( iAlarmPlayer = CAlmAlarmPlayer::NewL( this ); )
   280     SetBackLight( ETrue );
   280     //SetBackLight( ETrue );
   281     TRACE_EXIT_POINT;
   281     TRACE_EXIT_POINT;
   282     }
   282     }
   283 
   283 
   284 // ---------------------------------------------------------
   284 // ---------------------------------------------------------
   285 // Stop the alarm player.
   285 // Stop the alarm player.
   291     #if defined( RD_ALMALERT__SENSOR_SUPPORT )
   291     #if defined( RD_ALMALERT__SENSOR_SUPPORT )
   292     // notify the result through the context framework
   292     // notify the result through the context framework
   293     // only set the context if the player was really active
   293     // only set the context if the player was really active
   294     if( iAlarmPlayer && iCFSupport )
   294     if( iAlarmPlayer && iCFSupport )
   295         {
   295         {
   296         // PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmSilenced ); )
   296         PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmSilenced ); )
   297         }
   297         }
   298     #endif // RD_ALMALERT__SENSOR_SUPPORT
   298     #endif // RD_ALMALERT__SENSOR_SUPPORT
   299     delete iAlarmPlayer;
   299     delete iAlarmPlayer;
   300     iAlarmPlayer = NULL;
   300     iAlarmPlayer = NULL;
   301     SetBackLight( EFalse );
   301     //SetBackLight( EFalse );
   302     TRACE_EXIT_POINT;
   302     TRACE_EXIT_POINT;
   303     }
   303     }
   304 
   304 
   305 // ---------------------------------------------------------
   305 // ---------------------------------------------------------
   306 // Backlight on/off
   306 // Backlight on/off
   538     	TInt ringingVolume;
   538     	TInt ringingVolume;
   539     	repository->Get( KProEngActiveRingingVolume , ringingVolume);
   539     	repository->Get( KProEngActiveRingingVolume , ringingVolume);
   540     	iAlarmData.iVolume = ringingVolume;
   540     	iAlarmData.iVolume = ringingVolume;
   541     	
   541     	
   542     	iAlarmData.iVolumeRampTime = 0;
   542     	iAlarmData.iVolumeRampTime = 0;
       
   543     } else {
       
   544     	TInt volumeOn = iAlarmData.iAlarm.ClientData2();
       
   545     	if (!volumeOn) {
       
   546     		iAlarmData.iRingType = EProfileRingingTypeSilent;
       
   547     		iAlarmData.iVolume = 0;
       
   548     	}
   543     }
   549     }
   544     TRACE_EXIT_POINT;
   550     TRACE_EXIT_POINT;
   545     }
   551     }
   546 
   552 
   547 // -----------------------------------------------------------------------------
   553 // -----------------------------------------------------------------------------
   851     // notify the result through the context framework
   857     // notify the result through the context framework
   852     if( iCFSupport )
   858     if( iCFSupport )
   853         {
   859         {
   854 	     if(!iAlarmControl->IsStopFromContext() && IsCalendarAlarm())
   860 	     if(!iAlarmControl->IsStopFromContext() && IsCalendarAlarm())
   855 	     	{
   861 	     	{
   856 	     	// PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmStoppedAndExit );)
   862 	     	PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmStoppedAndExit );)
   857             // iAlarmControl->SetStopFromContext(EFalse);
   863             iAlarmControl->SetStopFromContext(EFalse);
   858 	     	}
   864 	     	}
   859 	     else
   865 	     else
   860 	     	{
   866 	     	{
   861 	     	// PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmStopped );)
   867 	     	PIM_TRAPD_ASSERT( iCFSupport->PublishAlarmResultL( EResultAlarmStopped );)
   862 	     	// iAlarmControl->SetStopFromContext(EFalse);
   868 	     	iAlarmControl->SetStopFromContext(EFalse);
   863 	     	}
   869 	     	}
   864         }
   870         }
   865     #endif // RD_ALMALERT__SENSOR_SUPPORT
   871     #endif // RD_ALMALERT__SENSOR_SUPPORT
   866     TRACE_EXIT_POINT;
   872     TRACE_EXIT_POINT;
   867     }
   873     }