1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/multimedia/mmaux.c
Alexandre Julliard 18506558a7 Release 950122
Sun Jan 22 18:55:33 1995  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [loader/resource.c] [objects/dib.c]
	Fixed icon loading and drawing, now that BitBlt() works correctly.
	
	* [objects/clipping.c] [objects/region.c]
	Implemented elliptic regions with a set of rectangle. This greatly
	simplifies the region code and should boost clipping performance.

	* [objects/color.c]
	Fixed bug that caused seg-fault on 24bpp displays.

	* [objects/bitblt.c]
	Fixed bug when shrinking a bitmap to more than half its size.

	* [windows/graphics.c]
	Fixed bugs in PaintRgn() and Polyline().

	* [windows/nonclient.c] [windows/painting.c] [windows/winpos.c]
	Fixed some problems with window background painting.

Thu Jan 12 12:20:25 PST 1995 Ross Biro (biro@yggdrasil.com)

       * [tools/build.c]
       * [tools/newbuild.c]
       * [Imakefile]
       * [include/wine.h]
       * [loader/call.S]
       * [loader/selector.c]
       * [include/segmem.h]
       * [misc/main.c]
       Changed selector code and 16/32 bit xfer code so that wine
       no longer has to be loaded low in memory.  Changed wine
       to work with ELF binary formats under Linux.
       
Sat Sep 17 11:08:49 1994  Eric Youngdale  (eric@esp22)

	* [debugger/db_disasm.c]
	New instruction disassembler - borrowed from Mach kernel.  Has a
	BSD style of license as opposed to the gdb code we were previously
	using which was under the GPL.

Mon Jan  9 18:27:11 1995  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [Imakefile]
	Compiling with -Wall flag.

	* [*/*]
	Fixes to minimize the number of compilation warnings.

	* [objects/bitblt.c]
	Fixed BitBlt() and used the same code to rewrite PatBlt() and
	StretchBlt(). The three *Blt() functions should now be correct in
	every case (famous last words).

	* [objects/brush.c] [objects/dither.c]
	Merged the two files into brush.c

	* [objects/dc.c]
	Fixed bug when the Windows programs forget to re-select the
	original bitmap in a memory DC.

	* [objects/font.c]
	Tty to use 'fixed' font when the system font can't be found.

	* [windows/dialog.c]
	Tentative fix to make dialogs look better when using fixed-width
	fonts.

	* [windows/graphics.c]
	Partially implemented the PS_INSIDEFRAME pen style.

	* [windows/nonclient.c]
	Fix for windows that have the WS_EX_DLGMODALFRAME style bit
	without the WS_DLGFRAME style.
1995-01-24 16:21:01 +00:00

245 lines
6.1 KiB
C

/*
* Sample AUXILARY Wine Driver for Linux
*
* Copyright 1994 Martin Ayotte
*
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
#ifndef WINELIB
#define BUILTIN_MMSYSTEM
#endif
#ifdef BUILTIN_MMSYSTEM
#define EMULATE_SB16
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "windows.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#ifdef linux
#include <linux/soundcard.h>
#endif
#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)
{
#ifdef linux
int mixer;
int volume;
printf("AUX_GetDevCaps(%u, %p, %lu);\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) {
close(mixer);
printf("AUX_GetDevCaps // unable read mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
#ifdef EMULATE_SB16
lpCaps->wMid = 0x0002;
lpCaps->vDriverVersion = 0x0200;
lpCaps->dwSupport = AUXCAPS_VOLUME | AUXCAPS_LRVOLUME;
switch (wDevID) {
case 0:
lpCaps->wPid = 0x0196;
strcpy(lpCaps->szPname, "SB16 Aux: Wave");
lpCaps->wTechnology = AUXCAPS_AUXIN;
break;
case 1:
lpCaps->wPid = 0x0197;
strcpy(lpCaps->szPname, "SB16 Aux: Midi Synth");
lpCaps->wTechnology = AUXCAPS_AUXIN;
break;
case 2:
lpCaps->wPid = 0x0191;
strcpy(lpCaps->szPname, "SB16 Aux: CD");
lpCaps->wTechnology = AUXCAPS_CDAUDIO;
break;
case 3:
lpCaps->wPid = 0x0192;
strcpy(lpCaps->szPname, "SB16 Aux: Line-In");
lpCaps->wTechnology = AUXCAPS_AUXIN;
break;
case 4:
lpCaps->wPid = 0x0193;
strcpy(lpCaps->szPname, "SB16 Aux: Mic");
lpCaps->wTechnology = AUXCAPS_AUXIN;
break;
case 5:
lpCaps->wPid = 0x0194;
strcpy(lpCaps->szPname, "SB16 Aux: Master");
lpCaps->wTechnology = AUXCAPS_AUXIN;
break;
}
#else
lpCaps->wMid = 0xAA;
lpCaps->wPid = 0x55;
lpCaps->vDriverVersion = 0x0100;
strcpy(lpCaps->szPname, "Generic Linux Auxiliary Driver");
lpCaps->wTechnology = AUXCAPS_CDAUDIO;
lpCaps->dwSupport = AUXCAPS_VOLUME | AUXCAPS_LRVOLUME;
#endif
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
/**************************************************************************
* AUX_GetVolume [internal]
*/
DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
{
#ifdef linux
int mixer;
int volume;
int cmd;
printf("AUX_GetVolume(%u, %p);\n", wDevID, lpdwVol);
if (lpdwVol == NULL) return MMSYSERR_NOTENABLED;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_GetVolume' // mixer device not available !\n");
return MMSYSERR_NOTENABLED;
}
switch(wDevID) {
case 0:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n");
cmd = SOUND_MIXER_READ_PCM;
break;
case 1:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n");
cmd = SOUND_MIXER_READ_SYNTH;
break;
case 2:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n");
cmd = SOUND_MIXER_READ_CD;
break;
case 3:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n");
cmd = SOUND_MIXER_READ_LINE;
break;
case 4:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n");
cmd = SOUND_MIXER_READ_MIC;
break;
case 5:
default:
printf("Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n");
cmd = SOUND_MIXER_READ_VOLUME;
break;
}
if (ioctl(mixer, cmd, &volume) == -1) {
printf("Linux 'AUX_GetVolume' // unable read mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
*lpdwVol = MAKELONG(volume, volume);
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
/**************************************************************************
* AUX_SetVolume [internal]
*/
DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
{
#ifdef linux
int mixer;
int volume;
int cmd;
printf("AUX_SetVolume(%u, %08lX);\n", wDevID, dwParam);
volume = LOWORD(dwParam);
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
printf("Linux 'AUX_SetVolume' // mixer device not available !\n");
return MMSYSERR_NOTENABLED;
}
switch(wDevID) {
case 0:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n");
cmd = SOUND_MIXER_WRITE_PCM;
break;
case 1:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n");
cmd = SOUND_MIXER_WRITE_SYNTH;
break;
case 2:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n");
cmd = SOUND_MIXER_WRITE_CD;
break;
case 3:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n");
cmd = SOUND_MIXER_WRITE_LINE;
break;
case 4:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n");
cmd = SOUND_MIXER_WRITE_MIC;
break;
case 5:
default:
printf("Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n");
cmd = SOUND_MIXER_WRITE_VOLUME;
break;
}
if (ioctl(mixer, cmd, &volume) == -1) {
printf("Linux 'AUX_SetVolume' // unable set mixer !\n");
return MMSYSERR_NOTENABLED;
}
close(mixer);
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
/**************************************************************************
* auxMessage [sample driver]
*/
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
printf("auxMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch(wMsg) {
case AUXDM_GETDEVCAPS:
return AUX_GetDevCaps(wDevID, (LPAUXCAPS)dwParam1, dwParam2);
case AUXDM_GETNUMDEVS:
printf("AUX_GetNumDevs();\n");
return 1L;
case AUXDM_GETVOLUME:
return AUX_GetVolume(wDevID, (LPDWORD)dwParam1);
case AUXDM_SETVOLUME:
return AUX_SetVolume(wDevID, dwParam1);
}
return MMSYSERR_NOTSUPPORTED;
}
#endif /* #ifdef BUILTIN_MMSYSTEM */