Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e8873b75
Commit
e8873b75
authored
May 10, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Pass only the needed stuff to the DMPort create functions.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
36a88d28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
22 deletions
+30
-22
dmusic.c
dlls/dmusic/dmusic.c
+5
-5
dmusic_private.h
dlls/dmusic/dmusic_private.h
+8
-4
port.c
dlls/dmusic/port.c
+17
-13
No files found.
dlls/dmusic/dmusic.c
View file @
e8873b75
...
...
@@ -153,7 +153,7 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSI
for
(
i
=
0
;
S_FALSE
!=
IDirectMusic8Impl_EnumPort
(
iface
,
i
,
&
port_caps
);
i
++
)
{
if
(
IsEqualCLSID
(
request_port
,
&
port_caps
.
guidPort
))
{
hr
=
This
->
system_ports
[
i
].
create
(
&
IID_IDirectMusicPort
,
(
LPVOID
*
)
&
new_port
,
(
LPUNKNOWN
)
This
,
port_params
,
&
port_caps
,
This
->
system_ports
[
i
].
device
);
hr
=
This
->
system_ports
[
i
].
create
(
This
,
port_params
,
&
port_caps
,
&
new_port
);
if
(
FAILED
(
hr
))
{
*
port
=
NULL
;
return
hr
;
...
...
@@ -379,7 +379,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object)
/* Fill midi mapper port info */
port
->
device
=
MIDI_MAPPER
;
port
->
create
=
DMUSIC_CreateMidiOutPortImpl
;
port
->
create
=
midi_out_port_create
;
midiOutGetDevCapsW
(
MIDI_MAPPER
,
&
caps_out
,
sizeof
(
caps_out
));
strcpyW
(
port
->
caps
.
wszDescription
,
caps_out
.
szPname
);
strcatW
(
port
->
caps
.
wszDescription
,
emulated
);
...
...
@@ -391,7 +391,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object)
for
(
i
=
0
;
i
<
nb_midi_out
;
i
++
)
{
port
->
device
=
i
;
port
->
create
=
DMUSIC_CreateMidiOutPortImpl
;
port
->
create
=
midi_out_port_create
;
midiOutGetDevCapsW
(
i
,
&
caps_out
,
sizeof
(
caps_out
));
strcpyW
(
port
->
caps
.
wszDescription
,
caps_out
.
szPname
);
strcatW
(
port
->
caps
.
wszDescription
,
emulated
);
...
...
@@ -404,7 +404,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object)
for
(
i
=
0
;
i
<
nb_midi_in
;
i
++
)
{
port
->
device
=
i
;
port
->
create
=
DMUSIC_CreateMidiInPortImpl
;
port
->
create
=
midi_in_port_create
;
midiInGetDevCapsW
(
i
,
&
caps_in
,
sizeof
(
caps_in
));
strcpyW
(
port
->
caps
.
wszDescription
,
caps_in
.
szPname
);
strcatW
(
port
->
caps
.
wszDescription
,
emulated
);
...
...
@@ -414,7 +414,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object)
}
/* Fill synth port info */
port
->
create
=
DMUSIC_CreateSynthPortImpl
;
port
->
create
=
synth_port_create
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth8
,
(
void
**
)
&
synth
);
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/dmusic/dmusic_private.h
View file @
e8873b75
...
...
@@ -71,7 +71,8 @@ typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ {
typedef
struct
port_info
{
DMUS_PORTCAPS
caps
;
HRESULT
(
*
create
)(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
);
HRESULT
(
*
create
)(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
);
ULONG
device
;
}
port_info
;
...
...
@@ -157,9 +158,12 @@ struct IDirectMusicDownloadImpl {
};
/** Internal factory */
extern
HRESULT
DMUSIC_CreateSynthPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateMidiOutPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateMidiInPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
DECLSPEC_HIDDEN
;
extern
HRESULT
synth_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
DECLSPEC_HIDDEN
;
extern
HRESULT
midi_out_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
DECLSPEC_HIDDEN
;
extern
HRESULT
midi_in_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IReferenceClockImpl implementation structure
...
...
dlls/dmusic/port.c
View file @
e8873b75
...
...
@@ -30,6 +30,7 @@ typedef struct SynthPortImpl {
IDirectMusicThru
IDirectMusicThru_iface
;
IKsControl
IKsControl_iface
;
LONG
ref
;
IDirectMusic8Impl
*
parent
;
IDirectSound
*
pDirectSound
;
IReferenceClock
*
pLatencyClock
;
IDirectMusicSynth
*
synth
;
...
...
@@ -763,16 +764,16 @@ static const IKsControlVtbl ikscontrol_vtbl = {
IKsControlImpl_KsEvent
};
HRESULT
DMUSIC_CreateSynthPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
HRESULT
synth_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
{
SynthPortImpl
*
obj
;
HRESULT
hr
=
E_FAIL
;
int
i
;
TRACE
(
"(%s, %p, %p, %p, %p, %d)
\n
"
,
debugstr_guid
(
guid
),
object
,
unkouter
,
port_params
,
port_caps
,
device
);
TRACE
(
"(%p, %p, %p)
\n
"
,
port_params
,
port_caps
,
port
);
*
objec
t
=
NULL
;
*
por
t
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SynthPortImpl
));
if
(
!
obj
)
...
...
@@ -782,7 +783,8 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou
obj
->
IDirectMusicPortDownload_iface
.
lpVtbl
=
&
SynthPortImpl_DirectMusicPortDownload_Vtbl
;
obj
->
IDirectMusicThru_iface
.
lpVtbl
=
&
SynthPortImpl_DirectMusicThru_Vtbl
;
obj
->
IKsControl_iface
.
lpVtbl
=
&
ikscontrol_vtbl
;
obj
->
ref
=
0
;
/* Will be inited by QueryInterface */
obj
->
ref
=
1
;
obj
->
parent
=
parent
;
obj
->
fActive
=
FALSE
;
obj
->
params
=
*
port_params
;
obj
->
caps
=
*
port_caps
;
...
...
@@ -839,8 +841,10 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou
}
}
if
(
SUCCEEDED
(
hr
))
return
IDirectMusicPort_QueryInterface
((
LPDIRECTMUSICPORT
)
obj
,
guid
,
object
);
if
(
SUCCEEDED
(
hr
))
{
*
port
=
&
obj
->
IDirectMusicPort_iface
;
return
S_OK
;
}
if
(
obj
->
synth
)
IDirectMusicSynth_Release
(
obj
->
synth
);
...
...
@@ -853,18 +857,18 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou
return
hr
;
}
HRESULT
DMUSIC_CreateMidiOutPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
HRESULT
midi_out_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
{
TRACE
(
"(%s, %p, %p, %p, %p, %d): stub
\n
"
,
debugstr_guid
(
guid
),
object
,
unkouter
,
port_params
,
port_caps
,
device
);
FIXME
(
"(%p, %p, %p): stub
\n
"
,
port_params
,
port_caps
,
port
);
return
E_NOTIMPL
;
}
HRESULT
DMUSIC_CreateMidiInPortImpl
(
LPCGUID
guid
,
LPVOID
*
object
,
LPUNKNOWN
unkouter
,
LPDMUS_PORTPARAMS
port_params
,
LPDMUS_PORTCAPS
port_caps
,
DWORD
device
)
HRESULT
midi_in_port_create
(
IDirectMusic8Impl
*
parent
,
DMUS_PORTPARAMS
*
port_params
,
DMUS_PORTCAPS
*
port_caps
,
IDirectMusicPort
**
port
)
{
TRACE
(
"(%s, %p, %p, %p, %p, %d): stub
\n
"
,
debugstr_guid
(
guid
),
object
,
unkouter
,
port_params
,
port_caps
,
device
);
FIXME
(
"(%p, %p, %p): stub
\n
"
,
port_params
,
port_caps
,
port
);
return
E_NOTIMPL
;
}
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