diff options
author | nick_m <mainsbridge@gmail.com> | 2016-03-07 06:35:32 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:11 +1000 |
commit | 278ad73259a396e5a2f5f16c037ea1a06d382de6 (patch) | |
tree | 6601cd055a8bfca9408f0466830cc27fb9769564 /gtk2_ardour/tempo_dialog.cc | |
parent | 36ec551a8ad66a99723f54d3149cbcf30d31c077 (diff) |
Tempo ramps - check for impossible locations tempo dialog bbt entry. reorganise code.
Diffstat (limited to 'gtk2_ardour/tempo_dialog.cc')
-rw-r--r-- | gtk2_ardour/tempo_dialog.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index 5d06f5ca3c..eef19e22a5 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -36,6 +36,8 @@ using namespace PBD; TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&) : ArdourDialog (_("New Tempo")) + , _map (&map) + , _section (0) , bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0) , bpm_spinner (bpm_adjustment) , when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER) @@ -52,6 +54,8 @@ TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&) TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&) : ArdourDialog (_("Edit Tempo")) + , _map (&map) + , _section (§ion) , bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0) , bpm_spinner (bpm_adjustment) , when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER) @@ -269,7 +273,15 @@ TempoDialog::bpm_button_release (GdkEventButton*) bool TempoDialog::entry_key_release (GdkEventKey*) { - set_response_sensitive (RESPONSE_ACCEPT, is_user_input_valid()); + Timecode::BBT_Time bbt; + get_bbt_time (bbt); + + if (_section && is_user_input_valid()) { + set_response_sensitive (RESPONSE_ACCEPT, _map->bbt_valid (_section, Tempo (get_bpm(), get_note_type()), bbt)); + } else { + set_response_sensitive (RESPONSE_ACCEPT, is_user_input_valid()); + } + return false; } |