Unicodify wineesd.
[wine] / dlls / winmm / wineesd / esound.c
1 /*
2  * Wine Driver for EsounD Sound Server
3  * http://www.tux.org/~ricdude/EsounD.html
4  *
5  * Copyright 2004 Zhangrong Huang <hzhr@users.sourceforge.net>
6  *
7  * Code massively copied from Eric Pouech's OSS driver
8  * and Chris Morgan aRts driver
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24
25 #include "config.h"
26
27 #include <stdarg.h>
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
33 #include "mmddk.h"
34 #include "esound.h"
35
36 #ifdef HAVE_ESD
37 static          int esd = 0;
38
39 /**************************************************************************
40  *                              ESD_drvOpen                     [internal]
41  */
42 static  DWORD   ESD_drvOpen(LPSTR str)
43 {
44     if (esd)
45         return 0;
46
47     /* I know, this is ugly, but who cares... */
48     esd = 1;
49     return 1;
50 }
51
52 /**************************************************************************
53  *                              ESD_drvClose                    [internal]
54  */
55 static  DWORD   ESD_drvClose(DWORD dwDevID)
56 {
57     if (esd) {
58         esd = 0;
59         return 1;
60     }
61     return 0;
62 }
63 #endif /* #ifdef HAVE_ESD */
64
65
66 /**************************************************************************
67  *                              DriverProc (WINEESD.@)
68  */
69 LONG CALLBACK   ESD_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_ESD
77     case DRV_LOAD:              if (ESD_WaveInit()<0) return 0;
78                                 return 1;
79     case DRV_FREE:              return ESD_WaveClose();
80     case DRV_OPEN:              return ESD_drvOpen((LPSTR)dwParam1);
81     case DRV_CLOSE:             return ESD_drvClose(dwDevID);
82     case DRV_ENABLE:            return 1;
83     case DRV_DISABLE:           return 1;
84     case DRV_QUERYCONFIGURE:    return 1;
85     case DRV_CONFIGURE:         MessageBoxA(0, "EsounD MultiMedia Driver!", "EsounD Driver", MB_OK);    return 1;
86     case DRV_INSTALL:           return DRVCNF_RESTART;
87     case DRV_REMOVE:            return DRVCNF_RESTART;
88 #endif
89     default:
90         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
91     }
92 }