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
4dbceec8
Commit
4dbceec8
authored
Oct 04, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mciseq: Separate player loop from MCI_PLAY command.
parent
2b54cb54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
44 deletions
+53
-44
mcimidi.c
dlls/mciseq/mcimidi.c
+53
-44
No files found.
dlls/mciseq/mcimidi.c
View file @
4dbceec8
...
...
@@ -903,55 +903,15 @@ static MCI_MIDITRACK* MIDI_mciFindNextEvent(WINE_MCIMIDI* wmm, LPDWORD hiPulse)
}
/**************************************************************************
* MIDI_
mciPlay
[internal]
* MIDI_
player
[internal]
*/
static
DWORD
MIDI_
mciPlay
(
WINE_MCIMIDI
*
wmm
,
DWORD
dwFlags
,
LPMCI_PLAY_PARMS
lpParm
s
)
static
DWORD
MIDI_
player
(
WINE_MCIMIDI
*
wmm
,
DWORD
dwStartMS
,
DWORD
dwEndMS
,
DWORD
dwFlag
s
)
{
DWORD
dwStartMS
,
dwEndMS
;
DWORD
dwRet
=
0
;
DWORD
dwRet
;
WORD
doPlay
,
nt
;
MCI_MIDITRACK
*
mmt
;
DWORD
hiPulse
;
HANDLE
oldcb
;
TRACE
(
"(%d, %08X, %p);
\n
"
,
wmm
->
wDevID
,
dwFlags
,
lpParms
);
if
(
wmm
->
hFile
==
0
)
{
WARN
(
"Can't play: no file %s!
\n
"
,
debugstr_w
(
wmm
->
lpstrElementName
));
return
MCIERR_FILE_NOT_FOUND
;
}
if
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
if
(
wmm
->
dwStatus
==
MCI_MODE_PAUSE
)
{
/* FIXME: parameters (start/end) in lpParams may not be used */
return
MIDI_mciResume
(
wmm
,
dwFlags
,
(
LPMCI_GENERIC_PARMS
)
lpParms
);
}
WARN
(
"Can't play: device is not stopped !
\n
"
);
return
MCIERR_INTERNAL
;
}
if
(
!
(
dwFlags
&
MCI_WAIT
))
{
return
MCI_SendCommandAsync
(
wmm
->
wDevID
,
MCI_PLAY
,
dwFlags
,
(
DWORD_PTR
)
lpParms
,
sizeof
(
MCI_PLAY_PARMS
));
}
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
dwStartMS
=
MIDI_ConvertTimeFormatToMS
(
wmm
,
lpParms
->
dwFrom
);
}
else
{
dwStartMS
=
wmm
->
dwPositionMS
;
}
if
(
lpParms
&&
(
dwFlags
&
MCI_TO
))
{
dwEndMS
=
MIDI_ConvertTimeFormatToMS
(
wmm
,
lpParms
->
dwTo
);
}
else
{
dwEndMS
=
0xFFFFFFFFul
;
}
TRACE
(
"Playing from %u to %u
\n
"
,
dwStartMS
,
dwEndMS
);
oldcb
=
InterlockedExchangePointer
(
&
wmm
->
hCallback
,
(
dwFlags
&
MCI_NOTIFY
)
?
HWND_32
(
LOWORD
(
lpParms
->
dwCallback
))
:
NULL
);
if
(
oldcb
)
mciDriverNotify
(
oldcb
,
wmm
->
wDevID
,
MCI_NOTIFY_ABORTED
);
oldcb
=
NULL
;
HANDLE
oldcb
=
NULL
;
/* init tracks */
for
(
nt
=
0
;
nt
<
wmm
->
nTracks
;
nt
++
)
{
...
...
@@ -1183,6 +1143,55 @@ static DWORD MIDI_mciPlay(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_PLAY_PARMS lpP
}
/**************************************************************************
* MIDI_mciPlay [internal]
*/
static
DWORD
MIDI_mciPlay
(
WINE_MCIMIDI
*
wmm
,
DWORD
dwFlags
,
LPMCI_PLAY_PARMS
lpParms
)
{
DWORD
dwStartMS
,
dwEndMS
;
HANDLE
oldcb
;
TRACE
(
"(%d, %08X, %p);
\n
"
,
wmm
->
wDevID
,
dwFlags
,
lpParms
);
if
(
wmm
->
hFile
==
0
)
{
WARN
(
"Can't play: no file %s!
\n
"
,
debugstr_w
(
wmm
->
lpstrElementName
));
return
MCIERR_FILE_NOT_FOUND
;
}
if
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
if
(
wmm
->
dwStatus
==
MCI_MODE_PAUSE
)
{
/* FIXME: parameters (start/end) in lpParams may not be used */
return
MIDI_mciResume
(
wmm
,
dwFlags
,
(
LPMCI_GENERIC_PARMS
)
lpParms
);
}
WARN
(
"Can't play: device is not stopped !
\n
"
);
return
MCIERR_INTERNAL
;
}
if
(
!
(
dwFlags
&
MCI_WAIT
))
{
return
MCI_SendCommandAsync
(
wmm
->
wDevID
,
MCI_PLAY
,
dwFlags
,
(
DWORD_PTR
)
lpParms
,
sizeof
(
MCI_PLAY_PARMS
));
}
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
dwStartMS
=
MIDI_ConvertTimeFormatToMS
(
wmm
,
lpParms
->
dwFrom
);
}
else
{
dwStartMS
=
wmm
->
dwPositionMS
;
}
if
(
lpParms
&&
(
dwFlags
&
MCI_TO
))
{
dwEndMS
=
MIDI_ConvertTimeFormatToMS
(
wmm
,
lpParms
->
dwTo
);
}
else
{
dwEndMS
=
0xFFFFFFFFul
;
}
TRACE
(
"Playing from %u to %u
\n
"
,
dwStartMS
,
dwEndMS
);
oldcb
=
InterlockedExchangePointer
(
&
wmm
->
hCallback
,
(
dwFlags
&
MCI_NOTIFY
)
?
HWND_32
(
LOWORD
(
lpParms
->
dwCallback
))
:
NULL
);
if
(
oldcb
)
mciDriverNotify
(
oldcb
,
wmm
->
wDevID
,
MCI_NOTIFY_ABORTED
);
return
MIDI_player
(
wmm
,
dwStartMS
,
dwEndMS
,
dwFlags
);
}
/**************************************************************************
* MIDI_mciPause [internal]
*/
static
DWORD
MIDI_mciPause
(
WINE_MCIMIDI
*
wmm
,
DWORD
dwFlags
,
LPMCI_GENERIC_PARMS
lpParms
)
...
...
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