Finally, I have found the cause of the problem. I believe so :)
Don't know why the sample _Ringtone uses 'Word' to delcare the volume
variable for TonesLibPlayTone.
See below,
Word volume = toneVolume3
TonesLibPlayTone (TonesLibRefNum, toneId, 1 /*playCount*/, volume,
toneVibrateNone, true /*blocking*/);
However, it should be 'ToneVolume' according to SDK Document.
ToneVolume volume = toneVolume3
Now, my program seems much more stable and no reset problem.
Raymond
Raymond Lo wrote:
My applicatoin followed the _Ringtone sample in SDK, playing a ringtone
in UI (by making a Play button) is definitely OK.
However, I got unexpected reset (sometime is OK, 70%) when using
TonesLibPlayTone in AlarmTrigger. I have no global variable in the
AlarmTrigger function.
Is there anything I should take care for using TonesLibPlayTone in
AlarmTrigger?
Regis St-Gelais wrote:
"Raymond Lo" <[email protected]> a écrit dans le message de news:
187...@palm-dev-forum...
Actually, I have followed _Ringtone example to develop my application
but I got unexpected reset problem when playing a ringtone in an alarm.
void AlarmTriggered (SysAlarmTriggeredParamType * cmdPBP)
..
err = SysLibFind (tonesLibName, &TonesLibRefNum);
err = SysLibLoad (tonesLibType, tonesLibCreator, &TonesLibRefNum);
..
err = TonesLibGetToneList (TonesLibRefNum, &ToneList, &numRings);
..
EvtResetAutoOffTimer();
..
CopyToneIdentifier ((&toneId),
ToneListRingtoneSequence_Call.identifier);
TonesLibPlayTone (TonesLibRefNum, toneId, 1, volume, toneVibrateNone,
true);
..
Any idea?
Raymond
Don't forget that you don't have access to the global variables during a
sysAppLaunchCmdAlarmTriggered or a sysAppLaunchCmdDisplayAlarm
launch code.
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/