The NAS headers and libraries are sometimes stored in the X
[wine] / dlls / winmm / winenas / nas.c
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2 /*
3  *
4  * Wine Driver for NAS Network Audio System
5  *   http://radscan.com/nas.html
6  *
7  * Copyright 2002 Nicolas Escuder <n.escuder@alineanet.com>
8  *
9  * Code massively copied from Eric Pouech's OSS driver
10  * and Chris Morgan aRts driver
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25  */
26
27 #include "config.h"
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
33 #include "mmddk.h"
34 #include "nas.h"
35
36 #ifdef HAVE_NAS
37 static          int nas = 0;
38
39 /**************************************************************************
40  *                              NAS_drvOpen                     [internal]
41  */
42 static  DWORD   NAS_drvOpen(LPSTR str)
43 {
44     if (nas)
45         return 0;
46
47     /* I know, this is ugly, but who cares... */
48     nas = 1;
49     return 1;
50 }
51
52 /**************************************************************************
53  *                              NAS_drvClose                    [internal]
54  */
55 static  DWORD   NAS_drvClose(DWORD dwDevID)
56 {
57     if (nas) {
58         nas = 0;
59         return 1;
60     }
61     return 0;
62 }
63 #endif /* #ifdef HAVE_NAS */
64
65
66 /**************************************************************************
67  *                              DriverProc (WINENAS.@)
68  */
69 LONG CALLBACK   NAS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
70                                DWORD dwParam1, DWORD dwParam2)
71 {
72 /* EPP     TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n",  */
73 /* EPP    dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
74
75     switch(wMsg) {
76 #ifdef HAVE_NAS
77     case DRV_LOAD:              NAS_WaveInit();
78 /*                              NAS_MidiInit(); FIXME: no midi */
79                                 return 1;
80     case DRV_FREE:              return NAS_WaveClose();
81     case DRV_OPEN:              return NAS_drvOpen((LPSTR)dwParam1);
82     case DRV_CLOSE:             return NAS_drvClose(dwDevID);
83     case DRV_ENABLE:            return 1;
84     case DRV_DISABLE:           return 1;
85     case DRV_QUERYCONFIGURE:    return 1;
86     case DRV_CONFIGURE:         MessageBoxA(0, "NAS MultiMedia Driver !", "NAS Driver", MB_OK); return 1;
87     case DRV_INSTALL:           return DRVCNF_RESTART;
88     case DRV_REMOVE:            return DRVCNF_RESTART;
89 #endif
90     default:
91         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
92     }
93 }