alarm.cpp__.htm

来自「symbian clock 源代码..........」· HTM 代码 · 共 86 行

HTM
86
字号
<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> &gt; <a href="http://www.pudn.com/downloads91/sourcecode/comm/symbian/detail348522.html">Exercise_GUIClock.rar</a> &gt 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 + =
减小字号Ctrl + -
显示快捷键?