1
0
Fork 0
This commit is contained in:
John Bintz 2022-11-05 10:52:01 -04:00
parent 97f57edcab
commit dc7982e71c
2 changed files with 5 additions and 2 deletions

BIN
main

Binary file not shown.

7
main.c
View File

@ -109,6 +109,7 @@ struct MsgPort *timerPort;
APTR bellSound = NULL;
struct Library *DataTypesBase;
BYTE waitForSoundSignalNumber;
// our business logic
// for how long should I cook this pizza?
@ -182,6 +183,8 @@ int setup(void) {
if (NULL == (DataTypesBase = OpenLibrary("datatypes.library", 40))) {
// this is ok, we just won't play sound
printf("no sound!");
} else {
waitForSoundSignalNumber = AllocSignal(-1);
}
return 1;
@ -194,6 +197,7 @@ void teardown(void) {
// http://amigadev.elowar.com/read/ADCD_2.1/Devices_Manual_guide/node0196.html
if (DataTypesBase) {
CloseLibrary(DataTypesBase);
FreeSignal(waitForSoundSignalNumber);
}
if (TimerIO) {
CloseDevice((struct IORequest *)TimerIO);
@ -708,7 +712,6 @@ void handleIntuitionMessage(struct IntuiMessage *iMessage) {
}
}
BYTE waitForSoundSignalNumber;
/**
* Start playing a bell sound, then wait for it to finish.
@ -717,8 +720,8 @@ void startBellSound(void) {
struct dtTrigger myTrigger;
ULONG soundPlayResult;
if (!DataTypesBase) return;
// https://amigaworld.net/modules/newbb/viewtopic.php?forum=15&topic_id=39094&post_id=735120&viewmode=thread&order=0#735120
waitForSoundSignalNumber = AllocSignal(-1);
if (bellSound = NewDTObject(
BELL_FILENAME,