diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-12 20:39:53 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-12 20:39:53 +0000 |
commit | ff9ddf510065305e13d169d35f9b4e6b88ce76d7 (patch) | |
tree | 0e41589d7332ce31499c9f02ca59f9b799487b03 /gtk2_ardour/audio_clock.cc | |
parent | ab565167ff36eb473340e950d93d46c3dfaa9616 (diff) |
tidy up (a bit) locations editing widget ; use pixbuf/string code from 2.0;remove edit point clock
git-svn-id: svn://localhost/ardour2/branches/3.0@6074 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r-- | gtk2_ardour/audio_clock.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index be387a2874..76d29aa23e 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -1108,6 +1108,7 @@ bool AudioClock::field_button_release_event (GdkEventButton *ev, Field field) { if (dragging) { + cerr << "button event on clock but we are dragging\n"; gdk_pointer_ungrab (GDK_CURRENT_TIME); dragging = false; if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)){ @@ -1125,6 +1126,7 @@ AudioClock::field_button_release_event (GdkEventButton *ev, Field field) } if (Keyboard::is_context_menu_event (ev)) { + cerr << "Context menu event on clock\n"; if (ops_menu == 0) { build_ops_menu (); } @@ -1954,6 +1956,32 @@ AudioClock::build_ops_menu () ops_items.push_back (MenuElem (_("Minutes:Seconds"), bind (mem_fun(*this, &AudioClock::set_mode), MinSec))); ops_items.push_back (MenuElem (_("Samples"), bind (mem_fun(*this, &AudioClock::set_mode), Frames))); ops_items.push_back (MenuElem (_("Off"), bind (mem_fun(*this, &AudioClock::set_mode), Off))); + + if (editable && !is_duration) { + ops_items.push_back (SeparatorElem()); + ops_items.push_back (MenuElem (_("Set From Playhead"), mem_fun(*this, &AudioClock::set_from_playhead))); + ops_items.push_back (MenuElem (_("Locate to this time"), mem_fun(*this, &AudioClock::locate))); + } +} + +void +AudioClock::set_from_playhead () +{ + if (!session) { + return; + } + + set (session->transport_frame()); +} + +void +AudioClock::locate () +{ + if (!session || is_duration) { + return; + } + + session->request_locate (current_time(), false); } void |