summaryrefslogtreecommitdiff
path: root/gtk2_ardour/location_ui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-03-10 00:43:23 +0000
committerCarl Hetherington <carl@carlh.net>2011-03-10 00:43:23 +0000
commite8060844021cdf5b4c6f3e284a892e70109787c3 (patch)
treef15c5bd5f7e00e44e4ecd1b4786bd6a4d8c198e5 /gtk2_ardour/location_ui.cc
parent6b87dbbf3497a9ccff19da15e7ec102ddbbb06f4 (diff)
Restore Use PH button in locations UI (#3667).
git-svn-id: svn://localhost/ardour2/branches/3.0@9117 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/location_ui.cc')
-rw-r--r--gtk2_ardour/location_ui.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index 849ce9de22..c24da57685 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -83,6 +83,12 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
composer_label.set_name ("LocationEditNumberLabel");
composer_entry.set_name ("LocationEditNameEntry");
+ Gtk::Button* start_to_playhead_button = manage (new Button (_("Use PH")));
+ Gtk::Button* end_to_playhead_button = manage (new Button (_("Use PH")));
+
+ ARDOUR_UI::instance()->tooltips().set_tip (*start_to_playhead_button, _("Set value to playhead"));
+ ARDOUR_UI::instance()->tooltips().set_tip (*end_to_playhead_button, _("Set value to playhead"));
+
isrc_label.set_text ("ISRC: ");
isrc_label.set_size_request (30, -1);
performer_label.set_text ("Performer: ");
@@ -121,19 +127,23 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
start_hbox.pack_start (start_go_button, false, false);
start_hbox.pack_start (start_clock, false, false);
+ start_hbox.pack_start (*start_to_playhead_button, false, false);
/* this is always in this location, no matter what the location is */
item_table.attach (start_hbox, 1, 2, 0, 1, FILL, FILL, 4, 0);
start_go_button.signal_clicked().connect(sigc::bind (sigc::mem_fun (*this, &LocationEditRow::go_button_pressed), LocStart));
+ 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.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocStart));
end_hbox.pack_start (end_go_button, false, false);
end_hbox.pack_start (end_clock, false, false);
+ end_hbox.pack_start (*end_to_playhead_button, false, false);
end_go_button.signal_clicked().connect(sigc::bind (sigc::mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd));
+ 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.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocEnd));
@@ -407,6 +417,25 @@ LocationEditRow::go_button_pressed (LocationPart part)
}
void
+LocationEditRow::to_playhead_button_pressed (LocationPart part)
+{
+ if (!location) {
+ return;
+ }
+
+ switch (part) {
+ case LocStart:
+ location->set_start (_session->transport_frame ());
+ break;
+ case LocEnd:
+ location->set_end (_session->transport_frame ());
+ break;
+ default:
+ break;
+ }
+}
+
+void
LocationEditRow::clock_changed (LocationPart part)
{
if (i_am_the_modifier || !location) {