class Simulator

Class Simulator

Public Methods

void advance_simulator (void)
Update times
wave* get_active_waves (void)
Return a pointer to the active_waves list.
double get_frame_time (void)
Return time variable frame_time.
CAVELOCK get_wave_lock (void)
Return wave_lock variable.
void kill_simulation (void)
Delete active waves and Card_DB. Set current times to 0.
const Simulator& operator= (const Simulator &)
Overloaded assignment operator.
void prep_simulator (void)
Kill any simulation currently running
void set_sim_go (int)
Set variable sim_go to true if its state changes.
int simulation_go (void)
Return variable sim_go.
Simulator (const Simulator &)
Copy constructor.
Simulator ()
Constructor
int wave_lock_init (void)
Return wave_lock_initizlied variable.
~Simulator ()
Destructor. Free all active waves and wave on the avail. list.

Private Methods

void advance_param (dynparam *p)
Update the dynamic parameters of a wave
void advance_wave (wave *p)
Update a wave's parameters
double calc_value (double t, float src, float dat, float type)
Calculate the new value of a dynamic parameter
void free_wave (wave *p)
Place a wave on the list of available waves
float* init_new_param (dynparam *p, float *data, double start)
Initialize the dynamic parameter values for a new wave
void init_new_wave (wave *p, float *data, int datalen)
Set the initial values for a new wave
wave* new_wave (void)
Get a new wave from the free waves list

Documentation

Class Simulator. Class Simulator takes care of maintaining the active wave list and keeping track of start and stop time. Simulation essentially starts and begins in the Simulator. The class also contains a Card_DB. This card database loads in the score file that is currently playing and keeps track of all card data before it is placed into the wave structures dealt with by the Simulator.
Simulator()
Constructor. Initialize all variables. Set up initial list of free waves

~Simulator()
Destructor. Free all active waves and wave on the avail. list.

Simulator(const Simulator &)
Copy constructor.

const Simulator& operator=(const Simulator &)
Overloaded assignment operator.

void prep_simulator(void)
Kill any simulation currently running. Get a new Card_DB Load the score of the new song, and set times and mode.

void advance_simulator(void)
Update times. Check to see if mode has changed or left wand button has been pressed. Start the sound file playing or update current waves accordingly. Check to see if simulation has finished.

int wave_lock_init(void)
Return wave_lock_initizlied variable.

CAVELOCK get_wave_lock(void)
Return wave_lock variable.

int simulation_go(void)
Return variable sim_go.

void set_sim_go(int)
Set variable sim_go to true if its state changes.

double get_frame_time(void)
Return time variable frame_time.

wave* get_active_waves(void)
Return a pointer to the active_waves list.

void kill_simulation(void)
Delete active waves and Card_DB. Set current times to 0.

wave* new_wave(void)
Get a new wave from the free waves list. If one is not available, allocate space for a new one.
Returns:
Address of a new wave

void free_wave(wave *p)
Place a wave on the list of available waves
Parameters:
p - The wave to be freed.

void advance_wave(wave *p)
Update a wave's parameters
Parameters:
p - Wave to be updated.

void advance_param(dynparam *p)
Update the dynamic parameters of a wave. Called from advance_wave.
Parameters:
p - Struct containg dynamic parameters for update.
See Also:
advance_wave.

double calc_value(double t, float src, float dat, float type)
Calculate the new value of a dynamic parameter. Called from advance_param.
Parameters:
t - The current time.
src - Current value.
dat - Current value incremented.
type - Type of function used to calculate.
See Also:
advance_param

void init_new_wave(wave *p, float *data, int datalen)
Set the initial values for a new wave
Parameters:
p - Pointer to the new wave.
data - Pointer to the data for the wave.
datalen - Number of data entries.

float* init_new_param(dynparam *p, float *data, double start)
Initialize the dynamic parameter values for a new wave. Called from init_new_wave.
Parameters:
p - Pointer to the dynamic parameters to be initialized.
data - Pointer to the data for the parameters.
start - Current time.


This class has no child classes.

alphabetic index hierarchy of classes


M4cave Sound Visualization

Contacts

M4cave Reference Manual
Help With Doc++

generated by doc++