blob: 7d48e93dd0199c7606c2cd18df55f88b6b9db5f9 [file] [log] [blame]
Rok Mandeljc3dec4c52003-04-08 03:56:04 +00001/*
2 * DirectMusic Software Synth Definitions
3 *
Rok Mandeljc0382ea12004-01-20 00:21:40 +00004 * Copyright (C) 2003-2004 Rok Mandeljc
Rok Mandeljc3dec4c52003-04-08 03:56:04 +00005 *
Alexandre Julliard7718d2b2007-05-30 12:54:07 +02006 * This program 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.
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000010 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Alexandre Julliard7718d2b2007-05-30 12:54:07 +020013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000015 *
Alexandre Julliard7718d2b2007-05-30 12:54:07 +020016 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000019 */
20
21#ifndef __WINE_DMUSIC_SOFTWARESYNTH_H
22#define __WINE_DMUSIC_SOFTWARESYNTH_H
23
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000024#include <dmusicc.h>
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000025
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000026/*****************************************************************************
Rok Mandeljc0382ea12004-01-20 00:21:40 +000027 * Registry path
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000028 */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000029#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000030
31
32/*****************************************************************************
33 * Predeclare the interfaces
34 */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000035/* IIDs */
36DEFINE_GUID(IID_IDirectMusicSynth, 0x09823661,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
37DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8);
38DEFINE_GUID(IID_IDirectMusicSynthSink, 0x09823663,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000039
Rok Mandeljc0382ea12004-01-20 00:21:40 +000040/* typedef definitions */
Alexandre Julliardb8d30752005-07-26 18:32:53 +000041typedef struct IDirectMusicSynth *LPDIRECTMUSICSYNTH;
42typedef struct IDirectMusicSynth8 *LPDIRECTMUSICSYNTH8;
43typedef struct IDirectMusicSynthSink *LPDIRECTMUSICSYNTHSINK;
Rok Mandeljc473c5652003-07-21 22:10:14 +000044
Rok Mandeljc0382ea12004-01-20 00:21:40 +000045/* GUIDs - property set */
46DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
47DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12);
48
49
50/*****************************************************************************
51 * Flags
52 */
53#define REFRESH_F_LASTBUFFER 0x1
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000054
55
56/*****************************************************************************
57 * Structures
58 */
59#ifndef _DMUS_VOICE_STATE_DEFINED
60#define _DMUS_VOICE_STATE_DEFINED
61
Rok Mandeljc0382ea12004-01-20 00:21:40 +000062/* typedef definition */
63typedef struct _DMUS_VOICE_STATE DMUS_VOICE_STATE, *LPDMUS_VOICE_STATE;
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000064
Rok Mandeljc0382ea12004-01-20 00:21:40 +000065/* actual structure */
66struct _DMUS_VOICE_STATE {
67 BOOL bExists;
68 SAMPLE_POSITION spPosition;
69};
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000070#endif /* _DMUS_VOICE_STATE_DEFINED */
71
72
73/*****************************************************************************
74 * IDirectMusicSynth interface
75 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000076#define INTERFACE IDirectMusicSynth
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000077DECLARE_INTERFACE_(IDirectMusicSynth,IUnknown)
78{
79 /*** IUnknown methods ***/
80 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
81 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
82 STDMETHOD_(ULONG,Release)(THIS) PURE;
83 /*** IDirectMusicSynth methods ***/
84 STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
85 STDMETHOD(Close)(THIS) PURE;
86 STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
87 STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
88 STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
89 STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
90 STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
91 STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
92 STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
93 STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
94 STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
Alexandre Julliardb8d30752005-07-26 18:32:53 +000095 STDMETHOD(SetSynthSink)(THIS_ struct IDirectMusicSynthSink *pSynthSink) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000096 STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
97 STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
98 STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
99 STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000100 STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000101};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000102#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000103
Francois Gouget52ecbf72004-10-04 19:35:40 +0000104#if !defined(__cplusplus) || defined(CINTERFACE)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000105/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000106#define IDirectMusicSynth_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
107#define IDirectMusicSynth_AddRef(p) (p)->lpVtbl->AddRef(p)
108#define IDirectMusicSynth_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000109/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000110#define IDirectMusicSynth_Open(p,a) (p)->lpVtbl->Open(p,a)
111#define IDirectMusicSynth_Close(p) (p)->lpVtbl->Close(p)
112#define IDirectMusicSynth_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
113#define IDirectMusicSynth_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
114#define IDirectMusicSynth_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
115#define IDirectMusicSynth_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
116#define IDirectMusicSynth_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
117#define IDirectMusicSynth_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
118#define IDirectMusicSynth_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
119#define IDirectMusicSynth_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
120#define IDirectMusicSynth_Activate(p,a) (p)->lpVtbl->Activate(p,a)
121#define IDirectMusicSynth_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
122#define IDirectMusicSynth_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
123#define IDirectMusicSynth_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
124#define IDirectMusicSynth_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
125#define IDirectMusicSynth_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
126#define IDirectMusicSynth_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
127#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000128
129
130/*****************************************************************************
131 * IDirectMusicSynth8 interface
132 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000133#define INTERFACE IDirectMusicSynth8
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000134DECLARE_INTERFACE_(IDirectMusicSynth8,IDirectMusicSynth)
135{
136 /*** IUnknown methods ***/
137 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
138 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
139 STDMETHOD_(ULONG,Release)(THIS) PURE;
140 /*** IDirectMusicSynth methods ***/
141 STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
142 STDMETHOD(Close)(THIS) PURE;
143 STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
144 STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
145 STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
146 STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
147 STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
148 STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
149 STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
150 STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
151 STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
Alexandre Julliardb8d30752005-07-26 18:32:53 +0000152 STDMETHOD(SetSynthSink)(THIS_ struct IDirectMusicSynthSink *pSynthSink) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000153 STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
154 STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
155 STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
156 STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
157 STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
158 /*** IDirectMusicSynth8 methods ***/
Michael Stefaniucca918502009-01-10 02:45:10 +0100159 STDMETHOD(PlayVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, LONG prPitch, LONG vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000160 STDMETHOD(StopVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId) PURE;
161 STDMETHOD(GetVoiceState)(THIS_ DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) PURE;
162 STDMETHOD(Refresh)(THIS_ DWORD dwDownloadID, DWORD dwFlags) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000163 STDMETHOD(AssignChannelToBuses)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000164};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000165#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000166
Francois Gouget52ecbf72004-10-04 19:35:40 +0000167#if !defined(__cplusplus) || defined(CINTERFACE)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000168/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000169#define IDirectMusicSynth8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
170#define IDirectMusicSynth8_AddRef(p) (p)->lpVtbl->AddRef(p)
171#define IDirectMusicSynth8_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000172/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000173#define IDirectMusicSynth8_Open(p,a) (p)->lpVtbl->Open(p,a)
174#define IDirectMusicSynth8_Close(p) (p)->lpVtbl->Close(p)
175#define IDirectMusicSynth8_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
176#define IDirectMusicSynth8_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
177#define IDirectMusicSynth8_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
178#define IDirectMusicSynth8_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
179#define IDirectMusicSynth8_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
180#define IDirectMusicSynth8_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
181#define IDirectMusicSynth8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
182#define IDirectMusicSynth8_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
183#define IDirectMusicSynth8_Activate(p,a) (p)->lpVtbl->Activate(p,a)
184#define IDirectMusicSynth8_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
185#define IDirectMusicSynth8_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
186#define IDirectMusicSynth8_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
187#define IDirectMusicSynth8_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
188#define IDirectMusicSynth8_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
189#define IDirectMusicSynth8_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000190/*** IDirectMusicSynth8 methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000191#define IDirectMusicSynth8_PlayVoice(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->PlayVoice(p,a,b,c,d,e,f,g,h,i,j)
192#define IDirectMusicSynth8_StopVoice(p,a,b) (p)->lpVtbl->StopVoice(p,a,b)
193#define IDirectMusicSynth8_GetVoiceState(p,a,b,c) (p)->lpVtbl->GetVoiceState(p,a,b,c)
194#define IDirectMusicSynth8_Refresh(p,a,b) (p)->lpVtbl->Refresh(p,a,b)
195#define IDirectMusicSynth8_AssignChannelToBuses(p,a,b,c,d) (p)->lpVtbl->AssignChannelToBuses(p,a,b,c,d)
196#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000197
198
199/*****************************************************************************
200 * IDirectMusicSynthSink interface
201 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000202#define INTERFACE IDirectMusicSynthSink
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000203DECLARE_INTERFACE_(IDirectMusicSynthSink,IUnknown)
204{
205 /*** IUnknown methods ***/
206 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
207 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
208 STDMETHOD_(ULONG,Release)(THIS) PURE;
209 /*** IDirectMusicSynthSink methods ***/
210 STDMETHOD(Init)(THIS_ IDirectMusicSynth *pSynth) PURE;
211 STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
212 STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
213 STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
214 STDMETHOD(SampleToRefTime)(THIS_ LONGLONG llSampleTime, REFERENCE_TIME *prfTime) PURE;
215 STDMETHOD(RefTimeToSample)(THIS_ REFERENCE_TIME rfTime, LONGLONG *pllSampleTime) PURE;
216 STDMETHOD(SetDirectSound)(THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000217 STDMETHOD(GetDesiredBufferSize)(THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +0000218};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000219#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000220
Francois Gouget52ecbf72004-10-04 19:35:40 +0000221#if !defined(__cplusplus) || defined(CINTERFACE)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000222/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000223#define IDirectMusicSynthSink_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
224#define IDirectMusicSynthSink_AddRef(p) (p)->lpVtbl->AddRef(p)
225#define IDirectMusicSynthSink_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000226/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000227#define IDirectMusicSynthSink_Init(p,a) (p)->lpVtbl->Init(p,a)
228#define IDirectMusicSynthSink_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
229#define IDirectMusicSynthSink_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
230#define IDirectMusicSynthSink_Activate(p,a) (p)->lpVtbl->Activate(p,a)
231#define IDirectMusicSynthSink_SampleToRefTime(p,a,b) (p)->lpVtbl->SampleToRefTime(p,a,b)
232#define IDirectMusicSynthSink_RefTimeToSample(p,a,b) (p)->lpVtbl->RefTimeToSample(p,a,b)
233#define IDirectMusicSynthSink_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b)
234#define IDirectMusicSynthSink_GetDesiredBufferSize(p,a) (p)->lpVtbl->GetDesiredBufferSize(p,a)
235#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000236
237#endif /* __WINE_DMUSIC_SOFTWARESYNTH_H */