1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/misc/mmaux.c
Alexandre Julliard 6b81b398f5 Release 940706
Sun, 3 Jul 1994 20:15:56 +0100 (BST)  David Metcalfe <david@prism.demon.co.uk>

	* [controls/edit.c]
	Bug fixes and tidying up.  Preliminary tab stop support
	(doesn't work yet).

	* [windows/dialog.c]
	Reversed order of buttons in CheckRadioButtons so that all
	buttons are now displayed.

Tue Jul  5 18:30:24 1994  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [include/options.h] [misc/main.c] [windows/win.c]
	Removed nosaveunders option, replaced by handling
	the CS_SAVEBITS flag.

	* [windows/class.c]
	Modified the fix for negative size in class extra bytes to
	avoid modifying the caller's data.

	* [windows/dc.c]
	Bug fix: system font must be a proportional font.
	Fixed a bug that caused the default pen to not be selected
	correctly in a DC.

	* [windows/graphics.c]
	Bug fix in GRAPH_DrawArc(). Thanks to Adriano Azevedo for
	noticing it.

	* [windows/painting.c]
	Removed incorrect selecting of default objects in BeginPaint()
	(no longer needed because of the fix in dc.c).

Jul 4, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [misc/mmsystem.c]
	* [misc/audio.c]
	Add more code to interface '/dev/dsp'.

	* New file [misc/mcicda.c]
	Create an MCI_DEVTYPE_CD_AUDIO driver connected to '/dev/sbpcd'.

	* New file [misc/mmaux.c]
	Stubs to make a future driver connected to '/dev/mixer'.

	* [windows/win.c]
	Temporary patch to CreateWindowEx() for reseting negative
	coordinates to 0,0 ; because 'soundrec.exe' give negative values
	and I need it to work on MMSYSTEM ... :-)

	* [miscemu/int2f.c]
	add a stub 'do_int2f_16' (function 0x16) for DMPI server.

Mon Jun 20 10:08:40 BST 1994  William Smith (wos@dcs.warwick.ac.uk)

	* include/comm.h
	New file -- some definitions that were in comm.c now need to
	be shared with misc/dos_fs.c

	* misc/comm.c
	Some definitions moved into include/comm.h

	* misc/dos_fs.c (DOS_GetEquipment):
	Fixed error in equipment -- bitwise or of two values should
	be used instead of logical or.  Also added code to correctly
	report the number of serial and parallel devices.
1994-07-07 16:23:58 +00:00

116 lines
3 KiB
C

/*
* Sample AUXILARY Wine Driver for Linux
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "stdio.h"
#include "win.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h>
#define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer"
#ifdef SOUND_VERSION
#define IOCTL(a,b,c) ioctl(a,b,&c)
#else
#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
#endif
/*-----------------------------------------------------------------------*/
/**************************************************************************
* AUX_GetDevCaps [internal]
*/
DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
{
int mixer;
int volume;
printf("AUX_GetDevCaps(%u, %08X, %u);\n", wDevID, lpCaps, dwSize);
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("AUX_GetDevCaps // mixer device not available !\n");
return MMSYSERR_NOTENABLED;
}
if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) {
printf("AUX_GetDevCaps // unable read mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* AUX_GetVolume [internal]
*/
DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
{
int mixer;
int volume;
printf("AUX_GetVolume(%u, %08X);\n", wDevID, dwParam);
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_GetVolume' // mixer device not available !\n");
return MMSYSERR_NOTENABLED;
}
if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) {
printf("Linux 'AUX_GetVolume' // unable read mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* AUX_SetVolume [internal]
*/
DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
{
int mixer;
int volume = 50;
printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam);
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_SetVolume' // mixer device not available !\n");
return MMSYSERR_NOTENABLED;
}
if (ioctl(mixer, SOUND_MIXER_WRITE_LINE, &volume) == -1) {
printf("Linux 'AUX_SetVolume' // unable set mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
return MMSYSERR_NOERROR;
}
/**************************************************************************
* auxMessage [sample driver]
*/
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
printf("auxMessage(%u, %04X, %08X, %08X, %08X);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch(wMsg) {
case AUXDM_GETDEVCAPS:
return AUX_GetDevCaps(wDevID, (LPAUXCAPS)dwParam1, dwParam2);
case AUXDM_GETNUMDEVS:
return 0L;
case AUXDM_GETVOLUME:
return AUX_GetVolume(wDevID, dwParam1);
case AUXDM_SETVOLUME:
return AUX_SetVolume(wDevID, dwParam1);
}
return MMSYSERR_NOTSUPPORTED;
}