DOOM-3-BFG

DOOM 3 BFG Edition
Log | Files | Refs

i_sound.h (3692B)


      1 /*
      2 ===========================================================================
      3 
      4 Doom 3 BFG Edition GPL Source Code
      5 Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. 
      6 
      7 This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").  
      8 
      9 Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
     10 it under the terms of the GNU General Public License as published by
     11 the Free Software Foundation, either version 3 of the License, or
     12 (at your option) any later version.
     13 
     14 Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
     15 but WITHOUT ANY WARRANTY; without even the implied warranty of
     16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17 GNU General Public License for more details.
     18 
     19 You should have received a copy of the GNU General Public License
     20 along with Doom 3 BFG Edition Source Code.  If not, see <http://www.gnu.org/licenses/>.
     21 
     22 In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code.  If not, please request a copy in writing from id Software at the address below.
     23 
     24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
     25 
     26 ===========================================================================
     27 */
     28 
     29 #ifndef __I_SOUND__
     30 #define __I_SOUND__
     31 
     32 #include "doomdef.h"
     33 
     34 // UNIX hack, to be removed.
     35 #ifdef SNDSERV
     36 #include <stdio.h>
     37 extern FILE* sndserver;
     38 extern char* sndserver_filename;
     39 #endif
     40 
     41 #include "doomstat.h"
     42 #include "sounds.h"
     43 
     44 
     45 
     46 // Init at program start...
     47 void I_InitSound();
     48 void I_InitSoundHardware( int numOutputChannels_, int channelMask );
     49 
     50 // ... update sound buffer and audio device at runtime...
     51 void I_UpdateSound(void);
     52 void I_SubmitSound(void);
     53 
     54 // ... shut down and relase at program termination.
     55 void I_ShutdownSound(void);
     56 void I_ShutdownSoundHardware();
     57 
     58 //
     59 //  SFX I/O
     60 //
     61 
     62 // Initialize channels?
     63 void I_SetChannels();
     64 
     65 // Get raw data lump index for sound descriptor.
     66 int I_GetSfxLumpNum (sfxinfo_t* sfxinfo );
     67 
     68 
     69 // Starts a sound in a particular sound channel.
     70 int I_StartSound( int id, mobj_t *origin, mobj_t *listener_origin, int vol, int pitch, int priority );
     71 
     72 
     73 // Stops a sound channel.
     74 void I_StopSound(int handle, int player = -1);
     75 
     76 // Called by S_*() functions
     77 //  to see if a channel is still playing.
     78 // Returns 0 if no longer playing, 1 if playing.
     79 int I_SoundIsPlaying(int handle);
     80 
     81 // Updates the volume, separation,
     82 //  and pitch of a sound channel.
     83 void I_UpdateSoundParams( int handle, int vol, int sep, int pitch );
     84 
     85 void I_SetSfxVolume( int );
     86 //
     87 //  MUSIC I/O
     88 //
     89 void I_InitMusic(void);
     90 void I_ShutdownMusic(void);
     91 // Volume.
     92 void I_SetMusicVolume(int volume);
     93 // PAUSE game handling.
     94 void I_PauseSong(int handle);
     95 void I_ResumeSong(int handle);
     96 // Registers a song handle to song data.
     97 int I_RegisterSong(void *data, int length);
     98 // Called by anything that wishes to start music.
     99 //  plays a song, and when the song is done,
    100 //  starts playing it again in an endless loop.
    101 // Horrible thing to do, considering.
    102 void I_PlaySong( const char *songname, int looping );
    103 // Stops a song over 3 seconds.
    104 void I_StopSong(int handle);
    105 // See above (register), then think backwards
    106 void I_UnRegisterSong(int handle);
    107 // Update Music (XMP), check for notifications
    108 void I_UpdateMusic(void);
    109 
    110 int Mus2Midi(unsigned char* bytes, unsigned char* out, int* len);
    111 
    112 #endif
    113