64 TRACE(
"(%p) ref = %u\n", iface,
ref);
74 TRACE(
"(%p) ref = %u\n", iface,
ref);
117 TRACE(
"(%p, %#x): method not implemented\n", iface,
cookie);
138 if (!(
obj = heap_alloc_zero(
sizeof(*
obj))))
144 obj->freq = 10000000.0 /
freq.QuadPart;
146 *
clock = &
obj->IReferenceClock_iface;
223 *port_caps =
This->system_ports[
index].caps;
237 if (!buffer_desc || !
buffer)
248 IDirectMusicPort* new_port =
NULL;
251 const GUID *request_port = rclsid_port;
255 if (!rclsid_port || !
port)
274 request_port = &default_port;
279 hr =
This->system_ports[
i].create(
This, port_params, &port_caps, &new_port);
287 sizeof(*
This->ports) *
This->num_ports);
290 sizeof(*
This->ports) *
This->num_ports);
291 This->ports[
This->num_ports - 1] = new_port;
317 ERR(
"Port %p not found in ports array.\n",
port);
335 TRACE(
"(%p)->(%d, %p)\n", iface,
index, clock_info);
345 static const GUID guid_system_clock = { 0x58d58419, 0x71b4, 0x11d1, { 0xa7, 0x4c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 } };
346 static const WCHAR name_system_clock[] = {
'S',
'y',
's',
't',
'e',
'm',
' ',
'C',
'l',
'o',
'c',
'k',0 };
349 clock_info->
guidClock = guid_system_clock;
354 static const GUID guid_dsound_clock = { 0x58d58420, 0x71b4, 0x11d1, { 0xa7, 0x4c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 } };
355 static const WCHAR name_dsound_clock[] = {
'D',
'i',
'r',
'e',
'c',
't',
'S',
'o',
'u',
'n',
'd',
' ',
'C',
'l',
'o',
'c',
'k',0 };
358 clock_info->
guidClock = guid_dsound_clock;
369 TRACE(
"(%p)->(%p, %p)\n",
This, guid_clock, reference_clock);
373 if (reference_clock) {
374 *reference_clock =
This->master_clock;
398 for (
i = 0;
i <
This->num_ports;
i++)
412 DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
413 char returnBuffer[51];
414 GUID defaultPortGUID;
422 WARN(
": registry entry missing\n" );
423 *guid_port = CLSID_DirectMusicSynth;
429 *guid_port = defaultPortGUID;
443 for (
i = 0;
i <
This->num_ports;
i++)
467 This->dsound = dsound;
499 static const WCHAR emulated[] = {
' ',
'[',
'E',
'm',
'u',
'l',
'a',
't',
'e',
'd',
']',0};
506 IDirectMusicSynth8* synth;
510 TRACE(
"(%p)\n",
object);
519 nb_ports = 1 + nb_midi_out + nb_midi_in + 1 ;
522 if (!
object->system_ports)
526 for (
i = 0;
i < (nb_ports - 1 );
i++)
530 object->system_ports[
i].caps.dwMemorySize = 0;
531 object->system_ports[
i].caps.dwMaxChannelGroups = 1;
532 object->system_ports[
i].caps.dwMaxVoices = 0;
533 object->system_ports[
i].caps.dwMaxAudioChannels = 0;
537 object->system_ports[
i].caps.guidPort.Data1 =
i + 1;
551 for (
i = 0;
i < nb_midi_out;
i++)
564 for (
i = 0;
i < nb_midi_in;
i++)
578 hr =
CoCreateInstance(&CLSID_DirectMusicSynth,
NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth8, (
void**)&synth);
581 port->caps.dwSize =
sizeof(
port->caps);
588 object->num_system_ports = nb_ports;
static HRESULT WINAPI IDirectMusic8Impl_EnumMasterClock(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_CLOCKINFO clock_info)
static HRESULT WINAPI IDirectMusic8Impl_SetMasterClock(LPDIRECTMUSIC8 iface, REFGUID rguidClock)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define memmove(s1, s2, n)
#define DMUS_PC_OUTPUTCLASS
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
#define IDirectMusic8_AddRef(p)
static HRESULT WINAPI IDirectMusic8Impl_QueryInterface(LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ret_iface)
static HRESULT WINAPI IDirectMusic8Impl_GetMasterClock(LPDIRECTMUSIC8 iface, LPGUID guid_clock, IReferenceClock **reference_clock)
void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port)
const char * debugstr_dmguid(const GUID *id)
static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDirectSound *dsound, HWND hwnd)
#define DMUS_PC_INPUTCLASS
HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID *ret_iface)
struct IDirectMusicBuffer * LPDIRECTMUSICBUFFER
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
struct IDirectMusic8 * LPDIRECTMUSIC8
WCHAR szPname[MAXPNAMELEN]
#define DMUS_E_DSOUND_NOT_SET
IReferenceClock IReferenceClock_iface
#define IDirectMusic8_Release(p)
static HRESULT WINAPI master_IReferenceClock_QueryInterface(IReferenceClock *iface, REFIID riid, void **ret_iface)
void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params)
#define IDirectMusicPort_SetDirectSound(p, a, b)
static HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock(LPDIRECTMUSIC8 iface, IReferenceClock *clock)
GLsizei GLsizei GLuint * obj
static void DMUSIC_UnlockModule(void)
HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
static HRESULT master_clock_create(IReferenceClock **clock)
#define IDirectMusicSynth8_GetPortCaps(p, a)
static HRESULT WINAPI master_IReferenceClock_GetTime(IReferenceClock *iface, REFERENCE_TIME *time)
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
static void DMUSIC_LockModule(void)
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)
static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSID rclsid_port, LPDMUS_PORTPARAMS port_params, LPDIRECTMUSICPORT *port, LPUNKNOWN unkouter)
#define IDirectMusicSynth8_Release(p)
struct _DMUS_PORTCAPS DMUS_PORTCAPS
static HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort(LPDIRECTMUSIC8 iface, LPGUID guid_port)
static ULONG WINAPI IDirectMusic8Impl_AddRef(LPDIRECTMUSIC8 iface)
#define DMUS_PORT_WINMM_DRIVER
WCHAR szPname[MAXPNAMELEN]
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface)
static struct master_clock * impl_from_IReferenceClock(IReferenceClock *iface)
static const IReferenceClockVtbl master_clock_vtbl
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
#define InterlockedDecrement
#define CLASS_E_NOAGGREGATION
static ULONG WINAPI master_IReferenceClock_AddRef(IReferenceClock *iface)
#define IDirectSound_SetCooperativeLevel(p, a, b)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
WCHAR wszDescription[DMUS_MAX_DESCRIPTION]
HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
#define DMUS_PC_SHAREABLE
#define InterlockedIncrement
#define IDirectSound_Release(p)
#define IReferenceClock_Release(p)
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
static IDirectMusic8Impl * impl_from_IDirectMusic8(IDirectMusic8 *iface)
static HRESULT WINAPI master_IReferenceClock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HANDLE event, DWORD *cookie)
IDirectMusicPort ** ports
static const IDirectMusic8Vtbl DirectMusic8_Vtbl
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
HWND WINAPI GetForegroundWindow(void)
static HRESULT WINAPI IDirectMusic8Impl_Activate(LPDIRECTMUSIC8 iface, BOOL enable)
struct IDirectMusicPort * LPDIRECTMUSICPORT
#define MultiByteToWideChar
static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer(LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC buffer_desc, LPDIRECTMUSICBUFFER *buffer, LPUNKNOWN unkouter)
#define IDirectMusicPort_Activate(p, a)
UINT WINAPI midiInGetNumDevs(void)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
#define IReferenceClock_AddRef(p)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
IDirectMusic8 IDirectMusic8_iface
WINE_DEFAULT_DEBUG_CHANNEL(dmusic)
static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_PORTCAPS port_caps)
static HRESULT WINAPI master_IReferenceClock_Unadvise(IReferenceClock *iface, DWORD cookie)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define IDirectSound_AddRef(p)
static ULONG WINAPI master_IReferenceClock_Release(IReferenceClock *iface)
#define IDirectMusic8_GetDefaultPort(p, a)
#define IsEqualCLSID(rclsid1, rclsid2)
static unsigned char buff[32768]
static HRESULT WINAPI master_IReferenceClock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HANDLE semaphore, DWORD *cookie)
UINT WINAPI midiOutGetNumDevs(void)
#define HeapFree(x, y, z)
IReferenceClock * master_clock
#define IsEqualIID(riid1, riid2)
static void create_system_ports_list(IDirectMusic8Impl *object)
static BOOL heap_free(void *mem)
#define HKEY_LOCAL_MACHINE
HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN