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
f9fef851
Commit
f9fef851
authored
Nov 29, 2005
by
Raphael Junqueira
Committed by
Alexandre Julliard
Nov 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix implementation of IDirectMusic8Impl_CreatePort.
parent
10ab77b8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
45 deletions
+72
-45
dmusic.c
dlls/dmusic/dmusic.c
+15
-41
dmusic_private.h
dlls/dmusic/dmusic_private.h
+7
-3
port.c
dlls/dmusic/port.c
+50
-1
No files found.
dlls/dmusic/dmusic.c
View file @
f9fef851
...
...
@@ -67,8 +67,8 @@ ULONG WINAPI IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface) {
/* IDirectMusic8Impl IDirectMusic part: */
HRESULT
WINAPI
IDirectMusic8Impl_EnumPort
(
LPDIRECTMUSIC8
iface
,
DWORD
dwIndex
,
LPDMUS_PORTCAPS
pPortCaps
)
{
IDirectMusic8Impl
*
This
=
(
IDirectMusic8Impl
*
)
iface
;
TRACE
(
"(%p, %ld, %p)
\n
"
,
This
,
dwIndex
,
pPortCaps
);
if
(
NULL
==
pPortCaps
)
{
return
E_POINTER
;
}
/* i guess the first port shown is always software synthesizer */
if
(
dwIndex
==
0
)
{
...
...
@@ -116,51 +116,25 @@ HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rcls
IDirectMusic8Impl
*
This
=
(
IDirectMusic8Impl
*
)
iface
;
int
i
/*, j*/
;
DMUS_PORTCAPS
PortCaps
;
IDirectMusicPort
*
pNewPort
=
NULL
;
HRESULT
hr
=
E_FAIL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
rclsidPort
),
pPortParams
,
ppPort
,
pUnkOuter
);
ZeroMemory
(
&
PortCaps
,
sizeof
(
DMUS_PORTCAPS
));
PortCaps
.
dwSize
=
sizeof
(
DMUS_PORTCAPS
);
for
(
i
=
0
;
S_FALSE
!=
IDirectMusic8Impl_EnumPort
(
iface
,
i
,
&
PortCaps
);
i
++
)
{
if
(
IsEqualCLSID
(
rclsidPort
,
&
PortCaps
.
guidPort
))
{
if
(
!
This
->
ppPorts
)
This
->
ppPorts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
else
This
->
ppPorts
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
ppPorts
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
if
(
NULL
==
This
->
ppPorts
[
This
->
nrofports
])
{
*
ppPort
=
(
LPDIRECTMUSICPORT
)
NULL
;
return
E_OUTOFMEMORY
;
}
This
->
ppPorts
[
This
->
nrofports
]
->
lpVtbl
=
&
DirectMusicPort_Vtbl
;
This
->
ppPorts
[
This
->
nrofports
]
->
ref
=
1
;
This
->
ppPorts
[
This
->
nrofports
]
->
fActive
=
FALSE
;
This
->
ppPorts
[
This
->
nrofports
]
->
pCaps
=
&
PortCaps
;
This
->
ppPorts
[
This
->
nrofports
]
->
pParams
=
pPortParams
;
/* this one is here just because there's a funct. which retrieves it back */
This
->
ppPorts
[
This
->
nrofports
]
->
pDirectSound
=
NULL
;
DMUSIC_CreateReferenceClockImpl
(
&
IID_IReferenceClock
,
(
LPVOID
*
)
&
This
->
ppPorts
[
This
->
nrofports
]
->
pLatencyClock
,
NULL
);
#if 0
if (pPortParams->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) {
This->ports[This->nrofports]->nrofgroups = pPortParams->dwChannelGroups;
/* setting default priorities */
for (j = 0; j < This->ports[This->nrofports]->nrofgroups; j++) {
TRACE ("Setting default channel priorities on channel group %i\n", j + 1);
This->ports[This->nrofports]->group[j].channel[0].priority = DAUD_CHAN1_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[1].priority = DAUD_CHAN2_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[2].priority = DAUD_CHAN3_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[3].priority = DAUD_CHAN4_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[4].priority = DAUD_CHAN5_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[5].priority = DAUD_CHAN6_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[6].priority = DAUD_CHAN7_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[7].priority = DAUD_CHAN8_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[8].priority = DAUD_CHAN9_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[9].priority = DAUD_CHAN10_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[10].priority = DAUD_CHAN11_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[11].priority = DAUD_CHAN12_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[12].priority = DAUD_CHAN13_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[13].priority = DAUD_CHAN14_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[14].priority = DAUD_CHAN15_DEF_VOICE_PRIORITY;
This->ports[This->nrofports]->group[j].channel[15].priority = DAUD_CHAN16_DEF_VOICE_PRIORITY;
}
hr
=
DMUSIC_CreateDirectMusicPortImpl
(
&
IID_IDirectMusicPort
,
(
LPVOID
*
)
&
pNewPort
,
(
LPUNKNOWN
)
This
,
pPortParams
,
&
PortCaps
);
if
(
FAILED
(
hr
))
{
*
ppPort
=
(
LPDIRECTMUSICPORT
)
NULL
;
return
hr
;
}
#endif
*
ppPort
=
(
LPDIRECTMUSICPORT
)
This
->
ppPorts
[
This
->
nrofports
];
This
->
nrofports
++
;
if
(
!
This
->
ppPorts
)
This
->
ppPorts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
else
This
->
ppPorts
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
ppPorts
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
This
->
ppPorts
[
This
->
nrofports
]
=
pNewPort
;
*
ppPort
=
(
LPDIRECTMUSICPORT
)
pNewPort
;
return
S_OK
;
}
}
...
...
@@ -198,7 +172,7 @@ HRESULT WINAPI IDirectMusic8Impl_Activate (LPDIRECTMUSIC8 iface, BOOL fEnable) {
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
fEnable
);
for
(
i
=
0
;
i
<
This
->
nrofports
;
i
++
)
{
This
->
ppPorts
[
i
]
->
fActive
=
fEnable
;
IDirectMusicPortImpl_Activate
(
This
->
ppPorts
[
i
],
fEnable
)
;
}
return
S_OK
;
...
...
dlls/dmusic/dmusic_private.h
View file @
f9fef851
...
...
@@ -99,7 +99,7 @@ struct IDirectMusic8Impl {
/* IDirectMusicImpl fields */
IReferenceClockImpl
*
pMasterClock
;
IDirectMusicPort
Impl
**
ppPorts
;
IDirectMusicPort
**
ppPorts
;
int
nrofports
;
};
...
...
@@ -176,14 +176,18 @@ struct IDirectMusicPortImpl {
IDirectSound
*
pDirectSound
;
IReferenceClock
*
pLatencyClock
;
BOOL
fActive
;
LPDMUS_PORTCAPS
pC
aps
;
LPDMUS_PORTPARAMS
pP
arams
;
DMUS_PORTCAPS
c
aps
;
DMUS_PORTPARAMS
p
arams
;
int
nrofgroups
;
DMUSIC_PRIVATE_CHANNEL_GROUP
group
[
1
];
};
/* IUnknown: */
extern
ULONG
WINAPI
IDirectMusicPortImpl_AddRef
(
LPDIRECTMUSICPORT
iface
);
extern
HRESULT
WINAPI
IDirectMusicPortImpl_Activate
(
LPDIRECTMUSICPORT
iface
,
BOOL
fActive
);
/** Internal factory */
extern
HRESULT
WINAPI
DMUSIC_CreateDirectMusicPortImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
,
LPDMUS_PORTPARAMS
pPortParams
,
LPDMUS_PORTCAPS
pPortCaps
);
/*****************************************************************************
* IDirectMusicThruImpl implementation structure
...
...
dlls/dmusic/port.c
View file @
f9fef851
...
...
@@ -115,7 +115,7 @@ HRESULT WINAPI IDirectMusicPortImpl_Compact (LPDIRECTMUSICPORT iface) {
HRESULT
WINAPI
IDirectMusicPortImpl_GetCaps
(
LPDIRECTMUSICPORT
iface
,
LPDMUS_PORTCAPS
pPortCaps
)
{
IDirectMusicPortImpl
*
This
=
(
IDirectMusicPortImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
pPortCaps
);
pPortCaps
=
This
->
pCaps
;
memcpy
(
pPortCaps
,
&
This
->
caps
,
sizeof
(
DMUS_PORTCAPS
))
;
return
S_OK
;
}
...
...
@@ -197,3 +197,52 @@ const IDirectMusicPortVtbl DirectMusicPort_Vtbl = {
IDirectMusicPortImpl_SetDirectSound
,
IDirectMusicPortImpl_GetFormat
};
HRESULT
WINAPI
DMUSIC_CreateDirectMusicPortImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
,
LPDMUS_PORTPARAMS
pPortParams
,
LPDMUS_PORTCAPS
pPortCaps
)
{
IDirectMusicPortImpl
*
obj
;
HRESULT
hr
=
E_FAIL
;
TRACE
(
"(%p,%p,%p)
\n
"
,
lpcGUID
,
ppobj
,
pUnkOuter
);
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicPortImpl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
(
LPDIRECTMUSICPORT
)
NULL
;
return
E_OUTOFMEMORY
;
}
obj
->
lpVtbl
=
&
DirectMusicPort_Vtbl
;
obj
->
ref
=
0
;
/* will be inited by QueryInterface */
obj
->
fActive
=
FALSE
;
memcpy
(
&
obj
->
params
,
pPortParams
,
sizeof
(
DMUS_PORTPARAMS
));
memcpy
(
&
obj
->
caps
,
pPortCaps
,
sizeof
(
DMUS_PORTCAPS
));
obj
->
pDirectSound
=
NULL
;
obj
->
pLatencyClock
=
NULL
;
hr
=
DMUSIC_CreateReferenceClockImpl
(
&
IID_IReferenceClock
,
(
LPVOID
*
)
&
obj
->
pLatencyClock
,
NULL
);
#if 0
if (pPortParams->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) {
obj->nrofgroups = pPortParams->dwChannelGroups;
/* setting default priorities */
for (j = 0; j < obj->nrofgroups; j++) {
TRACE ("Setting default channel priorities on channel group %i\n", j + 1);
obj->group[j].channel[0].priority = DAUD_CHAN1_DEF_VOICE_PRIORITY;
obj->group[j].channel[1].priority = DAUD_CHAN2_DEF_VOICE_PRIORITY;
obj->group[j].channel[2].priority = DAUD_CHAN3_DEF_VOICE_PRIORITY;
obj->group[j].channel[3].priority = DAUD_CHAN4_DEF_VOICE_PRIORITY;
obj->group[j].channel[4].priority = DAUD_CHAN5_DEF_VOICE_PRIORITY;
obj->group[j].channel[5].priority = DAUD_CHAN6_DEF_VOICE_PRIORITY;
obj->group[j].channel[6].priority = DAUD_CHAN7_DEF_VOICE_PRIORITY;
obj->group[j].channel[7].priority = DAUD_CHAN8_DEF_VOICE_PRIORITY;
obj->group[j].channel[8].priority = DAUD_CHAN9_DEF_VOICE_PRIORITY;
obj->group[j].channel[9].priority = DAUD_CHAN10_DEF_VOICE_PRIORITY;
obj->group[j].channel[10].priority = DAUD_CHAN11_DEF_VOICE_PRIORITY;
obj->group[j].channel[11].priority = DAUD_CHAN12_DEF_VOICE_PRIORITY;
obj->group[j].channel[12].priority = DAUD_CHAN13_DEF_VOICE_PRIORITY;
obj->group[j].channel[13].priority = DAUD_CHAN14_DEF_VOICE_PRIORITY;
obj->group[j].channel[14].priority = DAUD_CHAN15_DEF_VOICE_PRIORITY;
obj->group[j].channel[15].priority = DAUD_CHAN16_DEF_VOICE_PRIORITY;
}
}
#endif
return
IDirectMusicPortImpl_QueryInterface
((
LPDIRECTMUSICPORT
)
obj
,
lpcGUID
,
ppobj
);
}
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