Descent3/sndlib/soundload.h

77 lines
2.3 KiB
C
Raw Normal View History

/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
2024-04-16 03:43:29 +00:00
#ifndef SOUNDLOAD_H_
#define SOUNDLOAD_H_
#include "ssl_lib.h"
extern int Num_sounds;
extern int Num_sound_files;
// Allocs a sound file for use, returns -1 if error, else index on success
2024-04-16 18:56:40 +00:00
int AllocSoundFile();
2024-04-16 03:43:29 +00:00
// Frees sound index n
2024-04-16 18:56:40 +00:00
void FreeSoundFile(int n);
2024-04-16 03:43:29 +00:00
// Gets next sound file from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetNextSoundFile(int n);
2024-04-16 03:43:29 +00:00
// Gets previous sound file from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetPrevSoundFile(int n);
2024-04-16 03:43:29 +00:00
// Searches thru all sounds for a specific name, returns -1 if not found
// or index of sound with name
int FindSoundFileName(const char *name);
2024-04-16 03:43:29 +00:00
// Given a filename, loads the sound file.
int LoadSoundFile(const char *filename, float import_volume, bool f_get_data = false);
2024-04-16 03:43:29 +00:00
// Sets all sounds to unused
2024-04-16 18:56:40 +00:00
void InitSounds();
2024-04-16 03:43:29 +00:00
// Allocs a sound for use, returns -1 if error, else index on success
2024-04-16 18:56:40 +00:00
int AllocSound();
2024-04-16 03:43:29 +00:00
// Frees sound index n
2024-04-16 18:56:40 +00:00
void FreeSound(int n);
2024-04-16 03:43:29 +00:00
// Gets next sound from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetNextSound(int n);
2024-04-16 03:43:29 +00:00
// Gets previous sound from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetPrevSound(int n);
2024-04-16 03:43:29 +00:00
// Searches thru all sounds for a specific name, returns -1 if not found
// or index of sound with name
int FindSoundName(const char *name);
2024-04-16 03:43:29 +00:00
// Given a filename, loads the sound.
int LoadSound(const char *filename);
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
// This is a very confusing function. It takes all the sounds that we have loaded
// and remaps then into their proper places (if they are static).
void RemapSounds();
2024-04-16 03:43:29 +00:00
// goes thru every entity that could possible have a sound index (ie objects, robots, etc)
// and changes the old index to the new index
2024-04-16 18:56:40 +00:00
void RemapAllSoundObjects(int old_index, int new_index);
2024-04-16 03:43:29 +00:00
#endif