X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Faudio_clock.cc;h=8c24f429984e87ee89a637d9518fccb4cb2f8d70;hb=1315ee3dff1e4966ab28bd47e81b5f003cac6e40;hp=1334bfdc4b498d449ccad14f6587d8ea5785bff3;hpb=d6ef740e9002c7112bc47cb2d9d8d4b8609aa089;p=ardour.git diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 1334bfdc4b..8c24f42998 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; @@ -383,17 +385,40 @@ AudioClock::on_realize () } void -AudioClock::set (nframes_t when, bool force) +AudioClock::set (nframes_t when, bool force, nframes_t offset, char 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 == 'p' && pdelta) { + when = (when > offset) ? when - offset : offset - when; + } else if (offset && which == 's' && sdelta) { + when = (when > offset) ? when - offset : offset - when; + } + + if (which == 'p' && pdelta && !last_pdelta) { + set_widget_name("TransportClockDisplayDelta"); + last_pdelta = true; + } else if (which == 'p' && !pdelta && last_pdelta) { + set_widget_name("TransportClockDisplay"); + last_pdelta = false; + } else if (which == 's' && sdelta && !last_sdelta) { + set_widget_name("SecondaryClockDisplayDelta"); + last_sdelta = true; + } else if (which == 's' && !sdelta && last_sdelta) { + set_widget_name("SecondaryClockDisplay"); + last_sdelta = false; + } + switch (_mode) { case SMPTE: set_smpte (when, force); @@ -1073,39 +1098,6 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field field) return FALSE; break; - case 4: - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) { - frames = get_frames (field); - if (frames != 0) { - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { - frames *= 10; - } - set (current_time() + frames, true); - ValueChanged (); /* EMIT_SIGNAL */ - } - } - break; - - case 5: - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) { - frames = get_frames (field); - if (frames != 0) { - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { - frames *= 10; - } - - if ((double)current_time() - (double)frames < 0.0) { - set (0, true); - } - else { - set (current_time() - frames, true); - } - - ValueChanged (); /* EMIT_SIGNAL */ - } - } - break; - default: return FALSE; break;