?? alarm.cpp__.htm
字號:
<html><head><title>Exercise_GUIClock.rar Alarm.cpp</title>
<LINK href="/inc/read_style.css" type=text/css rel=stylesheet></head>
<body>
<p><a href=http://www.pudn.com>www.pudn.com</a> > <a href="http://www.pudn.com/downloads91/sourcecode/comm/symbian/detail348522.html">Exercise_GUIClock.rar</a> > Alarm.cpp</p><!-- saved from http://www.pudn.com -->
<script src="/inc/gg_read1.js"></script><BR>
<pre name="code" class="cpp">
// 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;
}
</pre>
<script src="/inc/gg_read2.js"></script><BR>
<script src="http://s117.cnzz.com/stat.php?id=1236358&web_id=1236358&show=pic" language="JavaScript" charset="gb2312"></script>
</body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -