Commit Graph

22 Commits

Author SHA1 Message Date
sezero af17307829 cd_sdl.c: Reverted the CDAudio_Update() change from 27 Oct: it does
not make things better.  Removed the SDL_CDStatus() check before the
error message in case of SDL_CDPlay() failures: I don't really know
the significance to it and witnessed that it caused the error report
once, so I don't see any merit in its presence.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@500 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-30 16:56:03 +00:00
sezero 6ca9562340 cd_sdl.c: Simplified, making it similar to cd_linux.c or cd_bsd.c by
performing checks every two seconds in CDAudio_Update() and caching
the last check time.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@498 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-10-27 09:40:46 +00:00
sezero 0221c58370 removed the cdplayer facility added in 0.85.3
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@394 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-12 10:02:16 +00:00
sezero 2950b5cdf9 Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
  Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
  sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
  CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
  changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
  and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
  which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
  in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
  calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
  shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
  S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
  music as raw samples. Adapted from quake2 and ioquake3 with changes.
  Individual codecs are responsible for handling any necessary byte swap
  operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
  from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
  Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
  USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
  codecs.
- Windows makefiles and project files as well as other CodeBlocks project
  files will be updated shortly.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
sezero 373bf70243 Made CDAudio_Play() to return success (0) or failure (-1) instead of void.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@368 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 18:33:21 +00:00
sezero f4b0b373cb Minor cd_sdl.c cleanups from uhexen2. Reorganized cdaudio volume
handling. If volume is 0, don't bother advancing and pause.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@351 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 14:55:25 +00:00
sezero 2d5f1285e9 more fixes for deprecated conversion from string constant to char*:
handle the -safe command line switch using a new global safemode,
check for safemode in the related driver init functions and remove
the safeargvs & co from common.c and COM_InitArgv().


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@307 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 12:55:41 +00:00
stevenaaus fded47666a Back out Oz's cd-sdl.c changes
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@297 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-24 10:06:16 +00:00
sezero 7b2134168b cd_sdl.c: cleaned up the latest mess a little. restricted track progressing
to the cd player facility only.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@293 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-24 09:04:16 +00:00
stevenaaus 83a08ef79a cd fix needed fo gameplay
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@292 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-24 01:28:40 +00:00
stevenaaus a8de20a97d Make "cd play" progress tracks
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@291 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-24 00:35:22 +00:00
sezero 30b71faa55 * cd_sdl.c (export_cddev_arg): make putevn() actually work.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@290 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 23:46:16 +00:00
sezero 8138aa8608 * cd_sdl.c (export_cddev_arg): fixed bad snprintf and the crash it was
causing.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@289 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 23:20:16 +00:00
sezero a7dba17c55 cd_sdl.c: no need for uhexen2's CVS version identifier to stay here.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@288 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 17:23:39 +00:00
sezero 339fd92605 * cd_sdl.c (get_cddev_arg): fix stupid typo in uppercasing.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@287 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 15:55:54 +00:00
sezero 201ae03fdb * cd_sdl.c (get_cddev_arg): check for null or empty arguments also
for non-windows platforms.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@286 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 14:32:34 +00:00
sezero 905f6e8ed7 * cd_sdl.c: Remove unnecessary SDL_getenv.h include.
(CDAudio_Init): Move the bad ugly hack about SDL_CDROM environment
variable into the new export_cddev_arg() helper. FOr the -cddev option,
call the new get_cddev_arg() helper.

(export_cddev_arg): SDL_CDROM environment variable hack moved from
CDAudio_Init() to here. Fixed bad strcat() usage orto the array. Made it
for non-windows platforms only.

(get_cddev_arg): Added for checking the argument to the -cddev option.
For non-windows platforms just return the argument itself. For windows,
arg should be like "D:\", make sure it is so, but tolerate args like "D"
or "D:", as well.

(CDAudio_Next): Make static. Minor cleanups.

(CDAudio_Prev): Make static. Minor cleanups.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@285 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 14:05:32 +00:00
stevenaaus 0494f72f2b cd command tweaks
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@284 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 10:31:00 +00:00
stevenaaus a0f158b276 Add "cd next" and "cd prev" commands. Add a new "-cd" option , which in combination with "-dedicated", allows QS to be a stand-alone cd player... Useful\!
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@283 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 09:49:03 +00:00
stevenaaus 01218ee9ae Set SDL_CDROM environment variable when using -cddev. Some doco updates.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@282 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-23 04:12:19 +00:00
sezero 55a81e8229 cd_sdl.c: replaced the stub with the implementation we have in the uhexen2 project.
cd_null.c: added new file.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@26 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:51:25 +00:00
sezero c5c4e96d44 initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00