summaryrefslogtreecommitdiff
path: root/gtk2_ardour/location_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-25 18:17:35 +0200
committerRobin Gareus <robin@gareus.org>2016-04-25 18:17:35 +0200
commit674fa50fb8552f358ac3201c9d780890c9d575e3 (patch)
treef871b3de54efe68f9cb45bb8b3f8858dca58bde6 /gtk2_ardour/location_ui.cc
parent77a36d639201704bc145c15e89a7c516646923a6 (diff)
return of the location GoTo Button
Despite the tooltip, middle-click to locate is not very discoverable, and tricky to not-available on MacBooks.
Diffstat (limited to 'gtk2_ardour/location_ui.cc')
-rw-r--r--gtk2_ardour/location_ui.cc43
1 files changed, 33 insertions, 10 deletions
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index 4a2fc45a47..fa2737296b 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -48,18 +48,20 @@ using namespace Gtkmm2ext;
LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
: SessionHandlePtr (0) /* explicitly set below */
- , location(0)
- , item_table (1, 6, false)
- , start_clock (X_("locationstart"), true, "", true, false)
+ , location(0)
+ , item_table (1, 6, false)
+ , start_clock (X_("locationstart"), true, "", true, false)
, start_to_playhead_button (_("Use PH"))
- , end_clock (X_("locationend"), true, "", true, false)
+ , locate_to_start_button (_("Goto"))
+ , end_clock (X_("locationend"), true, "", true, false)
, end_to_playhead_button (_("Use PH"))
- , length_clock (X_("locationlength"), true, "", true, false, true)
- , cd_check_button (_("CD"))
- , hide_check_button (_("Hide"))
- , lock_check_button (_("Lock"))
- , glue_check_button (_("Glue"))
- , _clock_group (0)
+ , locate_to_end_button (_("Goto"))
+ , length_clock (X_("locationlength"), true, "", true, false, true)
+ , cd_check_button (_("CD"))
+ , hide_check_button (_("Hide"))
+ , lock_check_button (_("Lock"))
+ , glue_check_button (_("Glue"))
+ , _clock_group (0)
{
i_am_the_modifier = 0;
@@ -67,6 +69,8 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
start_to_playhead_button.set_name ("LocationEditCdButton");
end_to_playhead_button.set_name ("LocationEditCdButton");
+ locate_to_start_button.set_name ("LocationEditCdButton");
+ locate_to_end_button.set_name ("LocationEditCdButton");
number_label.set_name ("LocationEditNumberLabel");
name_label.set_name ("LocationEditNameLabel");
@@ -133,6 +137,7 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
start_hbox.set_spacing (2);
start_hbox.pack_start (start_clock, false, false);
start_hbox.pack_start (start_to_playhead_button, false, false);
+ start_hbox.pack_start (locate_to_start_button, false, false);
/* this is always in this location, no matter what the location is */
@@ -143,14 +148,17 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
item_table.attach (start_hbox, 2, 3, 0, 1, FILL, Gtk::AttachOptions(0), 4, 0);
start_to_playhead_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocStart));
+ locate_to_start_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::locate_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);
end_hbox.pack_start (end_to_playhead_button, false, false);
+ end_hbox.pack_start (locate_to_end_button, false, false);
end_to_playhead_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocEnd));
+ locate_to_end_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::locate_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);
@@ -426,6 +434,21 @@ LocationEditRow::to_playhead_button_pressed (LocationPart part)
}
}
+void
+LocationEditRow::locate_button_pressed (LocationPart part)
+{
+ switch (part) {
+ case LocStart:
+ _session->request_locate (start_clock.current_time());
+ break;
+ case LocEnd:
+ _session->request_locate (end_clock.current_time());
+ break;
+ default:
+ break;
+ }
+}
+
bool
LocationEditRow::locate_to_clock (GdkEventButton* ev, AudioClock* clock)
{