summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_clock.cc
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2007-07-05 06:12:46 +0000
committerDoug McLain <doug@nostar.net>2007-07-05 06:12:46 +0000
commit77b77b88a3db21c47cf62afae147f24298c655f3 (patch)
treef19cf52a827e0bf8f8fda6aba9324c172d793714 /gtk2_ardour/audio_clock.cc
parent291a186cba343ed705c60d15fa7db0b21eb8a1fd (diff)
Delta Cursor option backported from trunk
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2111 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r--gtk2_ardour/audio_clock.cc30
1 files changed, 28 insertions, 2 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 0aa8ff8ab6..1220729b18 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -77,6 +77,8 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
{
session = 0;
last_when = 0;
+ last_pdelta = 0;
+ last_sdelta = 0;
key_entry_state = 0;
ops_menu = 0;
dragging = false;
@@ -404,17 +406,41 @@ AudioClock::on_realize ()
}
void
-AudioClock::set (nframes_t when, bool force)
+AudioClock::set (nframes_t when, bool force, nframes_t offset, int which)
{
if ((!force && !is_visible()) || session == 0) {
return;
}
- if (when == last_when && !force) {
+ if (when == last_when && !offset && !force) {
return;
}
+ bool pdelta = Config->get_primary_clock_delta_edit_cursor();
+ bool sdelta = Config->get_secondary_clock_delta_edit_cursor();
+
+ if (offset && which == 1 && pdelta) {
+ when = (when > offset) ? when - offset : offset - when;
+ } else if (offset && which == 2 && sdelta) {
+ when = (when > offset) ? when - offset : offset - when;
+ }
+
+ if (which == 1 && pdelta && !last_pdelta) {
+ cout << "set_widget_name() called" << endl;
+ set_widget_name("TransportClockDisplayDelta");
+ last_pdelta = true;
+ } else if (which == 1 && !pdelta && last_pdelta) {
+ set_widget_name("TransportClockDisplay");
+ last_pdelta = false;
+ } else if (which == 2 && sdelta && !last_sdelta) {
+ set_widget_name("SecondaryClockDisplayDelta");
+ last_sdelta = true;
+ } else if (which == 2 && !sdelta && last_sdelta) {
+ set_widget_name("SecondaryClockDisplay");
+ last_sdelta = false;
+ }
+
switch (_mode) {
case SMPTE:
set_smpte (when, force);