summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2008-11-07 11:00:13 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2008-11-07 11:00:13 +0000
commit13e2813847fbb3490874307a4ef23e46a315b3e7 (patch)
tree0f0c1ff5c10a0c76f465490093e7e4c9e47056d7 /gtk2_ardour
parenta06d68cce425d5e07a9864707b9a08c18b4cb598 (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')
-rw-r--r--gtk2_ardour/audio_clock.cc24
-rw-r--r--gtk2_ardour/editor.cc8
2 files changed, 24 insertions, 8 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;
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index cec5dbbda5..cb1ae4592d 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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
}