diff options
author | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-11-07 11:00:13 +0000 |
---|---|---|
committer | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-11-07 11:00:13 +0000 |
commit | 13e2813847fbb3490874307a4ef23e46a315b3e7 (patch) | |
tree | 0f0c1ff5c10a0c76f465490093e7e4c9e47056d7 /gtk2_ardour/audio_clock.cc | |
parent | a06d68cce425d5e07a9864707b9a08c18b4cb598 (diff) |
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
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r-- | gtk2_ardour/audio_clock.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 6848644266..518bd1c156 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -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; |