Descent3/lib/soundload.h

58 lines
1.6 KiB
C
Raw Normal View History

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
2024-04-16 18:56:40 +00:00
int FindSoundFileName(char *name);
2024-04-16 03:43:29 +00:00
// Given a filename, loads the sound file.
2024-04-16 18:56:40 +00:00
int LoadSoundFile(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
2024-04-16 18:56:40 +00:00
int FindSoundName(char *name);
2024-04-16 03:43:29 +00:00
// Given a filename, loads the sound.
2024-04-16 18:56:40 +00:00
int LoadSound(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