1999-09-22 18:52:47 +02:00
|
|
|
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
2002-06-01 01:06:46 +02:00
|
|
|
/*
|
1999-09-22 18:52:47 +02:00
|
|
|
* Wine Driver for Open Sound System
|
|
|
|
*
|
|
|
|
* Copyright 1999 Eric Pouech
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-09-22 18:52:47 +02:00
|
|
|
*/
|
|
|
|
|
2001-01-25 23:23:08 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2000-12-19 05:53:20 +01:00
|
|
|
#include "winbase.h"
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "wingdi.h"
|
1999-09-22 18:52:47 +02:00
|
|
|
#include "winuser.h"
|
|
|
|
#include "mmddk.h"
|
|
|
|
#include "oss.h"
|
|
|
|
|
2000-12-27 19:43:30 +01:00
|
|
|
#ifdef HAVE_OSS
|
|
|
|
|
1999-09-22 18:52:47 +02:00
|
|
|
static struct WINE_OSS* oss = NULL;
|
|
|
|
|
|
|
|
/**************************************************************************
|
2002-06-01 01:06:46 +02:00
|
|
|
* OSS_drvOpen [internal]
|
1999-09-22 18:52:47 +02:00
|
|
|
*/
|
|
|
|
static DWORD OSS_drvOpen(LPSTR str)
|
|
|
|
{
|
|
|
|
if (oss)
|
|
|
|
return 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-09-22 18:52:47 +02:00
|
|
|
/* I know, this is ugly, but who cares... */
|
|
|
|
oss = (struct WINE_OSS*)1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2002-06-01 01:06:46 +02:00
|
|
|
* OSS_drvClose [internal]
|
1999-09-22 18:52:47 +02:00
|
|
|
*/
|
|
|
|
static DWORD OSS_drvClose(DWORD dwDevID)
|
|
|
|
{
|
|
|
|
if (oss) {
|
|
|
|
oss = NULL;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-12-27 19:43:30 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-09-22 18:52:47 +02:00
|
|
|
/**************************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* DriverProc (WINEOSS.1)
|
1999-09-22 18:52:47 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
LONG CALLBACK OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
|
1999-09-22 18:52:47 +02:00
|
|
|
DWORD dwParam1, DWORD dwParam2)
|
|
|
|
{
|
|
|
|
/* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
|
|
|
|
/* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-09-22 18:52:47 +02:00
|
|
|
switch(wMsg) {
|
2000-12-27 19:43:30 +01:00
|
|
|
#ifdef HAVE_OSS
|
2002-06-01 01:06:46 +02:00
|
|
|
case DRV_LOAD: OSS_WaveInit();
|
2001-05-07 20:16:57 +02:00
|
|
|
#ifdef HAVE_OSS_MIDI
|
2002-06-01 01:06:46 +02:00
|
|
|
OSS_MidiInit();
|
2001-05-07 20:16:57 +02:00
|
|
|
#endif
|
|
|
|
return 1;
|
1999-09-22 18:52:47 +02:00
|
|
|
case DRV_FREE: return 1;
|
|
|
|
case DRV_OPEN: return OSS_drvOpen((LPSTR)dwParam1);
|
|
|
|
case DRV_CLOSE: return OSS_drvClose(dwDevID);
|
|
|
|
case DRV_ENABLE: return 1;
|
|
|
|
case DRV_DISABLE: return 1;
|
|
|
|
case DRV_QUERYCONFIGURE: return 1;
|
|
|
|
case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1;
|
|
|
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
|
|
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
2000-12-27 19:43:30 +01:00
|
|
|
#endif
|
1999-09-22 18:52:47 +02:00
|
|
|
default:
|
|
|
|
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|