⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alarm.cpp__.htm

📁 symbian clock 源代码..........
💻 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> &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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -