summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_clock.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-12-12 14:43:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-12-12 14:43:24 +0000
commitbc89fe0147c04b67141936d109c00dfd4d69cc4b (patch)
tree544ff450c40fe1f43853a8420228a26f27f1eafb /gtk2_ardour/audio_clock.cc
parent30daaebaa2d90d6b0e8673143ccc3cacd7bd1753 (diff)
most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r--gtk2_ardour/audio_clock.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 58db7f636b..c27015801f 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -636,14 +636,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);
@@ -1897,6 +1902,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;