Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b3b7616f
Commit
b3b7616f
authored
Sep 21, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Sep 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Implement IKsControl_KsProperty for Synth and SynthSink objects.
parent
8bb1af84
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
4 deletions
+111
-4
synth.c
dlls/dmsynth/synth.c
+46
-2
synthsink.c
dlls/dmsynth/synthsink.c
+26
-2
dmsynth.c
dlls/dmsynth/tests/dmsynth.c
+39
-0
No files found.
dlls/dmsynth/synth.c
View file @
b3b7616f
...
...
@@ -2,6 +2,7 @@
* IDirectMusicSynth8 Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2012 Christian Costa
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -415,9 +416,52 @@ static ULONG WINAPI DMSynthImpl_IKsControl_Release(IKsControl* iface)
static
HRESULT
WINAPI
DMSynthImpl_IKsControl_KsProperty
(
IKsControl
*
iface
,
PKSPROPERTY
Property
,
ULONG
PropertyLength
,
LPVOID
PropertyData
,
ULONG
DataLength
,
ULONG
*
BytesReturned
)
{
FIXME
(
"(%p)->(%p, %u, %p, %u, %p): stub
\n
"
,
iface
,
Property
,
PropertyLength
,
PropertyData
,
DataLength
,
BytesReturned
);
TRACE
(
"(%p)->(%p, %u, %p, %u, %p)
\n
"
,
iface
,
Property
,
PropertyLength
,
PropertyData
,
DataLength
,
BytesReturned
);
return
E_NOTIMPL
;
TRACE
(
"Property = %s - %u - %u
\n
"
,
debugstr_guid
(
&
Property
->
Set
),
Property
->
Id
,
Property
->
Flags
);
if
(
Property
->
Flags
!=
KSPROPERTY_TYPE_GET
)
{
FIXME
(
"Property flags %u not yet supported
\n
"
,
Property
->
Flags
);
return
S_FALSE
;
}
if
(
DataLength
<
sizeof
(
DWORD
))
return
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_INSTRUMENT2
))
{
*
(
DWORD
*
)
PropertyData
=
TRUE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_DLS2
))
{
*
(
DWORD
*
)
PropertyData
=
TRUE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_GM_Hardware
))
{
*
(
DWORD
*
)
PropertyData
=
FALSE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_GS_Hardware
))
{
*
(
DWORD
*
)
PropertyData
=
FALSE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_XG_Hardware
))
{
*
(
DWORD
*
)
PropertyData
=
FALSE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
{
FIXME
(
"Unknown property %s
\n
"
,
debugstr_guid
(
&
Property
->
Set
));
*
(
DWORD
*
)
PropertyData
=
FALSE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
DMSynthImpl_IKsControl_KsMethod
(
IKsControl
*
iface
,
PKSMETHOD
Method
,
ULONG
MethodLength
,
LPVOID
MethodData
,
...
...
dlls/dmsynth/synthsink.c
View file @
b3b7616f
...
...
@@ -2,6 +2,7 @@
* IDirectMusicSynthSink Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2012 Christian Costa
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -209,9 +210,32 @@ static ULONG WINAPI DMSynthSinkImpl_IKsControl_Release(IKsControl* iface)
static
HRESULT
WINAPI
DMSynthSinkImpl_IKsControl_KsProperty
(
IKsControl
*
iface
,
PKSPROPERTY
Property
,
ULONG
PropertyLength
,
LPVOID
PropertyData
,
ULONG
DataLength
,
ULONG
*
BytesReturned
)
{
FIXME
(
"(%p)->(%p, %u, %p, %u, %p): stub
\n
"
,
iface
,
Property
,
PropertyLength
,
PropertyData
,
DataLength
,
BytesReturned
);
TRACE
(
"(%p)->(%p, %u, %p, %u, %p)
\n
"
,
iface
,
Property
,
PropertyLength
,
PropertyData
,
DataLength
,
BytesReturned
);
return
E_NOTIMPL
;
TRACE
(
"Property = %s - %u - %u
\n
"
,
debugstr_guid
(
&
Property
->
Set
),
Property
->
Id
,
Property
->
Flags
);
if
(
Property
->
Flags
!=
KSPROPERTY_TYPE_GET
)
{
FIXME
(
"Property flags %u not yet supported
\n
"
,
Property
->
Flags
);
return
S_FALSE
;
}
if
(
DataLength
<
sizeof
(
DWORD
))
return
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
IsEqualGUID
(
&
Property
->
Set
,
&
GUID_DMUS_PROP_SinkUsesDSound
))
{
*
(
DWORD
*
)
PropertyData
=
TRUE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
else
{
FIXME
(
"Unknown property %s
\n
"
,
debugstr_guid
(
&
Property
->
Set
));
*
(
DWORD
*
)
PropertyData
=
FALSE
;
*
BytesReturned
=
sizeof
(
DWORD
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
DMSynthSinkImpl_IKsControl_KsMethod
(
IKsControl
*
iface
,
PKSMETHOD
Method
,
ULONG
MethodLength
,
LPVOID
MethodData
,
...
...
dlls/dmsynth/tests/dmsynth.c
View file @
b3b7616f
...
...
@@ -39,6 +39,9 @@ static void test_dmsynth(void)
IKsControl
*
control_synth
=
NULL
;
IKsControl
*
control_sink
=
NULL
;
HRESULT
hr
;
KSPROPERTY
property
;
ULONG
value
;
ULONG
bytes
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth
,
(
LPVOID
*
)
&
dmsynth
);
if
(
hr
!=
S_OK
)
...
...
@@ -52,9 +55,45 @@ static void test_dmsynth(void)
hr
=
IDirectMusicSynth_QueryInterface
(
dmsynth
,
&
IID_IKsControl
,
(
LPVOID
*
)
&
control_synth
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_QueryInterface returned: %x
\n
"
,
hr
);
property
.
Id
=
0
;
property
.
Flags
=
KSPROPERTY_TYPE_GET
;
property
.
Set
=
GUID_DMUS_PROP_INSTRUMENT2
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
property
.
Set
=
GUID_DMUS_PROP_DLS2
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
property
.
Set
=
GUID_DMUS_PROP_GM_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
property
.
Set
=
GUID_DMUS_PROP_GS_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
property
.
Set
=
GUID_DMUS_PROP_XG_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
hr
=
IDirectMusicSynthSink_QueryInterface
(
dmsynth_sink
,
&
IID_IKsControl
,
(
LPVOID
*
)
&
control_sink
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_QueryInterface returned: %x
\n
"
,
hr
);
property
.
Set
=
GUID_DMUS_PROP_SinkUsesDSound
;
hr
=
IKsControl_KsProperty
(
control_sink
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
/* Synth has no default clock */
hr
=
IDirectMusicSynth_GetLatencyClock
(
dmsynth
,
&
clock_synth
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_GetLatencyClock returned: %x
\n
"
,
hr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment