annotate lib/legacy_dx/dmusics.h @ 2253:aff7a7b072b7

adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
author Grumpy7
date Wed, 26 Feb 2014 23:35:23 +0100
parents 9c0607679772
children
rev   line source
0
Ritor1
parents:
diff changeset
1 /************************************************************************
Ritor1
parents:
diff changeset
2 * *
Ritor1
parents:
diff changeset
3 * dmusics.h -- Definitions for created a DirectMusic software synth *
Ritor1
parents:
diff changeset
4 * *
Ritor1
parents:
diff changeset
5 * Copyright (c) Microsoft Corporation. All rights reserved. *
Ritor1
parents:
diff changeset
6 * *
Ritor1
parents:
diff changeset
7 ************************************************************************/
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 #ifndef _DMUSICS_
Ritor1
parents:
diff changeset
10 #define _DMUSICS_
Ritor1
parents:
diff changeset
11
Ritor1
parents:
diff changeset
12 #include "dmusicc.h"
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14 /* Software synths are enumerated from under this registry key.
Ritor1
parents:
diff changeset
15 */
Ritor1
parents:
diff changeset
16 #define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18 interface IDirectMusicSynth;
Ritor1
parents:
diff changeset
19 interface IDirectMusicSynthSink;
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21 #ifndef __cplusplus
Ritor1
parents:
diff changeset
22 typedef interface IDirectMusicSynth IDirectMusicSynth;
Ritor1
parents:
diff changeset
23 typedef interface IDirectMusicSynthSink IDirectMusicSynthSink;
Ritor1
parents:
diff changeset
24 #endif
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26 #ifndef _DMUS_VOICE_STATE_DEFINED
Ritor1
parents:
diff changeset
27 #define _DMUS_VOICE_STATE_DEFINED
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29 typedef struct _DMUS_VOICE_STATE
Ritor1
parents:
diff changeset
30 {
Ritor1
parents:
diff changeset
31 BOOL bExists;
Ritor1
parents:
diff changeset
32 SAMPLE_POSITION spPosition;
Ritor1
parents:
diff changeset
33 } DMUS_VOICE_STATE;
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35 #endif /* _DMUS_VOICE_STATE_DEFINED */
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37 /* IDirectMusicSynth::Refresh
Ritor1
parents:
diff changeset
38 *
Ritor1
parents:
diff changeset
39 * This is the last buffer of the stream. It may be a partial block.
Ritor1
parents:
diff changeset
40 */
Ritor1
parents:
diff changeset
41 #define REFRESH_F_LASTBUFFER 0x00000001
Ritor1
parents:
diff changeset
42
Ritor1
parents:
diff changeset
43 #undef INTERFACE
Ritor1
parents:
diff changeset
44 #define INTERFACE IDirectMusicSynth
Ritor1
parents:
diff changeset
45 DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown)
Ritor1
parents:
diff changeset
46 {
Ritor1
parents:
diff changeset
47 /* IUnknown */
Ritor1
parents:
diff changeset
48 STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
Ritor1
parents:
diff changeset
49 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
Ritor1
parents:
diff changeset
50 STDMETHOD_(ULONG,Release) (THIS) PURE;
Ritor1
parents:
diff changeset
51
Ritor1
parents:
diff changeset
52 /* IDirectMusicSynth */
Ritor1
parents:
diff changeset
53 STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
Ritor1
parents:
diff changeset
54 STDMETHOD(Close) (THIS) PURE;
Ritor1
parents:
diff changeset
55 STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE;
Ritor1
parents:
diff changeset
56 STDMETHOD(Download) (THIS_ LPHANDLE phDownload,
Ritor1
parents:
diff changeset
57 LPVOID pvData,
Ritor1
parents:
diff changeset
58 LPBOOL pbFree ) PURE;
Ritor1
parents:
diff changeset
59 STDMETHOD(Unload) (THIS_ HANDLE hDownload,
Ritor1
parents:
diff changeset
60 HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE),
Ritor1
parents:
diff changeset
61 HANDLE hUserData ) PURE;
Ritor1
parents:
diff changeset
62 STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt,
Ritor1
parents:
diff changeset
63 LPBYTE pbBuffer,
Ritor1
parents:
diff changeset
64 DWORD cbBuffer) PURE;
Ritor1
parents:
diff changeset
65 STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
Ritor1
parents:
diff changeset
66 STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
Ritor1
parents:
diff changeset
67 STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
Ritor1
parents:
diff changeset
68 STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
Ritor1
parents:
diff changeset
69 STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
Ritor1
parents:
diff changeset
70 STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
Ritor1
parents:
diff changeset
71 STDMETHOD(Render) (THIS_ short *pBuffer,
Ritor1
parents:
diff changeset
72 DWORD dwLength,
Ritor1
parents:
diff changeset
73 LONGLONG llPosition) PURE;
Ritor1
parents:
diff changeset
74 STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
75 DWORD dwChannel,
Ritor1
parents:
diff changeset
76 DWORD dwPriority) PURE;
Ritor1
parents:
diff changeset
77 STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
78 DWORD dwChannel,
Ritor1
parents:
diff changeset
79 LPDWORD pdwPriority) PURE;
Ritor1
parents:
diff changeset
80 STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx,
Ritor1
parents:
diff changeset
81 LPDWORD pdwWaveFormatExSize) PURE;
Ritor1
parents:
diff changeset
82 STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
Ritor1
parents:
diff changeset
83 };
Ritor1
parents:
diff changeset
84
Ritor1
parents:
diff changeset
85 #undef INTERFACE
Ritor1
parents:
diff changeset
86
Ritor1
parents:
diff changeset
87 #define INTERFACE IDirectMusicSynth8
Ritor1
parents:
diff changeset
88 DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth)
Ritor1
parents:
diff changeset
89 {
Ritor1
parents:
diff changeset
90 /* IUnknown */
Ritor1
parents:
diff changeset
91 STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
Ritor1
parents:
diff changeset
92 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
Ritor1
parents:
diff changeset
93 STDMETHOD_(ULONG,Release) (THIS) PURE;
Ritor1
parents:
diff changeset
94
Ritor1
parents:
diff changeset
95 /* IDirectMusicSynth */
Ritor1
parents:
diff changeset
96 STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
Ritor1
parents:
diff changeset
97 STDMETHOD(Close) (THIS) PURE;
Ritor1
parents:
diff changeset
98 STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE;
Ritor1
parents:
diff changeset
99 STDMETHOD(Download) (THIS_ LPHANDLE phDownload,
Ritor1
parents:
diff changeset
100 LPVOID pvData,
Ritor1
parents:
diff changeset
101 LPBOOL pbFree ) PURE;
Ritor1
parents:
diff changeset
102 STDMETHOD(Unload) (THIS_ HANDLE hDownload,
Ritor1
parents:
diff changeset
103 HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE),
Ritor1
parents:
diff changeset
104 HANDLE hUserData ) PURE;
Ritor1
parents:
diff changeset
105 STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt,
Ritor1
parents:
diff changeset
106 LPBYTE pbBuffer,
Ritor1
parents:
diff changeset
107 DWORD cbBuffer) PURE;
Ritor1
parents:
diff changeset
108 STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
Ritor1
parents:
diff changeset
109 STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
Ritor1
parents:
diff changeset
110 STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
Ritor1
parents:
diff changeset
111 STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
Ritor1
parents:
diff changeset
112 STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
Ritor1
parents:
diff changeset
113 STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
Ritor1
parents:
diff changeset
114 STDMETHOD(Render) (THIS_ short *pBuffer,
Ritor1
parents:
diff changeset
115 DWORD dwLength,
Ritor1
parents:
diff changeset
116 LONGLONG llPosition) PURE;
Ritor1
parents:
diff changeset
117 STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
118 DWORD dwChannel,
Ritor1
parents:
diff changeset
119 DWORD dwPriority) PURE;
Ritor1
parents:
diff changeset
120 STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
121 DWORD dwChannel,
Ritor1
parents:
diff changeset
122 LPDWORD pdwPriority) PURE;
Ritor1
parents:
diff changeset
123 STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx,
Ritor1
parents:
diff changeset
124 LPDWORD pdwWaveFormatExSize) PURE;
Ritor1
parents:
diff changeset
125 STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
Ritor1
parents:
diff changeset
126
Ritor1
parents:
diff changeset
127 /* IDirectMusicSynth8 */
Ritor1
parents:
diff changeset
128 STDMETHOD(PlayVoice) (THIS_ REFERENCE_TIME rt,
Ritor1
parents:
diff changeset
129 DWORD dwVoiceId,
Ritor1
parents:
diff changeset
130 DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
131 DWORD dwChannel,
Ritor1
parents:
diff changeset
132 DWORD dwDLId,
Ritor1
parents:
diff changeset
133 long prPitch, /* PREL not defined here */
Ritor1
parents:
diff changeset
134 long vrVolume, /* VREL not defined here */
Ritor1
parents:
diff changeset
135 SAMPLE_TIME stVoiceStart,
Ritor1
parents:
diff changeset
136 SAMPLE_TIME stLoopStart,
Ritor1
parents:
diff changeset
137 SAMPLE_TIME stLoopEnd) PURE;
Ritor1
parents:
diff changeset
138
Ritor1
parents:
diff changeset
139 STDMETHOD(StopVoice) (THIS_ REFERENCE_TIME rt,
Ritor1
parents:
diff changeset
140 DWORD dwVoiceId ) PURE;
Ritor1
parents:
diff changeset
141
Ritor1
parents:
diff changeset
142 STDMETHOD(GetVoiceState) (THIS_ DWORD dwVoice[],
Ritor1
parents:
diff changeset
143 DWORD cbVoice,
Ritor1
parents:
diff changeset
144 DMUS_VOICE_STATE dwVoiceState[] ) PURE;
Ritor1
parents:
diff changeset
145 STDMETHOD(Refresh) (THIS_ DWORD dwDownloadID,
Ritor1
parents:
diff changeset
146 DWORD dwFlags) PURE;
Ritor1
parents:
diff changeset
147 STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup,
Ritor1
parents:
diff changeset
148 DWORD dwChannel,
Ritor1
parents:
diff changeset
149 LPDWORD pdwBuses,
Ritor1
parents:
diff changeset
150 DWORD cBuses) PURE;
Ritor1
parents:
diff changeset
151 };
Ritor1
parents:
diff changeset
152
Ritor1
parents:
diff changeset
153 #undef INTERFACE
Ritor1
parents:
diff changeset
154 #define INTERFACE IDirectMusicSynthSink
Ritor1
parents:
diff changeset
155 DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown)
Ritor1
parents:
diff changeset
156 {
Ritor1
parents:
diff changeset
157 /* IUnknown */
Ritor1
parents:
diff changeset
158 STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
Ritor1
parents:
diff changeset
159 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
Ritor1
parents:
diff changeset
160 STDMETHOD_(ULONG,Release) (THIS) PURE;
Ritor1
parents:
diff changeset
161
Ritor1
parents:
diff changeset
162 /* IDirectMusicSynthSink */
Ritor1
parents:
diff changeset
163 STDMETHOD(Init) (THIS_ IDirectMusicSynth *pSynth) PURE;
Ritor1
parents:
diff changeset
164 STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
Ritor1
parents:
diff changeset
165 STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
Ritor1
parents:
diff changeset
166 STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
Ritor1
parents:
diff changeset
167 STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime,
Ritor1
parents:
diff changeset
168 REFERENCE_TIME *prfTime) PURE;
Ritor1
parents:
diff changeset
169 STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime,
Ritor1
parents:
diff changeset
170 LONGLONG *pllSampleTime) PURE;
Ritor1
parents:
diff changeset
171 STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound,
Ritor1
parents:
diff changeset
172 LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
Ritor1
parents:
diff changeset
173 STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
Ritor1
parents:
diff changeset
174 };
Ritor1
parents:
diff changeset
175
Ritor1
parents:
diff changeset
176 DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
Ritor1
parents:
diff changeset
177 DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8);
Ritor1
parents:
diff changeset
178 DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
Ritor1
parents:
diff changeset
179
Ritor1
parents:
diff changeset
180 /* Property Set GUID_DMUS_PROP_SetSynthSink
Ritor1
parents:
diff changeset
181 *
Ritor1
parents:
diff changeset
182 * Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink.
Ritor1
parents:
diff changeset
183 */
Ritor1
parents:
diff changeset
184 DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
Ritor1
parents:
diff changeset
185
Ritor1
parents:
diff changeset
186 /* Property Set GUID_DMUS_PROP_SinkUsesDSound
Ritor1
parents:
diff changeset
187 *
Ritor1
parents:
diff changeset
188 * Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The
Ritor1
parents:
diff changeset
189 * default is FALSE if this property item is not implemented by the sink.
Ritor1
parents:
diff changeset
190 */
Ritor1
parents:
diff changeset
191 DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
Ritor1
parents:
diff changeset
192
Ritor1
parents:
diff changeset
193 #endif