- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / workbench / devs / AHI / Drivers / Void / void-init.c
blobcbffd7d33a02f93998c5a2225e0bc865aa88e410
2 #include <config.h>
4 #include "library.h"
5 #include "DriverData.h"
7 /******************************************************************************
8 ** Custom driver init *********************************************************
9 ******************************************************************************/
11 BOOL
12 DriverInit( struct DriverBase* AHIsubBase )
14 struct VoidBase* VoidBase = (struct VoidBase*) AHIsubBase;
16 VoidBase->dosbase = OpenLibrary( DOSNAME, 37 );
18 if( VoidBase->dosbase == NULL )
20 Req( "Unable to open 'dos.library' version 37.\n" );
21 return FALSE;
24 #ifdef __AMIGAOS4__
25 if ((IDOS = (struct DOSIFace *) GetInterface((struct Library *) DOSBase, "main", 1, NULL)) == NULL)
27 Req("Couldn't open IDOS interface!\n");
28 return FALSE;
30 #endif
32 // Fail if no hardware is present (this check prevents the audio
33 // modes from being added to the database if the driver cannot be
34 // used).
37 if( unable_to_find_hardware )
39 Req( "No sound card present.\n" );
40 return FALSE;
43 return TRUE;
47 /******************************************************************************
48 ** Custom driver clean-up *****************************************************
49 ******************************************************************************/
51 VOID
52 DriverCleanup( struct DriverBase* AHIsubBase )
54 struct VoidBase* VoidBase = (struct VoidBase*) AHIsubBase;
56 #ifdef __AMIGAOS4__
57 DropInterface( (struct Interface *) IDOS);
58 #endif
60 CloseLibrary( (struct Library*) DOSBase );