Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
5edc3adb
Commit
5edc3adb
authored
Jul 22, 2022
by
Alistair Leslie-Hughes
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xactengine3_7: Implement callback for supported messages
parent
afe0daad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
16 deletions
+53
-16
xact_dll.c
dlls/xactengine3_7/xact_dll.c
+53
-16
No files found.
dlls/xactengine3_7/xact_dll.c
View file @
5edc3adb
...
...
@@ -140,6 +140,23 @@ static HRESULT wrapper_add_entry(XACT3EngineImpl *engine, void *fwb, void *xact)
return
S_OK
;
}
/* Must be protected by engine->wb_wrapper_lookup_cs */
static
void
*
wrapper_find_entry
(
XACT3EngineImpl
*
engine
,
void
*
faudio
)
{
struct
wrapper_lookup
*
lookup
;
struct
wine_rb_entry
*
entry
;
entry
=
wine_rb_get
(
&
engine
->
wb_wrapper_lookup
,
faudio
);
if
(
entry
)
{
lookup
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wrapper_lookup
,
entry
);
return
lookup
->
xact
;
}
WARN
(
"cannot find interface in wrapper lookup
\n
"
);
return
NULL
;
}
typedef
struct
_XACT3CueImpl
{
IXACT3Cue
IXACT3Cue_iface
;
FACTCue
*
fact_cue
;
...
...
@@ -993,10 +1010,8 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
{
XACT3EngineImpl
*
engine
=
(
XACT3EngineImpl
*
)
notification
->
pvContext
;
XACT_NOTIFICATION
xnotification
;
struct
wrapper_lookup
*
lookup
;
struct
wine_rb_entry
*
entry
;
TRACE
(
"notification %
p
\n
"
,
notification
->
pvContext
);
TRACE
(
"notification %
d, context %p
\n
"
,
notification
->
type
,
notification
->
pvContext
);
/* Older versions of FAudio don't pass through the context */
if
(
!
engine
)
...
...
@@ -1009,28 +1024,50 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
xnotification
.
timeStamp
=
notification
->
timeStamp
;
xnotification
.
pvContext
=
engine
->
contexts
[
notification
->
type
-
1
];
EnterCriticalSection
(
&
engine
->
wb_wrapper_lookup_cs
);
if
(
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVEBANKPREPARED
||
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED
)
{
EnterCriticalSection
(
&
engine
->
wb_wrapper_lookup_cs
);
entry
=
wine_rb_get
(
&
engine
->
wb_wrapper_lookup
,
notification
->
waveBank
.
pWaveBank
);
if
(
!
entry
)
{
WARN
(
"cannot find wave bank in wrapper lookup
\n
"
);
xnotification
.
waveBank
.
pWaveBank
=
NULL
;
}
else
{
lookup
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wrapper_lookup
,
entry
);
xnotification
.
waveBank
.
pWaveBank
=
lookup
->
xact
;
}
LeaveCriticalSection
(
&
engine
->
wb_wrapper_lookup_cs
);
xnotification
.
waveBank
.
pWaveBank
=
wrapper_find_entry
(
engine
,
notification
->
waveBank
.
pWaveBank
);
}
else
if
(
notification
->
type
==
XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED
)
{
xnotification
.
soundBank
.
pSoundBank
=
wrapper_find_entry
(
engine
,
notification
->
soundBank
.
pSoundBank
);
}
else
if
(
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVESTOP
#if XACT3_VER >= 0x0205
||
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVEDESTROYED
||
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVELOOPED
||
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVEPLAY
||
notification
->
type
==
XACTNOTIFICATIONTYPE_WAVEPREPARED
)
#else
)
#endif
{
xnotification
.
wave
.
cueIndex
=
notification
->
wave
.
cueIndex
;
xnotification
.
wave
.
pCue
=
wrapper_find_entry
(
engine
,
notification
->
wave
.
pCue
);
xnotification
.
wave
.
pSoundBank
=
wrapper_find_entry
(
engine
,
notification
->
wave
.
pSoundBank
);
#if XACT3_VER >= 0x0205
xnotification
.
wave
.
pWave
=
wrapper_find_entry
(
engine
,
notification
->
wave
.
pWave
);
#endif
xnotification
.
wave
.
pWaveBank
=
wrapper_find_entry
(
engine
,
notification
->
wave
.
pWaveBank
);
}
else
if
(
notification
->
type
==
XACTNOTIFICATIONTYPE_CUEPLAY
||
notification
->
type
==
XACTNOTIFICATIONTYPE_CUEPREPARED
||
notification
->
type
==
XACTNOTIFICATIONTYPE_CUESTOP
||
notification
->
type
==
XACTNOTIFICATIONTYPE_CUEDESTROYED
)
{
xnotification
.
cue
.
pCue
=
wrapper_find_entry
(
engine
,
notification
->
cue
.
pCue
);
xnotification
.
cue
.
cueIndex
=
notification
->
cue
.
cueIndex
;
xnotification
.
cue
.
pSoundBank
=
wrapper_find_entry
(
engine
,
notification
->
cue
.
pSoundBank
);
}
else
{
LeaveCriticalSection
(
&
engine
->
wb_wrapper_lookup_cs
);
FIXME
(
"Unsupported callback type %d
\n
"
,
notification
->
type
);
return
;
}
LeaveCriticalSection
(
&
engine
->
wb_wrapper_lookup_cs
);
engine
->
notification_callback
(
&
xnotification
);
}
...
...
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