Open source remastering of the Freespace 2 engine
audiostr.cpp File Reference
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
#include "io/timer.h"
#include "sound/acm.h"
#include "sound/audiostr.h"
#include "sound/ds.h"
#include "sound/ogg/ogg.h"
#include "sound/openal.h"
#include "sound/sound.h"
#include "osapi/osapi.h"

Go to the source code of this file.


class  Timer
class  WaveFile
class  AudioStream


#define THREADED
#define ASF_FREE   0
#define ASF_USED   1
#define BIGBUF_SIZE   176400
#define AS_HIGHEST_MAX   999999999
#define VOLUME_ATTENUATION   0.65f


typedef bool(* TIMERCALLBACK) (ptr_u)


const char * stristr (const char *str, const char *substr)
void audiostream_init ()
void audiostream_close ()
int audiostream_open (const char *filename, int type)
void audiostream_close_file (int i, int fade)
void audiostream_close_all (int fade)
void audiostream_play (int i, float volume, int looping)
int audiostream_is_playing (int i)
void audiostream_stop (int i, int rewind, int paused)
void audiostream_set_volume_all (float volume, int type)
void audiostream_set_volume (int i, float volume)
int audiostream_is_paused (int i)
void audiostream_set_sample_cutoff (int i, uint cutoff)
uint audiostream_get_samples_committed (int i)
int audiostream_done_reading (int i)
int audiostream_is_inited ()
void audiostream_pause (int i, bool via_sexp_or_script)
void audiostream_unpause (int i, bool via_sexp_or_script)
void audiostream_pause_all (bool via_sexp_or_script)
void audiostream_unpause_all (bool via_sexp_or_script)


ubyteWavedata_load_buffer = NULL
ubyteWavedata_service_buffer = NULL
CRITICAL_SECTION Global_service_lock
ubyteCompressed_buffer = NULL
ubyteCompressed_service_buffer = NULL
const char * audio_ext_list [] = { ".ogg", ".wav" }
const int NUM_AUDIO_EXT = sizeof(audio_ext_list) / sizeof(char*)
int Audiostream_inited = 0
const ushort DefBufferServiceInterval = 250
AudioStream Audio_streams [MAX_AUDIO_STREAMS]

Macro Definition Documentation

#define AS_HIGHEST_MAX   999999999

Definition at line 46 of file audiostr.cpp.

#define ASF_FREE   0

Definition at line 30 of file audiostr.cpp.

#define ASF_USED   1

Definition at line 31 of file audiostr.cpp.

#define BIGBUF_SIZE   176400

Definition at line 34 of file audiostr.cpp.


Definition at line 42 of file audiostr.cpp.


Definition at line 27 of file audiostr.cpp.


Definition at line 11 of file audiostr.cpp.

#define THREADED

Definition at line 23 of file audiostr.cpp.

#define VOLUME_ATTENUATION   0.65f

Definition at line 1300 of file audiostr.cpp.


Definition at line 1299 of file audiostr.cpp.

Typedef Documentation

typedef bool(* TIMERCALLBACK) (ptr_u)

Definition at line 40 of file audiostr.cpp.

Function Documentation

void audiostream_close ( )

Definition at line 1661 of file audiostr.cpp.

void audiostream_close_all ( int  fade)

Definition at line 1791 of file audiostr.cpp.

void audiostream_close_file ( int  i,
int  fade 

Definition at line 1772 of file audiostr.cpp.

int audiostream_done_reading ( int  i)

Definition at line 1925 of file audiostr.cpp.

uint audiostream_get_samples_committed ( int  i)

Definition at line 1912 of file audiostr.cpp.

void audiostream_init ( )

Definition at line 1611 of file audiostr.cpp.

int audiostream_is_inited ( )

Definition at line 1938 of file audiostr.cpp.

int audiostream_is_paused ( int  i)

Definition at line 1885 of file audiostr.cpp.

int audiostream_is_playing ( int  i)

Definition at line 1827 of file audiostr.cpp.

int audiostream_open ( const char *  filename,
int  type 

Definition at line 1713 of file audiostr.cpp.

void audiostream_pause ( int  i,
bool  via_sexp_or_script 

Definition at line 1943 of file audiostr.cpp.

void audiostream_pause_all ( bool  via_sexp_or_script)

Definition at line 1978 of file audiostr.cpp.

void audiostream_play ( int  i,
float  volume,
int  looping 

Definition at line 1803 of file audiostr.cpp.

void audiostream_set_sample_cutoff ( int  i,
uint  cutoff 

Definition at line 1898 of file audiostr.cpp.

void audiostream_set_volume ( int  i,
float  volume 

Definition at line 1871 of file audiostr.cpp.

void audiostream_set_volume_all ( float  volume,
int  type 

Definition at line 1857 of file audiostr.cpp.

void audiostream_stop ( int  i,
int  rewind,
int  paused 

Definition at line 1840 of file audiostr.cpp.

void audiostream_unpause ( int  i,
bool  via_sexp_or_script 

Definition at line 1960 of file audiostr.cpp.

void audiostream_unpause_all ( bool  via_sexp_or_script)

Definition at line 1990 of file audiostr.cpp.

const char* stristr ( const char *  str,
const char *  substr 

Definition at line 3680 of file parselo.cpp.

Variable Documentation

const char* audio_ext_list[] = { ".ogg", ".wav" }

Definition at line 49 of file audiostr.cpp.

Definition at line 1608 of file audiostr.cpp.

int Audiostream_inited = 0

Definition at line 53 of file audiostr.cpp.

ubyte* Compressed_buffer = NULL

Definition at line 43 of file audiostr.cpp.

ubyte* Compressed_service_buffer = NULL

Definition at line 44 of file audiostr.cpp.

const ushort DefBufferServiceInterval = 250

Definition at line 1036 of file audiostr.cpp.

CRITICAL_SECTION Global_service_lock

Definition at line 38 of file audiostr.cpp.

const int NUM_AUDIO_EXT = sizeof(audio_ext_list) / sizeof(char*)

Definition at line 50 of file audiostr.cpp.

ubyte* Wavedata_load_buffer = NULL

Definition at line 35 of file audiostr.cpp.

ubyte* Wavedata_service_buffer = NULL

Definition at line 36 of file audiostr.cpp.