summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_clock.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-02-20 17:19:43 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2018-02-20 17:19:43 -0500
commit47970b0cd13e4a77058eb53116a6486ba4fd920e (patch)
treeb8438369a82dcd820cfab26d6b040d592e62fdba /gtk2_ardour/audio_clock.cc
parent54db84ffeee757ae46b61c2e519a26deb5f6f4df (diff)
user-friendly hack/heuristic: if they edit a BBT non-duration clock to say zero beats, act as if they had used 1
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r--gtk2_ardour/audio_clock.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index ae98f21de5..6a7733ae5f 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -1920,7 +1920,7 @@ AudioClock::current_duration (samplepos_t pos) const
}
bool
-AudioClock::bbt_validate_edit (const string& str)
+AudioClock::bbt_validate_edit (string & str)
{
AnyTime any;
@@ -1937,7 +1937,14 @@ AudioClock::bbt_validate_edit (const string& str)
}
if (!is_duration && any.bbt.beats == 0) {
- return false;
+ /* user could not have mean zero beats because for a
+ * non-duration clock that's impossible. Assume that they
+ * mis-entered things and meant Bar|1|ticks
+ */
+
+ char buf[128];
+ snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, any.bbt.bars, 1, any.bbt.ticks);
+ str = buf;
}
return true;