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 BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID *ret_iface)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
#define DMUS_E_DSOUND_NOT_SET
static HRESULT WINAPI master_IReferenceClock_Unadvise(IReferenceClock *iface, DWORD cookie)
static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer(LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC buffer_desc, LPDIRECTMUSICBUFFER *buffer, LPUNKNOWN unkouter)
static HRESULT WINAPI IDirectMusic8Impl_EnumMasterClock(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_CLOCKINFO clock_info)
static const IDirectMusic8Vtbl DirectMusic8_Vtbl
static IDirectMusic8Impl * impl_from_IDirectMusic8(IDirectMusic8 *iface)
static HRESULT WINAPI IDirectMusic8Impl_GetMasterClock(LPDIRECTMUSIC8 iface, LPGUID guid_clock, IReferenceClock **reference_clock)
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
static HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort(LPDIRECTMUSIC8 iface, LPGUID guid_port)
static ULONG WINAPI IDirectMusic8Impl_AddRef(LPDIRECTMUSIC8 iface)
static HRESULT WINAPI master_IReferenceClock_GetTime(IReferenceClock *iface, REFERENCE_TIME *time)
static HRESULT WINAPI master_IReferenceClock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HANDLE semaphore, DWORD *cookie)
static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDirectSound *dsound, HWND hwnd)
static ULONG WINAPI master_IReferenceClock_Release(IReferenceClock *iface)
static HRESULT WINAPI IDirectMusic8Impl_QueryInterface(LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ret_iface)
static HRESULT WINAPI master_IReferenceClock_QueryInterface(IReferenceClock *iface, REFIID riid, void **ret_iface)
static HRESULT WINAPI IDirectMusic8Impl_SetMasterClock(LPDIRECTMUSIC8 iface, REFGUID rguidClock)
static ULONG WINAPI master_IReferenceClock_AddRef(IReferenceClock *iface)
static HRESULT WINAPI IDirectMusic8Impl_Activate(LPDIRECTMUSIC8 iface, BOOL enable)
static const IReferenceClockVtbl master_clock_vtbl
static HRESULT WINAPI master_IReferenceClock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HANDLE event, DWORD *cookie)
static HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock(LPDIRECTMUSIC8 iface, IReferenceClock *clock)
void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port)
static struct master_clock * impl_from_IReferenceClock(IReferenceClock *iface)
static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD index, LPDMUS_PORTCAPS port_caps)
static HRESULT master_clock_create(IReferenceClock **clock)
static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSID rclsid_port, LPDMUS_PORTPARAMS port_params, LPDIRECTMUSICPORT *port, LPUNKNOWN unkouter)
static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface)
static void create_system_ports_list(IDirectMusic8Impl *object)
void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params)
const char * debugstr_dmguid(const GUID *id)
static void DMUSIC_UnlockModule(void)
static void DMUSIC_LockModule(void)
HRESULT midi_in_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 synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
#define IDirectMusicPort_SetDirectSound(p, a, b)
#define DMUS_PC_INPUTCLASS
struct IDirectMusicPort * LPDIRECTMUSICPORT
#define IReferenceClock_AddRef(p)
#define DMUS_PORT_WINMM_DRIVER
#define IDirectMusic8_Release(p)
#define DMUS_PC_SHAREABLE
#define IDirectMusic8_GetDefaultPort(p, a)
#define DMUS_PC_OUTPUTCLASS
#define IReferenceClock_Release(p)
struct IDirectMusic8 * LPDIRECTMUSIC8
struct _DMUS_PORTCAPS DMUS_PORTCAPS
#define IDirectMusicPort_Activate(p, a)
#define IDirectMusic8_AddRef(p)
struct IDirectMusicBuffer * LPDIRECTMUSICBUFFER
#define IDirectMusicSynth8_Release(p)
#define IDirectMusicSynth8_GetPortCaps(p, a)
#define IDirectSound_AddRef(p)
#define IDirectSound_Release(p)
#define IDirectSound_SetCooperativeLevel(p, a, b)
static unsigned char buff[32768]
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
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memmove(s1, s2, n)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2)
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
IReferenceClock * master_clock
IDirectMusicPort ** ports
IDirectMusic8 IDirectMusic8_iface
WCHAR wszDescription[DMUS_MAX_DESCRIPTION]
IReferenceClock IReferenceClock_iface
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
#define CONTAINING_RECORD(address, type, field)
#define CLASS_E_NOAGGREGATION
UINT WINAPI midiInGetNumDevs(void)
UINT WINAPI midiOutGetNumDevs(void)
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
#define HKEY_LOCAL_MACHINE
HWND WINAPI GetForegroundWindow(void)