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
0b0770c8
Commit
0b0770c8
authored
Jun 01, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Nov 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mciseq: The native MCI sequencer cannot record.
parent
19a2d144
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
70 deletions
+13
-70
mcimidi.c
dlls/mciseq/mcimidi.c
+7
-70
midi.c
dlls/winmm/tests/midi.c
+6
-0
No files found.
dlls/mciseq/mcimidi.c
View file @
0b0770c8
...
@@ -21,9 +21,8 @@
...
@@ -21,9 +21,8 @@
/* TODO:
/* TODO:
* + implement it correctly
* + implement it correctly
* + finish asynchronous commands
(especially for reading/record)
* + finish asynchronous commands
* + better implement non waiting command (without the MCI_WAIT flag).
* + better implement non waiting command (without the MCI_WAIT flag).
* + implement the recording features
*/
*/
#include <stdlib.h>
#include <stdlib.h>
...
@@ -970,7 +969,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -970,7 +969,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
}
}
dwRet
=
midiOutOpen
((
LPHMIDIOUT
)
&
wmm
->
hMidi
,
wmm
->
wPort
,
0L
,
0L
,
CALLBACK_NULL
);
dwRet
=
midiOutOpen
((
LPHMIDIOUT
)
&
wmm
->
hMidi
,
wmm
->
wPort
,
0L
,
0L
,
CALLBACK_NULL
);
/* dwRet = midiInOpen(&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL);*/
if
(
dwRet
!=
MMSYSERR_NOERROR
)
{
if
(
dwRet
!=
MMSYSERR_NOERROR
)
{
return
dwRet
;
return
dwRet
;
}
}
...
@@ -1187,64 +1185,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -1187,64 +1185,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
}
}
/**************************************************************************
/**************************************************************************
* MIDI_mciRecord [internal]
*/
static
DWORD
MIDI_mciRecord
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_RECORD_PARMS
lpParms
)
{
int
start
,
end
;
MIDIHDR
midiHdr
;
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
TRACE
(
"(%04X, %08X, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
wmm
==
0
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
->
hFile
==
0
)
{
WARN
(
"Can't find file=%s!
\n
"
,
debugstr_w
(
wmm
->
lpstrElementName
));
return
MCIERR_FILE_NOT_FOUND
;
}
start
=
1
;
end
=
99999
;
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
start
=
lpParms
->
dwFrom
;
TRACE
(
"MCI_FROM=%d
\n
"
,
start
);
}
if
(
lpParms
&&
(
dwFlags
&
MCI_TO
))
{
end
=
lpParms
->
dwTo
;
TRACE
(
"MCI_TO=%d
\n
"
,
end
);
}
midiHdr
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1200
);
if
(
!
midiHdr
.
lpData
)
return
MCIERR_OUT_OF_MEMORY
;
midiHdr
.
dwBufferLength
=
1024
;
midiHdr
.
dwUser
=
0L
;
midiHdr
.
dwFlags
=
0L
;
midiInPrepareHeader
((
HMIDIIN
)
wmm
->
hMidi
,
&
midiHdr
,
sizeof
(
MIDIHDR
));
TRACE
(
"After MIDM_PREPARE
\n
"
);
wmm
->
dwStatus
=
MCI_MODE_RECORD
;
/* FIXME: there is no buffer added */
while
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
TRACE
(
"wmm->dwStatus=%p %d
\n
"
,
&
wmm
->
dwStatus
,
wmm
->
dwStatus
);
midiHdr
.
dwBytesRecorded
=
0
;
midiInStart
((
HMIDIIN
)
wmm
->
hMidi
);
TRACE
(
"midiInStart => dwBytesRecorded=%u
\n
"
,
midiHdr
.
dwBytesRecorded
);
if
(
midiHdr
.
dwBytesRecorded
==
0
)
break
;
}
TRACE
(
"Before MIDM_UNPREPARE
\n
"
);
midiInUnprepareHeader
((
HMIDIIN
)
wmm
->
hMidi
,
&
midiHdr
,
sizeof
(
MIDIHDR
));
TRACE
(
"After MIDM_UNPREPARE
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
midiHdr
.
lpData
);
midiHdr
.
lpData
=
NULL
;
wmm
->
dwStatus
=
MCI_MODE_STOP
;
if
(
lpParms
&&
(
dwFlags
&
MCI_NOTIFY
))
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify
(
HWND_32
(
LOWORD
(
lpParms
->
dwCallback
)),
wmm
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
return
0
;
}
/**************************************************************************
* MIDI_mciPause [internal]
* MIDI_mciPause [internal]
*/
*/
static
DWORD
MIDI_mciPause
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_GENERIC_PARMS
lpParms
)
static
DWORD
MIDI_mciPause
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_GENERIC_PARMS
lpParms
)
...
@@ -1554,7 +1494,7 @@ static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
...
@@ -1554,7 +1494,7 @@ static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
break
;
break
;
case
MCI_GETDEVCAPS_CAN_RECORD
:
case
MCI_GETDEVCAPS_CAN_RECORD
:
TRACE
(
"MCI_GETDEVCAPS_CAN_RECORD !
\n
"
);
TRACE
(
"MCI_GETDEVCAPS_CAN_RECORD !
\n
"
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRU
E
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALS
E
);
ret
=
MCI_RESOURCE_RETURNED
;
ret
=
MCI_RESOURCE_RETURNED
;
break
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
case
MCI_GETDEVCAPS_CAN_SAVE
:
...
@@ -1679,7 +1619,6 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
...
@@ -1679,7 +1619,6 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
case
MCI_OPEN_DRIVER
:
return
MIDI_mciOpen
(
dwDevID
,
dwParam1
,
(
LPMCI_OPEN_PARMSW
)
dwParam2
);
case
MCI_OPEN_DRIVER
:
return
MIDI_mciOpen
(
dwDevID
,
dwParam1
,
(
LPMCI_OPEN_PARMSW
)
dwParam2
);
case
MCI_CLOSE_DRIVER
:
return
MIDI_mciClose
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
case
MCI_CLOSE_DRIVER
:
return
MIDI_mciClose
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
case
MCI_PLAY
:
return
MIDI_mciPlay
(
dwDevID
,
dwParam1
,
(
LPMCI_PLAY_PARMS
)
dwParam2
);
case
MCI_PLAY
:
return
MIDI_mciPlay
(
dwDevID
,
dwParam1
,
(
LPMCI_PLAY_PARMS
)
dwParam2
);
case
MCI_RECORD
:
return
MIDI_mciRecord
(
dwDevID
,
dwParam1
,
(
LPMCI_RECORD_PARMS
)
dwParam2
);
case
MCI_STOP
:
return
MIDI_mciStop
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
case
MCI_STOP
:
return
MIDI_mciStop
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
case
MCI_SET
:
return
MIDI_mciSet
(
dwDevID
,
dwParam1
,
(
LPMCI_SEQ_SET_PARMS
)
dwParam2
);
case
MCI_SET
:
return
MIDI_mciSet
(
dwDevID
,
dwParam1
,
(
LPMCI_SEQ_SET_PARMS
)
dwParam2
);
case
MCI_PAUSE
:
return
MIDI_mciPause
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
case
MCI_PAUSE
:
return
MIDI_mciPause
(
dwDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
...
@@ -1688,11 +1627,13 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
...
@@ -1688,11 +1627,13 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
case
MCI_GETDEVCAPS
:
return
MIDI_mciGetDevCaps
(
dwDevID
,
dwParam1
,
(
LPMCI_GETDEVCAPS_PARMS
)
dwParam2
);
case
MCI_GETDEVCAPS
:
return
MIDI_mciGetDevCaps
(
dwDevID
,
dwParam1
,
(
LPMCI_GETDEVCAPS_PARMS
)
dwParam2
);
case
MCI_INFO
:
return
MIDI_mciInfo
(
dwDevID
,
dwParam1
,
(
LPMCI_INFO_PARMSW
)
dwParam2
);
case
MCI_INFO
:
return
MIDI_mciInfo
(
dwDevID
,
dwParam1
,
(
LPMCI_INFO_PARMSW
)
dwParam2
);
case
MCI_SEEK
:
return
MIDI_mciSeek
(
dwDevID
,
dwParam1
,
(
LPMCI_SEEK_PARMS
)
dwParam2
);
case
MCI_SEEK
:
return
MIDI_mciSeek
(
dwDevID
,
dwParam1
,
(
LPMCI_SEEK_PARMS
)
dwParam2
);
/* commands that should be supported */
/* commands that should report an error */
case
MCI_RECORD
:
case
MCI_LOAD
:
case
MCI_LOAD
:
case
MCI_SAVE
:
case
MCI_SAVE
:
case
MCI_FREEZE
:
case
MCI_FREEZE
:
case
MCI_PUT
:
case
MCI_PUT
:
case
MCI_WINDOW
:
case
MCI_REALIZE
:
case
MCI_REALIZE
:
case
MCI_UNFREEZE
:
case
MCI_UNFREEZE
:
case
MCI_UPDATE
:
case
MCI_UPDATE
:
...
@@ -1704,11 +1645,7 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
...
@@ -1704,11 +1645,7 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
case
MCI_CUT
:
case
MCI_CUT
:
case
MCI_DELETE
:
case
MCI_DELETE
:
case
MCI_PASTE
:
case
MCI_PASTE
:
WARN
(
"Unsupported command [%u]
\n
"
,
wMsg
);
TRACE
(
"Unsupported command [0x%x]
\n
"
,
wMsg
);
break
;
/* commands that should report an error */
case
MCI_WINDOW
:
TRACE
(
"Unsupported command [%u]
\n
"
,
wMsg
);
break
;
break
;
case
MCI_OPEN
:
case
MCI_OPEN
:
case
MCI_CLOSE
:
case
MCI_CLOSE
:
...
@@ -1718,5 +1655,5 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
...
@@ -1718,5 +1655,5 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
TRACE
(
"Sending msg [%u] to default driver proc
\n
"
,
wMsg
);
TRACE
(
"Sending msg [%u] to default driver proc
\n
"
,
wMsg
);
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
}
return
MCIERR_UN
RECOGNIZED_COMMAND
;
return
MCIERR_UN
SUPPORTED_FUNCTION
;
}
}
dlls/winmm/tests/midi.c
View file @
0b0770c8
...
@@ -198,6 +198,12 @@ static void test_midi_mci(HWND hwnd)
...
@@ -198,6 +198,12 @@ static void test_midi_mci(HWND hwnd)
err
=
mciSendString
(
"sysinfo sequencer quantity"
,
buf
,
sizeof
(
buf
),
hwnd
);
err
=
mciSendString
(
"sysinfo sequencer quantity"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"mci sysinfo sequencer quantity returned %d
\n
"
,
err
);
ok
(
!
err
,
"mci sysinfo sequencer quantity returned %d
\n
"
,
err
);
if
(
!
err
)
trace
(
"Found %s MCI sequencer devices
\n
"
,
buf
);
if
(
!
err
)
trace
(
"Found %s MCI sequencer devices
\n
"
,
buf
);
if
(
!
strcmp
(
buf
,
"0"
))
return
;
err
=
mciSendString
(
"capability sequencer can record"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"mci sysinfo sequencer quantity returned %d
\n
"
,
err
);
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"false"
),
"capability can record is %s
\n
"
,
buf
);
}
}
...
...
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