player-core.h File Reference

#include "dsp-drivers.h"
#include "index.h"
Include dependency graph for player-core.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  t_segment

Defines

#define samples2ms(samples, rate)   (int)(1000*(samples)/rate)
#define samples2s(samples, rate)   (int)(samples/rate)
#define mperiod2bpm(period, rate)   (4.0*(float8)rate*60.0/(float8)(period))
#define ms2samples(ms, rate)   (int)((ms)*rate/1000)
#define ms2bytes(ms, rate)   (int)(4*ms2samples(ms,rate))
#define bytes2ms(bytes, rate)   (int)(samples2ms(bytes,rate)/4)
#define wave_bufsize   (32L*1024L)
#define err_none   0
#define err_needidx   1
#define err_noraw   2
#define err_nospawn   3
#define err_dsp   5
#define map_exit_restart   -1
#define map_exit_continue   -2
#define map_exit_stop   -1000

Typedefs

typedef unsigned8 cue_info
typedef stereo_sample2(* _lfo_ )(stereo_sample2 x)
typedef struct t_segment map_segment
typedef map_segmentmap_data

Functions

signed4 metarate_to_diskrate (signed4 mr)
signed4 diskrate_to_metarate (signed4 dr)
signed4 metarate_to_playrate (signed4 mr)
signed4 playrate_to_metarate (signed4 pr)
unsigned4 wave_max ()
void cue_set ()
void cue_store (int)
void cue_retrieve (int)
void jumpto (signed8)
void cue_shift_metarate (signed8)
int core_meta_init ()
int core_object_init (bool sync)
void pause_playing ()
void unpause_playing ()
void core_done ()
int core_start (bool ui)
void core_stop ()
stereo_sample2 lfo_no (stereo_sample2 x)
stereo_sample2 lfo_saw (stereo_sample2 x)
stereo_sample2 lfo_pan (stereo_sample2 x)
stereo_sample2 lfo_break (stereo_sample2 x)
stereo_sample2 lfo_difference (stereo_sample2 x)
stereo_sample2 lfo_revsaw (stereo_sample2 x)
stereo_sample2 lfo_metronome (stereo_sample2 x)
void lfo_set (const char *name, _lfo_ l, unsigned8 freq, unsigned8 phase)
_lfo_ lfo_get ()
void map_set_diskrate (signed2 map_size, map_data m, unsigned8 size, signed8 exit, bool loop)
void map_loop_set (bool l)
void map_stop ()
int app_init (int argc, char *argv[])
void process_options (int argc, char *argv[])
void msg_playing_state_changed ()
void msg_writing_finished ()
FILE * openCoreRawFile ()
int loop_set_diskrate (unsigned8 jumpback)
void set_normalperiod_metarate (quad_period_type newnormalperiod, bool update_on_disk=true)

Variables

const int metarate = 44100
const int diskrate = 44100
cue_info cue_metarate
cue_info cues_metarate [4]
char * wave_name
Indexplaying
int opt_quiet
int opt_match
char * arg_match
char * argument
bool opt_check

Define Documentation

#define bytes2ms ( bytes,
rate   )     (int)(samples2ms(bytes,rate)/4)

Referenced by dsp_oss::open().

#define err_dsp   5
#define err_needidx   1
#define err_none   0
#define err_noraw   2

Referenced by Player::initCore(), and wave_open().

#define err_nospawn   3

Referenced by Player::initCore(), and wave_open().

#define map_exit_continue   -2

Referenced by map_active(), and Player::mapStart().

#define map_exit_restart   -1

Referenced by map_active(), and Player::mapStart().

#define map_exit_stop   -1000

Referenced by map_active(), and Player::mapStart().

#define mperiod2bpm ( period,
rate   )     (4.0*(float8)rate*60.0/(float8)(period))

Referenced by Player::timerTick().

#define ms2bytes ( ms,
rate   )     (int)(4*ms2samples(ms,rate))

Referenced by dsp_oss::open().

#define ms2samples ( ms,
rate   )     (int)((ms)*rate/1000)
#define samples2ms ( samples,
rate   )     (int)(1000*(samples)/rate)

Referenced by dsp_oss::close().

#define samples2s ( samples,
rate   )     (int)(samples/rate)

Referenced by Player::timerTick(), and writer_died().

#define wave_bufsize   (32L*1024L)

Typedef Documentation

typedef struct t_segment map_segment

Function Documentation

int app_init ( int  argc,
char *  argv[] 
)
void core_done (  ) 

Closes the wave and writes any changes to the index

References Index::changed(), cue_write(), Debug(), finished, Info(), opt_quiet, wave_close(), and Index::write_idx().

Referenced by batch_start(), and Player::done().

int core_meta_init (  ) 

Initializes the index fields and start reading the audio The error can be err_none (wanted !), err_needidx, err_noraw, err_nospawn, or err_dsp.

References arg_match, argument, common_init(), copyright(), cue_read(), currentperiod_metarate, err_needidx, err_none, Index::get_period(), normalperiod_metarate, opt_match, period_to_quad(), target, and targetperiod_metarate.

Referenced by batch_start(), check_start(), and normal_start().

int core_object_init ( bool  sync  ) 

References wave_open().

Referenced by batch_start(), and Player::initCore().

int core_start ( bool  ui  ) 

Starts the core if the wave is already opened. If user interface is true it will use QMessageBox to display errors.

References assert(), dsp_driver::close(), dsp, err_dsp, err_none, finished, lfo_init(), map_init(), msg_playing_state_changed(), dsp_driver::open(), pause_playing(), rms_init(), and dsp_driver::start().

Referenced by Player::startCore().

void core_stop (  ) 

Waits for the core to finish, does nothing else

References dsp, finished, and dsp_driver::stop().

Referenced by Player::done(), and Player::stopCore().

void cue_retrieve ( int  nr  ) 

Will retrieve the cue from memory and place it in cue It will effectively be used later in the jumpto function which will also try to stay in sync with the current position in the phrase.

References cue_metarate, and cues_metarate.

void cue_set (  ) 
void cue_shift_metarate ( signed8   ) 
void cue_store ( int  nr  ) 

Will write the current position into one of the cue points

References cue_metarate, and cues_metarate.

signed4 diskrate_to_metarate ( signed4  dr  )  [inline]

References diskrate, and metarate.

Referenced by cue_set().

void jumpto ( signed8   ) 
stereo_sample2 lfo_break ( stereo_sample2  x  ) 

References lfo_phase_playrate, and y_playrate.

Referenced by Player::breakLfo().

stereo_sample2 lfo_difference ( stereo_sample2  x  ) 
_lfo_ lfo_get (  ) 

References lfo_do.

Referenced by Player::metronome().

stereo_sample2 lfo_metronome ( stereo_sample2  x  ) 
stereo_sample2 lfo_no ( stereo_sample2  x  ) 

References stereo_sample2::muldiv().

Referenced by lfo_init(), and Player::normalLfo().

stereo_sample2 lfo_pan ( stereo_sample2  x  ) 
stereo_sample2 lfo_revsaw ( stereo_sample2  x  ) 
stereo_sample2 lfo_saw ( stereo_sample2  x  ) 
void lfo_set ( const char *  name,
_lfo_  l,
unsigned8  freq,
unsigned8  phase 
)
int loop_set_diskrate ( unsigned8  jumpback  ) 
void map_loop_set ( bool  l  ) 

References map_loop.

Referenced by Player::mapLoopChange().

void map_set_diskrate ( signed2  map_size,
map_data  m,
unsigned8  size,
signed8  exit,
bool  loop 
)
void map_stop (  ) 
signed4 metarate_to_diskrate ( signed4  mr  )  [inline]
signed4 metarate_to_playrate ( signed4  mr  )  [inline]
void msg_playing_state_changed (  ) 

References app, and player_window.

void msg_writing_finished (  ) 

This function is called by the player core when the writing process finished its execution.

References app, opt_check, opt_setup, and player_window.

FILE* openCoreRawFile (  ) 
void pause_playing (  ) 

Asks the player to pause its playing. This function must return immediately and simply signals a pause request

References dsp, dsp_driver::get_paused(), msg_playing_state_changed(), and dsp_driver::pause().

Referenced by core_start(), cue_shift_metarate(), map_active(), and Player::start_stop().

signed4 playrate_to_metarate ( signed4  pr  )  [inline]

References dsp, metarate, and dsp_driver::playrate.

void process_options ( int  argc,
char *  argv[] 
)
void set_normalperiod_metarate ( quad_period_type  newnormalperiod,
bool  update_on_disk = true 
)
void unpause_playing (  ) 
unsigned4 wave_max (  ) 

References fsize(), wave_file, and wave_name.

Referenced by Player::timerTick(), wave_read(), and writer_died().


Variable Documentation

char* arg_match
char* argument

cue points are expressed as positions (samples) in the song at metarate cue is the current cue

Referenced by Player::checkCueNonZero(), cue_read(), cue_retrieve(), cue_set(), cue_shift_metarate(), cue_store(), cue_write(), BeatGraphLabel::drawCueText(), jumpto(), loop_set_diskrate(), map_set_diskrate(), and Player::start_stop().

These are the for Z, X, C and V cues, in that order

Referenced by cue_read(), cue_retrieve(), cue_store(), cue_write(), BeatGraphLabel::drawCueText(), and Player::mapStart().

const int diskrate = 44100
const int metarate = 44100
bool opt_check
int opt_match
int opt_quiet

Referenced by core_done(), and process_options().

char* wave_name
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2