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
377ba8a7
Commit
377ba8a7
authored
Oct 25, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Use an internal performance message for segment end.
parent
aec78ade
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
17 deletions
+40
-17
dmime_private.h
dlls/dmime/dmime_private.h
+2
-0
performance.c
dlls/dmime/performance.c
+34
-16
segmentstate.c
dlls/dmime/segmentstate.c
+4
-1
No files found.
dlls/dmime/dmime_private.h
View file @
377ba8a7
...
@@ -81,6 +81,8 @@ extern HRESULT wave_track_create_from_chunk(IStream *stream, struct chunk_entry
...
@@ -81,6 +81,8 @@ extern HRESULT wave_track_create_from_chunk(IStream *stream, struct chunk_entry
IDirectMusicTrack8
**
ret_iface
);
IDirectMusicTrack8
**
ret_iface
);
extern
HRESULT
performance_get_dsound
(
IDirectMusicPerformance8
*
iface
,
IDirectSound
**
dsound
);
extern
HRESULT
performance_get_dsound
(
IDirectMusicPerformance8
*
iface
,
IDirectSound
**
dsound
);
extern
HRESULT
performance_send_segment_end
(
IDirectMusicPerformance8
*
iface
,
MUSIC_TIME
music_time
,
IDirectMusicSegmentState
*
state
);
/*****************************************************************************
/*****************************************************************************
* Auxiliary definitions
* Auxiliary definitions
...
...
dlls/dmime/performance.c
View file @
377ba8a7
...
@@ -24,6 +24,12 @@
...
@@ -24,6 +24,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
enum
dmus_internal_message_type
{
DMUS_PMSGT_INTERNAL_FIRST
=
0x10
,
DMUS_PMSGT_INTERNAL_SEGMENT_END
=
DMUS_PMSGT_INTERNAL_FIRST
,
};
struct
pchannel_block
{
struct
pchannel_block
{
DWORD
block_num
;
/* Block 0 is PChannels 0-15, Block 1 is PChannels 16-31, etc */
DWORD
block_num
;
/* Block 0 is PChannels 0-15, Block 1 is PChannels 16-31, etc */
struct
{
struct
{
...
@@ -158,7 +164,8 @@ static DWORD WINAPI message_thread_proc(void *args)
...
@@ -158,7 +164,8 @@ static DWORD WINAPI message_thread_proc(void *args)
return
0
;
return
0
;
}
}
static
HRESULT
performance_send_dirty_pmsg
(
struct
performance
*
This
,
MUSIC_TIME
music_time
)
static
HRESULT
performance_send_pmsg
(
struct
performance
*
This
,
MUSIC_TIME
music_time
,
DWORD
flags
,
DWORD
type
,
IUnknown
*
object
)
{
{
IDirectMusicPerformance8
*
performance
=
&
This
->
IDirectMusicPerformance8_iface
;
IDirectMusicPerformance8
*
performance
=
&
This
->
IDirectMusicPerformance8_iface
;
IDirectMusicGraph
*
graph
=
&
This
->
IDirectMusicGraph_iface
;
IDirectMusicGraph
*
graph
=
&
This
->
IDirectMusicGraph_iface
;
...
@@ -169,10 +176,11 @@ static HRESULT performance_send_dirty_pmsg(struct performance *This, MUSIC_TIME
...
@@ -169,10 +176,11 @@ static HRESULT performance_send_dirty_pmsg(struct performance *This, MUSIC_TIME
return
hr
;
return
hr
;
msg
->
mtTime
=
music_time
;
msg
->
mtTime
=
music_time
;
msg
->
dwFlags
=
DMUS_PMSGF_MUSICTIME
|
DMUS_PMSGF_TOOL_QUEUE
;
msg
->
dwFlags
=
DMUS_PMSGF_MUSICTIME
|
flags
;
msg
->
dwType
=
DMUS_PMSGT_DIRTY
;
msg
->
dwType
=
type
;
if
((
msg
->
punkUser
=
object
))
IUnknown_AddRef
(
object
);
if
(
FAILED
(
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
))
if
(
(
type
<
DMUS_PMSGT_INTERNAL_FIRST
&&
FAILED
(
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
)
))
||
FAILED
(
hr
=
IDirectMusicPerformance8_SendPMsg
(
performance
,
msg
)))
||
FAILED
(
hr
=
IDirectMusicPerformance8_SendPMsg
(
performance
,
msg
)))
IDirectMusicPerformance8_FreePMsg
(
performance
,
msg
);
IDirectMusicPerformance8_FreePMsg
(
performance
,
msg
);
...
@@ -252,6 +260,19 @@ static inline struct performance *impl_from_IDirectMusicPerformance8(IDirectMusi
...
@@ -252,6 +260,19 @@ static inline struct performance *impl_from_IDirectMusicPerformance8(IDirectMusi
return
CONTAINING_RECORD
(
iface
,
struct
performance
,
IDirectMusicPerformance8_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
performance
,
IDirectMusicPerformance8_iface
);
}
}
HRESULT
performance_send_segment_end
(
IDirectMusicPerformance8
*
iface
,
MUSIC_TIME
music_time
,
IDirectMusicSegmentState
*
state
)
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
HRESULT
hr
;
if
(
FAILED
(
hr
=
performance_send_pmsg
(
This
,
music_time
,
DMUS_PMSGF_TOOL_ATTIME
,
DMUS_PMSGT_INTERNAL_SEGMENT_END
,
(
IUnknown
*
)
state
)))
return
hr
;
return
S_OK
;
}
/* IDirectMusicPerformance8 IUnknown part: */
/* IDirectMusicPerformance8 IUnknown part: */
static
HRESULT
WINAPI
performance_QueryInterface
(
IDirectMusicPerformance8
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
static
HRESULT
WINAPI
performance_QueryInterface
(
IDirectMusicPerformance8
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
{
...
@@ -1050,8 +1071,7 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
...
@@ -1050,8 +1071,7 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
list_remove
(
&
message
->
entry
);
list_remove
(
&
message
->
entry
);
list_init
(
&
message
->
entry
);
list_init
(
&
message
->
entry
);
/* process notifications to end any pending segment states */
if
(
message
->
msg
.
dwType
==
DMUS_PMSGT_INTERNAL_SEGMENT_END
)
if
(
message
->
msg
.
dwType
==
DMUS_PMSGT_NOTIFICATION
)
hr
=
IDirectMusicTool_ProcessPMsg
(
&
This
->
IDirectMusicTool_iface
,
hr
=
IDirectMusicTool_ProcessPMsg
(
&
This
->
IDirectMusicTool_iface
,
(
IDirectMusicPerformance
*
)
iface
,
&
message
->
msg
);
(
IDirectMusicPerformance
*
)
iface
,
&
message
->
msg
);
else
else
...
@@ -1210,7 +1230,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
...
@@ -1210,7 +1230,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
hr
=
performance_send_notification_pmsg
(
This
,
start_time
,
This
->
notification_segment
,
hr
=
performance_send_notification_pmsg
(
This
,
start_time
,
This
->
notification_segment
,
GUID_NOTIFICATION_SEGMENT
,
DMUS_NOTIFICATION_SEGSTART
,
(
IUnknown
*
)
state
);
GUID_NOTIFICATION_SEGMENT
,
DMUS_NOTIFICATION_SEGSTART
,
(
IUnknown
*
)
state
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
performance_send_
dirty_pmsg
(
This
,
start_time
);
hr
=
performance_send_
pmsg
(
This
,
start_time
,
DMUS_PMSGF_TOOL_QUEUE
,
DMUS_PMSGT_DIRTY
,
NULL
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
segment_state_play
(
state
,
iface
);
hr
=
segment_state_play
(
state
,
iface
);
...
@@ -1222,7 +1242,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
...
@@ -1222,7 +1242,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface,
hr
=
performance_send_notification_pmsg
(
This
,
start_time
+
length
,
This
->
notification_segment
,
hr
=
performance_send_notification_pmsg
(
This
,
start_time
+
length
,
This
->
notification_segment
,
GUID_NOTIFICATION_SEGMENT
,
DMUS_NOTIFICATION_SEGALMOSTEND
,
(
IUnknown
*
)
state
);
GUID_NOTIFICATION_SEGMENT
,
DMUS_NOTIFICATION_SEGALMOSTEND
,
(
IUnknown
*
)
state
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
performance_send_
dirty_pmsg
(
This
,
start_time
+
length
);
hr
=
performance_send_
pmsg
(
This
,
start_time
+
length
,
DMUS_PMSGF_TOOL_QUEUE
,
DMUS_PMSGT_DIRTY
,
NULL
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
performance_send_notification_pmsg
(
This
,
start_time
+
length
,
This
->
notification_performance
,
hr
=
performance_send_notification_pmsg
(
This
,
start_time
+
length
,
This
->
notification_performance
,
GUID_NOTIFICATION_PERFORMANCE
,
DMUS_NOTIFICATION_MUSICSTOPPED
,
NULL
);
GUID_NOTIFICATION_PERFORMANCE
,
DMUS_NOTIFICATION_MUSICSTOPPED
,
NULL
);
...
@@ -1764,14 +1784,6 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
...
@@ -1764,14 +1784,6 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
struct
message
*
previous
;
struct
message
*
previous
;
BOOL
enabled
=
FALSE
;
BOOL
enabled
=
FALSE
;
if
(
IsEqualGUID
(
&
notif
->
guidNotificationType
,
&
GUID_NOTIFICATION_SEGMENT
)
&&
notif
->
dwNotificationOption
==
DMUS_NOTIFICATION_SEGEND
)
{
if
(
FAILED
(
hr
=
segment_state_end_play
((
IDirectMusicSegmentState
*
)
notif
->
punkUser
,
(
IDirectMusicPerformance8
*
)
performance
)))
WARN
(
"Failed to end segment state %p, hr %#lx
\n
"
,
notif
->
punkUser
,
hr
);
}
if
(
IsEqualGUID
(
&
notif
->
guidNotificationType
,
&
GUID_NOTIFICATION_PERFORMANCE
))
if
(
IsEqualGUID
(
&
notif
->
guidNotificationType
,
&
GUID_NOTIFICATION_PERFORMANCE
))
enabled
=
This
->
notification_performance
;
enabled
=
This
->
notification_performance
;
if
(
IsEqualGUID
(
&
notif
->
guidNotificationType
,
&
GUID_NOTIFICATION_SEGMENT
))
if
(
IsEqualGUID
(
&
notif
->
guidNotificationType
,
&
GUID_NOTIFICATION_SEGMENT
))
...
@@ -1799,6 +1811,12 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
...
@@ -1799,6 +1811,12 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface,
WARN
(
"Failed to play wave buffer, hr %#lx
\n
"
,
hr
);
WARN
(
"Failed to play wave buffer, hr %#lx
\n
"
,
hr
);
break
;
break
;
case
DMUS_PMSGT_INTERNAL_SEGMENT_END
:
if
(
FAILED
(
hr
=
segment_state_end_play
((
IDirectMusicSegmentState
*
)
msg
->
punkUser
,
(
IDirectMusicPerformance8
*
)
performance
)))
WARN
(
"Failed to end segment state %p, hr %#lx
\n
"
,
msg
->
punkUser
,
hr
);
break
;
default:
default:
FIXME
(
"Unhandled message type %#lx
\n
"
,
msg
->
dwType
);
FIXME
(
"Unhandled message type %#lx
\n
"
,
msg
->
dwType
);
break
;
break
;
...
...
dlls/dmime/segmentstate.c
View file @
377ba8a7
...
@@ -214,8 +214,8 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
...
@@ -214,8 +214,8 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
IDirectMusicSegmentState
*
iface
;
IDirectMusicSegmentState
*
iface
;
struct
segment_state
*
This
;
struct
segment_state
*
This
;
IDirectMusicTrack
*
track
;
IDirectMusicTrack
*
track
;
UINT
i
,
duration
;
HRESULT
hr
;
HRESULT
hr
;
UINT
i
;
TRACE
(
"(%p, %lu, %p)
\n
"
,
segment
,
start_time
,
ret_iface
);
TRACE
(
"(%p, %lu, %p)
\n
"
,
segment
,
start_time
,
ret_iface
);
...
@@ -263,6 +263,9 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
...
@@ -263,6 +263,9 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time
}
}
}
}
duration
=
This
->
end_point
-
This
->
start_point
;
if
(
SUCCEEDED
(
hr
))
hr
=
performance_send_segment_end
(
performance
,
start_time
+
duration
,
iface
);
if
(
SUCCEEDED
(
hr
))
*
ret_iface
=
iface
;
if
(
SUCCEEDED
(
hr
))
*
ret_iface
=
iface
;
else
IDirectMusicSegmentState_Release
(
iface
);
else
IDirectMusicSegmentState_Release
(
iface
);
return
hr
;
return
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