Add an interface name to wineoss, winealsa, winearts and winejack.

Add support for wave interface message where missing.
This commit is contained in:
Robert Reif 2004-05-11 04:28:13 +00:00 committed by Alexandre Julliard
parent ee51a0c014
commit 4a787831f0
4 changed files with 187 additions and 12 deletions

View File

@ -149,7 +149,8 @@ typedef struct {
WAVEOUTCAPSA caps;
/* ALSA information (ALSA 0.9/1.x uses two different devices for playback/capture) */
char* device;
char* device;
char interface_name[64];
snd_pcm_t* p_handle; /* handle to ALSA playback device */
snd_pcm_t* c_handle; /* handle to ALSA capture device */
snd_pcm_hw_params_t * hw_params; /* ALSA Hw params */
@ -195,7 +196,8 @@ typedef struct {
WAVEOUTCAPSA caps;
/* ALSA information (ALSA 0.9/1.x uses two different devices for playback/capture) */
char* device;
char* device;
char interface_name[64];
snd_pcm_t* p_handle; /* handle to ALSA playback device */
snd_pcm_t* c_handle; /* handle to ALSA capture device */
snd_pcm_hw_params_t * hw_params; /* ALSA Hw params */
@ -581,6 +583,8 @@ LONG ALSA_WaveInit(void)
wwo->device = ALSA_GetDeviceFromReg("PlaybackDevice");
TRACE("using waveout device \"%s\"\n", wwo->device);
snprintf(wwo->interface_name, sizeof(wwo->interface_name), "winealsa: %s", wwo->device);
wwo->caps.wMid = 0x0002;
wwo->caps.wPid = 0x0104;
strcpy(wwo->caps.szPname, "SB16 Wave Out");
@ -694,6 +698,8 @@ LONG ALSA_WaveInit(void)
wwi->device = ALSA_GetDeviceFromReg("RecordDevice");
TRACE("using wavein device \"%s\"\n", wwi->device);
snprintf(wwi->interface_name, sizeof(wwi->interface_name), "winealsa: %s", wwi->device);
wwi->caps.wMid = 0x0002;
wwi->caps.wPid = 0x0104;
strcpy(wwi->caps.szPname, "SB16 Wave In");
@ -2000,7 +2006,7 @@ static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].device, -1,
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
@ -2010,10 +2016,10 @@ static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
*/
static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].device, -1,
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].device, -1,
MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
@ -3393,6 +3399,33 @@ static DWORD widGetNumDevs(void)
return ALSA_WidNumDevs;
}
/**************************************************************************
* widDevInterfaceSize [internal]
*/
static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* widDevInterface [internal]
*/
static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
return MMSYSERR_INVALPARAM;
}
/**************************************************************************
* widMessage (WINEALSA.@)
*/
@ -3420,9 +3453,9 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case WIDM_RESET: return widReset (wDevID);
case WIDM_START: return widStart (wDevID, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_STOP: return widStop (wDevID, (LPWAVEHDR)dwParam1, dwParam2);
/*case DRV_QUERYDEVICEINTERFACESIZE: return wdDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return wdDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
case DRV_QUERYDSOUNDIFACE: return widDsCreate (wDevID, (PIDSCDRIVER*)dwParam1);
case DRV_QUERYDEVICEINTERFACESIZE: return widDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return widDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
/*case DRV_QUERYDSOUNDIFACE: return widDsCreate (wDevID, (PIDSCDRIVER*)dwParam1);
case DRV_QUERYDSOUNDDESC: return widDsDesc (wDevID, (PDSDRIVERDESC)dwParam1);
case DRV_QUERYDSOUNDGUID: return widDsGuid (wDevID, (LPGUID)dwParam1);*/
default:

View File

@ -146,6 +146,7 @@ typedef struct {
WORD wFlags;
PCMWAVEFORMAT format;
WAVEOUTCAPSA caps;
char interface_name[32];
DWORD dwSleepTime; /* Num of milliseconds to sleep between filling the dsp buffers */
@ -183,6 +184,7 @@ typedef struct {
WORD wFlags;
PCMWAVEFORMAT format;
WAVEINCAPSA caps;
char interface_name[32];
/* arts information */
arts_stream_t record_stream; /* the stream structure we get from arts when opening a stream for recording */
@ -378,6 +380,8 @@ LONG ARTS_WaveInit(void)
/* strcpy(WOutDev[i].caps.szPname, "OpenSoundSystem WAVOUT Driver");*/
strcpy(WOutDev[i].caps.szPname, "CS4236/37/38");
#endif
snprintf(WOutDev[i].interface_name, sizeof(WOutDev[i].interface_name), "winearts: %d", i);
WOutDev[i].caps.vDriverVersion = 0x0100;
WOutDev[i].caps.dwFormats = 0x00000000;
WOutDev[i].caps.dwSupport = WAVECAPS_VOLUME;
@ -417,6 +421,8 @@ LONG ARTS_WaveInit(void)
WInDev[i].caps.wPid = 0x0001;
strcpy(WInDev[i].caps.szPname,"CS4236/37/38");
#endif
snprintf(WInDev[i].interface_name, sizeof(WInDev[i].interface_name), "winearts: %d", i);
WInDev[i].caps.vDriverVersion = 0x0100;
WInDev[i].caps.dwFormats = 0x00000000;
@ -1497,6 +1503,33 @@ static DWORD wodGetNumDevs(void)
return MAX_WAVEOUTDRV;
}
/**************************************************************************
* wodDevInterfaceSize [internal]
*/
static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* wodDevInterface [internal]
*/
static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
return MMSYSERR_INVALPARAM;
}
/**************************************************************************
* wodMessage (WINEARTS.@)
*/
@ -1532,6 +1565,8 @@ DWORD WINAPI ARTS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case WODM_RESTART: return wodRestart (wDevID);
case WODM_RESET: return wodReset (wDevID);
case DRV_QUERYDEVICEINTERFACESIZE: return wodDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
case DRV_QUERYDSOUNDIFACE: return wodDsCreate (wDevID, (PIDSDRIVER*)dwParam1);
case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1);
case DRV_QUERYDSOUNDGUID: return wodDsGuid (wDevID, (LPGUID)dwParam1);
@ -1554,6 +1589,34 @@ static DWORD widGetNumDevs(void)
return MAX_WAVEINDRV;
}
/**************************************************************************
* widDevInterfaceSize [internal]
*/
static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* widDevInterface [internal]
*/
static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
return MMSYSERR_INVALPARAM;
}
/**************************************************************************
* widNotifyClient [internal]
*/
@ -2029,6 +2092,8 @@ DWORD WINAPI ARTS_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case WIDM_RESET: return widReset (wDevID);
case WIDM_START: return widStart (wDevID);
case WIDM_STOP: return widStop (wDevID);
case DRV_QUERYDEVICEINTERFACESIZE: return widDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return widDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
default:
FIXME("unknown message %d!\n", wMsg);
}

View File

@ -128,6 +128,7 @@ typedef struct {
PCMWAVEFORMAT format;
WAVEOUTCAPSA caps;
WORD wDevID;
char interface_name[32];
jack_port_t* out_port_l; /* ports for left and right channels */
jack_port_t* out_port_r;
@ -171,6 +172,7 @@ typedef struct {
WAVEINCAPSA caps;
BOOL bTriggerSupport;
WORD wDevID;
char interface_name[32];
jack_port_t* in_port_l; /* ports for left and right channels */
jack_port_t* in_port_r;
@ -892,6 +894,9 @@ LONG JACK_WaveInit(void)
/* strcpy(WOutDev[i].caps.szPname, "OpenSoundSystem WAVOUT Driver");*/
strcpy(WOutDev[i].caps.szPname, "CS4236/37/38");
#endif
snprintf(WOutDev[i].interface_name, sizeof(WOutDev[i].interface_name), "winejack: %d", i);
WOutDev[i].caps.vDriverVersion = 0x0100;
WOutDev[i].caps.dwFormats = 0x00000000;
WOutDev[i].caps.dwSupport = WAVECAPS_VOLUME;
@ -933,6 +938,8 @@ LONG JACK_WaveInit(void)
WInDev[i].caps.wPid = 0x0001;
strcpy(WInDev[i].caps.szPname,"CS4236/37/38");
#endif
snprintf(WInDev[i].interface_name, sizeof(WInDev[i].interface_name), "winejack: %d", i);
WInDev[i].caps.vDriverVersion = 0x0100;
WInDev[i].caps.wChannels = 0x2;
@ -1675,6 +1682,33 @@ static DWORD wodGetNumDevs(void)
return MAX_WAVEOUTDRV;
}
/**************************************************************************
* wodDevInterfaceSize [internal]
*/
static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* wodDevInterface [internal]
*/
static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
return MMSYSERR_INVALPARAM;
}
/**************************************************************************
* wodMessage (WINEJACK.7)
*/
@ -1718,6 +1752,8 @@ DWORD WINAPI JACK_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case WODM_RESTART: return wodRestart(wDevID);
case WODM_RESET: return wodReset(wDevID);
case DRV_QUERYDEVICEINTERFACESIZE: return wodDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
case DRV_QUERYDSOUNDIFACE: return wodDsCreate(wDevID, (PIDSDRIVER*)dwParam1);
case DRV_QUERYDSOUNDDESC: return wodDsDesc(wDevID, (PDSDRIVERDESC)dwParam1);
case DRV_QUERYDSOUNDGUID: return wodDsGuid(wDevID, (LPGUID)dwParam1);
@ -2390,6 +2426,42 @@ static DWORD widReset(WORD wDevID)
return MMSYSERR_NOERROR;
}
/**************************************************************************
* widGetNumDevs [internal]
*/
static DWORD widGetNumDevs(void)
{
return MAX_WAVEINDRV;
}
/**************************************************************************
* widDevInterfaceSize [internal]
*/
static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* widDevInterface [internal]
*/
static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
return MMSYSERR_INVALPARAM;
}
/**************************************************************************
* widMessage (WINEJACK.6)
*/
@ -2412,10 +2484,12 @@ DWORD WINAPI JACK_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
case WIDM_PREPARE: return widPrepare (wDevID, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_UNPREPARE: return widUnprepare (wDevID, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_GETDEVCAPS: return widGetDevCaps (wDevID, (LPWAVEINCAPSA)dwParam1, dwParam2);
case WIDM_GETNUMDEVS: return MAX_WAVEINDRV;
case WIDM_GETNUMDEVS: return widGetNumDevs();
case WIDM_RESET: return widReset (wDevID);
case WIDM_START: return widStart (wDevID);
case WIDM_STOP: return widStop (wDevID);
case DRV_QUERYDEVICEINTERFACESIZE: return widDevInterfaceSize (wDevID, (LPDWORD)dwParam1);
case DRV_QUERYDEVICEINTERFACE: return widDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2);
default:
FIXME("unknown message %d!\n", wMsg);
}

View File

@ -150,6 +150,7 @@ typedef struct {
typedef struct tagOSS_DEVICE {
char dev_name[32];
char mixer_name[32];
char interface_name[64];
unsigned open_count;
WAVEOUTCAPSA out_caps;
WAVEINCAPSA in_caps;
@ -256,17 +257,17 @@ static DWORD wdDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{
TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].dev_name, -1,
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR;
}
static DWORD wdDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].dev_name, -1,
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].interface_name, -1,
NULL, 0 ) * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].dev_name, -1,
MultiByteToWideChar(CP_ACP, 0, OSS_Devices[wDevID].interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR;
}
@ -965,6 +966,8 @@ LONG OSS_WaveInit(void)
sprintf((char *)OSS_Devices[i].mixer_name, "/dev/mixer%d", i);
}
sprintf(OSS_Devices[i].interface_name, "wineoss: %s", OSS_Devices[i].dev_name);
INIT_GUID(OSS_Devices[i].ds_guid, 0xbd6dd71a, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i);
INIT_GUID(OSS_Devices[i].dsc_guid, 0xbd6dd71b, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i);
}