wow
This commit is contained in:
parent
97f57edcab
commit
dc7982e71c
7
main.c
7
main.c
|
@ -109,6 +109,7 @@ struct MsgPort *timerPort;
|
||||||
|
|
||||||
APTR bellSound = NULL;
|
APTR bellSound = NULL;
|
||||||
struct Library *DataTypesBase;
|
struct Library *DataTypesBase;
|
||||||
|
BYTE waitForSoundSignalNumber;
|
||||||
|
|
||||||
// our business logic
|
// our business logic
|
||||||
// for how long should I cook this pizza?
|
// for how long should I cook this pizza?
|
||||||
|
@ -182,6 +183,8 @@ int setup(void) {
|
||||||
if (NULL == (DataTypesBase = OpenLibrary("datatypes.library", 40))) {
|
if (NULL == (DataTypesBase = OpenLibrary("datatypes.library", 40))) {
|
||||||
// this is ok, we just won't play sound
|
// this is ok, we just won't play sound
|
||||||
printf("no sound!");
|
printf("no sound!");
|
||||||
|
} else {
|
||||||
|
waitForSoundSignalNumber = AllocSignal(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -194,6 +197,7 @@ void teardown(void) {
|
||||||
// http://amigadev.elowar.com/read/ADCD_2.1/Devices_Manual_guide/node0196.html
|
// http://amigadev.elowar.com/read/ADCD_2.1/Devices_Manual_guide/node0196.html
|
||||||
if (DataTypesBase) {
|
if (DataTypesBase) {
|
||||||
CloseLibrary(DataTypesBase);
|
CloseLibrary(DataTypesBase);
|
||||||
|
FreeSignal(waitForSoundSignalNumber);
|
||||||
}
|
}
|
||||||
if (TimerIO) {
|
if (TimerIO) {
|
||||||
CloseDevice((struct IORequest *)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.
|
* Start playing a bell sound, then wait for it to finish.
|
||||||
|
@ -717,8 +720,8 @@ void startBellSound(void) {
|
||||||
struct dtTrigger myTrigger;
|
struct dtTrigger myTrigger;
|
||||||
ULONG soundPlayResult;
|
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
|
// 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(
|
if (bellSound = NewDTObject(
|
||||||
BELL_FILENAME,
|
BELL_FILENAME,
|
||||||
|
|
Loading…
Reference in New Issue