snd_alsa: MIDI input support! MIDI events get mapped to MIDINOTE<n> events (n = 0 to 127) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9232 d7cf8633-e32d-0410-b094-e92efae38249
move two #defined to quakedef.h, and always include quakedef.h first before any other includes, even system headers. This is to make compilation with gcc -combine work. Also, fix some type mismatches between source files. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7689 d7cf8633-e32d-0410-b094-e92efae38249
more of these git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7315 d7cf8633-e32d-0410-b094-e92efae38249
Decreased the OSS buffer size, and cleaned some code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6485 d7cf8633-e32d-0410-b094-e92efae38249
Added snd_channellayout to configure the speaker layout dynamically (0: auto, 1: standard, 2: ALSA) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6458 d7cf8633-e32d-0410-b094-e92efae38249
Removed some debug printings, and made some others requiring developer >= 100. Reset the soundcard after opening in the OSS module. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6456 d7cf8633-e32d-0410-b094-e92efae38249
Attempt to fix speaker layout for 5.1 and 7.1 sound, on Windows and Mac OS X; the sound engine now builds its speaker layout based on the OS and the snd_swapstereo cvar. Plus a minor fix for the OSS sound module (was incorrectly reporting "audio can't keep up") git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6421 d7cf8633-e32d-0410-b094-e92efae38249
- the Linux sound modules (ALSA and OSS) are now write-based, instead of mmap-based. It should fix the problems with inboard sound cards - added 3 cvars controlling the sound output format: snd_speed, snd_channels, and snd_width (default values: 48000, 2, and 2 respectively). They're saved in the config file. - the checks for command line options and environment variables modifying the sound output format are now common to all modules. The command line options supported are: -sndmono, -sndstereo, -sndquad, -sndspeed, and -sndbits. The environment variables supported are: QUAKE_SOUND_CHANNELS, QUAKE_SOUND_SPEED, and QUAKE_SOUND_SAMPLEBITS. - added a (still dumb) function to figure out a better sound format when the initialization of the sound card failed - sound modules can now suggest a sound format if the initialization of the sound card failed - you can now do a "snd_restart" while having modified snd_width and/or snd_channel. Doing a snd_restart with a modified snd_speed isn't yet supported, it will fall back to the previous speed - The WGL video module was blocking the sound output when the application window lost the focus. Now, this code is shared and the AGL, GLX and SDL video modules implement such a mecanism - A lot of minor fixes, changes, factorizations and rewrites all over the sound engine code and its modules - added CeilPowerOf2() in the math library - fixed BSDmakefile for NetBSD git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6415 d7cf8633-e32d-0410-b094-e92efae38249
changed tryrates array to include 48000, 24000, and 16000 speeds (this should help 48khz AC97 chips) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5991 d7cf8633-e32d-0410-b094-e92efae38249
eliminated snd_inited and sound_started variables, now uses shm != NULL checks instead git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5842 d7cf8633-e32d-0410-b094-e92efae38249
implemented 7.1 audio, only works with SDL (attempted ALSA support but ALSA doesn't seem to like mmap access to 4/6/8 channel buffers) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5818 d7cf8633-e32d-0410-b094-e92efae38249
fix a signed/unsigned comparison warning git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4706 d7cf8633-e32d-0410-b094-e92efae38249
FreeBSD support git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4703 d7cf8633-e32d-0410-b094-e92efae38249
Lots of minor fixes and improvements to the sound engine, plus a few more important changes: - moved the internal structures and API into a separate file (snd_main.h) - added a lock mecanism on SFXs to free them as soon as they're no longer used - simplified the sound API - minor fixes and comment changes here and there - independent sound volume for fake CD tracks - updated MSVC and Dev-C++ project files accordingly - removed unused functions - added a SFX flag to make sure the engine complains at most one time for each missing sound file - made the SFX list a linked list to remove the hardcoded limit for the number of SFX a client can handle - changed the way ambient sounds are managed to be more consistent with the new API - factorized some code - removed the useless IN_Accumulate in the Win32 specific code - removed the table for 8bit sound mixing (snd_scaletable) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4624 d7cf8633-e32d-0410-b094-e92efae38249
revised commandline option comments for better categorization when sorted git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4595 d7cf8633-e32d-0410-b094-e92efae38249
added COMMANDLINEOPTION comments for every commandline option, these will be listed in the readme git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4594 d7cf8633-e32d-0410-b094-e92efae38249
Ogg vorbis streaming support; the code decides whether it will cache or stream the sound depending on the file and uncompressed sound sizes. It should be stable enough for a regular use now; you lose a few FPS once every second or so of course, it's not free, but you can expect the Vorbis stream to use between 5 and 12 times less memory than before, depending on the sound quality and the number of SFX sources using it. This patch also contains a couple of fixes (a pretty annoying typo in the OSS and BSD driver - 22051Hz instead of 22050Hz, and a potential memory leak in WAV loader) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4052 d7cf8633-e32d-0410-b094-e92efae38249
Changed the way DP detects and handles the CPU endianess. All the tests are done at compile time now. Tested on Win32 (MSVC6 and MinGW32), Linux and NetBSD; should also work on the other BSDs. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4007 d7cf8633-e32d-0410-b094-e92efae38249
added Print versions of Printf functions and made all calls that do not need formating use the Print versions; yes this is a cosmetic cleanup, prints are too rare to have any performance improvements. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3991 d7cf8633-e32d-0410-b094-e92efae38249
cd audio now tied to sound system sound system now tied to video system because DirectSound needs a window to work at all (thank you Windows for another useless obstacle) sound system can now restart (snd_restart command) vid_stencil cvar removed (now tied to 32bit color) vid_bitsperpixel now defaults to 32 r_shadow_shadows cvar added (default 1) for stencil shadows on dlights (since vid_stencil is gone) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3548 d7cf8633-e32d-0410-b094-e92efae38249