ReactOS 0.4.15-dev-7931-gfd331f1
dmusic_private.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "winreg.h"
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
#include "dmksctrl.h"
Include dependency graph for dmusic_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DMUSIC_PRIVATE_MCHANNEL_
 
struct  DMUSIC_PRIVATE_CHANNEL_GROUP_
 
struct  port_info
 
struct  instrument_region
 
struct  instrument_articulation
 
struct  IDirectMusic8Impl
 
struct  IDirectMusicBufferImpl
 
struct  IDirectMusicDownloadedInstrumentImpl
 
struct  IDirectMusicDownloadImpl
 
struct  IReferenceClockImpl
 
struct  _DMUS_PRIVATE_INSTRUMENT_ENTRY
 
struct  _DMUS_PRIVATE_POOLCUE
 
struct  IDirectMusicInstrumentImpl
 
struct  _DMUS_PRIVATE_CHUNK
 
struct  flag_info
 
struct  guid_info
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define FE(x)   { x, #x }
 
#define GE(x)   { &x, #x }
 

Typedefs

typedef struct IDirectMusic8Impl IDirectMusic8Impl
 
typedef struct IDirectMusicBufferImpl IDirectMusicBufferImpl
 
typedef struct IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrumentImpl
 
typedef struct IDirectMusicDownloadImpl IDirectMusicDownloadImpl
 
typedef struct IReferenceClockImpl IReferenceClockImpl
 
typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl
 
typedef struct DMUSIC_PRIVATE_MCHANNEL_ DMUSIC_PRIVATE_MCHANNEL
 
typedef struct DMUSIC_PRIVATE_MCHANNEL_LPDMUSIC_PRIVATE_MCHANNEL
 
typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ DMUSIC_PRIVATE_CHANNEL_GROUP
 
typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_LPDMUSIC_PRIVATE_CHANNEL_GROUP
 
typedef struct port_info port_info
 
typedef struct instrument_region instrument_region
 
typedef struct instrument_articulation instrument_articulation
 
typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRY DMUS_PRIVATE_INSTRUMENTENTRY
 
typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRYLPDMUS_PRIVATE_INSTRUMENTENTRY
 
typedef struct _DMUS_PRIVATE_POOLCUE DMUS_PRIVATE_POOLCUE
 
typedef struct _DMUS_PRIVATE_POOLCUELPDMUS_PRIVATE_POOLCUE
 
typedef struct _DMUS_PRIVATE_CHUNK DMUS_PRIVATE_CHUNK
 
typedef struct _DMUS_PRIVATE_CHUNKLPDMUS_PRIVATE_CHUNK
 

Functions

HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT DMUSIC_CreateDirectMusicBufferImpl (LPDMUS_BUFFERDESC desc, LPVOID *ret_iface) DECLSPEC_HIDDEN
 
HRESULT DMUSIC_CreateDirectMusicDownloadImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
 
HRESULT synth_port_create (IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
 
HRESULT midi_out_port_create (IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
 
HRESULT midi_in_port_create (IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
 
static IDirectMusicInstrumentImplimpl_from_IDirectMusicInstrument (IDirectMusicInstrument *iface)
 
HRESULT IDirectMusicInstrumentImpl_CustomLoad (IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN
 
static void DMUSIC_LockModule (void)
 
static void DMUSIC_UnlockModule (void)
 
void dmusic_remove_port (IDirectMusic8Impl *dmusic, IDirectMusicPort *port) DECLSPEC_HIDDEN
 
DWORD MIDILOCALE2Patch (const MIDILOCALE *pLocale) DECLSPEC_HIDDEN
 
void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale) DECLSPEC_HIDDEN
 
int even_or_odd (DWORD number) DECLSPEC_HIDDEN
 
const chardebugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN
 
const chardebugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN
 
void dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC desc) DECLSPEC_HIDDEN
 
void dump_DMUS_PORTPARAMS (LPDMUS_PORTPARAMS params) DECLSPEC_HIDDEN
 

Variables

LONG DMUSIC_refCount DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file dmusic_private.h.

◆ FE

#define FE (   x)    { x, #x }

Definition at line 253 of file dmusic_private.h.

◆ GE

#define GE (   x)    { &x, #x }

Definition at line 254 of file dmusic_private.h.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 29 of file dmusic_private.h.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 28 of file dmusic_private.h.

Typedef Documentation

◆ DMUS_PRIVATE_CHUNK

◆ DMUS_PRIVATE_INSTRUMENTENTRY

◆ DMUS_PRIVATE_POOLCUE

◆ DMUSIC_PRIVATE_CHANNEL_GROUP

◆ DMUSIC_PRIVATE_MCHANNEL

◆ IDirectMusic8Impl

Definition at line 53 of file dmusic_private.h.

◆ IDirectMusicBufferImpl

◆ IDirectMusicDownloadedInstrumentImpl

◆ IDirectMusicDownloadImpl

◆ IDirectMusicInstrumentImpl

◆ instrument_articulation

◆ instrument_region

◆ IReferenceClockImpl

Definition at line 57 of file dmusic_private.h.

◆ LPDMUS_PRIVATE_CHUNK

◆ LPDMUS_PRIVATE_INSTRUMENTENTRY

◆ LPDMUS_PRIVATE_POOLCUE

◆ LPDMUSIC_PRIVATE_CHANNEL_GROUP

◆ LPDMUSIC_PRIVATE_MCHANNEL

◆ port_info

Function Documentation

◆ debugstr_dmguid()

const char * debugstr_dmguid ( const GUID id)

Definition at line 237 of file dmusic_main.c.

237 {
238 static const guid_info guids[] = {
239 /* CLSIDs */
240 GE(CLSID_AudioVBScript),
241 GE(CLSID_DirectMusic),
242 GE(CLSID_DirectMusicAudioPathConfig),
243 GE(CLSID_DirectMusicAuditionTrack),
244 GE(CLSID_DirectMusicBand),
245 GE(CLSID_DirectMusicBandTrack),
246 GE(CLSID_DirectMusicChordMapTrack),
247 GE(CLSID_DirectMusicChordMap),
248 GE(CLSID_DirectMusicChordTrack),
249 GE(CLSID_DirectMusicCollection),
250 GE(CLSID_DirectMusicCommandTrack),
251 GE(CLSID_DirectMusicComposer),
252 GE(CLSID_DirectMusicContainer),
253 GE(CLSID_DirectMusicGraph),
254 GE(CLSID_DirectMusicLoader),
255 GE(CLSID_DirectMusicLyricsTrack),
256 GE(CLSID_DirectMusicMarkerTrack),
257 GE(CLSID_DirectMusicMelodyFormulationTrack),
258 GE(CLSID_DirectMusicMotifTrack),
259 GE(CLSID_DirectMusicMuteTrack),
260 GE(CLSID_DirectMusicParamControlTrack),
261 GE(CLSID_DirectMusicPatternTrack),
262 GE(CLSID_DirectMusicPerformance),
263 GE(CLSID_DirectMusicScript),
264 GE(CLSID_DirectMusicScriptAutoImpSegment),
265 GE(CLSID_DirectMusicScriptAutoImpPerformance),
266 GE(CLSID_DirectMusicScriptAutoImpSegmentState),
267 GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
268 GE(CLSID_DirectMusicScriptAutoImpAudioPath),
269 GE(CLSID_DirectMusicScriptAutoImpSong),
270 GE(CLSID_DirectMusicScriptSourceCodeLoader),
271 GE(CLSID_DirectMusicScriptTrack),
272 GE(CLSID_DirectMusicSection),
273 GE(CLSID_DirectMusicSegment),
274 GE(CLSID_DirectMusicSegmentState),
275 GE(CLSID_DirectMusicSegmentTriggerTrack),
276 GE(CLSID_DirectMusicSegTriggerTrack),
277 GE(CLSID_DirectMusicSeqTrack),
278 GE(CLSID_DirectMusicSignPostTrack),
279 GE(CLSID_DirectMusicSong),
280 GE(CLSID_DirectMusicStyle),
281 GE(CLSID_DirectMusicStyleTrack),
282 GE(CLSID_DirectMusicSynth),
283 GE(CLSID_DirectMusicSynthSink),
284 GE(CLSID_DirectMusicSysExTrack),
285 GE(CLSID_DirectMusicTemplate),
286 GE(CLSID_DirectMusicTempoTrack),
287 GE(CLSID_DirectMusicTimeSigTrack),
288 GE(CLSID_DirectMusicWaveTrack),
289 GE(CLSID_DirectSoundWave),
290 /* IIDs */
291 GE(IID_IDirectMusic),
292 GE(IID_IDirectMusic2),
293 GE(IID_IDirectMusic8),
294 GE(IID_IDirectMusicAudioPath),
295 GE(IID_IDirectMusicBand),
296 GE(IID_IDirectMusicBuffer),
297 GE(IID_IDirectMusicChordMap),
298 GE(IID_IDirectMusicCollection),
299 GE(IID_IDirectMusicComposer),
300 GE(IID_IDirectMusicContainer),
301 GE(IID_IDirectMusicDownload),
302 GE(IID_IDirectMusicDownloadedInstrument),
303 GE(IID_IDirectMusicGetLoader),
304 GE(IID_IDirectMusicGraph),
305 GE(IID_IDirectMusicInstrument),
306 GE(IID_IDirectMusicLoader),
307 GE(IID_IDirectMusicLoader8),
308 GE(IID_IDirectMusicObject),
309 GE(IID_IDirectMusicPatternTrack),
310 GE(IID_IDirectMusicPerformance),
311 GE(IID_IDirectMusicPerformance2),
312 GE(IID_IDirectMusicPerformance8),
313 GE(IID_IDirectMusicPort),
314 GE(IID_IDirectMusicPortDownload),
315 GE(IID_IDirectMusicScript),
316 GE(IID_IDirectMusicSegment),
317 GE(IID_IDirectMusicSegment2),
318 GE(IID_IDirectMusicSegment8),
319 GE(IID_IDirectMusicSegmentState),
320 GE(IID_IDirectMusicSegmentState8),
321 GE(IID_IDirectMusicStyle),
322 GE(IID_IDirectMusicStyle8),
323 GE(IID_IDirectMusicSynth),
324 GE(IID_IDirectMusicSynth8),
325 GE(IID_IDirectMusicSynthSink),
326 GE(IID_IDirectMusicThru),
327 GE(IID_IDirectMusicTool),
328 GE(IID_IDirectMusicTool8),
329 GE(IID_IDirectMusicTrack),
330 GE(IID_IDirectMusicTrack8),
333 GE(IID_IStream),
335 /* GUIDs */
336 GE(GUID_DirectMusicAllTypes),
337 GE(GUID_NOTIFICATION_CHORD),
338 GE(GUID_NOTIFICATION_COMMAND),
339 GE(GUID_NOTIFICATION_MEASUREANDBEAT),
340 GE(GUID_NOTIFICATION_PERFORMANCE),
341 GE(GUID_NOTIFICATION_RECOMPOSE),
342 GE(GUID_NOTIFICATION_SEGMENT),
343 GE(GUID_BandParam),
344 GE(GUID_ChordParam),
345 GE(GUID_CommandParam),
346 GE(GUID_CommandParam2),
347 GE(GUID_CommandParamNext),
348 GE(GUID_IDirectMusicBand),
349 GE(GUID_IDirectMusicChordMap),
350 GE(GUID_IDirectMusicStyle),
351 GE(GUID_MuteParam),
352 GE(GUID_Play_Marker),
353 GE(GUID_RhythmParam),
354 GE(GUID_TempoParam),
355 GE(GUID_TimeSignature),
356 GE(GUID_Valid_Start_Time),
357 GE(GUID_Clear_All_Bands),
358 GE(GUID_ConnectToDLSCollection),
359 GE(GUID_Disable_Auto_Download),
360 GE(GUID_DisableTempo),
361 GE(GUID_DisableTimeSig),
362 GE(GUID_Download),
363 GE(GUID_DownloadToAudioPath),
364 GE(GUID_Enable_Auto_Download),
365 GE(GUID_EnableTempo),
366 GE(GUID_EnableTimeSig),
368 GE(GUID_SeedVariations),
369 GE(GUID_StandardMIDIFile),
370 GE(GUID_Unload),
371 GE(GUID_UnloadFromAudioPath),
372 GE(GUID_Variations),
373 GE(GUID_PerfMasterTempo),
374 GE(GUID_PerfMasterVolume),
375 GE(GUID_PerfMasterGrooveLevel),
376 GE(GUID_PerfAutoDownload),
377 GE(GUID_DefaultGMCollection),
378 GE(GUID_Synth_Default),
379 GE(GUID_Buffer_Reverb),
380 GE(GUID_Buffer_EnvReverb),
381 GE(GUID_Buffer_Stereo),
382 GE(GUID_Buffer_3D_Dry),
383 GE(GUID_Buffer_Mono),
384 GE(GUID_DMUS_PROP_GM_Hardware),
385 GE(GUID_DMUS_PROP_GS_Capable),
386 GE(GUID_DMUS_PROP_GS_Hardware),
387 GE(GUID_DMUS_PROP_DLS1),
388 GE(GUID_DMUS_PROP_DLS2),
389 GE(GUID_DMUS_PROP_Effects),
390 GE(GUID_DMUS_PROP_INSTRUMENT2),
391 GE(GUID_DMUS_PROP_LegacyCaps),
392 GE(GUID_DMUS_PROP_MemorySize),
393 GE(GUID_DMUS_PROP_SampleMemorySize),
394 GE(GUID_DMUS_PROP_SamplePlaybackRate),
395 GE(GUID_DMUS_PROP_SetSynthSink),
396 GE(GUID_DMUS_PROP_SinkUsesDSound),
397 GE(GUID_DMUS_PROP_SynthSink_DSOUND),
398 GE(GUID_DMUS_PROP_SynthSink_WAVE),
399 GE(GUID_DMUS_PROP_Volume),
400 GE(GUID_DMUS_PROP_WavesReverb),
401 GE(GUID_DMUS_PROP_WriteLatency),
402 GE(GUID_DMUS_PROP_WritePeriod),
403 GE(GUID_DMUS_PROP_XG_Capable),
404 GE(GUID_DMUS_PROP_XG_Hardware)
405 };
406
407 unsigned int i;
408
409 if (!id) return "(null)";
410
411 for (i = 0; i < ARRAY_SIZE(guids); i++) {
412 if (IsEqualGUID(id, guids[i].guid))
413 return guids[i].name;
414 }
415 /* if we didn't find it, act like standard debugstr_guid */
416 return debugstr_guid(id);
417}
#define ARRAY_SIZE(A)
Definition: main.h:33
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define GE(x)
#define GUID_IgnoreBankSelectForGM
Definition: dmusici.h:181
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
Definition: name.c:39

Referenced by ClassFactory_CreateInstance(), DllGetClassObject(), dump_DMUS_OBJECTDESC(), IDirectMusic8Impl_CreatePort(), IDirectMusic8Impl_QueryInterface(), IDirectMusic8Impl_SetMasterClock(), IDirectMusicBufferImpl_QueryInterface(), IDirectMusicCollectionImpl_QueryInterface(), IDirectMusicDownloadedInstrumentImpl_QueryInterface(), IDirectMusicDownloadImpl_QueryInterface(), IDirectMusicInstrumentImpl_QueryInterface(), IPersistStreamImpl_Load(), IReferenceClockImpl_QueryInterface(), master_IReferenceClock_QueryInterface(), midi_IDirectMusicPort_QueryInterface(), SynthPortImpl_IDirectMusicPort_QueryInterface(), SynthPortImpl_IDirectMusicPortDownload_QueryInterface(), and SynthPortImpl_IDirectMusicThru_QueryInterface().

◆ debugstr_fourcc()

const char * debugstr_fourcc ( DWORD  fourcc)

Definition at line 219 of file dmusic_main.c.

219 {
220 if (!fourcc) return "'null'";
221 return wine_dbg_sprintf ("\'%c%c%c%c\'",
222 (char)(fourcc), (char)(fourcc >> 8),
223 (char)(fourcc >> 16), (char)(fourcc >> 24));
224}
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296

◆ DMUSIC_CreateDirectMusicBufferImpl()

HRESULT DMUSIC_CreateDirectMusicBufferImpl ( LPDMUS_BUFFERDESC  desc,
LPVOID ret_iface 
)

Definition at line 294 of file buffer.c.

295{
296 IDirectMusicBufferImpl* dmbuffer;
297
298 TRACE("(%p, %p)\n", desc, ret_iface);
299
300 *ret_iface = NULL;
301
303 if (!dmbuffer)
304 return E_OUTOFMEMORY;
305
307 dmbuffer->ref = 1;
308
309 if (IsEqualGUID(&desc->guidBufferFormat, &GUID_NULL))
311 else
312 dmbuffer->format = desc->guidBufferFormat;
313 dmbuffer->size = (desc->cbBuffer + 3) & ~3; /* Buffer size must be multiple of 4 bytes */
314
315 dmbuffer->data = HeapAlloc(GetProcessHeap(), 0, dmbuffer->size);
316 if (!dmbuffer->data) {
317 HeapFree(GetProcessHeap(), 0, dmbuffer);
318 return E_OUTOFMEMORY;
319 }
320
322 *ret_iface = &dmbuffer->IDirectMusicBuffer_iface;
323
324 return S_OK;
325}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
static const IDirectMusicBufferVtbl DirectMusicBuffer_Vtbl
Definition: buffer.c:275
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static void DMUSIC_LockModule(void)
#define S_OK
Definition: intsafe.h:52
#define GUID_NULL
Definition: ks.h:106
#define KSDATAFORMAT_SUBTYPE_MIDI
Definition: ksmedia.h:1016
static const WCHAR desc[]
Definition: protectdata.c:36
#define TRACE(s)
Definition: solgame.cpp:4
IDirectMusicBuffer IDirectMusicBuffer_iface

Referenced by IDirectMusic8Impl_CreateMusicBuffer().

◆ DMUSIC_CreateDirectMusicCollectionImpl()

HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl ( LPCGUID  lpcGUID,
LPVOID ppobj,
LPUNKNOWN  pUnkOuter 
)

Definition at line 530 of file collection.c.

531{
533 HRESULT hr;
534
535 *ppobj = NULL;
536 if (pUnkOuter)
538
540 if (!obj)
541 return E_OUTOFMEMORY;
542
543 obj->IDirectMusicCollection_iface.lpVtbl = &DirectMusicCollection_Collection_Vtbl;
544 obj->ref = 1;
545 dmobject_init(&obj->dmobj, &CLSID_DirectMusicCollection,
546 (IUnknown*)&obj->IDirectMusicCollection_iface);
547 obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
548 obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
549
550 list_init (&obj->Instruments);
551
553 hr = IDirectMusicCollection_QueryInterface(&obj->IDirectMusicCollection_iface, lpcGUID, ppobj);
554 IDirectMusicCollection_Release(&obj->IDirectMusicCollection_iface);
555
556 return hr;
557}
static void list_init(struct list_entry *head)
Definition: list.h:51
static const IDirectMusicCollectionVtbl DirectMusicCollection_Collection_Vtbl
Definition: collection.c:170
static const IDirectMusicObjectVtbl dmobject_vtbl
Definition: collection.c:210
static const IPersistStreamVtbl persiststream_vtbl
Definition: collection.c:518
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk)
Definition: dmobject.c:407
#define IDirectMusicCollection_QueryInterface(p, a, b)
Definition: dmusicc.h:575
#define IDirectMusicCollection_Release(p)
Definition: dmusicc.h:577
HRESULT hr
Definition: shlfolder.c:183
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ DMUSIC_CreateDirectMusicDownloadImpl()

HRESULT DMUSIC_CreateDirectMusicDownloadImpl ( LPCGUID  lpcGUID,
LPVOID ppobj,
LPUNKNOWN  pUnkOuter 
)

◆ DMUSIC_CreateDirectMusicImpl()

HRESULT WINAPI DMUSIC_CreateDirectMusicImpl ( LPCGUID  lpcGUID,
LPVOID ppobj,
LPUNKNOWN  pUnkOuter 
)

Definition at line 592 of file dmusic.c.

593{
594 IDirectMusic8Impl *dmusic;
595 HRESULT ret;
596
597 TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
598
599 *ret_iface = NULL;
600 if (unkouter)
602
604 if (!dmusic)
605 return E_OUTOFMEMORY;
606
607 dmusic->IDirectMusic8_iface.lpVtbl = &DirectMusic8_Vtbl;
608 dmusic->ref = 1;
610 if (FAILED(ret)) {
611 HeapFree(GetProcessHeap(), 0, dmusic);
612 return ret;
613 }
614
616
620
621 return ret;
622}
static const IDirectMusic8Vtbl DirectMusic8_Vtbl
Definition: dmusic.c:481
static HRESULT WINAPI IDirectMusic8Impl_QueryInterface(LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ret_iface)
Definition: dmusic.c:157
static HRESULT master_clock_create(IReferenceClock **clock)
Definition: dmusic.c:131
static void create_system_ports_list(IDirectMusic8Impl *object)
Definition: dmusic.c:497
#define IDirectMusic8_Release(p)
Definition: dmusicc.h:441
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
IReferenceClock * master_clock
IDirectMusic8 IDirectMusic8_iface
int ret

◆ DMUSIC_CreateDirectMusicInstrumentImpl()

HRESULT DMUSIC_CreateDirectMusicInstrumentImpl ( LPCGUID  lpcGUID,
LPVOID ppobj,
LPUNKNOWN  pUnkOuter 
)

Definition at line 123 of file instrument.c.

123 {
125 HRESULT hr;
126
128 if (NULL == dminst) {
129 *ppobj = NULL;
130 return E_OUTOFMEMORY;
131 }
133 dminst->ref = 1;
134
137 ppobj);
139
140 return hr;
141}
#define IDirectMusicInstrument_QueryInterface(p, a, b)
Definition: dmusicc.h:524
#define IDirectMusicInstrument_Release(p)
Definition: dmusicc.h:526
static const IDirectMusicInstrumentVtbl DirectMusicInstrument_Vtbl
Definition: instrument.c:113
IDirectMusicInstrument IDirectMusicInstrument_iface

Referenced by IPersistStreamImpl_Load().

◆ DMUSIC_CreateReferenceClockImpl()

HRESULT DMUSIC_CreateReferenceClockImpl ( LPCGUID  lpcGUID,
LPVOID ppobj,
LPUNKNOWN  pUnkOuter 
)

Definition at line 121 of file clock.c.

122{
124 HRESULT hr;
125
126 TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
127
129 if (!clock) {
130 *ret_iface = NULL;
131 return E_OUTOFMEMORY;
132 }
133
134 clock->IReferenceClock_iface.lpVtbl = &ReferenceClock_Vtbl;
135 clock->ref = 1;
136 clock->rtTime = 0;
137 clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
138
140 hr = IReferenceClockImpl_QueryInterface(&clock->IReferenceClock_iface, riid, ret_iface);
141 IReferenceClock_Release(&clock->IReferenceClock_iface);
142
143 return hr;
144}
static HRESULT WINAPI IReferenceClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
Definition: clock.c:31
static const IReferenceClockVtbl ReferenceClock_Vtbl
Definition: clock.c:110
DMUS_CLOCKINFO8 DMUS_CLOCKINFO
Definition: dmusicc.h:277
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23

Referenced by midi_port_create(), and synth_port_create().

◆ DMUSIC_LockModule()

◆ dmusic_remove_port()

void dmusic_remove_port ( IDirectMusic8Impl dmusic,
IDirectMusicPort *  port 
)

Definition at line 300 of file dmusic.c.

301{
302 BOOL found = FALSE;
303 int i;
304
305 TRACE("Removing port %p.\n", port);
306
307 for (i = 0; i < dmusic->num_ports; i++)
308 {
309 if (dmusic->ports[i] == port) {
310 found = TRUE;
311 break;
312 }
313 }
314
315 if (!found)
316 {
317 ERR("Port %p not found in ports array.\n", port);
318 return;
319 }
320
321 if (!--dmusic->num_ports) {
322 HeapFree(GetProcessHeap(), 0, dmusic->ports);
323 dmusic->ports = NULL;
324 return;
325 }
326
327 memmove(&dmusic->ports[i], &dmusic->ports[i + 1],
328 (dmusic->num_ports - i) * sizeof(*dmusic->ports));
329 dmusic->ports = HeapReAlloc(GetProcessHeap(), 0, dmusic->ports,
330 sizeof(*dmusic->ports) * dmusic->num_ports);
331}
#define ERR(fmt,...)
Definition: debug.h:110
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define HeapReAlloc
Definition: compat.h:734
USHORT port
Definition: uri.c:228
unsigned int BOOL
Definition: ntddk_ex.h:94
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
IDirectMusicPort ** ports

Referenced by SynthPortImpl_IDirectMusicPort_Release().

◆ DMUSIC_UnlockModule()

◆ dump_DMUS_OBJECTDESC()

void dump_DMUS_OBJECTDESC ( LPDMUS_OBJECTDESC  desc)

Definition at line 459 of file dmusic_main.c.

460{
461 TRACE("DMUS_OBJECTDESC (%p):\n", desc);
462 TRACE(" - dwSize = %d\n", desc->dwSize);
463 TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (desc->dwValidData));
464 if (desc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
465 if (desc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
466 if (desc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n");
467 if (desc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&desc->vVersion));
468 if (desc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(desc->wszName));
469 if (desc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
470 if (desc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
471 if (desc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s\n - pbMemData = %p\n",
472 wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
473 if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream);
474}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
static const char * debugstr_DMUS_OBJ_FLAGS(DWORD flagmask)
Definition: dmusic_main.c:440
static const char * debugstr_dmversion(const DMUS_VERSION *version)
Definition: dmusic_main.c:227
const char * debugstr_dmguid(const GUID *id)
Definition: dmusic_main.c:237
#define DMUS_OBJ_DATE
Definition: dmusici.h:273
#define DMUS_OBJ_MEMORY
Definition: dmusici.h:275
#define DMUS_OBJ_NAME
Definition: dmusici.h:267
#define DMUS_OBJ_STREAM
Definition: dmusici.h:276
#define DMUS_OBJ_FILENAME
Definition: dmusici.h:269
#define DMUS_OBJ_CLASS
Definition: dmusici.h:266
#define DMUS_OBJ_VERSION
Definition: dmusici.h:272
#define DMUS_OBJ_CATEGORY
Definition: dmusici.h:268
#define DMUS_OBJ_OBJECT
Definition: dmusici.h:265
#define debugstr_w
Definition: kernel32.h:32

Referenced by col_IDirectMusicObject_ParseDescriptor(), and IPersistStreamImpl_Load().

◆ dump_DMUS_PORTPARAMS()

void dump_DMUS_PORTPARAMS ( LPDMUS_PORTPARAMS  params)

Definition at line 491 of file dmusic_main.c.

492{
493 TRACE("DMUS_PORTPARAMS (%p):\n", params);
494 TRACE(" - dwSize = %d\n", params->dwSize);
495 TRACE(" - dwValidParams = %s\n", debugstr_DMUS_PORTPARAMS_FLAGS(params->dwValidParams));
496 if (params->dwValidParams & DMUS_PORTPARAMS_VOICES) TRACE(" - dwVoices = %u\n", params->dwVoices);
497 if (params->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) TRACE(" - dwChannelGroup = %u\n", params->dwChannelGroups);
498 if (params->dwValidParams & DMUS_PORTPARAMS_AUDIOCHANNELS) TRACE(" - dwAudioChannels = %u\n", params->dwAudioChannels);
499 if (params->dwValidParams & DMUS_PORTPARAMS_SAMPLERATE) TRACE(" - dwSampleRate = %u\n", params->dwSampleRate);
500 if (params->dwValidParams & DMUS_PORTPARAMS_EFFECTS) TRACE(" - dwEffectFlags = %x\n", params->dwEffectFlags);
501 if (params->dwValidParams & DMUS_PORTPARAMS_SHARE) TRACE(" - fShare = %u\n", params->fShare);
502}
static const char * debugstr_DMUS_PORTPARAMS_FLAGS(DWORD flagmask)
Definition: dmusic_main.c:477
#define DMUS_PORTPARAMS_CHANNELGROUPS
Definition: dmusicc.h:205
#define DMUS_PORTPARAMS_SAMPLERATE
Definition: dmusicc.h:207
#define DMUS_PORTPARAMS_AUDIOCHANNELS
Definition: dmusicc.h:206
#define DMUS_PORTPARAMS_SHARE
Definition: dmusicc.h:209
#define DMUS_PORTPARAMS_VOICES
Definition: dmusicc.h:204
#define DMUS_PORTPARAMS_EFFECTS
Definition: dmusicc.h:208
GLenum const GLfloat * params
Definition: glext.h:5645

Referenced by IDirectMusic8Impl_CreatePort().

◆ even_or_odd()

int even_or_odd ( DWORD  number)

Definition at line 214 of file dmusic_main.c.

214 {
215 return (number & 0x1); /* basically, check if bit 0 is set ;) */
216}
static unsigned int number
Definition: dsound.c:1479

Referenced by IPersistStreamImpl_Load().

◆ IDirectMusicInstrumentImpl_CustomLoad()

HRESULT IDirectMusicInstrumentImpl_CustomLoad ( IDirectMusicInstrument *  iface,
IStream stream 
)

Definition at line 291 of file instrument.c.

292{
294 HRESULT hr;
296 ULONG i = 0;
297 ULONG length = This->length;
298
299 TRACE("(%p, %p): offset = 0x%s, length = %u)\n", This, stream, wine_dbgstr_longlong(This->liInstrumentPosition.QuadPart), This->length);
300
301 if (This->loaded)
302 return S_OK;
303
304 hr = IStream_Seek(stream, This->liInstrumentPosition, STREAM_SEEK_SET, NULL);
305 if (FAILED(hr))
306 {
307 WARN("IStream_Seek failed: %08x\n", hr);
309 }
310
311 This->regions = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->regions) * This->header.cRegions);
312 if (!This->regions)
313 return E_OUTOFMEMORY;
314
315 while (length)
316 {
317 hr = read_from_stream(stream, &chunk, sizeof(chunk));
318 if (FAILED(hr))
319 goto error;
320
321 length = subtract_bytes(length, sizeof(chunk) + chunk.dwSize);
322
323 switch (chunk.fccID)
324 {
325 case FOURCC_INSH:
326 case FOURCC_DLID:
327 TRACE("Chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
328
329 /* Instrument header and id are already set so just skip */
330 hr = advance_stream(stream, chunk.dwSize);
331 if (FAILED(hr))
332 goto error;
333
334 break;
335
336 case FOURCC_LIST: {
337 DWORD size = chunk.dwSize;
338
339 TRACE("LIST chunk: %u bytes\n", chunk.dwSize);
340
341 hr = read_from_stream(stream, &chunk.fccID, sizeof(chunk.fccID));
342 if (FAILED(hr))
343 goto error;
344
345 size = subtract_bytes(size, sizeof(chunk.fccID));
346
347 switch (chunk.fccID)
348 {
349 case FOURCC_LRGN:
350 TRACE("LRGN chunk (regions list): %u bytes\n", size);
351
352 while (size)
353 {
354 hr = read_from_stream(stream, &chunk, sizeof(chunk));
355 if (FAILED(hr))
356 goto error;
357
358 if (chunk.fccID != FOURCC_LIST)
359 {
360 TRACE("Unknown chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
361 goto error;
362 }
363
364 hr = read_from_stream(stream, &chunk.fccID, sizeof(chunk.fccID));
365 if (FAILED(hr))
366 goto error;
367
368 if (chunk.fccID == FOURCC_RGN)
369 {
370 TRACE("RGN chunk (region): %u bytes\n", chunk.dwSize);
371 hr = load_region(This, stream, &This->regions[i++], chunk.dwSize - sizeof(chunk.fccID));
372 }
373 else
374 {
375 TRACE("Unknown chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
376 hr = advance_stream(stream, chunk.dwSize - sizeof(chunk.fccID));
377 }
378 if (FAILED(hr))
379 goto error;
380
381 size = subtract_bytes(size, chunk.dwSize + sizeof(chunk));
382 }
383 break;
384
385 case FOURCC_LART:
386 TRACE("LART chunk (articulations list): %u bytes\n", size);
387
388 while (size)
389 {
390 hr = read_from_stream(stream, &chunk, sizeof(chunk));
391 if (FAILED(hr))
392 goto error;
393
394 if (chunk.fccID == FOURCC_ART1)
395 {
396 TRACE("ART1 chunk (level 1 articulation): %u bytes\n", chunk.dwSize);
398 }
399 else
400 {
401 TRACE("Unknown chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
402 hr = advance_stream(stream, chunk.dwSize);
403 }
404 if (FAILED(hr))
405 goto error;
406
407 size = subtract_bytes(size, chunk.dwSize + sizeof(chunk));
408 }
409 break;
410
411 default:
412 TRACE("Unknown chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
413
414 hr = advance_stream(stream, chunk.dwSize - sizeof(chunk.fccID));
415 if (FAILED(hr))
416 goto error;
417
418 size = subtract_bytes(size, chunk.dwSize - sizeof(chunk.fccID));
419 break;
420 }
421 break;
422 }
423
424 default:
425 TRACE("Unknown chunk %s: %u bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize);
426
427 hr = advance_stream(stream, chunk.dwSize);
428 if (FAILED(hr))
429 goto error;
430
431 break;
432 }
433 }
434
435 This->loaded = TRUE;
436
437 return S_OK;
438
439error:
440 HeapFree(GetProcessHeap(), 0, This->regions);
441 This->regions = NULL;
442
444}
#define WARN(fmt,...)
Definition: debug.h:112
#define FOURCC_RGN
Definition: dls1.h:44
#define FOURCC_LART
Definition: dls1.h:46
#define FOURCC_LRGN
Definition: dls1.h:43
#define FOURCC_DLID
Definition: dls1.h:34
#define FOURCC_INSH
Definition: dls1.h:42
#define FOURCC_ART1
Definition: dls1.h:47
#define DMUS_E_UNSUPPORTED_STREAM
Definition: dmerror.h:101
static IDirectMusicInstrumentImpl * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
static DWORD subtract_bytes(DWORD len, DWORD bytes)
Definition: instrument.c:161
static HRESULT advance_stream(IStream *stream, ULONG bytes)
Definition: instrument.c:170
static HRESULT load_articulation(IDirectMusicInstrumentImpl *This, IStream *stream, ULONG length)
Definition: instrument.c:254
static HRESULT load_region(IDirectMusicInstrumentImpl *This, IStream *stream, instrument_region *region, ULONG length)
Definition: instrument.c:184
static HRESULT read_from_stream(IStream *stream, void *data, ULONG size)
Definition: instrument.c:143
#define error(str)
Definition: mkdosfs.c:1605
#define FOURCC_LIST
Definition: mmsystem.h:565
static const char * debugstr_fourcc(DWORD fourcc)
Definition: parsing.c:85
Definition: parse.h:23
uint32_t ULONG
Definition: typedefs.h:59

Referenced by IDirectMusicCollectionImpl_GetInstrument().

◆ impl_from_IDirectMusicInstrument()

◆ midi_in_port_create()

HRESULT midi_in_port_create ( IDirectMusic8Impl parent,
DMUS_PORTPARAMS port_params,
DMUS_PORTCAPS port_caps,
IDirectMusicPort **  port 
)

Definition at line 1209 of file port.c.

1211{
1212 TRACE("(%p, %p, %p, %p)\n", parent, params, caps, port);
1213
1214 return midi_port_create(parent, params, caps, port);
1215}
static HRESULT midi_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, DMUS_PORTCAPS *caps, IDirectMusicPort **port)
Definition: port.c:1177
r parent
Definition: btrfs.c:3010

Referenced by create_system_ports_list().

◆ midi_out_port_create()

HRESULT midi_out_port_create ( IDirectMusic8Impl parent,
DMUS_PORTPARAMS port_params,
DMUS_PORTCAPS port_caps,
IDirectMusicPort **  port 
)

Definition at line 1201 of file port.c.

1203{
1204 TRACE("(%p, %p, %p, %p)\n", parent, params, caps, port);
1205
1206 return midi_port_create(parent, params, caps, port);
1207}

Referenced by create_system_ports_list().

◆ MIDILOCALE2Patch()

DWORD MIDILOCALE2Patch ( const MIDILOCALE pLocale)

Definition at line 195 of file dmusic_main.c.

195 {
196 DWORD dwPatch = 0;
197 if (!pLocale) return 0;
198 dwPatch |= (pLocale->ulBank & F_INSTRUMENT_DRUMS); /* set drum bit */
199 dwPatch |= ((pLocale->ulBank & 0x00007F7F) << 8); /* set MIDI bank location */
200 dwPatch |= (pLocale->ulInstrument & 0x0000007F); /* set PC value */
201 return dwPatch;
202}
#define F_INSTRUMENT_DRUMS
Definition: dls1.h:51
ULONG ulInstrument
Definition: dls1.h:97
ULONG ulBank
Definition: dls1.h:96

Referenced by IDirectMusicInstrumentImpl_GetPatch(), IPersistStreamImpl_Load(), and SynthPortImpl_IDirectMusicPort_DownloadInstrument().

◆ Patch2MIDILOCALE()

void Patch2MIDILOCALE ( DWORD  dwPatch,
LPMIDILOCALE  pLocale 
)

Definition at line 205 of file dmusic_main.c.

205 {
206 memset (pLocale, 0, sizeof(MIDILOCALE));
207
208 pLocale->ulInstrument = (dwPatch & 0x7F); /* get PC value */
209 pLocale->ulBank = ((dwPatch & 0x007F7F00) >> 8); /* get MIDI bank location */
210 pLocale->ulBank |= (dwPatch & F_INSTRUMENT_DRUMS); /* get drum bit */
211}
#define memset(x, y, z)
Definition: compat.h:39

Referenced by IDirectMusicInstrumentImpl_SetPatch().

◆ synth_port_create()

HRESULT synth_port_create ( IDirectMusic8Impl parent,
DMUS_PORTPARAMS port_params,
DMUS_PORTCAPS port_caps,
IDirectMusicPort **  port 
)

Internal factory

Definition at line 814 of file port.c.

816{
818 HRESULT hr = E_FAIL;
819 int i;
820
821 TRACE("(%p, %p, %p)\n", port_params, port_caps, port);
822
823 *port = NULL;
824
826 if (!obj)
827 return E_OUTOFMEMORY;
828
829 obj->IDirectMusicPort_iface.lpVtbl = &SynthPortImpl_DirectMusicPort_Vtbl;
830 obj->IDirectMusicPortDownload_iface.lpVtbl = &SynthPortImpl_DirectMusicPortDownload_Vtbl;
831 obj->IDirectMusicThru_iface.lpVtbl = &SynthPortImpl_DirectMusicThru_Vtbl;
832 obj->IKsControl_iface.lpVtbl = &ikscontrol_vtbl;
833 obj->ref = 1;
834 obj->parent = parent;
835 obj->active = FALSE;
836 obj->params = *port_params;
837 obj->caps = *port_caps;
838
839 hr = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (LPVOID*)&obj->pLatencyClock, NULL);
840 if (hr != S_OK)
841 {
843 return hr;
844 }
845
846 if (SUCCEEDED(hr))
847 hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (void**)&obj->synth);
848
849 if (SUCCEEDED(hr))
850 hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (void**)&obj->synth_sink);
851
852 if (SUCCEEDED(hr))
853 hr = IDirectMusicSynth_SetMasterClock(obj->synth, obj->pLatencyClock);
854
855 if (SUCCEEDED(hr))
856 hr = IDirectMusicSynthSink_SetMasterClock(obj->synth_sink, obj->pLatencyClock);
857
858 if (SUCCEEDED(hr))
859 hr = IDirectMusicSynth_SetSynthSink(obj->synth, obj->synth_sink);
860
861 if (SUCCEEDED(hr))
862 hr = IDirectMusicSynth_Open(obj->synth, port_params);
863
864 if (0)
865 {
866 if (port_params->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) {
867 obj->nrofgroups = port_params->dwChannelGroups;
868 /* Setting default priorities */
869 for (i = 0; i < obj->nrofgroups; i++) {
870 TRACE ("Setting default channel priorities on channel group %i\n", i + 1);
871 obj->group[i].channel[0].priority = DAUD_CHAN1_DEF_VOICE_PRIORITY;
872 obj->group[i].channel[1].priority = DAUD_CHAN2_DEF_VOICE_PRIORITY;
873 obj->group[i].channel[2].priority = DAUD_CHAN3_DEF_VOICE_PRIORITY;
874 obj->group[i].channel[3].priority = DAUD_CHAN4_DEF_VOICE_PRIORITY;
875 obj->group[i].channel[4].priority = DAUD_CHAN5_DEF_VOICE_PRIORITY;
876 obj->group[i].channel[5].priority = DAUD_CHAN6_DEF_VOICE_PRIORITY;
877 obj->group[i].channel[6].priority = DAUD_CHAN7_DEF_VOICE_PRIORITY;
878 obj->group[i].channel[7].priority = DAUD_CHAN8_DEF_VOICE_PRIORITY;
879 obj->group[i].channel[8].priority = DAUD_CHAN9_DEF_VOICE_PRIORITY;
880 obj->group[i].channel[9].priority = DAUD_CHAN10_DEF_VOICE_PRIORITY;
881 obj->group[i].channel[10].priority = DAUD_CHAN11_DEF_VOICE_PRIORITY;
882 obj->group[i].channel[11].priority = DAUD_CHAN12_DEF_VOICE_PRIORITY;
883 obj->group[i].channel[12].priority = DAUD_CHAN13_DEF_VOICE_PRIORITY;
884 obj->group[i].channel[13].priority = DAUD_CHAN14_DEF_VOICE_PRIORITY;
885 obj->group[i].channel[14].priority = DAUD_CHAN15_DEF_VOICE_PRIORITY;
886 obj->group[i].channel[15].priority = DAUD_CHAN16_DEF_VOICE_PRIORITY;
887 }
888 }
889 }
890
891 if (SUCCEEDED(hr)) {
892 *port = &obj->IDirectMusicPort_iface;
893 return S_OK;
894 }
895
896 if (obj->synth)
898 if (obj->synth_sink)
900 if (obj->pLatencyClock)
901 IReferenceClock_Release(obj->pLatencyClock);
903
904 return hr;
905}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
Definition: clock.c:121
static const IDirectMusicThruVtbl SynthPortImpl_DirectMusicThru_Vtbl
Definition: port.c:736
static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl
Definition: port.c:572
static const IDirectMusicPortDownloadVtbl SynthPortImpl_DirectMusicPortDownload_Vtbl
Definition: port.c:683
static const IKsControlVtbl ikscontrol_vtbl
Definition: port.c:805
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define IDirectMusicSynth_Release(p)
Definition: dmusics.h:108
#define IDirectMusicSynth_SetSynthSink(p, a)
Definition: dmusics.h:121
#define IDirectMusicSynthSink_Release(p)
Definition: dmusics.h:225
#define IDirectMusicSynth_Open(p, a)
Definition: dmusics.h:110
#define IDirectMusicSynth_SetMasterClock(p, a)
Definition: dmusics.h:118
#define IDirectMusicSynthSink_SetMasterClock(p, a)
Definition: dmusics.h:228
#define DAUD_CHAN16_DEF_VOICE_PRIORITY
Definition: dmusprop.h:182
#define DAUD_CHAN4_DEF_VOICE_PRIORITY
Definition: dmusprop.h:170
#define DAUD_CHAN13_DEF_VOICE_PRIORITY
Definition: dmusprop.h:179
#define DAUD_CHAN9_DEF_VOICE_PRIORITY
Definition: dmusprop.h:175
#define DAUD_CHAN14_DEF_VOICE_PRIORITY
Definition: dmusprop.h:180
#define DAUD_CHAN5_DEF_VOICE_PRIORITY
Definition: dmusprop.h:171
#define DAUD_CHAN7_DEF_VOICE_PRIORITY
Definition: dmusprop.h:173
#define DAUD_CHAN6_DEF_VOICE_PRIORITY
Definition: dmusprop.h:172
#define DAUD_CHAN10_DEF_VOICE_PRIORITY
Definition: dmusprop.h:176
#define DAUD_CHAN8_DEF_VOICE_PRIORITY
Definition: dmusprop.h:174
#define DAUD_CHAN3_DEF_VOICE_PRIORITY
Definition: dmusprop.h:169
#define DAUD_CHAN1_DEF_VOICE_PRIORITY
Definition: dmusprop.h:167
#define DAUD_CHAN2_DEF_VOICE_PRIORITY
Definition: dmusprop.h:168
#define DAUD_CHAN15_DEF_VOICE_PRIORITY
Definition: dmusprop.h:181
#define DAUD_CHAN11_DEF_VOICE_PRIORITY
Definition: dmusprop.h:177
#define DAUD_CHAN12_DEF_VOICE_PRIORITY
Definition: dmusprop.h:178
#define SUCCEEDED(hr)
Definition: intsafe.h:50
DWORD dwValidParams
Definition: dmusicc.h:315
DWORD dwChannelGroups
Definition: dmusicc.h:317

Referenced by create_system_ports_list().

Variable Documentation

◆ DECLSPEC_HIDDEN

LONG DMUSIC_refCount DECLSPEC_HIDDEN
extern

Definition at line 289 of file d3dcompiler_private.h.