2001-04-26 16:45:43 +00:00
|
|
|
/*
|
|
|
|
SDL - Simple DirectMedia Layer
|
2006-02-01 06:32:25 +00:00
|
|
|
Copyright (C) 1997-2006 Sam Lantinga
|
2001-04-26 16:45:43 +00:00
|
|
|
|
2006-02-07 06:59:48 +00:00
|
|
|
This library is SDL_free software; you can redistribute it and/or
|
2006-02-01 06:32:25 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2001-04-26 16:45:43 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2006-02-01 06:32:25 +00:00
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
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
|
2006-02-01 06:32:25 +00:00
|
|
|
Lesser General Public License for more details.
|
2001-04-26 16:45:43 +00:00
|
|
|
|
2006-02-01 06:32:25 +00:00
|
|
|
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
Sam Lantinga
|
2001-12-14 12:38:15 +00:00
|
|
|
slouken@libsdl.org
|
2001-04-26 16:45:43 +00:00
|
|
|
*/
|
2006-02-21 08:46:50 +00:00
|
|
|
#include "SDL_config.h"
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
#ifndef _SDL_sysaudio_h
|
|
|
|
#define _SDL_sysaudio_h
|
|
|
|
|
|
|
|
#include "SDL_mutex.h"
|
|
|
|
#include "SDL_thread.h"
|
|
|
|
|
|
|
|
/* The SDL audio driver */
|
|
|
|
typedef struct SDL_AudioDevice SDL_AudioDevice;
|
|
|
|
|
|
|
|
/* Define the SDL audio driver structure */
|
|
|
|
#define _THIS SDL_AudioDevice *_this
|
|
|
|
#ifndef _STATUS
|
|
|
|
#define _STATUS SDL_status *status
|
|
|
|
#endif
|
2006-07-10 21:04:37 +00:00
|
|
|
struct SDL_AudioDevice
|
|
|
|
{
|
|
|
|
/* * * */
|
|
|
|
/* The name of this audio driver */
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* The description of this audio driver */
|
|
|
|
const char *desc;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Public driver functions */
|
|
|
|
int (*OpenAudio) (_THIS, SDL_AudioSpec * spec);
|
|
|
|
void (*ThreadInit) (_THIS); /* Called by audio thread at start */
|
|
|
|
void (*WaitAudio) (_THIS);
|
|
|
|
void (*PlayAudio) (_THIS);
|
|
|
|
Uint8 *(*GetAudioBuf) (_THIS);
|
|
|
|
void (*WaitDone) (_THIS);
|
|
|
|
void (*CloseAudio) (_THIS);
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Lock / Unlock functions added for the Mac port */
|
|
|
|
void (*LockAudio) (_THIS);
|
|
|
|
void (*UnlockAudio) (_THIS);
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Data common to all devices */
|
|
|
|
|
|
|
|
/* The current audio specification (shared with audio thread) */
|
|
|
|
SDL_AudioSpec spec;
|
|
|
|
|
|
|
|
/* An audio conversion block for audio format emulation */
|
|
|
|
SDL_AudioCVT convert;
|
|
|
|
|
|
|
|
/* Current state flags */
|
|
|
|
int enabled;
|
|
|
|
int paused;
|
|
|
|
int opened;
|
|
|
|
|
|
|
|
/* Fake audio buffer for when the audio hardware is busy */
|
|
|
|
Uint8 *fake_stream;
|
|
|
|
|
|
|
|
/* A semaphore for locking the mixing buffers */
|
|
|
|
SDL_mutex *mixer_lock;
|
|
|
|
|
|
|
|
/* A thread to feed the audio device */
|
|
|
|
SDL_Thread *thread;
|
|
|
|
Uint32 threadid;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Data private to this driver */
|
|
|
|
struct SDL_PrivateAudioData *hidden;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* The function used to dispose of this structure */
|
|
|
|
void (*free) (_THIS);
|
2001-04-26 16:45:43 +00:00
|
|
|
};
|
|
|
|
#undef _THIS
|
|
|
|
|
2006-07-10 21:04:37 +00:00
|
|
|
typedef struct AudioBootStrap
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *desc;
|
|
|
|
int (*available) (void);
|
|
|
|
SDL_AudioDevice *(*create) (int devindex);
|
2001-04-26 16:45:43 +00:00
|
|
|
} AudioBootStrap;
|
|
|
|
|
2006-03-21 09:33:54 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_BSD
|
|
|
|
extern AudioBootStrap BSD_AUDIO_bootstrap;
|
2001-07-08 09:00:06 +00:00
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_OSS
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap DSP_bootstrap;
|
|
|
|
extern AudioBootStrap DMA_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_ALSA
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap ALSA_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_QNXNTO
|
Date: Sat, 2 Aug 2003 16:22:51 +0300
From: "Mike Gorchak"
Subject: New patches for QNX6
Here my patches for the SDL/QNX:
QNXSDL.diff - diff to non-QNX related sources:
- updated BUGS file, I think QNX6 is now will be officially supported
- configure.in - added shared library support for QNX, and removed dependency between the ALSA and QNX6.
- SDL_audio.c - added QNX NTO sound bootstrap insted of ALSA's.
- SDL_sysaudio.h - the same.
- SDL_nto_audio.c - the same.
- SDL_video.c - right now, QNX doesn't offer any method to obtain pointers to the OpenGL functions by function name, so they must be hardcoded in library, otherwise OpenGL will not be supported.
- testsprite.c - fixed: do not draw vertical red line if we are in non-double-buffered mode.
sdlqnxph.tar.gz - archive of the ./src/video/photon/* . Too many changes in code to make diffs :) :
+ Added stub for support hide/unhide window event
+ Added full YUV overlays support.
+ Added window maximize support.
+ Added mouse wheel events.
+ Added support for some specific key codes in Unicode mode (like ESC).
+ Added more checks to the all memory allocation code.
+ Added SDL_DOUBLEBUF support in all fullscreen modes.
+ Added fallback to window mode, if desired fullscreen mode is not supported.
+ Added stub support for the GL_LoadLibrary and GL_GetProcAddress functions.
+ Added resizable window support without caption.
! Fixed bug in the Ph_EV_EXPOSE event handler, when rectangles to update is 0 and when width or height of the rectangle is 0.
! Fixed bug in the event handler code. Events has not been passed to the window widget handler.
! Fixed codes for Win keys (Super/Hyper/Menu).
! Fixed memory leak, when deallocation palette.
! Fixed palette emulation code bugs.
! Fixed fullscreen and hwsurface handling.
! Fixed CLOSE button bug. First event was passed to the handler, but second terminated the application. Now all events passed to the application correctly.
- Removed all printfs in code, now SDL_SetError used instead of them.
- Disabled ToggleFullScreen function.
README.QNX - updated README.QNX file. Added much more issues.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40664
2003-08-04 00:52:42 +00:00
|
|
|
extern AudioBootStrap QNXNTOAUDIO_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_SUNAUDIO
|
2001-08-09 13:09:47 +00:00
|
|
|
extern AudioBootStrap SUNAUDIO_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DMEDIA
|
2001-08-09 13:09:47 +00:00
|
|
|
extern AudioBootStrap DMEDIA_bootstrap;
|
2001-05-23 00:36:17 +00:00
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_ARTS
|
|
|
|
extern AudioBootStrap ARTS_bootstrap;
|
2001-04-26 16:45:43 +00:00
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_ESD
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap ESD_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_NAS
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap NAS_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DSOUND
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap DSOUND_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_WAVEOUT
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap WAVEOUT_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_PAUD
|
2001-05-10 20:13:29 +00:00
|
|
|
extern AudioBootStrap Paud_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_BAUDIO
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap BAUDIO_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_COREAUDIO
|
2004-08-21 02:06:30 +00:00
|
|
|
extern AudioBootStrap COREAUDIO_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_SNDMGR
|
2001-04-26 16:45:43 +00:00
|
|
|
extern AudioBootStrap SNDMGR_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_AHI
|
2001-05-10 20:13:29 +00:00
|
|
|
extern AudioBootStrap AHI_bootstrap;
|
2001-04-26 16:45:43 +00:00
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_MINT
|
2003-07-07 19:16:03 +00:00
|
|
|
extern AudioBootStrap MINTAUDIO_GSXB_bootstrap;
|
|
|
|
extern AudioBootStrap MINTAUDIO_MCSN_bootstrap;
|
|
|
|
extern AudioBootStrap MINTAUDIO_STFA_bootstrap;
|
|
|
|
extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap;
|
|
|
|
extern AudioBootStrap MINTAUDIO_DMA8_bootstrap;
|
2002-06-10 20:42:53 +00:00
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DISK
|
2001-06-16 01:51:42 +00:00
|
|
|
extern AudioBootStrap DISKAUD_bootstrap;
|
|
|
|
#endif
|
2006-03-14 08:53:33 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DUMMY
|
|
|
|
extern AudioBootStrap DUMMYAUD_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DC
|
2002-10-05 16:50:56 +00:00
|
|
|
extern AudioBootStrap DCAUD_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_MMEAUDIO
|
2003-07-22 14:01:21 +00:00
|
|
|
extern AudioBootStrap MMEAUDIO_bootstrap;
|
|
|
|
#endif
|
2006-02-16 10:11:48 +00:00
|
|
|
#if SDL_AUDIO_DRIVER_DART
|
2005-11-23 07:29:56 +00:00
|
|
|
extern AudioBootStrap DART_bootstrap;
|
|
|
|
#endif
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
/* This is the current audio device */
|
|
|
|
extern SDL_AudioDevice *current_audio;
|
|
|
|
|
|
|
|
#endif /* _SDL_sysaudio_h */
|
2006-07-10 21:04:37 +00:00
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|