quakespasm/Quake/bgmusic.h

44 lines
1.3 KiB
C
Raw Normal View History

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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
/*
* Background music handling for Quakespasm (adapted from uHexen2)
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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
* Handles streaming music as raw sound samples and runs the midi driver
*
* Copyright (C) 1999-2005 Id Software, Inc.
* Copyright (C) 2010-2011 O.Sezer <sezero@users.sourceforge.net>
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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _BGMUSIC_H_
#define _BGMUSIC_H_
extern qboolean bgmloop;
extern cvar_t bgm_extmusic;
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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
qboolean BGM_Init (void);
void BGM_Shutdown (void);
void BGM_Play (const char *filename);
void BGM_Stop (void);
void BGM_Update (void);
void BGM_Pause (void);
void BGM_Resume (void);
void BGM_PlayCDtrack (byte track, qboolean looping);
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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00
#endif /* _BGMUSIC_H_ */