Don't use invalid info in the Timebase callback if no tempo map exists.

This commit is contained in:
Jonathan Moore Liles 2008-06-13 23:51:15 -05:00
parent c55b01dc68
commit 0e34509e51
3 changed files with 8 additions and 2 deletions

View File

@ -174,6 +174,7 @@ Engine::timebase ( jack_transport_state_t, jack_nframes_t, jack_position_t *pos,
position_info pi = timeline->solve_tempomap( pos->frame ); position_info pi = timeline->solve_tempomap( pos->frame );
pos->valid = JackPositionBBT; pos->valid = JackPositionBBT;
pos->beats_per_bar = pi.beats_per_bar; pos->beats_per_bar = pi.beats_per_bar;
pos->beat_type = pi.beat_type; pos->beat_type = pi.beat_type;
pos->beats_per_minute = pi.tempo; pos->beats_per_minute = pi.tempo;

View File

@ -161,7 +161,7 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {}
} { } {
Fl_Window main_window { Fl_Window main_window {
label Timeline label Timeline
xywh {254 189 1025 770} type Double resizable xclass Non_DAW visible xywh {174 117 1025 770} type Double resizable xclass Non_DAW visible
} { } {
Fl_Menu_Bar menubar { Fl_Menu_Bar menubar {
xywh {0 0 1024 25} xywh {0 0 1024 25}
@ -933,7 +933,7 @@ while ( _window->shown() )
} { } {
Fl_Window _window { Fl_Window _window {
label {Project info} open selected label {Project info} open selected
xywh {394 254 520 625} type Double visible xywh {215 260 520 625} type Double visible
} { } {
Fl_Value_Output {} { Fl_Value_Output {} {
label {Sample Rate} label {Sample Rate}

View File

@ -686,6 +686,11 @@ Timeline::render_tempomap( nframes_t start, nframes_t length, measure_line_callb
BBT &bbt = pos.bbt; BBT &bbt = pos.bbt;
/* default values */
pos.beat_type = 4;
pos.beats_per_bar = 4;
pos.tempo = 120.0;
const nframes_t samples_per_minute = sample_rate() * 60; const nframes_t samples_per_minute = sample_rate() * 60;
float bpm = 120.0f; float bpm = 120.0f;