Commit Graph

15 Commits

Author SHA1 Message Date
sezero fe924aa632 Merge several FS_* and snd_codec* layer updates from uhexen2 tree:
tidy-ups in FS* stdio replacement functions. add new FS_filelength.
snd codec layer updates: changed codec_open() to operate only on a
stream pointer and moved all file open/close stuff to snd_codec.c.
codec_open now only returns true or false upon success or failure
instead of a stream pointer. added new snd_codec.c toplevel helper
S_CodecForwardStream(), which allows one codec to hand over its
stream from its codec_open() to another codec. Support for tracker
(mod) music, including support for Unreal umx containers. (might
be useful if we ever make a Nehahra version of the engine some day.
edit the makefiles to enable when compiling.)


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@867 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-09-25 11:01:12 +00:00
sezero 4b45dcbda5 snd_mp3.c (mp3_startread): set the missing stream->info.bits value
(for completeness only.)


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@865 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-07-27 05:05:44 +00:00
sezero 6d340ff733 snd_mp3.c (mp3_startread): don't error upon a short read
as it may be a short but still a valid file.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@860 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-07-23 17:01:20 +00:00
sezero 3e9ec5f401 updated snd bits from uhexen2. added signed 8 bit format support
to the mixer.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@688 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-06-25 12:50:09 +00:00
sezero 1b51748596 snd_mp3.c, snd_vorbis.c, snd_wave.c: Make _sure_ that the number
of channels in the music file is supported, i.e. either stereo or
mono. Minor tidy up of the error return paths.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@661 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-04-22 11:02:08 +00:00
sezero c2e215c30f snd_mp3.c (mp3_madseek): clang, -Wtautological-compare: fixed the
"comparison of unsigned expression >= 0 is always true" warning for
to_skip_samples.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@624 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-01-29 19:15:20 +00:00
sezero 2713633423 snd_mp3.c (S_MP3_CodecOpenStream): Don't Z_Free() stream's private
data when not allocating on the zone.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@479 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-21 09:10:52 +00:00
sezero 7920f6af3e snd_mp3.c: leave Z_ alone and allocate libmad decoding buffers (ca. 64kb)
on the system memory.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@471 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-20 09:00:12 +00:00
sezero 9800cf9d15 a little syncing with uhexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@460 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-12 12:25:22 +00:00
sezero 82960be532 Sync music stuff with uHexen2: Removed S_FileExtension, replaced its use
by COM_FileGetExtension.  Adjusted all users because COM_FileGetExtension
doesn't include the leading dot for the extension, nor does it ever return
NULL.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@455 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-05-20 22:20:30 +00:00
sezero 687eb577cd * snd_mp3.c: removed useless rudimentary info checks.
* updated copyright years for several sound related sources.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@405 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-30 21:34:12 +00:00
sezero d8ffad069b * snd_mp3.c: sync with sox project CVS repo and add mp3_madseek()
as a new private function. make S_MP3_CodecRewindStream() to use
  the new mp3_madseek() function.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@404 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-30 18:23:20 +00:00
sezero 5acd0431ee min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
sezero c307083fd1 snd_mp3.c: fixed windows build.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@377 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 21:29:00 +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