ReactOS  0.4.14-dev-77-gd9e7c48
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 "wine/unicode.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 251 of file dmusic_private.h.

◆ GE

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

Definition at line 252 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 51 of file dmusic_private.h.

◆ IDirectMusicBufferImpl

◆ IDirectMusicDownloadedInstrumentImpl

◆ IDirectMusicDownloadImpl

◆ IDirectMusicInstrumentImpl

◆ instrument_articulation

◆ instrument_region

◆ IReferenceClockImpl

Definition at line 55 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),
331  GE(IID_IUnknown),
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 }
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
const GUID * guid
#define GUID_IgnoreBankSelectForGM
Definition: dmusici.h:181
#define debugstr_guid
Definition: kernel32.h:35
#define GE(x)
const GUID IID_IUnknown
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
Definition: name.c:36
const GUID IID_IClassFactory

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(), midi_IDirectMusicPort_QueryInterface(), SynthPortImpl_IDirectMusicPort_QueryInterface(), SynthPortImpl_IDirectMusicPortDownload_QueryInterface(), and SynthPortImpl_IDirectMusicThru_QueryInterface().

◆ debugstr_fourcc()

const char* debugstr_fourcc ( DWORD  fourcc)

Definition at line 221 of file dmusic_main.c.

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

◆ 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))
310  dmbuffer->format = KSDATAFORMAT_SUBTYPE_MIDI;
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
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const GUID KSDATAFORMAT_SUBTYPE_MIDI
Definition: sup.c:36
#define GUID_NULL
Definition: ks.h:106
#define S_OK
Definition: intsafe.h:59
IDirectMusicBuffer IDirectMusicBuffer_iface
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const IDirectMusicBufferVtbl DirectMusicBuffer_Vtbl
Definition: buffer.c:275
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by IDirectMusic8Impl_CreateMusicBuffer().

◆ DMUSIC_CreateDirectMusicCollectionImpl()

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

Definition at line 536 of file collection.c.

537 {
539  HRESULT hr;
540 
541  *ppobj = NULL;
542  if (pUnkOuter)
543  return CLASS_E_NOAGGREGATION;
544 
546  if (!obj)
547  return E_OUTOFMEMORY;
548 
549  obj->IDirectMusicCollection_iface.lpVtbl = &DirectMusicCollection_Collection_Vtbl;
550  obj->ref = 1;
551  dmobject_init(&obj->dmobj, &CLSID_DirectMusicCollection,
552  (IUnknown*)&obj->IDirectMusicCollection_iface);
553  obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
554  obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
555 
556  list_init (&obj->Instruments);
557 
559  hr = IDirectMusicCollection_QueryInterface(&obj->IDirectMusicCollection_iface, lpcGUID, ppobj);
560  IDirectMusicCollection_Release(&obj->IDirectMusicCollection_iface);
561 
562  return hr;
563 }
HRESULT hr
Definition: shlfolder.c:183
static const IDirectMusicCollectionVtbl DirectMusicCollection_Collection_Vtbl
Definition: collection.c:170
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
#define IDirectMusicCollection_QueryInterface(p, a, b)
Definition: dmusicc.h:575
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk)
Definition: dmobject.c:407
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define IDirectMusicCollection_Release(p)
Definition: dmusicc.h:577
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
static const IPersistStreamVtbl persiststream_vtbl
Definition: collection.c:524
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static const IDirectMusicObjectVtbl dmobject_vtbl
Definition: collection.c:210

◆ 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 469 of file dmusic.c.

470 {
471  IDirectMusic8Impl *dmusic;
472  HRESULT ret;
473 
474  TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
475 
476  *ret_iface = NULL;
477  if (unkouter)
478  return CLASS_E_NOAGGREGATION;
479 
481  if (!dmusic)
482  return E_OUTOFMEMORY;
483 
484  dmusic->IDirectMusic8_iface.lpVtbl = &DirectMusic8_Vtbl;
485  dmusic->ref = 1;
486  ret = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (void **)&dmusic->master_clock, NULL);
487  if (FAILED(ret)) {
488  HeapFree(GetProcessHeap(), 0, dmusic);
489  return ret;
490  }
491 
492  create_system_ports_list(dmusic);
493 
497 
498  return ret;
499 }
static HRESULT WINAPI IDirectMusic8Impl_QueryInterface(LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ret_iface)
Definition: dmusic.c:34
REFIID riid
Definition: precomp.h:44
#define IDirectMusic8_Release(p)
Definition: dmusicc.h:441
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
static const IDirectMusic8Vtbl DirectMusic8_Vtbl
Definition: dmusic.c:358
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
IDirectMusic8 IDirectMusic8_iface
IReferenceClockImpl * master_clock
#define HeapFree(x, y, z)
Definition: compat.h:394
static void create_system_ports_list(IDirectMusic8Impl *object)
Definition: dmusic.c:374
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
Definition: clock.c:121

◆ 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 }
static const IDirectMusicInstrumentVtbl DirectMusicInstrument_Vtbl
Definition: instrument.c:113
HRESULT hr
Definition: shlfolder.c:183
#define IDirectMusicInstrument_Release(p)
Definition: dmusicc.h:526
IDirectMusicInstrument IDirectMusicInstrument_iface
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
#define IDirectMusicInstrument_QueryInterface(p, a, b)
Definition: dmusicc.h:524
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

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 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
DMUS_CLOCKINFO8 DMUS_CLOCKINFO
Definition: dmusicc.h:277
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
static const IReferenceClockVtbl ReferenceClock_Vtbl
Definition: clock.c:110
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI IReferenceClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
Definition: clock.c:31
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
clock_t clock(void)
Definition: clock.c:23
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by DMUSIC_CreateDirectMusicImpl(), midi_port_create(), and synth_port_create().

◆ DMUSIC_LockModule()

◆ dmusic_remove_port()

void dmusic_remove_port ( IDirectMusic8Impl dmusic,
IDirectMusicPort *  port 
)

Definition at line 177 of file dmusic.c.

178 {
179  BOOL found = FALSE;
180  int i;
181 
182  TRACE("Removing port %p.\n", port);
183 
184  for (i = 0; i < dmusic->num_ports; i++)
185  {
186  if (dmusic->ports[i] == port) {
187  found = TRUE;
188  break;
189  }
190  }
191 
192  if (!found)
193  {
194  ERR("Port %p not found in ports array.\n", port);
195  return;
196  }
197 
198  if (!--dmusic->num_ports) {
199  HeapFree(GetProcessHeap(), 0, dmusic->ports);
200  dmusic->ports = NULL;
201  return;
202  }
203 
204  memmove(&dmusic->ports[i], &dmusic->ports[i + 1],
205  (dmusic->num_ports - i) * sizeof(*dmusic->ports));
206  dmusic->ports = HeapReAlloc(GetProcessHeap(), 0, dmusic->ports,
207  sizeof(*dmusic->ports) * dmusic->num_ports);
208 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define TRUE
Definition: types.h:120
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
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define ERR(fmt,...)
Definition: debug.h:109
IDirectMusicPort ** ports
#define HeapReAlloc
Definition: compat.h:393
USHORT port
Definition: uri.c:227
#define HeapFree(x, y, z)
Definition: compat.h:394

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 }
const char * debugstr_dmguid(const GUID *id)
Definition: dmusic_main.c:237
#define DMUS_OBJ_NAME
Definition: dmusici.h:267
#define DMUS_OBJ_FILENAME
Definition: dmusici.h:269
static const char * debugstr_dmversion(const DMUS_VERSION *version)
Definition: dmusic_main.c:229
static const char * debugstr_DMUS_OBJ_FLAGS(DWORD flagmask)
Definition: dmusic_main.c:440
#define debugstr_w
Definition: kernel32.h:32
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define DMUS_OBJ_OBJECT
Definition: dmusici.h:265
#define DMUS_OBJ_MEMORY
Definition: dmusici.h:275
#define DMUS_OBJ_DATE
Definition: dmusici.h:273
#define DMUS_OBJ_CATEGORY
Definition: dmusici.h:268
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
#define DMUS_OBJ_VERSION
Definition: dmusici.h:272
#define DMUS_OBJ_CLASS
Definition: dmusici.h:266
#define DMUS_OBJ_STREAM
Definition: dmusici.h:276

Referenced by col_IDirectMusicObject_ParseDescriptor().

◆ 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 }
#define DMUS_PORTPARAMS_EFFECTS
Definition: dmusicc.h:208
#define DMUS_PORTPARAMS_CHANNELGROUPS
Definition: dmusicc.h:205
GLenum const GLfloat * params
Definition: glext.h:5645
#define TRACE(s)
Definition: solgame.cpp:4
#define DMUS_PORTPARAMS_AUDIOCHANNELS
Definition: dmusicc.h:206
#define DMUS_PORTPARAMS_VOICES
Definition: dmusicc.h:204
#define DMUS_PORTPARAMS_SHARE
Definition: dmusicc.h:209
static const char * debugstr_DMUS_PORTPARAMS_FLAGS(DWORD flagmask)
Definition: dmusic_main.c:477
#define DMUS_PORTPARAMS_SAMPLERATE
Definition: dmusicc.h:207

Referenced by IDirectMusic8Impl_CreatePort().

◆ even_or_odd()

int even_or_odd ( DWORD  number)

Definition at line 216 of file dmusic_main.c.

216  {
217  return (number & 0x1); /* basically, check if bit 0 is set ;) */
218 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
static size_t double number
Definition: printf.c:64

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);
397  hr = load_articulation(This, stream, 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 
439 error:
440  HeapFree(GetProcessHeap(), 0, This->regions);
441  This->regions = NULL;
442 
444 }
static IDirectMusicInstrumentImpl * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
#define TRUE
Definition: types.h:120
#define FOURCC_LRGN
Definition: dls1.h:43
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define WARN(fmt,...)
Definition: debug.h:111
#define DMUS_E_UNSUPPORTED_STREAM
Definition: dmerror.h:101
#define FOURCC_ART1
Definition: dls1.h:47
#define FOURCC_LART
Definition: dls1.h:46
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT advance_stream(IStream *stream, ULONG bytes)
Definition: instrument.c:170
#define FOURCC_DLID
Definition: dls1.h:34
static const char * debugstr_fourcc(DWORD fourcc)
Definition: parsing.c:86
smooth NULL
Definition: ftsmooth.c:416
#define FOURCC_RGN
Definition: dls1.h:44
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
#define FOURCC_LIST
Definition: mmsystem.h:565
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT load_region(IDirectMusicInstrumentImpl *This, IStream *stream, instrument_region *region, ULONG length)
Definition: instrument.c:184
static DWORD subtract_bytes(DWORD len, DWORD bytes)
Definition: instrument.c:161
Definition: parse.h:22
#define S_OK
Definition: intsafe.h:59
static HRESULT load_articulation(IDirectMusicInstrumentImpl *This, IStream *stream, ULONG length)
Definition: instrument.c:254
unsigned int ULONG
Definition: retypes.h:1
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
#define HeapFree(x, y, z)
Definition: compat.h:394
static HRESULT read_from_stream(IStream *stream, void *data, ULONG size)
Definition: instrument.c:143
#define FOURCC_INSH
Definition: dls1.h:42

Referenced by IDirectMusicCollectionImpl_GetInstrument().

◆ impl_from_IDirectMusicInstrument()

static IDirectMusicInstrumentImpl* impl_from_IDirectMusicInstrument ( IDirectMusicInstrument *  iface)
inlinestatic

Definition at line 213 of file dmusic_private.h.

214 {
215  return CONTAINING_RECORD(iface, IDirectMusicInstrumentImpl, IDirectMusicInstrument_iface);
216 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDirectMusicCollectionImpl_EnumInstrument(), IDirectMusicInstrumentImpl_AddRef(), IDirectMusicInstrumentImpl_CustomLoad(), IDirectMusicInstrumentImpl_GetPatch(), IDirectMusicInstrumentImpl_Release(), IDirectMusicInstrumentImpl_SetPatch(), IPersistStreamImpl_Load(), and SynthPortImpl_IDirectMusicPort_DownloadInstrument().

◆ 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 }
GLenum const GLfloat * params
Definition: glext.h:5645
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2897
static HRESULT midi_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, DMUS_PORTCAPS *caps, IDirectMusicPort **port)
Definition: port.c:1177
USHORT port
Definition: uri.c:227

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 }
GLenum const GLfloat * params
Definition: glext.h:5645
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2897
static HRESULT midi_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, DMUS_PORTCAPS *caps, IDirectMusicPort **port)
Definition: port.c:1177
USHORT port
Definition: uri.c:227

Referenced by create_system_ports_list().

◆ MIDILOCALE2Patch()

DWORD MIDILOCALE2Patch ( const MIDILOCALE pLocale)

Definition at line 197 of file dmusic_main.c.

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

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

◆ Patch2MIDILOCALE()

void Patch2MIDILOCALE ( DWORD  dwPatch,
LPMIDILOCALE  pLocale 
)

Definition at line 207 of file dmusic_main.c.

207  {
208  memset (pLocale, 0, sizeof(MIDILOCALE));
209 
210  pLocale->ulInstrument = (dwPatch & 0x7F); /* get PC value */
211  pLocale->ulBank = ((dwPatch & 0x007F7F00) >> 8); /* get MIDI bank location */
212  pLocale->ulBank |= (dwPatch & F_INSTRUMENT_DRUMS); /* get drum bit */
213 }
ULONG ulInstrument
Definition: dls1.h:97
ULONG ulBank
Definition: dls1.h:96
#define F_INSTRUMENT_DRUMS
Definition: dls1.h:51
#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  {
842  HeapFree(GetProcessHeap(), 0, obj);
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)
899  IDirectMusicSynthSink_Release(obj->synth_sink);
900  if (obj->pLatencyClock)
901  IReferenceClock_Release(obj->pLatencyClock);
902  HeapFree(GetProcessHeap(), 0, obj);
903 
904  return hr;
905 }
#define DAUD_CHAN5_DEF_VOICE_PRIORITY
Definition: dmusprop.h:171
static const IDirectMusicThruVtbl SynthPortImpl_DirectMusicThru_Vtbl
Definition: port.c:736
static const IKsControlVtbl ikscontrol_vtbl
Definition: port.c:805
HRESULT hr
Definition: shlfolder.c:183
#define DMUS_PORTPARAMS_CHANNELGROUPS
Definition: dmusicc.h:205
#define DAUD_CHAN7_DEF_VOICE_PRIORITY
Definition: dmusprop.h:173
#define DAUD_CHAN16_DEF_VOICE_PRIORITY
Definition: dmusprop.h:182
DWORD dwChannelGroups
Definition: dmusicc.h:317
#define E_FAIL
Definition: ddrawi.h:102
#define IDirectMusicSynthSink_Release(p)
Definition: dmusics.h:225
DWORD dwValidParams
Definition: dmusicc.h:315
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
#define DAUD_CHAN15_DEF_VOICE_PRIORITY
Definition: dmusprop.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 DAUD_CHAN3_DEF_VOICE_PRIORITY
Definition: dmusprop.h:169
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirectMusicSynthSink_SetMasterClock(p, a)
Definition: dmusics.h:228
#define IDirectMusicSynth_Open(p, a)
Definition: dmusics.h:110
smooth NULL
Definition: ftsmooth.c:416
#define DAUD_CHAN11_DEF_VOICE_PRIORITY
Definition: dmusprop.h:177
#define DAUD_CHAN1_DEF_VOICE_PRIORITY
Definition: dmusprop.h:167
#define DAUD_CHAN14_DEF_VOICE_PRIORITY
Definition: dmusprop.h:180
#define TRACE(s)
Definition: solgame.cpp:4
#define DAUD_CHAN10_DEF_VOICE_PRIORITY
Definition: dmusprop.h:176
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2897
LONG HRESULT
Definition: typedefs.h:77
static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl
Definition: port.c:572
#define DAUD_CHAN9_DEF_VOICE_PRIORITY
Definition: dmusprop.h:175
#define IDirectMusicSynth_SetSynthSink(p, a)
Definition: dmusics.h:121
#define DAUD_CHAN2_DEF_VOICE_PRIORITY
Definition: dmusprop.h:168
#define DAUD_CHAN8_DEF_VOICE_PRIORITY
Definition: dmusprop.h:174
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define IDirectMusicSynth_Release(p)
Definition: dmusics.h:108
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDirectMusicSynth_SetMasterClock(p, a)
Definition: dmusics.h:118
USHORT port
Definition: uri.c:227
static const IDirectMusicPortDownloadVtbl SynthPortImpl_DirectMusicPortDownload_Vtbl
Definition: port.c:683
#define DAUD_CHAN13_DEF_VOICE_PRIORITY
Definition: dmusprop.h:179
#define DAUD_CHAN6_DEF_VOICE_PRIORITY
Definition: dmusprop.h:172
#define HeapFree(x, y, z)
Definition: compat.h:394
#define DAUD_CHAN12_DEF_VOICE_PRIORITY
Definition: dmusprop.h:178
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
Definition: clock.c:121
#define DAUD_CHAN4_DEF_VOICE_PRIORITY
Definition: dmusprop.h:170

Referenced by create_system_ports_list().

Variable Documentation

◆ DECLSPEC_HIDDEN

LONG DMUSIC_refCount DECLSPEC_HIDDEN

Definition at line 155 of file crypt32_private.h.