Added support for MCI AVI driver
Added some fixes mixer functions Fixed MCI string comparison (thanks to Lionel ULMER) No longer using 16 bit USER functions (use their 32 bit counter part) Reindenting. Added function sndPlaySound32W
This commit is contained in:
parent
6ccda0d582
commit
c11b167f62
166
include/debug.h
166
include/debug.h
|
@ -73,88 +73,90 @@
|
||||||
#define dbch_local 65
|
#define dbch_local 65
|
||||||
#define dbch_mci 66
|
#define dbch_mci 66
|
||||||
#define dbch_mcianim 67
|
#define dbch_mcianim 67
|
||||||
#define dbch_mcimidi 68
|
#define dbch_mciavi 68
|
||||||
#define dbch_mciwave 69
|
#define dbch_mcimidi 69
|
||||||
#define dbch_mdi 70
|
#define dbch_mciwave 70
|
||||||
#define dbch_menu 71
|
#define dbch_mdi 71
|
||||||
#define dbch_message 72
|
#define dbch_menu 72
|
||||||
#define dbch_metafile 73
|
#define dbch_message 73
|
||||||
#define dbch_midi 74
|
#define dbch_metafile 74
|
||||||
#define dbch_mmaux 75
|
#define dbch_midi 75
|
||||||
#define dbch_mmio 76
|
#define dbch_mmaux 76
|
||||||
#define dbch_mmsys 77
|
#define dbch_mmio 77
|
||||||
#define dbch_mmtime 78
|
#define dbch_mmsys 78
|
||||||
#define dbch_module 79
|
#define dbch_mmtime 79
|
||||||
#define dbch_monthcal 80
|
#define dbch_module 80
|
||||||
#define dbch_mpr 81
|
#define dbch_monthcal 81
|
||||||
#define dbch_msacm 82
|
#define dbch_mpr 82
|
||||||
#define dbch_msg 83
|
#define dbch_msacm 83
|
||||||
#define dbch_msvideo 84
|
#define dbch_msg 84
|
||||||
#define dbch_nativefont 85
|
#define dbch_msvideo 85
|
||||||
#define dbch_nonclient 86
|
#define dbch_nativefont 86
|
||||||
#define dbch_ntdll 87
|
#define dbch_nonclient 87
|
||||||
#define dbch_ole 88
|
#define dbch_ntdll 88
|
||||||
#define dbch_pager 89
|
#define dbch_ole 89
|
||||||
#define dbch_palette 90
|
#define dbch_pager 90
|
||||||
#define dbch_pidl 91
|
#define dbch_palette 91
|
||||||
#define dbch_print 92
|
#define dbch_pidl 92
|
||||||
#define dbch_process 93
|
#define dbch_print 93
|
||||||
#define dbch_profile 94
|
#define dbch_process 94
|
||||||
#define dbch_progress 95
|
#define dbch_profile 95
|
||||||
#define dbch_prop 96
|
#define dbch_progress 96
|
||||||
#define dbch_propsheet 97
|
#define dbch_prop 97
|
||||||
#define dbch_psapi 98
|
#define dbch_propsheet 98
|
||||||
#define dbch_psdrv 99
|
#define dbch_psapi 99
|
||||||
#define dbch_ras 100
|
#define dbch_psdrv 100
|
||||||
#define dbch_rebar 101
|
#define dbch_ras 101
|
||||||
#define dbch_reg 102
|
#define dbch_rebar 102
|
||||||
#define dbch_region 103
|
#define dbch_reg 103
|
||||||
#define dbch_relay 104
|
#define dbch_region 104
|
||||||
#define dbch_resource 105
|
#define dbch_relay 105
|
||||||
#define dbch_scroll 106
|
#define dbch_resource 106
|
||||||
#define dbch_security 107
|
#define dbch_scroll 107
|
||||||
#define dbch_segment 108
|
#define dbch_security 108
|
||||||
#define dbch_selector 109
|
#define dbch_segment 109
|
||||||
#define dbch_sem 110
|
#define dbch_selector 110
|
||||||
#define dbch_sendmsg 111
|
#define dbch_sem 111
|
||||||
#define dbch_server 112
|
#define dbch_sendmsg 112
|
||||||
#define dbch_shell 113
|
#define dbch_server 113
|
||||||
#define dbch_shm 114
|
#define dbch_shell 114
|
||||||
#define dbch_snoop 115
|
#define dbch_shm 115
|
||||||
#define dbch_sound 116
|
#define dbch_snoop 116
|
||||||
#define dbch_static 117
|
#define dbch_sound 117
|
||||||
#define dbch_statusbar 118
|
#define dbch_static 118
|
||||||
#define dbch_stress 119
|
#define dbch_statusbar 119
|
||||||
#define dbch_string 120
|
#define dbch_stress 120
|
||||||
#define dbch_syscolor 121
|
#define dbch_string 121
|
||||||
#define dbch_system 122
|
#define dbch_syscolor 122
|
||||||
#define dbch_tab 123
|
#define dbch_system 123
|
||||||
#define dbch_task 124
|
#define dbch_tab 124
|
||||||
#define dbch_text 125
|
#define dbch_task 125
|
||||||
#define dbch_thread 126
|
#define dbch_text 126
|
||||||
#define dbch_thunk 127
|
#define dbch_thread 127
|
||||||
#define dbch_timer 128
|
#define dbch_thunk 128
|
||||||
#define dbch_toolbar 129
|
#define dbch_timer 129
|
||||||
#define dbch_toolhelp 130
|
#define dbch_toolbar 130
|
||||||
#define dbch_tooltips 131
|
#define dbch_toolhelp 131
|
||||||
#define dbch_trackbar 132
|
#define dbch_tooltips 132
|
||||||
#define dbch_treeview 133
|
#define dbch_trackbar 133
|
||||||
#define dbch_ttydrv 134
|
#define dbch_treeview 134
|
||||||
#define dbch_tweak 135
|
#define dbch_ttydrv 135
|
||||||
#define dbch_uitools 136
|
#define dbch_tweak 136
|
||||||
#define dbch_updown 137
|
#define dbch_uitools 137
|
||||||
#define dbch_ver 138
|
#define dbch_unknown 138
|
||||||
#define dbch_virtual 139
|
#define dbch_updown 139
|
||||||
#define dbch_vxd 140
|
#define dbch_ver 140
|
||||||
#define dbch_wave 141
|
#define dbch_virtual 141
|
||||||
#define dbch_win 142
|
#define dbch_vxd 142
|
||||||
#define dbch_win16drv 143
|
#define dbch_wave 143
|
||||||
#define dbch_win32 144
|
#define dbch_win 144
|
||||||
#define dbch_wing 145
|
#define dbch_win16drv 145
|
||||||
#define dbch_winsock 146
|
#define dbch_win32 146
|
||||||
#define dbch_wnet 147
|
#define dbch_wing 147
|
||||||
#define dbch_x11 148
|
#define dbch_winsock 148
|
||||||
#define dbch_x11drv 149
|
#define dbch_wnet 149
|
||||||
|
#define dbch_x11 150
|
||||||
|
#define dbch_x11drv 151
|
||||||
/* Definitions for classes identifiers */
|
/* Definitions for classes identifiers */
|
||||||
#define dbcl_fixme 0
|
#define dbcl_fixme 0
|
||||||
#define dbcl_err 1
|
#define dbcl_err 1
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUG_CHANNEL_COUNT 150
|
#define DEBUG_CHANNEL_COUNT 152
|
||||||
#ifdef DEBUG_RUNTIME
|
#ifdef DEBUG_RUNTIME
|
||||||
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
|
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
|
||||||
{1, 1, 0, 0},
|
{1, 1, 0, 0},
|
||||||
|
@ -157,6 +157,8 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
|
||||||
{1, 1, 0, 0},
|
{1, 1, 0, 0},
|
||||||
{1, 1, 0, 0},
|
{1, 1, 0, 0},
|
||||||
{1, 1, 0, 0},
|
{1, 1, 0, 0},
|
||||||
|
{1, 1, 0, 0},
|
||||||
|
{1, 1, 0, 0},
|
||||||
};
|
};
|
||||||
const char* debug_ch_name[] = {
|
const char* debug_ch_name[] = {
|
||||||
"accel",
|
"accel",
|
||||||
|
@ -227,6 +229,7 @@ const char* debug_ch_name[] = {
|
||||||
"local",
|
"local",
|
||||||
"mci",
|
"mci",
|
||||||
"mcianim",
|
"mcianim",
|
||||||
|
"mciavi",
|
||||||
"mcimidi",
|
"mcimidi",
|
||||||
"mciwave",
|
"mciwave",
|
||||||
"mdi",
|
"mdi",
|
||||||
|
@ -296,6 +299,7 @@ const char* debug_ch_name[] = {
|
||||||
"ttydrv",
|
"ttydrv",
|
||||||
"tweak",
|
"tweak",
|
||||||
"uitools",
|
"uitools",
|
||||||
|
"unknown",
|
||||||
"updown",
|
"updown",
|
||||||
"ver",
|
"ver",
|
||||||
"virtual",
|
"virtual",
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
* a good way to do so.
|
* a good way to do so.
|
||||||
*/
|
*/
|
||||||
#define MAX_MIDIOUTDRV (16)
|
#define MAX_MIDIOUTDRV (16)
|
||||||
#define MAX_MCIMIDIDRV (1)
|
|
||||||
|
|
||||||
#if defined(HAVE_SYS_SOUNDCARD_H)
|
#if defined(HAVE_SYS_SOUNDCARD_H)
|
||||||
# include <sys/soundcard.h>
|
# include <sys/soundcard.h>
|
||||||
|
@ -81,5 +80,7 @@ LONG MCICDAUDIO_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
DWORD dwParam1, DWORD dwParam2);
|
DWORD dwParam1, DWORD dwParam2);
|
||||||
LONG MCIANIM_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
LONG MCIANIM_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
DWORD dwParam1, DWORD dwParam2);
|
DWORD dwParam1, DWORD dwParam2);
|
||||||
|
LONG MCIAVI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
|
DWORD dwParam1, DWORD dwParam2);
|
||||||
|
|
||||||
#endif /* __WINE_MULTIMEDIA_H */
|
#endif /* __WINE_MULTIMEDIA_H */
|
||||||
|
|
|
@ -12,6 +12,7 @@ C_SRCS = \
|
||||||
init.c \
|
init.c \
|
||||||
joystick.c \
|
joystick.c \
|
||||||
mcianim.c \
|
mcianim.c \
|
||||||
|
mciavi.c \
|
||||||
mcicda.c \
|
mcicda.c \
|
||||||
mcimidi.c \
|
mcimidi.c \
|
||||||
mcistring.c \
|
mcistring.c \
|
||||||
|
|
|
@ -597,7 +597,7 @@ LONG MCIANIM_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
case DRV_ENABLE: return 1;
|
case DRV_ENABLE: return 1;
|
||||||
case DRV_DISABLE: return 1;
|
case DRV_DISABLE: return 1;
|
||||||
case DRV_QUERYCONFIGURE: return 1;
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
case DRV_CONFIGURE: MessageBox16(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
||||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,316 @@
|
||||||
|
/*
|
||||||
|
* Digital video MCI Wine Driver
|
||||||
|
*
|
||||||
|
* Copyright 1999 Eric POUECH
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "wine/winuser16.h"
|
||||||
|
#include "multimedia.h"
|
||||||
|
#include "user.h"
|
||||||
|
#include "driver.h"
|
||||||
|
#include "xmalloc.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "callback.h"
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int nUseCount; /* Incremented for each shared open */
|
||||||
|
BOOL16 fShareable; /* TRUE if first open was shareable */
|
||||||
|
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
||||||
|
HANDLE16 hCallback; /* Callback handle for pending notification */
|
||||||
|
HMMIO32 hFile; /* mmio file handle open as Element */
|
||||||
|
MCI_OPEN_PARMS32A openParms;
|
||||||
|
DWORD dwTimeFormat;
|
||||||
|
} WINE_MCIAVI;
|
||||||
|
|
||||||
|
#define MAX_MCIAVIDRV (1)
|
||||||
|
static WINE_MCIAVI MCIAviDev[MAX_MCIAVIDRV];
|
||||||
|
|
||||||
|
/*======================================================================*
|
||||||
|
* MCI AVI implemantation *
|
||||||
|
*======================================================================*/
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* AVI_mciGetOpenDev [internal]
|
||||||
|
*/
|
||||||
|
static WINE_MCIAVI* AVI_mciGetOpenDev(UINT16 wDevID)
|
||||||
|
{
|
||||||
|
if (wDevID >= MAX_MCIAVIDRV || MCIAviDev[wDevID].nUseCount == 0) {
|
||||||
|
WARN(mciavi, "Invalid wDevID=%u\n", wDevID);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return &MCIAviDev[wDevID];
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms);
|
||||||
|
|
||||||
|
static DWORD AVI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS32A lpParms)
|
||||||
|
{
|
||||||
|
WINE_MCIAVI* wma;
|
||||||
|
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : semi-stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
|
||||||
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
||||||
|
if (wDevID > MAX_MCIAVIDRV) return MCIERR_INVALID_DEVICE_ID;
|
||||||
|
|
||||||
|
wma = &MCIAviDev[wDevID];
|
||||||
|
|
||||||
|
if (wma->nUseCount > 0) {
|
||||||
|
/* The driver is already open on this channel */
|
||||||
|
/* If the driver was opened shareable before and this open specifies */
|
||||||
|
/* shareable then increment the use count */
|
||||||
|
if (wma->fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
||||||
|
++wma->nUseCount;
|
||||||
|
else
|
||||||
|
return MCIERR_MUST_USE_SHAREABLE;
|
||||||
|
} else {
|
||||||
|
wma->nUseCount = 1;
|
||||||
|
wma->fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
||||||
|
}
|
||||||
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
||||||
|
TRACE(cdaudio,"MCI_OPEN_ELEMENT !\n");
|
||||||
|
/* return MCIERR_NO_ELEMENT_ALLOWED; */
|
||||||
|
}
|
||||||
|
|
||||||
|
wma->openParms.dwCallback = lpParms->dwCallback;
|
||||||
|
wma->openParms.wDeviceID = (WORD)lpParms->wDeviceID;
|
||||||
|
wma->openParms.lpstrDeviceType = lpParms->lpstrDeviceType;
|
||||||
|
wma->openParms.lpstrElementName = lpParms->lpstrElementName;
|
||||||
|
wma->openParms.lpstrAlias = lpParms->lpstrAlias;
|
||||||
|
|
||||||
|
wma->wNotifyDeviceID = lpParms->wDeviceID;
|
||||||
|
/* FIXME: do real open */
|
||||||
|
/* wmcda->mciMode = MCI_MODE_STOP; */
|
||||||
|
wma->dwTimeFormat = MCI_FORMAT_TMSF;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciClose(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
|
{
|
||||||
|
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
|
||||||
|
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : semi-stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
|
||||||
|
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
|
||||||
|
|
||||||
|
if (wma->nUseCount == 1) {
|
||||||
|
AVI_mciStop(wDevID, 0, NULL);
|
||||||
|
/* FIXME: do real closing */
|
||||||
|
}
|
||||||
|
wma->nUseCount--;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
|
||||||
|
{
|
||||||
|
WINE_MCIAVI* wmm = AVI_mciGetOpenDev(wDevID);
|
||||||
|
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
|
||||||
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
||||||
|
if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID;
|
||||||
|
|
||||||
|
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
|
||||||
|
switch (lpParms->dwItem) {
|
||||||
|
case MCI_GETDEVCAPS_DEVICE_TYPE:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_DEVICE_TYPE !\n");
|
||||||
|
lpParms->dwReturn = MCI_DEVTYPE_DIGITAL_VIDEO;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_HAS_AUDIO:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_HAS_AUDIO !\n");
|
||||||
|
lpParms->dwReturn = TRUE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_HAS_VIDEO:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_HAS_VIDEO !\n");
|
||||||
|
lpParms->dwReturn = TRUE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_USES_FILES:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_USES_FILES !\n");
|
||||||
|
lpParms->dwReturn = TRUE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_COMPOUND_DEVICE:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
|
||||||
|
lpParms->dwReturn = TRUE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_CAN_EJECT:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_EJECT !\n");
|
||||||
|
lpParms->dwReturn = FALSE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_CAN_PLAY:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_PLAY !\n");
|
||||||
|
lpParms->dwReturn = TRUE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_CAN_RECORD:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_RECORD !\n");
|
||||||
|
lpParms->dwReturn = FALSE;
|
||||||
|
break;
|
||||||
|
case MCI_GETDEVCAPS_CAN_SAVE:
|
||||||
|
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_SAVE !\n");
|
||||||
|
lpParms->dwReturn = FALSE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
TRACE(mciavi, "Unknown capability (%08lx) !\n", lpParms->dwItem);
|
||||||
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TRACE(mciavi, "No GetDevCaps-Item !\n");
|
||||||
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS32A lpParms)
|
||||||
|
{
|
||||||
|
DWORD ret = 0;
|
||||||
|
LPSTR str = 0;
|
||||||
|
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
|
||||||
|
|
||||||
|
TRACE(mciavi, "(%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 {
|
||||||
|
TRACE(mciavi, "buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
|
||||||
|
|
||||||
|
switch (dwFlags) {
|
||||||
|
case MCI_INFO_PRODUCT:
|
||||||
|
str = "Wine's AVI player";
|
||||||
|
break;
|
||||||
|
case MCI_INFO_FILE:
|
||||||
|
str = "";
|
||||||
|
break;
|
||||||
|
#if 0
|
||||||
|
/* FIXME: the following manifest constants are not defined in <WINE>/include/mmsystem.h */
|
||||||
|
case MCI_INFO_COPYRIGHT:
|
||||||
|
break;
|
||||||
|
case MCI_INFO_NAME:
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
WARN(mciavi, "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 ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD AVI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
||||||
|
{
|
||||||
|
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*======================================================================*
|
||||||
|
* MCI AVI entry points *
|
||||||
|
*======================================================================*/
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* MCIAVI_DriverProc32 [sample driver]
|
||||||
|
*/
|
||||||
|
LONG WINAPI MCIAVI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
|
{
|
||||||
|
switch (wMsg) {
|
||||||
|
case DRV_LOAD: return 1;
|
||||||
|
case DRV_FREE: return 1;
|
||||||
|
case DRV_OPEN: return 1;
|
||||||
|
case DRV_CLOSE: return 1;
|
||||||
|
case DRV_ENABLE: return 1;
|
||||||
|
case DRV_DISABLE: return 1;
|
||||||
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample AVI Wine Driver !", "MM-Wine Driver", MB_OK); return 1;
|
||||||
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
|
case MCI_OPEN_DRIVER: return AVI_mciOpen (dwDevID, dwParam1, (LPMCI_OPEN_PARMS32A) dwParam2);
|
||||||
|
case MCI_CLOSE_DRIVER: return AVI_mciClose (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
|
case MCI_PLAY: return AVI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2);
|
||||||
|
case MCI_RECORD: return AVI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2);
|
||||||
|
case MCI_STOP: return AVI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
|
case MCI_SET: return AVI_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2);
|
||||||
|
case MCI_PAUSE: return AVI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
|
case MCI_RESUME: return AVI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
|
case MCI_STATUS: return AVI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2);
|
||||||
|
case MCI_GETDEVCAPS: return AVI_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
|
||||||
|
case MCI_INFO: return AVI_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMS32A) dwParam2);
|
||||||
|
case MCI_SEEK: return AVI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2);
|
||||||
|
case MCI_LOAD:
|
||||||
|
case MCI_SAVE:
|
||||||
|
case MCI_FREEZE:
|
||||||
|
case MCI_PUT:
|
||||||
|
case MCI_REALIZE:
|
||||||
|
case MCI_UNFREEZE:
|
||||||
|
case MCI_UPDATE:
|
||||||
|
case MCI_WHERE:
|
||||||
|
case MCI_WINDOW:
|
||||||
|
case MCI_STEP:
|
||||||
|
case MCI_SPIN:
|
||||||
|
case MCI_ESCAPE:
|
||||||
|
case MCI_COPY:
|
||||||
|
case MCI_CUT:
|
||||||
|
case MCI_DELETE:
|
||||||
|
case MCI_PASTE:
|
||||||
|
WARN(mciavi, "Unsupported command=%s\n", MCI_CommandToString(wMsg));
|
||||||
|
break;
|
||||||
|
case MCI_OPEN:
|
||||||
|
case MCI_CLOSE:
|
||||||
|
FIXME(mciavi, "Shouldn't receive a MCI_OPEN or CLOSE message\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
TRACE(mciavi, "Sending msg=%s to default driver proc\n", MCI_CommandToString(wMsg));
|
||||||
|
return DefDriverProc32(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||||
|
}
|
||||||
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
|
}
|
|
@ -65,6 +65,7 @@ typedef struct {
|
||||||
DWORD dwStartTicks;
|
DWORD dwStartTicks;
|
||||||
} WINE_MCIMIDI;
|
} WINE_MCIMIDI;
|
||||||
|
|
||||||
|
#define MAX_MCIMIDIDRV (1)
|
||||||
static WINE_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV];
|
static WINE_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV];
|
||||||
|
|
||||||
/*======================================================================*
|
/*======================================================================*
|
||||||
|
@ -1470,7 +1471,7 @@ static DWORD MIDI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* MCIMIDI_DriverProc32 [sample driver]
|
* MCIMIDI_DriverProc32 [sample driver]
|
||||||
*/
|
*/
|
||||||
LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
LONG WINAPI MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
switch (wMsg) {
|
switch (wMsg) {
|
||||||
|
@ -1481,7 +1482,7 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
case DRV_ENABLE: return 1;
|
case DRV_ENABLE: return 1;
|
||||||
case DRV_DISABLE: return 1;
|
case DRV_DISABLE: return 1;
|
||||||
case DRV_QUERYCONFIGURE: return 1;
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
||||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
#ifdef SNDCTL_MIDI_INFO
|
#ifdef SNDCTL_MIDI_INFO
|
||||||
|
@ -1540,4 +1541,4 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
return MCIERR_UNRECOGNIZED_COMMAND;
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
|
||||||
|
|
|
@ -178,9 +178,13 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
|
||||||
TRACE(mciwave, "wDevID=%04X (lpParams->wDeviceID=%08lX)\n", wDevID, dwDeviceID);
|
TRACE(mciwave, "wDevID=%04X (lpParams->wDeviceID=%08lX)\n", wDevID, dwDeviceID);
|
||||||
|
|
||||||
if (dwFlags & MCI_OPEN_ELEMENT) {
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
||||||
LPCSTR lpstrElementName;
|
if (dwFlags & MCI_OPEN_ELEMENT_ID) {
|
||||||
|
/* could it be that (DWORD)lpOpenParms->lpstrElementName
|
||||||
lpstrElementName = lpOpenParms->lpstrElementName;
|
* contains the hFile value ?
|
||||||
|
*/
|
||||||
|
dwRet = MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
|
} else {
|
||||||
|
LPCSTR lpstrElementName = lpOpenParms->lpstrElementName;
|
||||||
|
|
||||||
/*FIXME : what should be done id wmw->hFile is already != 0, or the driver is playin' */
|
/*FIXME : what should be done id wmw->hFile is already != 0, or the driver is playin' */
|
||||||
TRACE(mciwave,"MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
|
TRACE(mciwave,"MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
|
||||||
|
@ -189,12 +193,13 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
|
||||||
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
|
||||||
if (wmw->hFile == 0) {
|
if (wmw->hFile == 0) {
|
||||||
WARN(mciwave, "can't find file='%s' !\n", lpstrElementName);
|
WARN(mciwave, "can't find file='%s' !\n", lpstrElementName);
|
||||||
return MCIERR_FILE_NOT_FOUND;
|
dwRet = MCIERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wmw->hFile = 0;
|
wmw->hFile = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TRACE(mciwave,"hFile=%u\n", wmw->hFile);
|
TRACE(mciwave,"hFile=%u\n", wmw->hFile);
|
||||||
|
|
||||||
memcpy(&wmw->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMS32A));
|
memcpy(&wmw->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMS32A));
|
||||||
|
@ -203,7 +208,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
|
||||||
|
|
||||||
wmw->waveDesc.hWave = 0;
|
wmw->waveDesc.hWave = 0;
|
||||||
|
|
||||||
if (wmw->hFile != 0) {
|
if (dwRet == 0 && wmw->hFile != 0) {
|
||||||
MMCKINFO ckMainRIFF;
|
MMCKINFO ckMainRIFF;
|
||||||
|
|
||||||
if (mmioDescend(wmw->hFile, &ckMainRIFF, NULL, 0) != 0) {
|
if (mmioDescend(wmw->hFile, &ckMainRIFF, NULL, 0) != 0) {
|
||||||
|
@ -757,8 +762,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
|
||||||
TRACE(mciwave,"MCI_WAVE_STATUS_CHANNELS => %lu!\n", lpParms->dwReturn);
|
TRACE(mciwave,"MCI_WAVE_STATUS_CHANNELS => %lu!\n", lpParms->dwReturn);
|
||||||
break;
|
break;
|
||||||
case MCI_WAVE_STATUS_FORMATTAG:
|
case MCI_WAVE_STATUS_FORMATTAG:
|
||||||
lpParms->dwReturn = wmw->WaveFormat.wf.
|
lpParms->dwReturn = wmw->WaveFormat.wf.wFormatTag;
|
||||||
wFormatTag;
|
|
||||||
TRACE(mciwave,"MCI_WAVE_FORMATTAG => %lu!\n", lpParms->dwReturn);
|
TRACE(mciwave,"MCI_WAVE_FORMATTAG => %lu!\n", lpParms->dwReturn);
|
||||||
break;
|
break;
|
||||||
case MCI_WAVE_STATUS_LEVEL:
|
case MCI_WAVE_STATUS_LEVEL:
|
||||||
|
@ -871,7 +875,7 @@ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WARN(mciwave, "Don't know this info command (%lu)\n", dwFlags);
|
WARN(mciwave, "Don't know this info command (%lu)\n", dwFlags);
|
||||||
return MCIERR_UNRECOGNIZED_COMMAND;
|
ret = MCIERR_UNRECOGNIZED_COMMAND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (str) {
|
if (str) {
|
||||||
|
@ -904,7 +908,7 @@ LONG MCIWAVE_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
case DRV_ENABLE: return 1;
|
case DRV_ENABLE: return 1;
|
||||||
case DRV_DISABLE: return 1;
|
case DRV_DISABLE: return 1;
|
||||||
case DRV_QUERYCONFIGURE: return 1;
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
case DRV_CONFIGURE: MessageBox16(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
||||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
case MCI_OPEN_DRIVER: return WAVE_mciOpen (dwDevID, dwParam1, (LPMCI_WAVE_OPEN_PARMS32A)dwParam2);
|
case MCI_OPEN_DRIVER: return WAVE_mciOpen (dwDevID, dwParam1, (LPMCI_WAVE_OPEN_PARMS32A)dwParam2);
|
||||||
|
|
|
@ -1541,12 +1541,12 @@ LONG MIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||||
case DRV_ENABLE: return 1;
|
case DRV_ENABLE: return 1;
|
||||||
case DRV_DISABLE: return 1;
|
case DRV_DISABLE: return 1;
|
||||||
case DRV_QUERYCONFIGURE: return 1;
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
||||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
default:
|
default:
|
||||||
TRACE(midi, "Sending msg=%lu to default driver proc\n", wMsg);
|
TRACE(midi, "Sending msg=%lu to default driver proc\n", wMsg);
|
||||||
return DefDriverProc32(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
return DefDriverProc16(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1564,7 +1564,7 @@ LONG MIDI_DriverProc16(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
|
||||||
case DRV_ENABLE: return 1;
|
case DRV_ENABLE: return 1;
|
||||||
case DRV_DISABLE: return 1;
|
case DRV_DISABLE: return 1;
|
||||||
case DRV_QUERYCONFIGURE: return 1;
|
case DRV_QUERYCONFIGURE: return 1;
|
||||||
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
|
||||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -24,8 +24,8 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize)
|
||||||
#ifdef HAVE_OSS
|
#ifdef HAVE_OSS
|
||||||
int mixer,mask;
|
int mixer,mask;
|
||||||
|
|
||||||
TRACE(mmaux,"(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
|
||||||
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
|
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
|
||||||
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
|
||||||
WARN(mmaux, "mixer device not available !\n");
|
WARN(mmaux, "mixer device not available !\n");
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
|
@ -33,7 +33,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize)
|
||||||
lpCaps->wMid = 0xAA;
|
lpCaps->wMid = 0xAA;
|
||||||
lpCaps->wPid = 0x55;
|
lpCaps->wPid = 0x55;
|
||||||
lpCaps->vDriverVersion = 0x0100;
|
lpCaps->vDriverVersion = 0x0100;
|
||||||
strcpy(lpCaps->szPname,"WINE Generic Mixer");
|
strcpy(lpCaps->szPname, "WINE Generic Mixer");
|
||||||
if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &mask) == -1) {
|
if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &mask) == -1) {
|
||||||
close(mixer);
|
close(mixer);
|
||||||
perror("ioctl mixer SOUND_MIXER_DEVMASK");
|
perror("ioctl mixer SOUND_MIXER_DEVMASK");
|
||||||
|
@ -53,67 +53,16 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize)
|
||||||
#ifdef HAVE_OSS
|
#ifdef HAVE_OSS
|
||||||
static char *sdlabels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS;
|
static char *sdlabels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS;
|
||||||
static char *sdnames[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
|
static char *sdnames[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**************************************************************************
|
static void MIX_GetLineInfoFromIndex(LPMIXERLINE16 lpml, int devmask, DWORD idx)
|
||||||
* MIX_GetLineInfo [internal]
|
|
||||||
*/
|
|
||||||
static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
|
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OSS
|
strcpy(lpml->szShortName, sdlabels[idx]);
|
||||||
int mixer,i,j,devmask,recsrc,recmask;
|
strcpy(lpml->szName, sdnames[idx]);
|
||||||
|
lpml->dwLineID = idx;
|
||||||
TRACE(mmaux,"(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo);
|
lpml->dwDestination = 0; /* index for speakers */
|
||||||
if (lpml == NULL) return MMSYSERR_NOTENABLED;
|
lpml->cConnections = 1;
|
||||||
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0)
|
lpml->cControls = 1;
|
||||||
return MMSYSERR_NOTENABLED;
|
switch (idx) {
|
||||||
|
|
||||||
if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
|
|
||||||
close(mixer);
|
|
||||||
perror("ioctl mixer SOUND_MIXER_DEVMASK");
|
|
||||||
return MMSYSERR_NOTENABLED;
|
|
||||||
}
|
|
||||||
if (ioctl(mixer, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) {
|
|
||||||
close(mixer);
|
|
||||||
perror("ioctl mixer SOUND_MIXER_RECSRC");
|
|
||||||
return MMSYSERR_NOTENABLED;
|
|
||||||
}
|
|
||||||
if (ioctl(mixer, SOUND_MIXER_READ_RECMASK, &recmask) == -1) {
|
|
||||||
close(mixer);
|
|
||||||
perror("ioctl mixer SOUND_MIXER_RECMASK");
|
|
||||||
return MMSYSERR_NOTENABLED;
|
|
||||||
}
|
|
||||||
lpml->cbStruct = sizeof(MIXERLINE16);
|
|
||||||
/* FIXME: set all the variables correctly... the lines below
|
|
||||||
* are very wrong...
|
|
||||||
*/
|
|
||||||
lpml->fdwLine = MIXERLINE_LINEF_ACTIVE;
|
|
||||||
lpml->cChannels = 2;
|
|
||||||
|
|
||||||
switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) {
|
|
||||||
case MIXER_GETLINEINFOF_DESTINATION:
|
|
||||||
/* FIXME: Linux doesn't seem to support multiple outputs?
|
|
||||||
* So we have only one outputtype, Speaker.
|
|
||||||
*/
|
|
||||||
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
|
|
||||||
/* we have all connections found in the devmask */
|
|
||||||
lpml->cConnections = 0;
|
|
||||||
for (j=0;j<31;j++)
|
|
||||||
if (devmask & (1<<j))
|
|
||||||
lpml->cConnections++;
|
|
||||||
break;
|
|
||||||
case MIXER_GETLINEINFOF_SOURCE:
|
|
||||||
for (i=j=0;j<31;j++) {
|
|
||||||
if (devmask & (1<<j)) {
|
|
||||||
if (lpml->dwSource == i)
|
|
||||||
break;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
strcpy(lpml->szShortName,sdlabels[i]);
|
|
||||||
strcpy(lpml->szName,sdnames[i]);
|
|
||||||
lpml->dwLineID = i;
|
|
||||||
switch (i) {
|
|
||||||
case SOUND_MIXER_SYNTH:
|
case SOUND_MIXER_SYNTH:
|
||||||
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER;
|
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER;
|
||||||
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
|
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
|
||||||
|
@ -135,23 +84,119 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
|
||||||
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
|
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERR(mmaux,"Mixertype %d not handle.\n",i);
|
ERR(mmaux, "Index %ld not handled.\n", idx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* MIX_GetLineInfo [internal]
|
||||||
|
*/
|
||||||
|
static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_OSS
|
||||||
|
int mixer, i, j, devmask, recsrc, recmask;
|
||||||
|
DWORD ret = MMSYSERR_NOERROR;
|
||||||
|
|
||||||
|
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo);
|
||||||
|
if (lpml == NULL || lpml->cbStruct != sizeof(*lpml))
|
||||||
|
return MMSYSERR_INVALPARAM;
|
||||||
|
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0)
|
||||||
|
return MMSYSERR_NOTENABLED;
|
||||||
|
|
||||||
|
if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
|
||||||
|
close(mixer);
|
||||||
|
perror("ioctl mixer SOUND_MIXER_DEVMASK");
|
||||||
|
return MMSYSERR_NOTENABLED;
|
||||||
|
}
|
||||||
|
if (ioctl(mixer, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) {
|
||||||
|
close(mixer);
|
||||||
|
perror("ioctl mixer SOUND_MIXER_RECSRC");
|
||||||
|
return MMSYSERR_NOTENABLED;
|
||||||
|
}
|
||||||
|
if (ioctl(mixer, SOUND_MIXER_READ_RECMASK, &recmask) == -1) {
|
||||||
|
close(mixer);
|
||||||
|
perror("ioctl mixer SOUND_MIXER_RECMASK");
|
||||||
|
return MMSYSERR_NOTENABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: set all the variables correctly... the lines below
|
||||||
|
* are very wrong...
|
||||||
|
*/
|
||||||
|
lpml->fdwLine = MIXERLINE_LINEF_ACTIVE;
|
||||||
|
lpml->cChannels = 2;
|
||||||
|
|
||||||
|
switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) {
|
||||||
|
case MIXER_GETLINEINFOF_DESTINATION:
|
||||||
|
/* FIXME: Linux doesn't seem to support multiple outputs?
|
||||||
|
* So we have only one outputtype, Speaker.
|
||||||
|
*/
|
||||||
|
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
|
||||||
|
/* we have all connections found in the devmask */
|
||||||
|
lpml->cConnections = 0;
|
||||||
|
for (j=0;j<31;j++)
|
||||||
|
if (devmask & (1<<j))
|
||||||
|
lpml->cConnections++;
|
||||||
|
break;
|
||||||
|
case MIXER_GETLINEINFOF_SOURCE:
|
||||||
|
for (i = j = 0; j < 31; j++) {
|
||||||
|
if (devmask & (1 << j)) {
|
||||||
|
if (lpml->dwSource == i)
|
||||||
|
break;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MIX_GetLineInfoFromIndex(lpml, devmask, i);
|
||||||
break;
|
break;
|
||||||
case MIXER_GETLINEINFOF_LINEID:
|
case MIXER_GETLINEINFOF_LINEID:
|
||||||
FIXME(mmaux,"_LINEID (%ld) not implemented yet.\n",lpml->dwLineID);
|
MIX_GetLineInfoFromIndex(lpml, devmask, lpml->dwLineID);
|
||||||
break;
|
break;
|
||||||
case MIXER_GETLINEINFOF_COMPONENTTYPE:
|
case MIXER_GETLINEINFOF_COMPONENTTYPE:
|
||||||
FIXME(mmaux," _COMPONENTTYPE not implemented yet.\n");
|
TRACE(mmaux, "Getting component type (%08lx)\n", lpml->dwComponentType);
|
||||||
|
switch (lpml->dwComponentType) {
|
||||||
|
case MIXERLINE_COMPONENTTYPE_DST_SPEAKERS:
|
||||||
|
i = -1;
|
||||||
|
break;
|
||||||
|
case MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER:
|
||||||
|
i = SOUND_MIXER_SYNTH;
|
||||||
|
break;
|
||||||
|
case MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC:
|
||||||
|
i = SOUND_MIXER_CD;
|
||||||
|
break;
|
||||||
|
case MIXERLINE_COMPONENTTYPE_SRC_LINE:
|
||||||
|
i = SOUND_MIXER_LINE;
|
||||||
|
break;
|
||||||
|
case MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE:
|
||||||
|
i = SOUND_MIXER_MIC;
|
||||||
|
break;
|
||||||
|
case MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT:
|
||||||
|
i = SOUND_MIXER_PCM;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
FIXME(mmaux, "Unhandled component type (%08lx)\n", lpml->dwComponentType);
|
||||||
|
return MMSYSERR_INVALPARAM;
|
||||||
|
}
|
||||||
|
if (i != -1 && (devmask & (1 << i))) {
|
||||||
|
strcpy(lpml->szShortName, sdlabels[i]);
|
||||||
|
strcpy(lpml->szName, sdnames[i]);
|
||||||
|
lpml->dwLineID = i;
|
||||||
|
lpml->fdwLine = MIXERLINE_LINEF_SOURCE;
|
||||||
|
} else {
|
||||||
|
lpml->cConnections = 0;
|
||||||
|
for (j=0;j<31;j++)
|
||||||
|
if (devmask & (1<<j))
|
||||||
|
lpml->cConnections++;
|
||||||
|
lpml->dwLineID = 32;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MIXER_GETLINEINFOF_TARGETTYPE:
|
case MIXER_GETLINEINFOF_TARGETTYPE:
|
||||||
FIXME(mmaux,"_TARGETTYPE not implemented yet.\n");
|
FIXME(mmaux, "_TARGETTYPE not implemented yet.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lpml->Target.dwType = MIXERLINE_TARGETTYPE_AUX;
|
lpml->Target.dwType = MIXERLINE_TARGETTYPE_AUX;
|
||||||
close(mixer);
|
close(mixer);
|
||||||
return MMSYSERR_NOERROR;
|
return ret;
|
||||||
#else
|
#else
|
||||||
return MMSYSERR_NOTENABLED;
|
return MMSYSERR_NOTENABLED;
|
||||||
#endif
|
#endif
|
||||||
|
@ -164,8 +209,8 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpmod, DWORD flags)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OSS
|
#ifdef HAVE_OSS
|
||||||
|
|
||||||
TRACE(mmaux,"(%04X, %p, %lu);\n",wDevID,lpmod,flags);
|
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID,lpmod,flags);
|
||||||
if (lpmod == NULL) return MMSYSERR_NOTENABLED;
|
if (lpmod == NULL) return MMSYSERR_INVALPARAM;
|
||||||
/* hmm. We don't keep the mixer device open. So just pretend it works */
|
/* hmm. We don't keep the mixer device open. So just pretend it works */
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
#else
|
#else
|
||||||
|
@ -179,20 +224,23 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpmod, DWORD flags)
|
||||||
DWORD WINAPI mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
|
DWORD WINAPI mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
|
||||||
DWORD dwParam1, DWORD dwParam2)
|
DWORD dwParam1, DWORD dwParam2)
|
||||||
{
|
{
|
||||||
TRACE(mmaux,"(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
TRACE(mmaux, "(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
||||||
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
||||||
|
|
||||||
switch(wMsg) {
|
switch(wMsg) {
|
||||||
case MXDM_GETDEVCAPS:
|
case MXDM_GETDEVCAPS:
|
||||||
return MIX_GetDevCaps(wDevID,(LPMIXERCAPS16)dwParam1,dwParam2);
|
return MIX_GetDevCaps(wDevID, (LPMIXERCAPS16)dwParam1, dwParam2);
|
||||||
case MXDM_GETLINEINFO:
|
case MXDM_GETLINEINFO:
|
||||||
return MIX_GetLineInfo(wDevID,(LPMIXERLINE16)dwParam1,dwParam2);
|
return MIX_GetLineInfo(wDevID, (LPMIXERLINE16)dwParam1, dwParam2);
|
||||||
case MXDM_GETNUMDEVS:
|
case MXDM_GETNUMDEVS:
|
||||||
TRACE(mmsys,"return 1;\n");
|
TRACE(mmaux, "return 1;\n");
|
||||||
return 1;
|
return 1;
|
||||||
case MXDM_OPEN:
|
case MXDM_OPEN:
|
||||||
return MIX_Open(wDevID,(LPMIXEROPENDESC)dwParam1,dwParam2);
|
return MIX_Open(wDevID, (LPMIXEROPENDESC)dwParam1, dwParam2);
|
||||||
|
case MXDM_CLOSE:
|
||||||
|
return MMSYSERR_NOERROR;
|
||||||
default:
|
default:
|
||||||
WARN(mmaux,"unknown message %d!\n",wMsg);
|
WARN(mmaux, "unknown message %d!\n", wMsg);
|
||||||
}
|
}
|
||||||
return MMSYSERR_NOTSUPPORTED;
|
return MMSYSERR_NOTSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -136,7 +136,7 @@ type win32
|
||||||
133 stdcall mmioWrite(long ptr long) mmioWrite32
|
133 stdcall mmioWrite(long ptr long) mmioWrite32
|
||||||
134 stdcall mmsystemGetVersion() mmsystemGetVersion32
|
134 stdcall mmsystemGetVersion() mmsystemGetVersion32
|
||||||
135 stdcall sndPlaySoundA(ptr long) sndPlaySound
|
135 stdcall sndPlaySoundA(ptr long) sndPlaySound
|
||||||
136 stub sndPlaySoundW
|
136 stdcall sndPlaySoundW(ptr long) sndPlaySound32W
|
||||||
137 stdcall timeBeginPeriod(long) timeBeginPeriod32
|
137 stdcall timeBeginPeriod(long) timeBeginPeriod32
|
||||||
138 stdcall timeEndPeriod(long) timeEndPeriod32
|
138 stdcall timeEndPeriod(long) timeEndPeriod32
|
||||||
139 stdcall timeGetDevCaps(ptr long) timeGetDevCaps32
|
139 stdcall timeGetDevCaps(ptr long) timeGetDevCaps32
|
||||||
|
|
Loading…
Reference in New Issue