From 33f62360a253511f8b8112012cd13e59b26095a6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 11 Dec 2011 17:26:48 +0000 Subject: [PATCH] add middle-clock-on-range/marker-clock to locate there git-svn-id: svn://localhost/ardour2/branches/3.0@10980 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/location_ui.cc | 14 ++++++++++++++ gtk2_ardour/location_ui.h | 1 + 2 files changed, 15 insertions(+) diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index f3029cd062..6f7db62593 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -131,6 +131,7 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) start_to_playhead_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocStart)); start_clock.ValueChanged.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::clock_changed), LocStart)); + start_clock.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::locate_to_clock), &start_clock), false); end_hbox.set_spacing (2); end_hbox.pack_start (end_clock, false, false); @@ -138,6 +139,7 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) end_to_playhead_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocEnd)); end_clock.ValueChanged.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::clock_changed), LocEnd)); + end_clock.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::locate_to_clock), &end_clock), false); length_clock.ValueChanged.connect (sigc::bind ( sigc::mem_fun(*this, &LocationEditRow::clock_changed), LocLength)); @@ -237,6 +239,8 @@ LocationEditRow::set_location (Location *loc) name_label.set_text (location->name()); name_label.set_size_request (80, -1); + remove_button.hide (); + if (!name_label.get_parent()) { item_table.attach (name_label, 1, 2, 0, 1, FILL, FILL, 4, 0); } @@ -402,6 +406,16 @@ LocationEditRow::to_playhead_button_pressed (LocationPart part) } } +bool +LocationEditRow::locate_to_clock (GdkEventButton* ev, AudioClock* clock) +{ + if (Keyboard::is_button2_event (ev)) { + _session->request_locate (clock->current_time()); + return true; + } + return false; +} + void LocationEditRow::clock_changed (LocationPart part) { diff --git a/gtk2_ardour/location_ui.h b/gtk2_ardour/location_ui.h index ec19389f4a..928231cded 100644 --- a/gtk2_ardour/location_ui.h +++ b/gtk2_ardour/location_ui.h @@ -118,6 +118,7 @@ class LocationEditRow : public Gtk::HBox, public ARDOUR::SessionHandlePtr void to_playhead_button_pressed (LocationPart part); void clock_changed (LocationPart part); + bool locate_to_clock (GdkEventButton*, AudioClock*); void cd_toggled (); void hide_toggled ();