1 /* DirectMusicSynthesizer Private Include
3 * Copyright (C) 2003-2004 Rok Mandeljc
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.
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.
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.
20 #ifndef __WINE_DMSYNTH_PRIVATE_H
21 #define __WINE_DMSYNTH_PRIVATE_H
31 #include "wine/debug.h"
32 #include "wine/list.h"
33 #include "wine/unicode.h"
40 /*****************************************************************************
43 typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl
;
44 typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl
;
46 /*****************************************************************************
47 * Predeclare the interface implementation structures
49 extern ICOM_VTABLE(IDirectMusicSynth8
) DirectMusicSynth8_Vtbl
;
50 extern ICOM_VTABLE(IDirectMusicSynthSink
) DirectMusicSynthSink_Vtbl
;
52 /*****************************************************************************
55 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
56 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicSynthSinkImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
58 /*****************************************************************************
59 * IDirectMusicSynth8Impl implementation structure
61 struct IDirectMusicSynth8Impl
{
63 ICOM_VFIELD(IDirectMusicSynth8
);
66 /* IDirectMusicSynth8 fields */
69 IReferenceClock
* pLatencyClock
;
70 IDirectMusicSynthSinkImpl
* pSynthSink
;
74 extern HRESULT WINAPI
IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface
, REFIID riid
, LPVOID
*ppobj
);
75 extern ULONG WINAPI
IDirectMusicSynth8Impl_AddRef (LPDIRECTMUSICSYNTH8 iface
);
76 extern ULONG WINAPI
IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface
);
77 /* IDirectMusicSynth: */
78 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface
, LPDMUS_PORTPARAMS pPortParams
);
79 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Close (LPDIRECTMUSICSYNTH8 iface
);
80 extern HRESULT WINAPI
IDirectMusicSynth8Impl_SetNumChannelGroups (LPDIRECTMUSICSYNTH8 iface
, DWORD dwGroups
);
81 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Download (LPDIRECTMUSICSYNTH8 iface
, LPHANDLE phDownload
, LPVOID pvData
, LPBOOL pbFree
);
82 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Unload (LPDIRECTMUSICSYNTH8 iface
, HANDLE hDownload
, HRESULT (CALLBACK
* lpFreeHandle
)(HANDLE
,HANDLE
), HANDLE hUserData
);
83 extern HRESULT WINAPI
IDirectMusicSynth8Impl_PlayBuffer (LPDIRECTMUSICSYNTH8 iface
, REFERENCE_TIME rt
, LPBYTE pbBuffer
, DWORD cbBuffer
);
84 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetRunningStats (LPDIRECTMUSICSYNTH8 iface
, LPDMUS_SYNTHSTATS pStats
);
85 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetPortCaps (LPDIRECTMUSICSYNTH8 iface
, LPDMUS_PORTCAPS pCaps
);
86 extern HRESULT WINAPI
IDirectMusicSynth8Impl_SetMasterClock (LPDIRECTMUSICSYNTH8 iface
, IReferenceClock
* pClock
);
87 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetLatencyClock (LPDIRECTMUSICSYNTH8 iface
, IReferenceClock
** ppClock
);
88 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Activate (LPDIRECTMUSICSYNTH8 iface
, BOOL fEnable
);
89 extern HRESULT WINAPI
IDirectMusicSynth8Impl_SetSynthSink (LPDIRECTMUSICSYNTH8 iface
, IDirectMusicSynthSink
* pSynthSink
);
90 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Render (LPDIRECTMUSICSYNTH8 iface
, short* pBuffer
, DWORD dwLength
, LONGLONG llPosition
);
91 extern HRESULT WINAPI
IDirectMusicSynth8Impl_SetChannelPriority (LPDIRECTMUSICSYNTH8 iface
, DWORD dwChannelGroup
, DWORD dwChannel
, DWORD dwPriority
);
92 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetChannelPriority (LPDIRECTMUSICSYNTH8 iface
, DWORD dwChannelGroup
, DWORD dwChannel
, LPDWORD pdwPriority
);
93 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetFormat (LPDIRECTMUSICSYNTH8 iface
, LPWAVEFORMATEX pWaveFormatEx
, LPDWORD pdwWaveFormatExSiz
);
94 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface
, DWORD
* pdwAppend
);
95 /* IDirectMusicSynth8: */
96 extern HRESULT WINAPI
IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface
, REFERENCE_TIME rt
, DWORD dwVoiceId
, DWORD dwChannelGroup
, DWORD dwChannel
, DWORD dwDLId
, long prPitch
, long vrVolume
, SAMPLE_TIME stVoiceStart
, SAMPLE_TIME stLoopStart
, SAMPLE_TIME stLoopEnd
);
97 extern HRESULT WINAPI
IDirectMusicSynth8Impl_StopVoice (LPDIRECTMUSICSYNTH8 iface
, REFERENCE_TIME rt
, DWORD dwVoiceId
);
98 extern HRESULT WINAPI
IDirectMusicSynth8Impl_GetVoiceState (LPDIRECTMUSICSYNTH8 iface
, DWORD dwVoice
[], DWORD cbVoice
, DMUS_VOICE_STATE dwVoiceState
[]);
99 extern HRESULT WINAPI
IDirectMusicSynth8Impl_Refresh (LPDIRECTMUSICSYNTH8 iface
, DWORD dwDownloadID
, DWORD dwFlags
);
100 extern HRESULT WINAPI
IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSICSYNTH8 iface
, DWORD dwChannelGroup
, DWORD dwChannel
, LPDWORD pdwBuses
, DWORD cBuses
);
102 /*****************************************************************************
103 * IDirectMusicSynthSinkImpl implementation structure
105 struct IDirectMusicSynthSinkImpl
{
106 /* IUnknown fields */
107 ICOM_VFIELD(IDirectMusicSynthSink
);
110 /* IDirectMusicSynthSinkImpl fields */
114 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface
, REFIID riid
, LPVOID
*ppobj
);
115 extern ULONG WINAPI
IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface
);
116 extern ULONG WINAPI
IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface
);
117 /* IDirectMusicSynthSinkImpl: */
118 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface
, IDirectMusicSynth
* pSynth
);
119 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface
, IReferenceClock
* pClock
);
120 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface
, IReferenceClock
** ppClock
);
121 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface
, BOOL fEnable
);
122 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface
, LONGLONG llSampleTime
, REFERENCE_TIME
* prfTime
);
123 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface
, REFERENCE_TIME rfTime
, LONGLONG
* pllSampleTime
);
124 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface
, LPDIRECTSOUND pDirectSound
, LPDIRECTSOUNDBUFFER pDirectSoundBuffer
);
125 extern HRESULT WINAPI
IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface
, LPDWORD pdwBufferSizeInSamples
);
128 /*****************************************************************************
131 /* used for generic dumping (copied from ddraw) */
142 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
143 #define DM_STRUCT_INIT(x) \
145 memset((x), 0, sizeof(*(x))); \
146 (x)->dwSize = sizeof(*x); \
149 #define FE(x) { x, #x }
150 #define GE(x) { &x, #x }
152 /* FOURCC to string conversion for debug messages */
153 extern const char *debugstr_fourcc (DWORD fourcc
);
154 /* DMUS_VERSION struct to string conversion for debug messages */
155 extern const char *debugstr_dmversion (LPDMUS_VERSION version
);
156 /* returns name of given GUID */
157 extern const char *debugstr_dmguid (const GUID
*id
);
158 /* returns name of given error code */
159 extern const char *debugstr_dmreturn (DWORD code
);
160 /* generic flags-dumping function */
161 extern const char *debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
);
164 #endif /* __WINE_DMSYNTH_PRIVATE_H */