summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/location_ui.cc14
-rw-r--r--gtk2_ardour/location_ui.h1
2 files changed, 15 insertions, 0 deletions
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 ();