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
b26cfe76
Commit
b26cfe76
authored
Jul 24, 1999
by
Eric Pouech
Committed by
Alexandre Julliard
Jul 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed return values for some messages in DriverProc (MCI_GETDEVCAPS &
MCI_STATUS) for mciSendString.
parent
71c7efac
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
331 additions
and
246 deletions
+331
-246
mcianim.c
multimedia/mcianim.c
+84
-72
mciavi.c
multimedia/mciavi.c
+46
-39
mcicda.c
multimedia/mcicda.c
+81
-61
mcimidi.c
multimedia/mcimidi.c
+61
-48
mciwave.c
multimedia/mciwave.c
+59
-26
No files found.
multimedia/mcianim.c
View file @
b26cfe76
...
...
@@ -47,7 +47,7 @@ static DWORD ANIM_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wma
->
wDevID
=
modp
->
wDeviceID
;
mciSetDriverData
(
wma
->
wDevID
,
(
DWORD
)
wma
);
modp
->
wCustomCommandTable
=
-
1
;
modp
->
wCustomCommandTable
=
MCI_NO_COMMAND_TABLE
;
modp
->
wType
=
MCI_DEVTYPE_SEQUENCER
;
return
modp
->
wDeviceID
;
}
...
...
@@ -165,6 +165,7 @@ static DWORD ANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS
lpParms
)
{
WINE_MCIANIM
*
wma
=
ANIM_mciGetOpenDrv
(
wDevID
);
DWORD
ret
;
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -173,47 +174,61 @@ static DWORD ANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
if
(
dwFlags
&
MCI_GETDEVCAPS_ITEM
)
{
TRACE
(
"MCI_GETDEVCAPS_ITEM dwItem=%08lX;
\n
"
,
lpParms
->
dwItem
);
switch
(
lpParms
->
dwItem
)
{
case
MCI_GETDEVCAPS_CAN_RECORD
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_AUDIO
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_VIDEO
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_DEVICE_TYPE
:
lpParms
->
dwReturn
=
MCI_DEVTYPE_ANIMATION
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_DEVTYPE_ANIMATION
,
MCI_DEVTYPE_ANIMATION
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_USES_FILES
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_COMPOUND_DEVICE
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_EJECT
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_PLAY
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
default:
FIXME
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
WARN
(
"No GETDEVCAPS_ITEM !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
TRACE
(
"lpParms->dwReturn=%08lX;
\n
"
,
lpParms
->
dwReturn
);
return
0
;
return
ret
;
}
/**************************************************************************
* ANIM_CalcTime [internal]
*/
static
DWORD
ANIM_CalcTime
(
WINE_MCIANIM
*
wma
,
DWORD
dwFormatType
,
DWORD
dwFrame
)
static
DWORD
ANIM_CalcTime
(
WINE_MCIANIM
*
wma
,
DWORD
dwFormatType
,
DWORD
dwFrame
,
LPDWORD
lpRet
)
{
DWORD
dwTime
=
0
;
UINT16
wTrack
;
...
...
@@ -226,6 +241,7 @@ static DWORD ANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFrame)
switch
(
dwFormatType
)
{
case
MCI_FORMAT_MILLISECONDS
:
dwTime
=
dwFrame
/
ANIMFRAMES_PERSEC
*
1000
;
*
lpRet
=
0
;
TRACE
(
"MILLISECONDS %lu
\n
"
,
dwTime
);
break
;
case
MCI_FORMAT_MSF
:
...
...
@@ -234,8 +250,8 @@ static DWORD ANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFrame)
wFrames
=
dwFrame
-
ANIMFRAMES_PERMIN
*
wMinutes
-
ANIMFRAMES_PERSEC
*
wSeconds
;
dwTime
=
MCI_MAKE_MSF
(
wMinutes
,
wSeconds
,
wFrames
);
TRACE
(
"MSF %02u:%02u:%02u -> dwTime=%lu
\n
"
,
wMinutes
,
wSeconds
,
wFrames
,
dwTime
)
;
TRACE
(
"MSF %02u:%02u:%02u -> dwTime=%lu
\n
"
,
wMinutes
,
wSeconds
,
wFrames
,
dwTime
);
*
lpRet
=
MCI_COLONIZED3_RETURN
;
break
;
default:
/* unknown format ! force TMSF ! ... */
...
...
@@ -252,8 +268,8 @@ static DWORD ANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFrame)
wFrames
=
dwFrame
-
ANIMFRAMES_PERMIN
*
wMinutes
-
ANIMFRAMES_PERSEC
*
wSeconds
;
dwTime
=
MCI_MAKE_TMSF
(
wTrack
,
wMinutes
,
wSeconds
,
wFrames
);
TRACE
(
"%02u-%02u:%02u:%02u
\n
"
,
wTrack
,
wMinutes
,
wSeconds
,
wFrames
);
*
lpRet
=
MCI_COLONIZED4_RETURN
;
TRACE
(
"%02u-%02u:%02u:%02u
\n
"
,
wTrack
,
wMinutes
,
wSeconds
,
wFrames
);
break
;
}
return
dwTime
;
...
...
@@ -302,23 +318,22 @@ static DWORD ANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTime)
return
dwFrame
;
}
/**************************************************************************
* ANIM_mciInfo [internal]
*/
static
DWORD
ANIM_mciInfo
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_INFO_PARMS16
lpParms
)
{
WINE_MCIANIM
*
wma
=
ANIM_mciGetOpenDrv
(
wDevID
);
DWORD
ret
=
0
;
LPSTR
str
=
0
;
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
{
ret
=
MCIERR_NULL_PARAMETER_BLOCK
;
}
else
if
(
wma
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
if
(
wma
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
TRACE
(
"buf=%p, len=%lu
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
switch
(
dwFlags
)
{
...
...
@@ -333,16 +348,10 @@ static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
break
;
default:
WARN
(
"Don't know this info command (%lu)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
if
(
str
)
{
ret
=
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
ret
;
return
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
)
;
}
/**************************************************************************
...
...
@@ -351,6 +360,7 @@ static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
static
DWORD
ANIM_mciStatus
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_STATUS_PARMS
lpParms
)
{
WINE_MCIANIM
*
wma
=
ANIM_mciGetOpenDrv
(
wDevID
);
DWORD
ret
;
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -358,8 +368,8 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
if
(
wma
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -368,35 +378,33 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
case
MCI_STATUS_CURRENT_TRACK
:
lpParms
->
dwReturn
=
wma
->
nCurTrack
;
TRACE
(
"CURRENT_TRACK=%lu!
\n
"
,
lpParms
->
dwReturn
);
return
0
;
break
;
case
MCI_STATUS_LENGTH
:
if
(
dwFlags
&
MCI_TRACK
)
{
TRACE
(
"MCI_TRACK #%lu LENGTH=??? !
\n
"
,
lpParms
->
dwTrack
);
TRACE
(
"MCI_TRACK #%lu LENGTH=??? !
\n
"
,
lpParms
->
dwTrack
);
if
(
lpParms
->
dwTrack
>
wma
->
nTracks
)
return
MCIERR_OUTOFRANGE
;
lpParms
->
dwReturn
=
wma
->
lpdwTrackLen
[
lpParms
->
dwTrack
];
}
else
lpParms
->
dwReturn
=
wma
->
dwTotalLen
;
lpParms
->
dwReturn
=
ANIM_CalcTime
(
wma
,
wma
->
dwTimeFormat
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
ANIM_CalcTime
(
wma
,
wma
->
dwTimeFormat
,
lpParms
->
dwReturn
,
&
ret
);
TRACE
(
"LENGTH=%lu !
\n
"
,
lpParms
->
dwReturn
);
return
0
;
break
;
case
MCI_STATUS_MODE
:
lpParms
->
dwReturn
=
wma
->
mode
;
TRACE
(
"MCI_STATUS_MODE=%08lX !
\n
"
,
lpParms
->
dwReturn
)
;
return
0
;
TRACE
(
"MCI_STATUS_MODE=%04X !
\n
"
,
wma
->
mode
)
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wma
->
mode
,
wma
->
mode
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_MEDIA_PRESENT
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
TRACE
(
"MCI_STATUS_MEDIA_PRESENT !
\n
"
);
return
0
;
break
;
case
MCI_STATUS_NUMBER_OF_TRACKS
:
lpParms
->
dwReturn
=
1
;
TRACE
(
"MCI_STATUS_NUMBER_OF_TRACKS = %lu !
\n
"
,
lpParms
->
dwReturn
);
if
(
lpParms
->
dwReturn
==
(
WORD
)
-
1
)
return
MCIERR_INTERNAL
;
return
0
;
TRACE
(
"MCI_STATUS_NUMBER_OF_TRACKS = %lu !
\n
"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_POSITION
:
lpParms
->
dwReturn
=
wma
->
dwCurFrame
;
if
(
dwFlags
&
MCI_STATUS_START
)
{
...
...
@@ -409,25 +417,29 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
lpParms
->
dwReturn
=
wma
->
lpdwTrackPos
[
lpParms
->
dwTrack
-
1
];
TRACE
(
"get MCI_TRACK #%lu !
\n
"
,
lpParms
->
dwTrack
);
}
lpParms
->
dwReturn
=
ANIM_CalcTime
(
wma
,
wma
->
dwTimeFormat
,
lpParms
->
dwReturn
);
TRACE
(
"MCI_STATUS_POSITION=%08lX !
\n
"
,
lpParms
->
dwReturn
);
return
0
;
lpParms
->
dwReturn
=
ANIM_CalcTime
(
wma
,
wma
->
dwTimeFormat
,
lpParms
->
dwReturn
,
&
ret
);
TRACE
(
"MCI_STATUS_POSITION=%08lX !
\n
"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_READY
:
TRACE
(
"MCI_STATUS_READY !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
return
0
;
case
MCI_STATUS_TIME_FORMAT
:
TRACE
(
"MCI_STATUS_TIME_FORMAT !
\n
"
);
lpParms
->
dwReturn
=
MCI_FORMAT_MILLISECONDS
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_FORMAT_MILLISECONDS
,
MCI_FORMAT_MILLISECONDS
);
TRACE
(
"MCI_STATUS_TIME_FORMAT => %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
return
0
;
default:
WARN
(
"Unknown command %08lX !
\n
"
,
lpParms
->
dwItem
);
FIXME
(
"Unknown command %08lX !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
WARN
(
"No MCI_STATUS_ITEM !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
WARN
(
"Not MCI_STATUS_ITEM !
\n
"
);
return
0
;
return
ret
;
}
...
...
@@ -478,8 +490,8 @@ static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
wma
->
mode
=
MCI_MODE_STOP
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -497,8 +509,8 @@ static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
if
(
lpParms
==
NULL
)
return
MCIERR_INTERNAL
;
wma
->
mode
=
MCI_MODE_PAUSE
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -516,8 +528,8 @@ static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp
if
(
lpParms
==
NULL
)
return
MCIERR_INTERNAL
;
wma
->
mode
=
MCI_MODE_STOP
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -537,7 +549,7 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
if
(
lpParms
==
NULL
)
return
MCIERR_INTERNAL
;
wma
->
mode
=
MCI_MODE_SEEK
;
switch
(
dwFlags
)
{
switch
(
dwFlags
)
{
case
MCI_SEEK_TO_START
:
PlayParms
.
dwFrom
=
0
;
break
;
...
...
@@ -552,8 +564,8 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
if
(
dwRet
!=
0
)
return
dwRet
;
dwRet
=
ANIM_mciStop
(
wDevID
,
MCI_WAIT
,
(
LPMCI_GENERIC_PARMS
)
&
PlayParms
);
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -569,6 +581,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
WINE_MCIANIM
*
wma
=
ANIM_mciGetOpenDrv
(
wDevID
);
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
)
return
MCIERR_INTERNAL
;
if
(
wma
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
/*
...
...
@@ -596,8 +609,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
if
(
dwFlags
&
MCI_SET_ON
)
return
MCIERR_UNSUPPORTED_FUNCTION
;
if
(
dwFlags
&
MCI_SET_OFF
)
return
MCIERR_UNSUPPORTED_FUNCTION
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
...
...
@@ -610,7 +622,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
LONG
CALLBACK
MCIANIM_DriverProc
(
DWORD
dwDevID
,
HDRVR
hDriv
,
DWORD
wMsg
,
DWORD
dwParam1
,
DWORD
dwParam2
)
{
switch
(
wMsg
)
{
switch
(
wMsg
)
{
case
DRV_LOAD
:
return
1
;
case
DRV_FREE
:
return
1
;
case
DRV_OPEN
:
return
ANIM_drvOpen
((
LPSTR
)
dwParam1
,
(
LPMCI_OPEN_DRIVER_PARMSA
)
dwParam2
);
...
...
@@ -649,14 +661,14 @@ LONG CALLBACK MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_CUT
:
case
MCI_DELETE
:
case
MCI_PASTE
:
WARN
(
"Unsupported command=%s
\n
"
,
MCI_Command
ToString
(
wMsg
));
FIXME
(
"Unsupported message=%s
\n
"
,
MCI_Message
ToString
(
wMsg
));
break
;
case
MCI_OPEN
:
case
MCI_CLOSE
:
FIXME
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
ERR
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
break
;
default:
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Command
ToString
(
wMsg
));
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Message
ToString
(
wMsg
));
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
return
MCIERR_UNRECOGNIZED_COMMAND
;
...
...
multimedia/mciavi.c
View file @
b26cfe76
...
...
@@ -44,7 +44,7 @@ static DWORD AVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wma
->
wDevID
=
modp
->
wDeviceID
;
mciSetDriverData
(
wma
->
wDevID
,
(
DWORD
)
wma
);
modp
->
wCustomCommandTable
=
-
1
;
modp
->
wCustomCommandTable
=
MCI_NO_COMMAND_TABLE
;
modp
->
wType
=
MCI_DEVTYPE_SEQUENCER
;
return
modp
->
wDeviceID
;
}
...
...
@@ -354,6 +354,7 @@ static DWORD AVI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParm
static
DWORD
AVI_mciStatus
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_DGV_STATUS_PARMSA
lpParms
)
{
WINE_MCIAVI
*
wma
=
AVI_mciGetOpenDev
(
wDevID
);
DWORD
ret
=
0
;
TRACE
(
"(%04x, %08lX, %p) : stub
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -376,12 +377,14 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
TRACE
(
"MCI_STATUS_LENGTH => %lu
\n
"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_MODE
:
lpParms
->
dwReturn
=
wma
->
wStatus
;
TRACE
(
"MCI_STATUS_MODE => %lu
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wma
->
wStatus
,
wma
->
wStatus
);
ret
=
MCI_RESOURCE_RETURNED
;
TRACE
(
"MCI_STATUS_MODE => %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
break
;
case
MCI_STATUS_MEDIA_PRESENT
:
TRACE
(
"MCI_STATUS_MEDIA_PRESENT => TRUE
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_NUMBER_OF_TRACKS
:
lpParms
->
dwReturn
=
3
;
...
...
@@ -394,15 +397,18 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
(
dwFlags
&
MCI_STATUS_START
)
?
"start"
:
"current"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_READY
:
lpParms
->
dwReturn
=
(
wma
->
wStatus
!=
MCI_MODE_NOT_READY
);
TRACE
(
"MCI_STATUS_READY = %lu
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
(
wma
->
wStatus
==
MCI_MODE_NOT_READY
)
?
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
)
:
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
TRACE
(
"MCI_STATUS_READY = %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
break
;
case
MCI_STATUS_TIME_FORMAT
:
lpParms
->
dwReturn
=
wma
->
dwTimeFormat
;
TRACE
(
"MCI_STATUS_TIME_FORMAT => %lu
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wma
->
dwTimeFormat
,
wma
->
dwTimeFormat
);
TRACE
(
"MCI_STATUS_TIME_FORMAT => %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
break
;
default:
WARN
(
"Unknowm command %08lX !
\n
"
,
lpParms
->
dwItem
);
FIXME
(
"Unknowm command %08lX !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
...
...
@@ -415,7 +421,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
wma
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
return
0
;
return
ret
;
}
/***************************************************************************
...
...
@@ -424,6 +430,7 @@ static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA
static
DWORD
AVI_mciGetDevCaps
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_GETDEVCAPS_PARMS
lpParms
)
{
WINE_MCIAVI
*
wma
=
AVI_mciGetOpenDev
(
wDevID
);
DWORD
ret
;
TRACE
(
"(%04x, %08lX, %p) : stub
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -434,49 +441,58 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P
switch
(
lpParms
->
dwItem
)
{
case
MCI_GETDEVCAPS_DEVICE_TYPE
:
TRACE
(
"MCI_GETDEVCAPS_DEVICE_TYPE !
\n
"
);
lpParms
->
dwReturn
=
MCI_DEVTYPE_DIGITAL_VIDEO
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_DEVTYPE_DIGITAL_VIDEO
,
MCI_DEVTYPE_DIGITAL_VIDEO
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_AUDIO
:
TRACE
(
"MCI_GETDEVCAPS_HAS_AUDIO !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_VIDEO
:
TRACE
(
"MCI_GETDEVCAPS_HAS_VIDEO !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_USES_FILES
:
TRACE
(
"MCI_GETDEVCAPS_USES_FILES !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_COMPOUND_DEVICE
:
TRACE
(
"MCI_GETDEVCAPS_COMPOUND_DEVICE !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_EJECT
:
TRACE
(
"MCI_GETDEVCAPS_CAN_EJECT !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_PLAY
:
TRACE
(
"MCI_GETDEVCAPS_CAN_PLAY !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_RECORD
:
TRACE
(
"MCI_GETDEVCAPS_CAN_RECORD !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
TRACE
(
"MCI_GETDEVCAPS_CAN_SAVE !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
default:
TRAC
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
FIXM
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
TRACE
(
"No GetDevCaps-Item !
\n
"
);
WARN
(
"No GetDevCaps-Item !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
0
;
return
ret
;
}
/***************************************************************************
...
...
@@ -484,17 +500,15 @@ static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P
*/
static
DWORD
AVI_mciInfo
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_DGV_INFO_PARMSA
lpParms
)
{
DWORD
ret
=
0
;
LPSTR
str
=
0
;
WINE_MCIAVI
*
wma
=
AVI_mciGetOpenDev
(
wDevID
);
TRACE
(
"(%04X, %08lX, %p) : stub;
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
{
ret
=
MCIERR_NULL_PARAMETER_BLOCK
;
}
else
if
(
wma
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
if
(
wma
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
TRACE
(
"buf=%p, len=%lu
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
switch
(
dwFlags
)
{
...
...
@@ -513,16 +527,9 @@ static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpP
#endif
default:
WARN
(
"Don't know this info command (%lu)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
if
(
str
)
{
ret
=
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
ret
;
return
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
/***************************************************************************
...
...
@@ -1018,14 +1025,14 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_SPIN
:
case
MCI_ESCAPE
:
WARN
(
"Unsupported command=%s
\n
"
,
MCI_
Command
ToString
(
wMsg
));
WARN
(
"Unsupported command=%s
\n
"
,
MCI_
Message
ToString
(
wMsg
));
break
;
case
MCI_OPEN
:
case
MCI_CLOSE
:
FIXME
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
break
;
default:
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Command
ToString
(
wMsg
));
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Message
ToString
(
wMsg
));
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
return
MCIERR_UNRECOGNIZED_COMMAND
;
...
...
multimedia/mcicda.c
View file @
b26cfe76
...
...
@@ -40,7 +40,7 @@ static DWORD CDAUDIO_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wmcda
->
wDevID
=
modp
->
wDeviceID
;
mciSetDriverData
(
wmcda
->
wDevID
,
(
DWORD
)
wmcda
);
modp
->
wCustomCommandTable
=
-
1
;
modp
->
wCustomCommandTable
=
MCI_NO_COMMAND_TABLE
;
modp
->
wType
=
MCI_DEVTYPE_SEQUENCER
;
return
modp
->
wDeviceID
;
}
...
...
@@ -152,7 +152,7 @@ static DWORD CDAUDIO_CalcFrame(WINE_MCICDAUDIO* wmcda, DWORD dwTime)
/**************************************************************************
* CDAUDIO_CalcTime [internal]
*/
static
DWORD
CDAUDIO_CalcTime
(
WINE_MCICDAUDIO
*
wmcda
,
DWORD
dwFrame
)
static
DWORD
CDAUDIO_CalcTime
(
WINE_MCICDAUDIO
*
wmcda
,
DWORD
dwFrame
,
LPDWORD
lpRet
)
{
DWORD
dwTime
=
0
;
UINT16
wTrack
;
...
...
@@ -166,6 +166,7 @@ static DWORD CDAUDIO_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD dwFrame)
case
MCI_FORMAT_MILLISECONDS
:
dwTime
=
(
dwFrame
*
1000
)
/
CDFRAMES_PERSEC
;
TRACE
(
"MILLISECONDS %lu
\n
"
,
dwTime
);
*
lpRet
=
0
;
break
;
case
MCI_FORMAT_MSF
:
wMinutes
=
dwFrame
/
CDFRAMES_PERMIN
;
...
...
@@ -174,6 +175,7 @@ static DWORD CDAUDIO_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD dwFrame)
dwTime
=
MCI_MAKE_MSF
(
wMinutes
,
wSeconds
,
wFrames
);
TRACE
(
"MSF %02u:%02u:%02u -> dwTime=%lu
\n
"
,
wMinutes
,
wSeconds
,
wFrames
,
dwTime
);
*
lpRet
=
MCI_COLONIZED3_RETURN
;
break
;
case
MCI_FORMAT_TMSF
:
default:
...
...
@@ -189,6 +191,7 @@ static DWORD CDAUDIO_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD dwFrame)
wFrames
=
dwFrame
-
CDFRAMES_PERMIN
*
wMinutes
-
CDFRAMES_PERSEC
*
wSeconds
;
dwTime
=
MCI_MAKE_TMSF
(
wTrack
,
wMinutes
,
wSeconds
,
wFrames
);
TRACE
(
"%02u-%02u:%02u:%02u
\n
"
,
wTrack
,
wMinutes
,
wSeconds
,
wFrames
);
*
lpRet
=
MCI_COLONIZED4_RETURN
;
break
;
}
return
dwTime
;
...
...
@@ -281,6 +284,8 @@ static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS
static
DWORD
CDAUDIO_mciGetDevCaps
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_GETDEVCAPS_PARMS
lpParms
)
{
DWORD
ret
=
0
;
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
...
...
@@ -288,40 +293,53 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
if
(
dwFlags
&
MCI_GETDEVCAPS_ITEM
)
{
TRACE
(
"MCI_GETDEVCAPS_ITEM dwItem=%08lX;
\n
"
,
lpParms
->
dwItem
);
switch
(
lpParms
->
dwItem
)
{
switch
(
lpParms
->
dwItem
)
{
case
MCI_GETDEVCAPS_CAN_RECORD
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_AUDIO
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_VIDEO
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_DEVICE_TYPE
:
lpParms
->
dwReturn
=
MCI_DEVTYPE_CD_AUDIO
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_DEVTYPE_CD_AUDIO
,
MCI_DEVTYPE_CD_AUDIO
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_USES_FILES
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_COMPOUND_DEVICE
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_EJECT
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_PLAY
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
default:
ERR
(
"Unsupported %lx devCaps item
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
TRACE
(
"No GetDevCaps-Item !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
TRACE
(
"lpParms->dwReturn=%08lX;
\n
"
,
lpParms
->
dwReturn
);
return
0
;
return
ret
;
}
/**************************************************************************
...
...
@@ -329,17 +347,15 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
*/
static
DWORD
CDAUDIO_mciInfo
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_INFO_PARMS16
lpParms
)
{
DWORD
ret
=
0
;
LPSTR
str
=
0
;
WINE_MCICDAUDIO
*
wmcda
=
CDAUDIO_mciGetOpenDrv
(
wDevID
);
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
{
ret
=
MCIERR_NULL_PARAMETER_BLOCK
;
}
else
if
(
wmcda
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
if
(
wmcda
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
TRACE
(
"buf=%p, len=%lu
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
switch
(
dwFlags
)
{
...
...
@@ -348,16 +364,9 @@ static DWORD CDAUDIO_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lp
break
;
default:
WARN
(
"Don't know this info command (%lu)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
if
(
str
)
{
ret
=
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
ret
;
return
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
/**************************************************************************
...
...
@@ -370,11 +379,9 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
)
{
ret
=
MCIERR_NULL_PARAMETER_BLOCK
;
}
else
if
(
wmcda
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
if
(
lpParms
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
if
(
wmcda
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
dwFlags
&
MCI_NOTIFY
)
{
TRACE
(
"MCI_NOTIFY_SUCCESSFUL %08lX !
\n
"
,
lpParms
->
dwCallback
);
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
...
...
@@ -388,7 +395,7 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
}
lpParms
->
dwReturn
=
wmcda
->
wcda
.
nCurTrack
;
TRACE
(
"CURRENT_TRACK=%lu!
\n
"
,
lpParms
->
dwReturn
);
return
0
;
break
;
case
MCI_STATUS_LENGTH
:
if
(
wmcda
->
wcda
.
nTracks
==
0
)
{
if
(
!
CDAUDIO_GetTracksInfo
(
&
wmcda
->
wcda
))
{
...
...
@@ -404,28 +411,32 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
}
else
{
lpParms
->
dwReturn
=
wmcda
->
wcda
.
dwTotalLen
;
}
lpParms
->
dwReturn
=
CDAUDIO_CalcTime
(
wmcda
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
CDAUDIO_CalcTime
(
wmcda
,
lpParms
->
dwReturn
,
&
ret
);
TRACE
(
"LENGTH=%lu !
\n
"
,
lpParms
->
dwReturn
);
return
0
;
break
;
case
MCI_STATUS_MODE
:
if
(
!
CDAUDIO_GetCDStatus
(
&
wmcda
->
wcda
))
return
CDAUDIO_mciGetError
(
wmcda
);
lpParms
->
dwReturn
=
CDAUDIO_mciMode
(
wmcda
->
wcda
.
cdaMode
);
if
(
!
lpParms
->
dwReturn
)
lpParms
->
dwReturn
=
wmcda
->
mciMode
;
TRACE
(
"MCI_STATUS_MODE=%08lX !
\n
"
,
lpParms
->
dwReturn
);
return
0
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
lpParms
->
dwReturn
,
lpParms
->
dwReturn
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_MEDIA_PRESENT
:
if
(
!
CDAUDIO_GetCDStatus
(
&
wmcda
->
wcda
))
return
CDAUDIO_mciGetError
(
wmcda
);
lpParms
->
dwReturn
=
(
wmcda
->
wcda
.
nTracks
>
0
)
?
TRUE
:
FALSE
;
TRACE
(
"MCI_STATUS_MEDIA_PRESENT =%s!
\n
"
,
lpParms
->
dwReturn
?
"Y"
:
"N"
);
return
0
;
lpParms
->
dwReturn
=
(
wmcda
->
wcda
.
nTracks
==
0
)
?
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
)
:
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
TRACE
(
"MCI_STATUS_MEDIA_PRESENT =%s!
\n
"
,
LOWORD
(
lpParms
->
dwReturn
)
?
"Y"
:
"N"
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_NUMBER_OF_TRACKS
:
lpParms
->
dwReturn
=
CDAUDIO_GetNumberOfTracks
(
&
wmcda
->
wcda
);
TRACE
(
"MCI_STATUS_NUMBER_OF_TRACKS = %lu !
\n
"
,
lpParms
->
dwReturn
);
if
(
lpParms
->
dwReturn
==
(
WORD
)
-
1
)
return
CDAUDIO_mciGetError
(
wmcda
);
return
0
;
break
;
case
MCI_STATUS_POSITION
:
if
(
!
CDAUDIO_GetCDStatus
(
&
wmcda
->
wcda
))
return
CDAUDIO_mciGetError
(
wmcda
);
...
...
@@ -440,35 +451,40 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
lpParms
->
dwReturn
=
wmcda
->
wcda
.
lpdwTrackPos
[
lpParms
->
dwTrack
-
1
];
TRACE
(
"get MCI_TRACK #%lu !
\n
"
,
lpParms
->
dwTrack
);
}
lpParms
->
dwReturn
=
CDAUDIO_CalcTime
(
wmcda
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
CDAUDIO_CalcTime
(
wmcda
,
lpParms
->
dwReturn
,
&
ret
);
TRACE
(
"MCI_STATUS_POSITION=%08lX !
\n
"
,
lpParms
->
dwReturn
);
return
0
;
break
;
case
MCI_STATUS_READY
:
TRACE
(
"MCI_STATUS_READY !
\n
"
);
lpParms
->
dwReturn
=
(
wmcda
->
wcda
.
cdaMode
!=
WINE_CDA_DONTKNOW
&&
wmcda
->
wcda
.
cdaMode
!=
WINE_CDA_NOTREADY
);
TRACE
(
"MCI_STATUS_READY=%ld!
\n
"
,
lpParms
->
dwReturn
);
return
0
;
lpParms
->
dwReturn
=
(
wmcda
->
wcda
.
cdaMode
==
WINE_CDA_DONTKNOW
||
wmcda
->
wcda
.
cdaMode
==
WINE_CDA_NOTREADY
)
?
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
)
:
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
TRACE
(
"MCI_STATUS_READY=%u!
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_TIME_FORMAT
:
lpParms
->
dwReturn
=
wmcda
->
dwTimeFormat
;
TRACE
(
"MCI_STATUS_TIME_FORMAT =%08lx!
\n
"
,
lpParms
->
dwReturn
);
return
0
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wmcda
->
dwTimeFormat
,
wmcda
->
dwTimeFormat
);
TRACE
(
"MCI_STATUS_TIME_FORMAT=%08x!
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_CDA_STATUS_TYPE_TRACK
:
if
(
!
(
dwFlags
&
MCI_TRACK
))
return
MCIERR_MISSING_PARAMETER
;
if
(
lpParms
->
dwTrack
>
wmcda
->
wcda
.
nTracks
||
lpParms
->
dwTrack
==
0
)
return
MCIERR_OUTOFRANGE
;
ret
=
MCIERR_MISSING_PARAMETER
;
else
if
(
lpParms
->
dwTrack
>
wmcda
->
wcda
.
nTracks
||
lpParms
->
dwTrack
==
0
)
ret
=
MCIERR_OUTOFRANGE
;
else
lpParms
->
dwReturn
=
(
wmcda
->
wcda
.
lpbTrackFlags
[
lpParms
->
dwTrack
-
1
]
&
CDROM_DATA_TRACK
)
?
MCI_CDA_TRACK_OTHER
:
MCI_CDA_TRACK_AUDIO
;
TRACE
(
"MCI_CDA_STATUS_TYPE_TRACK[%ld]=%08lx
\n
"
,
lpParms
->
dwTrack
,
lpParms
->
dwReturn
);
return
0
;
break
;
default:
WARN
(
"unknown command %08lX !
\n
"
,
lpParms
->
dwItem
);
FIXME
(
"unknown command %08lX !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
}
}
else
{
WARN
(
"not MCI_STATUS_ITEM !
\n
"
);
return
0
;
}
return
ret
;
}
/**************************************************************************
...
...
@@ -730,6 +746,7 @@ LONG CALLBACK MCICDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
/* FIXME: I wonder if those two next items are really called ? */
case
MCI_SET_DOOR_OPEN
:
return
CDAUDIO_mciSetDoor
(
dwDevID
,
TRUE
);
case
MCI_SET_DOOR_CLOSED
:
return
CDAUDIO_mciSetDoor
(
dwDevID
,
FALSE
);
/* commands that should be supported */
case
MCI_LOAD
:
case
MCI_SAVE
:
case
MCI_FREEZE
:
...
...
@@ -738,7 +755,6 @@ LONG CALLBACK MCICDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_UNFREEZE
:
case
MCI_UPDATE
:
case
MCI_WHERE
:
case
MCI_WINDOW
:
case
MCI_STEP
:
case
MCI_SPIN
:
case
MCI_ESCAPE
:
...
...
@@ -746,14 +762,18 @@ LONG CALLBACK MCICDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_CUT
:
case
MCI_DELETE
:
case
MCI_PASTE
:
WARN
(
"Unsupported command=%s
\n
"
,
MCI_CommandToString
(
wMsg
));
FIXME
(
"Unsupported yet command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
/* commands that should report an error */
case
MCI_WINDOW
:
FIXME
(
"Unsupported command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
case
MCI_OPEN
:
case
MCI_CLOSE
:
FIXME
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
ERR
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
break
;
default:
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Command
ToString
(
wMsg
));
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Message
ToString
(
wMsg
));
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
return
MCIERR_UNRECOGNIZED_COMMAND
;
...
...
multimedia/mcimidi.c
View file @
b26cfe76
...
...
@@ -34,7 +34,7 @@ typedef struct {
WORD
wEventLength
;
/* current length (event) pointed by dwIndex */
WORD
wStatus
:
1
,
/* 1 : playing, 0 : done */
wTrackNr
:
7
,
wLastCommand
:
8
;
wLastCommand
:
8
;
/* last MIDI command on track */
}
MCI_MIDITRACK
;
typedef
struct
tagWINE_MCIMIDI
{
...
...
@@ -44,7 +44,7 @@ typedef struct tagWINE_MCIMIDI {
WORD
wNotifyDeviceID
;
/* MCI device ID with a pending notification */
HANDLE16
hCallback
;
/* Callback handle for pending notification */
HMMIO
hFile
;
/* mmio file handle open as Element */
MCI_OPEN_PARMSA
openParms
;
LPCSTR
lpstrElementName
;
/* Name of file */
HLOCAL16
hMidiHdr
;
WORD
dwStatus
;
/* one from MCI_MODE_xxxx */
DWORD
dwMciTimeFormat
;
/* One of the supported MCI_FORMAT_xxxx */
...
...
@@ -80,7 +80,7 @@ static DWORD MIDI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wmm
->
wDevID
=
modp
->
wDeviceID
;
mciSetDriverData
(
wmm
->
wDevID
,
(
DWORD
)
wmm
);
modp
->
wCustomCommandTable
=
-
1
;
modp
->
wCustomCommandTable
=
MCI_NO_COMMAND_TABLE
;
modp
->
wType
=
MCI_DEVTYPE_SEQUENCER
;
return
modp
->
wDeviceID
;
}
...
...
@@ -619,7 +619,8 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParm
}
TRACE
(
"hFile=%u
\n
"
,
wmm
->
hFile
);
memcpy
(
&
wmm
->
openParms
,
lpParms
,
sizeof
(
MCI_OPEN_PARMSA
));
/* FIXME: should I get a strdup() of it instead? */
wmm
->
lpstrElementName
=
lpParms
->
lpstrElementName
;
wmm
->
wNotifyDeviceID
=
dwDeviceID
;
wmm
->
dwStatus
=
MCI_MODE_NOT_READY
;
/* while loading file contents */
...
...
@@ -775,7 +776,7 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
if
(
wmm
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
->
hFile
==
0
)
{
WARN
(
"Can't play: no file '%s' !
\n
"
,
wmm
->
openParms
.
lpstrElementName
);
WARN
(
"Can't play: no file '%s' !
\n
"
,
wmm
->
lpstrElementName
);
return
MCIERR_FILE_NOT_FOUND
;
}
...
...
@@ -1063,8 +1064,7 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP
if
(
wmm
==
0
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
->
hFile
==
0
)
{
WARN
(
"Can't find file='%08lx' !
\n
"
,
(
DWORD
)
wmm
->
openParms
.
lpstrElementName
);
WARN
(
"Can't find file='%s' !
\n
"
,
wmm
->
lpstrElementName
);
return
MCIERR_FILE_NOT_FOUND
;
}
start
=
1
;
end
=
99999
;
...
...
@@ -1246,6 +1246,7 @@ static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
static
DWORD
MIDI_mciStatus
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_STATUS_PARMS
lpParms
)
{
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
DWORD
ret
=
0
;
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -1272,12 +1273,14 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
TRACE
(
"MCI_STATUS_LENGTH => %lu
\n
"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_MODE
:
lpParms
->
dwReturn
=
wmm
->
dwStatus
;
TRACE
(
"MCI_STATUS_MODE => %lu
\n
"
,
lpParms
->
dwReturn
);
TRACE
(
"MCI_STATUS_MODE => %u
\n
"
,
wmm
->
dwStatus
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wmm
->
dwStatus
,
wmm
->
dwStatus
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_MEDIA_PRESENT
:
TRACE
(
"MCI_STATUS_MEDIA_PRESENT => TRUE
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_NUMBER_OF_TRACKS
:
lpParms
->
dwReturn
=
(
wmm
->
wFormat
==
2
)
?
wmm
->
nTracks
:
1
;
...
...
@@ -1291,12 +1294,15 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
(
dwFlags
&
MCI_STATUS_START
)
?
"start"
:
"current"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_READY
:
lpParms
->
dwReturn
=
(
wmm
->
dwStatus
!=
MCI_MODE_NOT_READY
);
TRACE
(
"MCI_STATUS_READY = %lu
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
(
wmm
->
dwStatus
==
MCI_MODE_NOT_READY
)
?
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
)
:
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
TRACE
(
"MCI_STATUS_READY = %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
break
;
case
MCI_STATUS_TIME_FORMAT
:
lpParms
->
dwReturn
=
wmm
->
dwMciTimeFormat
;
TRACE
(
"MCI_STATUS_TIME_FORMAT => %lu
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wmm
->
dwMciTimeFormat
,
wmm
->
dwMciTimeFormat
);
TRACE
(
"MCI_STATUS_TIME_FORMAT => %u
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_SEQ_STATUS_DIVTYPE
:
TRACE
(
"MCI_SEQ_STATUS_DIVTYPE !
\n
"
);
...
...
@@ -1311,6 +1317,8 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
}
else
{
lpParms
->
dwReturn
=
MCI_SEQ_DIV_PPQN
;
}
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
lpParms
->
dwReturn
,
lpParms
->
dwReturn
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_SEQ_STATUS_MASTER
:
TRACE
(
"MCI_SEQ_STATUS_MASTER !
\n
"
);
...
...
@@ -1333,7 +1341,7 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
lpParms
->
dwReturn
=
wmm
->
dwTempo
;
break
;
default:
WARN
(
"Unknowm command %08lX !
\n
"
,
lpParms
->
dwItem
);
FIXME
(
"Unknowm command %08lX !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
...
...
@@ -1345,7 +1353,7 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wmm
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
return
0
;
return
ret
;
}
/**************************************************************************
...
...
@@ -1355,6 +1363,7 @@ static DWORD MIDI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS
lpParms
)
{
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
DWORD
ret
;
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -1365,49 +1374,58 @@ static DWORD MIDI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
switch
(
lpParms
->
dwItem
)
{
case
MCI_GETDEVCAPS_DEVICE_TYPE
:
TRACE
(
"MCI_GETDEVCAPS_DEVICE_TYPE !
\n
"
);
lpParms
->
dwReturn
=
MCI_DEVTYPE_SEQUENCER
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_DEVTYPE_SEQUENCER
,
MCI_DEVTYPE_SEQUENCER
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_AUDIO
:
TRACE
(
"MCI_GETDEVCAPS_HAS_AUDIO !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_VIDEO
:
TRACE
(
"MCI_GETDEVCAPS_HAS_VIDEO !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_USES_FILES
:
TRACE
(
"MCI_GETDEVCAPS_USES_FILES !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_COMPOUND_DEVICE
:
TRACE
(
"MCI_GETDEVCAPS_COMPOUND_DEVICE !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_EJECT
:
TRACE
(
"MCI_GETDEVCAPS_CAN_EJECT !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_PLAY
:
TRACE
(
"MCI_GETDEVCAPS_CAN_PLAY !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_RECORD
:
TRACE
(
"MCI_GETDEVCAPS_CAN_RECORD !
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
TRACE
(
"MCI_GETDEVCAPS_CAN_SAVE !
\n
"
);
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
default:
TRAC
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
FIXM
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
TRACE
(
"No GetDevCaps-Item !
\n
"
);
WARN
(
"No GetDevCaps-Item !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
0
;
return
ret
;
}
/**************************************************************************
...
...
@@ -1415,17 +1433,15 @@ static DWORD MIDI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
*/
static
DWORD
MIDI_mciInfo
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_INFO_PARMSA
lpParms
)
{
DWORD
ret
=
0
;
LPSTR
str
=
0
;
LPCSTR
str
=
0
;
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
{
ret
=
MCIERR_NULL_PARAMETER_BLOCK
;
}
else
if
(
wmm
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
if
(
lpParms
==
NULL
||
lpParms
->
lpstrReturn
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
if
(
wmm
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
TRACE
(
"buf=%p, len=%lu
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
switch
(
dwFlags
)
{
...
...
@@ -1433,7 +1449,7 @@ static DWORD MIDI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParm
str
=
"Wine's MIDI sequencer"
;
break
;
case
MCI_INFO_FILE
:
str
=
wmm
->
openParms
.
lpstrElementName
;
str
=
wmm
->
lpstrElementName
;
break
;
#if 0
/* FIXME: the following manifest constants are not defined in <WINE>/include/mmsystem.h */
...
...
@@ -1444,16 +1460,9 @@ static DWORD MIDI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParm
#endif
default:
WARN
(
"Don't know this info command (%lu)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
if
(
str
)
{
ret
=
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
ret
;
return
MCI_WriteString
(
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
,
str
);
}
/**************************************************************************
...
...
@@ -1546,6 +1555,7 @@ LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_INFO
:
case
MCI_SEEK
:
#endif
/* commands that should be supported */
case
MCI_LOAD
:
case
MCI_SAVE
:
case
MCI_FREEZE
:
...
...
@@ -1554,7 +1564,6 @@ LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_UNFREEZE
:
case
MCI_UPDATE
:
case
MCI_WHERE
:
case
MCI_WINDOW
:
case
MCI_STEP
:
case
MCI_SPIN
:
case
MCI_ESCAPE
:
...
...
@@ -1562,14 +1571,18 @@ LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_CUT
:
case
MCI_DELETE
:
case
MCI_PASTE
:
WARN
(
"Unsupported command=%s
\n
"
,
MCI_CommandToString
(
wMsg
));
WARN
(
"Unsupported command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
/* commands that should report an error */
case
MCI_WINDOW
:
FIXME
(
"Unsupported command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
case
MCI_OPEN
:
case
MCI_CLOSE
:
FIXME
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
break
;
default:
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Command
ToString
(
wMsg
));
TRACE
(
"Sending msg=%s to default driver proc
\n
"
,
MCI_
Message
ToString
(
wMsg
));
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
return
MCIERR_UNRECOGNIZED_COMMAND
;
...
...
multimedia/mciwave.c
View file @
b26cfe76
...
...
@@ -60,7 +60,7 @@ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
wmw
->
wDevID
=
modp
->
wDeviceID
;
mciSetDriverData
(
wmw
->
wDevID
,
(
DWORD
)
wmw
);
modp
->
wCustomCommandTable
=
-
1
;
modp
->
wCustomCommandTable
=
MCI_NO_COMMAND_TABLE
;
modp
->
wType
=
MCI_DEVTYPE_WAVEFORM_AUDIO
;
return
modp
->
wDeviceID
;
}
...
...
@@ -94,7 +94,10 @@ static WINE_MCIWAVE* WAVE_mciGetOpenDev(UINT16 wDevID)
return
wmw
;
}
static
DWORD
WAVE_ConvertByteToTimeFormat
(
WINE_MCIWAVE
*
wmw
,
DWORD
val
)
/**************************************************************************
* WAVE_ConvertByteToTimeFormat [internal]
*/
static
DWORD
WAVE_ConvertByteToTimeFormat
(
WINE_MCIWAVE
*
wmw
,
DWORD
val
,
LPDWORD
lpRet
)
{
DWORD
ret
=
0
;
...
...
@@ -112,9 +115,13 @@ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val)
WARN
(
"Bad time format %lu!
\n
"
,
wmw
->
dwMciTimeFormat
);
}
TRACE
(
"val=%lu=0x%08lx [tf=%lu] => ret=%lu
\n
"
,
val
,
val
,
wmw
->
dwMciTimeFormat
,
ret
);
*
lpRet
=
0
;
return
ret
;
}
/**************************************************************************
* WAVE_ConvertTimeFormatToByte [internal]
*/
static
DWORD
WAVE_ConvertTimeFormatToByte
(
WINE_MCIWAVE
*
wmw
,
DWORD
val
)
{
DWORD
ret
=
0
;
...
...
@@ -136,6 +143,9 @@ static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val)
return
ret
;
}
/**************************************************************************
* WAVE_mciReadFmt [internal]
*/
static
DWORD
WAVE_mciReadFmt
(
WINE_MCIWAVE
*
wmw
,
MMCKINFO
*
pckMainRIFF
)
{
MMCKINFO
mmckInfo
;
...
...
@@ -741,6 +751,7 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
static
DWORD
WAVE_mciStatus
(
UINT16
wDevID
,
DWORD
dwFlags
,
LPMCI_STATUS_PARMS
lpParms
)
{
WINE_MCIWAVE
*
wmw
=
WAVE_mciGetOpenDev
(
wDevID
);
DWORD
ret
;
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
lpParms
==
NULL
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
...
...
@@ -754,16 +765,18 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
break
;
case
MCI_STATUS_LENGTH
:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms
->
dwReturn
=
WAVE_ConvertByteToTimeFormat
(
wmw
,
wmw
->
dwLength
);
lpParms
->
dwReturn
=
WAVE_ConvertByteToTimeFormat
(
wmw
,
wmw
->
dwLength
,
&
ret
);
TRACE
(
"MCI_STATUS_LENGTH => %lu
\n
"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_MODE
:
lpParms
->
dwReturn
=
wmw
->
dwStatus
;
TRACE
(
"MCI_STATUS_MODE => %lu
\n
"
,
lpParms
->
dwReturn
);
TRACE
(
"MCI_STATUS_MODE => %u
\n
"
,
wmw
->
dwStatus
);
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wmw
->
dwStatus
,
wmw
->
dwStatus
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_MEDIA_PRESENT
:
TRACE
(
"MCI_STATUS_MEDIA_PRESENT => TRUE!
\n
"
);
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_NUMBER_OF_TRACKS
:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
...
...
@@ -773,17 +786,21 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
case
MCI_STATUS_POSITION
:
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms
->
dwReturn
=
WAVE_ConvertByteToTimeFormat
(
wmw
,
(
dwFlags
&
MCI_STATUS_START
)
?
0
:
wmw
->
dwPosition
);
(
dwFlags
&
MCI_STATUS_START
)
?
0
:
wmw
->
dwPosition
,
&
ret
);
TRACE
(
"MCI_STATUS_POSITION %s => %lu
\n
"
,
(
dwFlags
&
MCI_STATUS_START
)
?
"start"
:
"current"
,
lpParms
->
dwReturn
);
break
;
case
MCI_STATUS_READY
:
lpParms
->
dwReturn
=
(
wmw
->
dwStatus
!=
MCI_MODE_NOT_READY
);
TRACE
(
"MCI_STATUS_READY => %lu!
\n
"
,
lpParms
->
dwReturn
);
lpParms
->
dwReturn
=
(
wmw
->
dwStatus
==
MCI_MODE_NOT_READY
)
?
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
)
:
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
TRACE
(
"MCI_STATUS_READY => %u!
\n
"
,
LOWORD
(
lpParms
->
dwReturn
));
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_STATUS_TIME_FORMAT
:
lpParms
->
dwReturn
=
wmw
->
dwMciTimeFormat
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
wmw
->
dwMciTimeFormat
,
wmw
->
dwMciTimeFormat
)
;
TRACE
(
"MCI_STATUS_TIME_FORMAT => %lu
\n
"
,
lpParms
->
dwReturn
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_WAVE_INPUT
:
TRACE
(
"MCI_WAVE_INPUT !
\n
"
);
...
...
@@ -831,7 +848,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
mciDriverNotify16
((
HWND16
)
LOWORD
(
lpParms
->
dwCallback
),
wmw
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
return
0
;
return
ret
;
}
/**************************************************************************
...
...
@@ -841,6 +858,7 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS
lpParms
)
{
WINE_MCIWAVE
*
wmw
=
WAVE_mciGetOpenDev
(
wDevID
);
DWORD
ret
=
0
;
TRACE
(
"(%u, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -850,31 +868,40 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
if
(
dwFlags
&
MCI_GETDEVCAPS_ITEM
)
{
switch
(
lpParms
->
dwItem
)
{
case
MCI_GETDEVCAPS_DEVICE_TYPE
:
lpParms
->
dwReturn
=
MCI_DEVTYPE_WAVEFORM_AUDIO
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
MCI_DEVTYPE_WAVEFORM_AUDIO
,
MCI_DEVTYPE_WAVEFORM_AUDIO
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_AUDIO
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_HAS_VIDEO
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_USES_FILES
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_COMPOUND_DEVICE
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_RECORD
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_EJECT
:
lpParms
->
dwReturn
=
FALSE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
FALSE
,
MCI_FALSE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_PLAY
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_GETDEVCAPS_CAN_SAVE
:
lpParms
->
dwReturn
=
TRUE
;
lpParms
->
dwReturn
=
MAKEMCIRESOURCE
(
TRUE
,
MCI_TRUE
);
ret
=
MCI_RESOURCE_RETURNED
;
break
;
case
MCI_WAVE_GETDEVCAPS_INPUTS
:
lpParms
->
dwReturn
=
1
;
...
...
@@ -883,11 +910,14 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags,
lpParms
->
dwReturn
=
1
;
break
;
default:
TRAC
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
FIXM
E
(
"Unknown capability (%08lx) !
\n
"
,
lpParms
->
dwItem
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
}
else
{
WARN
(
"No GetDevCaps-Item !
\n
"
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
return
0
;
return
ret
;
}
/**************************************************************************
...
...
@@ -972,6 +1002,7 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_GETDEVCAPS
:
return
WAVE_mciGetDevCaps
(
dwDevID
,
dwParam1
,
(
LPMCI_GETDEVCAPS_PARMS
)
dwParam2
);
case
MCI_INFO
:
return
WAVE_mciInfo
(
dwDevID
,
dwParam1
,
(
LPMCI_INFO_PARMS16
)
dwParam2
);
case
MCI_SEEK
:
return
WAVE_mciSeek
(
dwDevID
,
dwParam1
,
(
LPMCI_SEEK_PARMS
)
dwParam2
);
/* commands that should be supported */
case
MCI_LOAD
:
case
MCI_SAVE
:
case
MCI_FREEZE
:
...
...
@@ -980,7 +1011,6 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_UNFREEZE
:
case
MCI_UPDATE
:
case
MCI_WHERE
:
case
MCI_WINDOW
:
case
MCI_STEP
:
case
MCI_SPIN
:
case
MCI_ESCAPE
:
...
...
@@ -988,14 +1018,17 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
case
MCI_CUT
:
case
MCI_DELETE
:
case
MCI_PASTE
:
WARN
(
"Unsupported command=%s
\n
"
,
MCI_CommandToString
(
wMsg
));
FIXME
(
"Unsupported yet command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
case
MCI_WINDOW
:
TRACE
(
"Unsupported command=%s
\n
"
,
MCI_MessageToString
(
wMsg
));
break
;
case
MCI_OPEN
:
case
MCI_CLOSE
:
FIXME
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
ERR
(
"Shouldn't receive a MCI_OPEN or CLOSE message
\n
"
);
break
;
default:
FIXME
(
"is probably wrong msg=%s
\n
"
,
MCI_
Command
ToString
(
wMsg
));
FIXME
(
"is probably wrong msg=%s
\n
"
,
MCI_
Message
ToString
(
wMsg
));
return
DefDriverProc
(
dwDevID
,
hDriv
,
wMsg
,
dwParam1
,
dwParam2
);
}
return
MCIERR_UNRECOGNIZED_COMMAND
;
...
...
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