BBT duration clocks use zero-based values, init SAE nudge default better.

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4104 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Nick Mainsbridge 2008-11-07 11:00:13 +00:00
parent a06d68cce4
commit 13e2813847
2 changed files with 24 additions and 8 deletions

View File

@ -635,14 +635,19 @@ AudioClock::set_bbt (nframes_t when, bool force)
char buf[16];
BBT_Time bbt;
session->tempo_map().bbt_time (when, bbt);
/* handle a common case */
if (is_duration && when == 0) {
bbt.bars = 0;
bbt.beats = 0;
if (is_duration) {
if (when == 0) {
bbt.bars = 0;
bbt.beats = 0;
bbt.ticks = 0;
} else {
session->tempo_map().bbt_time (when, bbt);
bbt.bars--;
bbt.beats--;
}
} else {
session->tempo_map().bbt_time (when, bbt);
}
sprintf (buf, "%03" PRIu32, bbt.bars);
@ -1896,6 +1901,11 @@ AudioClock::bbt_frame_from_display (nframes_t pos) const
any.bbt.beats = atoi (beats_label.get_text());
any.bbt.ticks = atoi (ticks_label.get_text());
if (is_duration) {
any.bbt.bars++;
any.bbt.beats++;
}
nframes_t ret = session->convert_to_frames_at (pos, any);
return ret;

View File

@ -1228,8 +1228,14 @@ Editor::connect_to_session (Session *t)
_playlist_selector->set_session (session);
nudge_clock.set_session (session);
if (Profile->get_sae()) {
BBT_Time bbt;
bbt.bars = 0;
bbt.beats = 0;
bbt.ticks = 120;
nframes_t pos = session->tempo_map().bbt_duration_at (0, bbt, 1);
nudge_clock.set_mode(AudioClock::BBT);
nudge_clock.set (session->frame_rate() / 32, true, 0, AudioClock::BBT);
nudge_clock.set (pos, true, 0, AudioClock::BBT);
} else {
nudge_clock.set (session->frame_rate() * 5, true, 0, AudioClock::SMPTE); // default of 5 seconds
}