?? alarm.cpp.txt
字號:
// Alarm.cpp: implementation of the CAlarm class.
//
//////////////////////////////////////////////////////////////////////
#include "MdaAudioSamplePlayer.h"
#include "Alarm.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
_LIT(KSoundSampleFile, "C:\\System\\Apps\\Sound\\play.wav");
CAlarm::CAlarm( )
{
}
CAlarm::~CAlarm()
{
delete iMdaAudioPlayerUtility;
iMdaAudioPlayerUtility = NULL;
}
void CAlarm::UpdateClock(TTime aTime)
{
TDateTime dt1 = iAlarmTime.DateTime();
TDateTime dt2 = aTime.DateTime();
if(dt1.Hour() == dt2.Hour() &&
dt1.Minute() == dt2.Minute() && dt2.Second() == 0)
DoAlarm();
}
CAlarm * CAlarm::NewLC()
{
CAlarm *self = new (ELeave) CAlarm();
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CAlarm * CAlarm::NewL()
{
CAlarm *self = CAlarm::NewLC();
CleanupStack::Pop();
return self;
}
void CAlarm::ConstructL()
{
iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewFilePlayerL(KSoundSampleFile, *this);
}
void CAlarm::DoAlarm()
{
iMdaAudioPlayerUtility->Play();
}
void CAlarm::SetAlarmTime(TTime aTime)
{
iAlarmTime = aTime;
}
void CAlarm::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
{
iState = aError ? ENotReady : EReadyToPlay;
}
void CAlarm::MapcPlayComplete(TInt aError)
{
iState = aError ? ENotReady : EReadyToPlay;
}
// Alarm.cpp: implementation of the CAlarm class.
//
//////////////////////////////////////////////////////////////////////
#include "MdaAudioSamplePlayer.h"
#include "Alarm.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
_LIT(KSoundSampleFile, "C:\\System\\Apps\\Sound\\play.wav");
CAlarm::CAlarm( )
{
}
CAlarm::~CAlarm()
{
delete iMdaAudioPlayerUtility;
iMdaAudioPlayerUtility = NULL;
}
void CAlarm::UpdateClock(TTime aTime)
{
TDateTime dt1 = iAlarmTime.DateTime();
TDateTime dt2 = aTime.DateTime();
if(dt1.Hour() == dt2.Hour() &&
dt1.Minute() == dt2.Minute() && dt2.Second() == 0)
DoAlarm();
}
CAlarm * CAlarm::NewLC()
{
CAlarm *self = new (ELeave) CAlarm();
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CAlarm * CAlarm::NewL()
{
CAlarm *self = CAlarm::NewLC();
CleanupStack::Pop();
return self;
}
void CAlarm::ConstructL()
{
iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewFilePlayerL(KSoundSampleFile, *this);
}
void CAlarm::DoAlarm()
{
iMdaAudioPlayerUtility->Play();
}
void CAlarm::SetAlarmTime(TTime aTime)
{
iAlarmTime = aTime;
}
void CAlarm::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
{
iState = aError ? ENotReady : EReadyToPlay;
}
void CAlarm::MapcPlayComplete(TInt aError)
{
iState = aError ? ENotReady : EReadyToPlay;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -