Split the dmusic interfaces.
[wine] / dlls / dmscript / script.c
1 /* IDirectMusicScript
2  *
3  * Copyright (C) 2003 Rok Mandeljc
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #include "windef.h"
21 #include "winbase.h"
22 #include "winuser.h"
23 #include "wingdi.h"
24 #include "wine/debug.h"
25
26 #include "dmscript_private.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
29
30 /* IDirectMusicScript IUnknown parts follow: */
31 HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj)
32 {
33         ICOM_THIS(IDirectMusicScriptImpl,iface);
34
35         if (IsEqualGUID(riid, &IID_IUnknown) || 
36             IsEqualGUID(riid, &IID_IDirectMusicScript))
37         {
38                 IDirectMusicScriptImpl_AddRef(iface);
39                 *ppobj = This;
40                 return S_OK;
41         }
42         WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
43         return E_NOINTERFACE;
44 }
45
46 ULONG WINAPI IDirectMusicScriptImpl_AddRef (LPDIRECTMUSICSCRIPT iface)
47 {
48         ICOM_THIS(IDirectMusicScriptImpl,iface);
49         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
50         return ++(This->ref);
51 }
52
53 ULONG WINAPI IDirectMusicScriptImpl_Release (LPDIRECTMUSICSCRIPT iface)
54 {
55         ICOM_THIS(IDirectMusicScriptImpl,iface);
56         ULONG ref = --This->ref;
57         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
58         if (ref == 0)
59         {
60                 HeapFree(GetProcessHeap(), 0, This);
61         }
62         return ref;
63 }
64
65 /* IDirectMusicScript Interface follow: */
66 HRESULT WINAPI IDirectMusicScriptImpl_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
67 {
68         ICOM_THIS(IDirectMusicScriptImpl,iface);
69
70         FIXME("(%p, %p, %p): stub\n", This, pPerformance, pErrorInfo);
71
72         return S_OK;
73 }
74
75 HRESULT WINAPI IDirectMusicScriptImpl_CallRoutine (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszRoutineName, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
76 {
77         ICOM_THIS(IDirectMusicScriptImpl,iface);
78
79         FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo);
80
81         return S_OK;
82 }
83
84 HRESULT WINAPI IDirectMusicScriptImpl_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
85 {
86         ICOM_THIS(IDirectMusicScriptImpl,iface);
87
88         FIXME("(%p, %p, FIXME, %d, %p): stub\n", This, pwszVariableName,/* varValue,*/ fSetRef, pErrorInfo);
89
90         return S_OK;
91 }
92
93 HRESULT WINAPI IDirectMusicScriptImpl_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
94 {
95         ICOM_THIS(IDirectMusicScriptImpl,iface);
96
97         FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, pvarValue, pErrorInfo);
98
99         return S_OK;
100 }
101
102 HRESULT WINAPI IDirectMusicScriptImpl_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
103 {
104         ICOM_THIS(IDirectMusicScriptImpl,iface);
105
106         FIXME("(%p, %p, %li, %p): stub\n", This, pwszVariableName, lValue, pErrorInfo);
107
108         return S_OK;
109 }
110
111 HRESULT WINAPI IDirectMusicScriptImpl_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
112 {
113         ICOM_THIS(IDirectMusicScriptImpl,iface);
114
115         FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, plValue, pErrorInfo);
116
117         return S_OK;
118 }
119
120 HRESULT WINAPI IDirectMusicScriptImpl_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
121 {
122         ICOM_THIS(IDirectMusicScriptImpl,iface);
123
124         FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, punkValue, pErrorInfo);
125
126         return S_OK;
127 }
128
129 HRESULT WINAPI IDirectMusicScriptImpl_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
130 {
131         ICOM_THIS(IDirectMusicScriptImpl,iface);
132
133         FIXME("(%p, %p, %s, %p, %p): stub\n", This, pwszVariableName, debugstr_guid(riid), ppv, pErrorInfo);
134
135         return S_OK;
136 }
137
138 HRESULT WINAPI IDirectMusicScriptImpl_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName)
139 {
140         ICOM_THIS(IDirectMusicScriptImpl,iface);
141
142         FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
143
144         return S_OK;
145 }
146
147 HRESULT WINAPI IDirectMusicScriptImpl_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName)
148 {
149         ICOM_THIS(IDirectMusicScriptImpl,iface);
150
151         FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
152
153         return S_OK;
154 }
155
156 ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl =
157 {
158     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
159         IDirectMusicScriptImpl_QueryInterface,
160         IDirectMusicScriptImpl_AddRef,
161         IDirectMusicScriptImpl_Release,
162         IDirectMusicScriptImpl_Init,
163         IDirectMusicScriptImpl_CallRoutine,
164         IDirectMusicScriptImpl_SetVariableVariant,
165         IDirectMusicScriptImpl_GetVariableVariant,
166         IDirectMusicScriptImpl_SetVariableNumber,
167         IDirectMusicScriptImpl_GetVariableNumber,
168         IDirectMusicScriptImpl_SetVariableObject,
169         IDirectMusicScriptImpl_GetVariableObject,
170         IDirectMusicScriptImpl_EnumRoutine,
171         IDirectMusicScriptImpl_EnumVariable
172 };
173
174 /* for ClassFactory */
175 HRESULT WINAPI DMUSIC_CreateDirectMusicScript (LPCGUID lpcGUID, LPDIRECTMUSICSCRIPT* ppDMScript, LPUNKNOWN pUnkOuter)
176 {
177         if (IsEqualGUID (lpcGUID, &IID_IDirectMusicScript))
178         {
179                 FIXME("Not yet\n");
180                 return E_NOINTERFACE;
181         }
182         WARN("No interface found\n");
183         
184         return E_NOINTERFACE;   
185 }