blob: c401029513657360323f2a27e7084a0195d90c37 [file] [log] [blame]
Rok Mandeljc3dec4c52003-04-08 03:56:04 +00001/*
2 * DirectMusic Software Synth Definitions
3 *
4 * Copyright (C) 2003 Rok Mandeljc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program 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
14 * GNU Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
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
26
27/*****************************************************************************
28 * Definitions
29 */
30#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
31#define REFRESH_F_LASTBUFFER 0x00000001
32
33
34/*****************************************************************************
35 * Predeclare the interfaces
36 */
37
38DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6);
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000039DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8);
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000040DEFINE_GUID(IID_IDirectMusicSynthSink, 0x9823663,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa, 0x0,0x24,0xd8,0xb6);
Rok Mandeljc473c5652003-07-21 22:10:14 +000041
42typedef struct IDirectMusicSynth IDirectMusicSynth, *LPDIRECTMUSICSYNTH;
43typedef struct IDirectMusicSynth8 IDirectMusicSynth8, *LPDIRECTMUSICSYNTH8;
44typedef struct IDirectMusicSynthSink IDirectMusicSynthSink, *LPDIRECTMUSICSYNTHSINK;
45
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000046DEFINE_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 * Structures
52 */
53#ifndef _DMUS_VOICE_STATE_DEFINED
54#define _DMUS_VOICE_STATE_DEFINED
55
56typedef struct _DMUS_VOICE_STATE
57{
58 BOOL bExists;
59 SAMPLE_POSITION spPosition;
60} DMUS_VOICE_STATE;
61
62#endif /* _DMUS_VOICE_STATE_DEFINED */
63
64
65/*****************************************************************************
66 * IDirectMusicSynth interface
67 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000068#undef INTERFACE
69#define INTERFACE IDirectMusicSynth
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000070#define IDirectMusicSynth_METHODS \
Alexandre Julliardaae3cb62003-04-11 00:31:02 +000071 IUnknown_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000072 STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; \
73 STDMETHOD(Close)(THIS) PURE; \
74 STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE; \
75 STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE; \
76 STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE; \
77 STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE; \
78 STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE; \
79 STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE; \
80 STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE; \
81 STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE; \
82 STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE; \
83 STDMETHOD(SetSynthSink)(THIS_ IDirectMusicSynthSink *pSynthSink) PURE; \
84 STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE; \
85 STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE; \
86 STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE; \
87 STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE; \
88 STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000089ICOM_DEFINE(IDirectMusicSynth,IUnknown)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000090#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000091
Alexandre Julliard55379112003-04-10 21:13:58 +000092#ifdef COBJMACROS
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000093/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +000094#define IDirectMusicSynth_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
95#define IDirectMusicSynth_AddRef(p) (p)->lpVtbl->AddRef(p)
96#define IDirectMusicSynth_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +000097/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +000098#define IDirectMusicSynth_Open(p,a) (p)->lpVtbl->Open(p,a)
99#define IDirectMusicSynth_Close(p) (p)->lpVtbl->Close(p)
100#define IDirectMusicSynth_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
101#define IDirectMusicSynth_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
102#define IDirectMusicSynth_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
103#define IDirectMusicSynth_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
104#define IDirectMusicSynth_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
105#define IDirectMusicSynth_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
106#define IDirectMusicSynth_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
107#define IDirectMusicSynth_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
108#define IDirectMusicSynth_Activate(p,a) (p)->lpVtbl->Activate(p,a)
109#define IDirectMusicSynth_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
110#define IDirectMusicSynth_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
111#define IDirectMusicSynth_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
112#define IDirectMusicSynth_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
113#define IDirectMusicSynth_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
114#define IDirectMusicSynth_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
115#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000116
117
118/*****************************************************************************
119 * IDirectMusicSynth8 interface
120 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000121#undef INTERFACE
122#define INTERFACE IDirectMusicSynth8
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000123#define IDirectMusicSynth8_METHODS \
Alexandre Julliardaae3cb62003-04-11 00:31:02 +0000124 IDirectMusicSynth_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000125 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; \
126 STDMETHOD(StopVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId) PURE; \
127 STDMETHOD(GetVoiceState)(THIS_ DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) PURE; \
128 STDMETHOD(Refresh)(THIS_ DWORD dwDownloadID, DWORD dwFlags) PURE; \
129 STDMETHOD(AssignChannelToBuses)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses) PURE;
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000130ICOM_DEFINE(IDirectMusicSynth8,IDirectMusicSynth)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000131#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000132
Alexandre Julliard55379112003-04-10 21:13:58 +0000133#ifdef COBJMACROS
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000134/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000135#define IDirectMusicSynth8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
136#define IDirectMusicSynth8_AddRef(p) (p)->lpVtbl->AddRef(p)
137#define IDirectMusicSynth8_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000138/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000139#define IDirectMusicSynth8_Open(p,a) (p)->lpVtbl->Open(p,a)
140#define IDirectMusicSynth8_Close(p) (p)->lpVtbl->Close(p)
141#define IDirectMusicSynth8_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
142#define IDirectMusicSynth8_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
143#define IDirectMusicSynth8_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
144#define IDirectMusicSynth8_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
145#define IDirectMusicSynth8_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
146#define IDirectMusicSynth8_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
147#define IDirectMusicSynth8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
148#define IDirectMusicSynth8_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
149#define IDirectMusicSynth8_Activate(p,a) (p)->lpVtbl->Activate(p,a)
150#define IDirectMusicSynth8_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
151#define IDirectMusicSynth8_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
152#define IDirectMusicSynth8_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
153#define IDirectMusicSynth8_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
154#define IDirectMusicSynth8_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
155#define IDirectMusicSynth8_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000156/*** IDirectMusicSynth8 methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000157#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)
158#define IDirectMusicSynth8_StopVoice(p,a,b) (p)->lpVtbl->StopVoice(p,a,b)
159#define IDirectMusicSynth8_GetVoiceState(p,a,b,c) (p)->lpVtbl->GetVoiceState(p,a,b,c)
160#define IDirectMusicSynth8_Refresh(p,a,b) (p)->lpVtbl->Refresh(p,a,b)
161#define IDirectMusicSynth8_AssignChannelToBuses(p,a,b,c,d) (p)->lpVtbl->AssignChannelToBuses(p,a,b,c,d)
162#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000163
164
165/*****************************************************************************
166 * IDirectMusicSynthSink interface
167 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000168#undef INTERFACE
169#define INTERFACE IDirectMusicSynthSink
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000170#define IDirectMusicSynthSink_METHODS \
Alexandre Julliardaae3cb62003-04-11 00:31:02 +0000171 IUnknown_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000172 STDMETHOD(Init)(THIS_ IDirectMusicSynth *pSynth) PURE; \
173 STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE; \
174 STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE; \
175 STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE; \
176 STDMETHOD(SampleToRefTime)(THIS_ LONGLONG llSampleTime, REFERENCE_TIME *prfTime) PURE; \
177 STDMETHOD(RefTimeToSample)(THIS_ REFERENCE_TIME rfTime, LONGLONG *pllSampleTime) PURE; \
178 STDMETHOD(SetDirectSound)(THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; \
179 STDMETHOD(GetDesiredBufferSize)(THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000180ICOM_DEFINE(IDirectMusicSynthSink,IUnknown)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000181#undef INTERFACE
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000182
Alexandre Julliard55379112003-04-10 21:13:58 +0000183#ifdef COBJMACROS
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000184/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000185#define IDirectMusicSynthSink_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
186#define IDirectMusicSynthSink_AddRef(p) (p)->lpVtbl->AddRef(p)
187#define IDirectMusicSynthSink_Release(p) (p)->lpVtbl->Release(p)
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000188/*** IDirectMusicSynth methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000189#define IDirectMusicSynthSink_Init(p,a) (p)->lpVtbl->Init(p,a)
190#define IDirectMusicSynthSink_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
191#define IDirectMusicSynthSink_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
192#define IDirectMusicSynthSink_Activate(p,a) (p)->lpVtbl->Activate(p,a)
193#define IDirectMusicSynthSink_SampleToRefTime(p,a,b) (p)->lpVtbl->SampleToRefTime(p,a,b)
194#define IDirectMusicSynthSink_RefTimeToSample(p,a,b) (p)->lpVtbl->RefTimeToSample(p,a,b)
195#define IDirectMusicSynthSink_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b)
196#define IDirectMusicSynthSink_GetDesiredBufferSize(p,a) (p)->lpVtbl->GetDesiredBufferSize(p,a)
197#endif
Rok Mandeljc3dec4c52003-04-08 03:56:04 +0000198
199#endif /* __WINE_DMUSIC_SOFTWARESYNTH_H */