smf_tempo.c File Reference

Tempo map related part. More...

Go to the source code of this file.

Functions

void maybe_add_to_tempo_map (smf_event_t *event)
void remove_last_tempo_with_pulses (smf_t *smf, int pulses)
void smf_create_tempo_map_and_compute_seconds (smf_t *smf)
smf_tempo_tsmf_get_tempo_by_number (const smf_t *smf, int number)
smf_tempo_tsmf_get_tempo_by_pulses (const smf_t *smf, int pulses)
 Return last tempo (i.e.
smf_tempo_tsmf_get_tempo_by_seconds (const smf_t *smf, double seconds)
 Return last tempo (i.e.
smf_tempo_tsmf_get_last_tempo (const smf_t *smf)
 Return last tempo.
void smf_fini_tempo (smf_t *smf)
void smf_init_tempo (smf_t *smf)
void smf_track_add_event_delta_pulses (smf_track_t *track, smf_event_t *event, int delta)
 Adds event to the track at the time "pulses" clocks from the previous event in this track.
void smf_track_add_event_pulses (smf_track_t *track, smf_event_t *event, int pulses)
 Adds event to the track at the time "pulses" clocks from the start of song.
void smf_track_add_event_seconds (smf_track_t *track, smf_event_t *event, double seconds)
 Adds event to the track at the time "seconds" seconds from the start of song.

Detailed Description

Tempo map related part.

Definition in file smf_tempo.c.


Function Documentation

void maybe_add_to_tempo_map ( smf_event_t event  ) 
void remove_last_tempo_with_pulses ( smf_t smf,
int  pulses 
)
void smf_create_tempo_map_and_compute_seconds ( smf_t smf  ) 
void smf_fini_tempo ( smf_t smf  ) 

Definition at line 342 of file smf_tempo.c.

References smf_struct::tempo_array.

Referenced by smf_delete(), and smf_init_tempo().

smf_tempo_t* smf_get_last_tempo ( const smf_t smf  ) 

Return last tempo.

Definition at line 326 of file smf_tempo.c.

References smf_get_tempo_by_number(), and smf_struct::tempo_array.

Referenced by remove_last_tempo_with_pulses().

smf_tempo_t* smf_get_tempo_by_number ( const smf_t smf,
int  number 
)
smf_tempo_t* smf_get_tempo_by_pulses ( const smf_t smf,
int  pulses 
)

Return last tempo (i.e.

tempo with greatest time_pulses) that happens before "pulses".

Definition at line 271 of file smf_tempo.c.

References smf_get_tempo_by_number(), smf_struct::tempo_array, and smf_tempo_struct::time_pulses.

smf_tempo_t* smf_get_tempo_by_seconds ( const smf_t smf,
double  seconds 
)

Return last tempo (i.e.

tempo with greatest time_seconds) that happens before "seconds".

Definition at line 298 of file smf_tempo.c.

References smf_get_tempo_by_number(), smf_struct::tempo_array, and smf_tempo_struct::time_seconds.

void smf_init_tempo ( smf_t smf  ) 

Definition at line 367 of file smf_tempo.c.

References smf_fini_tempo().

Referenced by smf_create_tempo_map_and_compute_seconds(), and smf_new().

void smf_track_add_event_delta_pulses ( smf_track_t track,
smf_event_t event,
int  delta 
)

Adds event to the track at the time "pulses" clocks from the previous event in this track.

The remaining two time fields will be computed automatically based on the third argument and current tempo map. Note that ->delta_pulses is computed by smf.c:smf_track_add_event, not here.

Definition at line 403 of file smf_tempo.c.

References smf_track_struct::smf, smf_track_add_event_pulses(), smf_event_struct::time_pulses, and smf_event_struct::time_seconds.

Referenced by smf_track_add_eot_delta_pulses().

void smf_track_add_event_pulses ( smf_track_t track,
smf_event_t event,
int  pulses 
)

Adds event to the track at the time "pulses" clocks from the start of song.

The remaining two time fields will be computed automatically based on the third argument and current tempo map.

Definition at line 419 of file smf_tempo.c.

References smf_track_struct::smf, smf_track_add_event(), smf_event_struct::time_pulses, and smf_event_struct::time_seconds.

Referenced by smf_track_add_eot_pulses(), and smf_track_add_event_delta_pulses().

void smf_track_add_event_seconds ( smf_track_t track,
smf_event_t event,
double  seconds 
)

Adds event to the track at the time "seconds" seconds from the start of song.

The remaining two time fields will be computed automatically based on the third argument and current tempo map.

Definition at line 437 of file smf_tempo.c.

References smf_track_struct::smf, smf_track_add_event(), smf_event_struct::time_pulses, and smf_event_struct::time_seconds.

Referenced by smf_track_add_eot_seconds().

Generated on Sun Mar 28 19:42:17 2010 for libsmf by  doxygen 1.6.3