Assorted spelling fixes.
[wine] / dlls / winecoreaudio.drv / coreaudio.c
1 /*
2  * Wine Driver for CoreAudio
3  *
4  * Copyright 2005 Emmanuel Maillard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21
22 #include "config.h"
23
24 #include <stdarg.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "mmddk.h"
31 #include "coreaudio.h"
32 #include "wine/library.h"
33 #include "wine/debug.h"
34
35 WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
36
37 #ifdef HAVE_COREAUDIO_COREAUDIO_H
38
39 /**************************************************************************
40  *                              CoreAudio_drvLoad       [internal]      
41  */
42 static LRESULT CoreAudio_drvLoad(void)
43 {
44     TRACE("()\n");
45     CoreAudio_WaveInit();
46     CoreAudio_MIDIInit();
47     CoreAudio_MixerInit();
48     return 1;
49 }
50
51 /**************************************************************************
52  *                              CoreAudio_drvFree       [internal]      
53  */
54 static LRESULT CoreAudio_drvFree(void)
55 {
56     TRACE("()\n");
57     CoreAudio_WaveRelease();
58     CoreAudio_MIDIRelease();
59     CoreAudio_MixerRelease();
60     return 1;
61 }
62
63 /**************************************************************************
64  *                              CoreAudio_drvOpen       [internal]
65  */
66 static LRESULT CoreAudio_drvOpen(LPSTR str)
67 {
68     TRACE("(%s)\n", str);
69     return 1;
70 }
71
72 /**************************************************************************
73  *                              CoreAudio_drvClose      [internal]
74  */
75 static DWORD CoreAudio_drvClose(DWORD dwDevID)
76 {
77     TRACE("(%08x)\n", dwDevID);
78     return 1;
79 }
80 #endif /* HAVE_COREAUDIO_COREAUDIO_H */
81
82 /**************************************************************************
83  *                              DriverProc (WINECOREAUDIO.1)
84  */
85 LRESULT CALLBACK CoreAudio_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, 
86                                  LPARAM dwParam1, LPARAM dwParam2)
87 {
88      TRACE("(%08lX, %p, %s (%08X), %08lX, %08lX)\n",
89            dwDevID, hDriv, wMsg == DRV_LOAD ? "DRV_LOAD" :
90            wMsg == DRV_FREE ? "DRV_FREE" :
91            wMsg == DRV_OPEN ? "DRV_OPEN" :
92            wMsg == DRV_CLOSE ? "DRV_CLOSE" :
93            wMsg == DRV_ENABLE ? "DRV_ENABLE" :
94            wMsg == DRV_DISABLE ? "DRV_DISABLE" :
95            wMsg == DRV_QUERYCONFIGURE ? "DRV_QUERYCONFIGURE" :
96            wMsg == DRV_CONFIGURE ? "DRV_CONFIGURE" :
97            wMsg == DRV_INSTALL ? "DRV_INSTALL" :
98            wMsg == DRV_REMOVE ? "DRV_REMOVE" : "UNKNOWN", 
99            wMsg, dwParam1, dwParam2);
100     
101     switch(wMsg) {
102 #ifdef HAVE_COREAUDIO_COREAUDIO_H
103     case DRV_LOAD:              return CoreAudio_drvLoad();
104     case DRV_FREE:              return CoreAudio_drvFree();
105     case DRV_OPEN:              return CoreAudio_drvOpen((LPSTR)dwParam1);
106     case DRV_CLOSE:             return CoreAudio_drvClose(dwDevID);
107     case DRV_ENABLE:            return 1;
108     case DRV_DISABLE:           return 1;
109     case DRV_QUERYCONFIGURE:    return 1;
110     case DRV_CONFIGURE:         MessageBoxA(0, "CoreAudio driver!", "CoreAudio driver", MB_OK); return 1;
111     case DRV_INSTALL:           return DRVCNF_RESTART;
112     case DRV_REMOVE:            return DRVCNF_RESTART;
113 #endif
114     default:
115         return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
116     }
117 }