oss.c 2.94 KB
Newer Older
1
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
2
/*
3 4 5
 * Wine Driver for Open Sound System
 *
 * Copyright 	1999 Eric Pouech
6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * 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
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 21
 */

22 23
#include "config.h"

24 25
#include <stdarg.h>

26
#include "windef.h"
27
#include "winbase.h"
28
#include "wingdi.h"
29 30 31
#include "winuser.h"
#include "mmddk.h"
#include "oss.h"
32 33 34
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(wave);
35

36 37
#ifdef HAVE_OSS

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
/**************************************************************************
 * 				OSS_drvLoad			[internal]
 */
static LRESULT OSS_drvLoad(void)
{
    TRACE("()\n");
    OSS_WaveInit();
    OSS_MidiInit();
    OSS_MixerInit();
    OSS_AuxInit();
    return 1;
}

/**************************************************************************
 * 				OSS_drvFree			[internal]
 */
static LRESULT OSS_drvFree(void)
{
    TRACE("()\n");
    OSS_WaveExit();
    OSS_MidiExit();
    OSS_MixerExit();
    OSS_AuxExit();
    return 1;
}

64
/**************************************************************************
65
 * 				OSS_drvOpen			[internal]
66
 */
67
static LRESULT OSS_drvOpen(LPSTR str)
68
{
69
    TRACE("(%s)\n", str);
70 71 72 73
    return 1;
}

/**************************************************************************
74
 * 				OSS_drvClose			[internal]
75
 */
76
static LRESULT OSS_drvClose(DWORD_PTR dwDevID)
77
{
78
    TRACE("(%08lx)\n", dwDevID);
79
    return 1;
80 81
}

82 83 84
#endif


85
/**************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
86
 * 				DriverProc (WINEOSS.1)
87
 */
88 89
LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
                                LPARAM dwParam1, LPARAM dwParam2)
90
{
91 92
     TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
           dwDevID, hDriv, wMsg, dwParam1, dwParam2);
93

94
    switch(wMsg) {
95
#ifdef HAVE_OSS
96 97
    case DRV_LOAD:		return OSS_drvLoad();
    case DRV_FREE:		return OSS_drvFree();
98 99 100 101 102 103 104 105
    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;
106
#endif
107 108 109 110
    default:
	return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
    }
}