libsmf

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions
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_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. More...
smf_tempo_t * | smf_get_tempo_by_seconds (const smf_t *smf, double seconds)
| Return last tempo (i.e. More...
smf_tempo_t * | smf_get_last_tempo (const smf_t *smf)
| Return last tempo. More...
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. More...
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. More...
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. More...

## Detailed Description

Tempo map related part.

Definition in file smf_tempo.c.

## Function Documentation

void maybe_add_to_tempo_map | ( | smf_event_t * | event | ) |

Definition at line 125 of file smf_tempo.c.

References smf_event_struct::midi_buffer, smf_event_struct::midi_buffer_length, smf_track_struct::smf, smf_event_is_metadata(), smf_event_struct::time_pulses, and smf_event_struct::track.

Referenced by smf_create_tempo_map_and_compute_seconds(), and smf_track_add_event().

void remove_last_tempo_with_pulses | ( | smf_t * | smf,
|  | int | pulses
| ) |  |

Definition at line 173 of file smf_tempo.c.

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

Referenced by smf_event_remove_from_track().

void smf_create_tempo_map_and_compute_seconds | ( | smf_t * | smf | ) |

Definition at line 235 of file smf_tempo.c.

References maybe_add_to_tempo_map(), smf_get_next_event(), smf_init_tempo(), smf_rewind(), and smf_event_struct::time_pulses.

Referenced by smf_event_remove_from_track(), and smf_track_add_event().

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
| ) |  |

Definition at line 257 of file smf_tempo.c.

References smf_struct::tempo_array.

Referenced by smf_get_last_tempo(), smf_get_tempo_by_pulses(), and smf_get_tempo_by_seconds().

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().