2 Copyright 2010, The AROS Development Team. All rights reserved.
9 * by Nexus Development 2003
10 * coded by Emanuele Cesaroni
15 #include "audio_intern.h"
16 #include <proto/dos.h>
22 * Initializes the slave process. Return 1 for successfull, 0 if fails.
26 STRPTR PROCESS_NAME
= "audio.device slave";
28 BOOL
InitSLAVE(struct IOAudio
*ioaudio
)
32 struct TagItem NPTags
[] =
34 { NP_Entry
, (IPTR
) & TaskBody
},
35 { NP_Name
, (IPTR
) PROCESS_NAME
},
37 { NP_StackSize
, PROCESS_STACK
},
40 ematsys
= &ematsys0
; // Here is inited the pointer.
41 ematsys
->ts_slavetask
= NULL
;
42 ematsys
->ts_initio
= ioaudio
; // This is the audioio used to wait the init signal from the slave process.
43 ematsys
->ts_opentask
= FindTask(NULL
);
44 oldsignals
= SetSignal(0, STOLEN_SIG
);
46 if ((ematsys
->ts_slavetask
= (struct Task
*) CreateNewProc(NPTags
)))
49 if (ioaudio
->ioa_Request
.io_Error
== IONOERROR
)
51 SetSignal(oldsignals
, STOLEN_SIG
);
55 ematsys
->ts_slavetask
= NULL
;
57 SetSignal(oldsignals
, STOLEN_SIG
);
66 * Frees the slave process.
69 VOID
FreeSLAVE(struct IOAudio
*ioaudio
)
71 if (ematsys
->ts_slavetask
)
73 audio_CLOSE(ioaudio
, global_eta
);
77 WORD
GetMultiple(WORD d0
, WORD d1
)
100 * Initialize some needed things for the system.
106 emasys
= &emasys0
; // Here initilized the pointer.
116 * Simply frees all the ESYS resources.