LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
: SessionHandlePtr (0) /* explicitly set below */
- , location(0)
+ , location(0)
, item_table (1, 6, false)
, start_clock (X_("locationstart"), true, X_("LocationEditRowClock"), true, false)
, end_clock (X_("locationend"), true, X_("LocationEditRowClock"), true, false)
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: ");
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));
{
SessionHandlePtr::set_session (sess);
- if (!_session) {
+ if (!_session) {
return;
}
LocationEditRow::name_entry_changed ()
{
ENSURE_GUI_THREAD (*this, &LocationEditRow::name_entry_changed)
-
+
if (i_am_the_modifier || !location) {
return;
}
}
}
+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)
{
}
void
-LocationEditRow::end_changed (ARDOUR::Location *loc)
+LocationEditRow::end_changed (ARDOUR::Location *)
{
ENSURE_GUI_THREAD (*this, &LocationEditRow::end_changed, loc)
loop_punch_box.pack_start (loop_edit_row, false, false);
loop_punch_box.pack_start (punch_edit_row, false, false);
-
+
table->attach (loop_punch_box, 1, 2, table_row, table_row + 1);
++table_row;
vbox->pack_start (*table, false, false);
-
+
table = manage (new Table (3, 2));
table->set_spacings (4);
table->set_col_spacing (0, 32);
table->attach (*manage (new Label ("")), 0, 2, table_row, table_row + 1, Gtk::SHRINK, Gtk::SHRINK);
++table_row;
-
+
l = manage (new Label (_("<b>Markers (Including CD Index)</b>")));
l->set_alignment (0, 0.5);
l->set_use_markup (true);
table->attach (*manage (new Label ("")), 0, 2, table_row, table_row + 1, Gtk::SHRINK, Gtk::SHRINK);
++table_row;
-
+
l = manage (new Label (_("<b>Ranges (Including CD Track Ranges)</b>")));
l->set_alignment (0, 0.5);
l->set_use_markup (true);
add_location_button.signal_clicked().connect (sigc::mem_fun(*this, &LocationUI::add_new_location));
add_range_button.signal_clicked().connect (sigc::mem_fun(*this, &LocationUI::add_new_range));
-
+
show_all ();
}
delete _clock_group;
}
-gint
+gint
LocationUI::do_location_remove (ARDOUR::Location *loc)
{
/* this is handled internally by Locations, but there's
return FALSE;
}
-void
+void
LocationUI::location_remove_requested (ARDOUR::Location *loc)
{
// must do this to prevent problems when destroying
}
-void
+void
LocationUI::location_redraw_ranges ()
{
range_rows.hide();
}
++i;
-
+
if (j != children.end()) {
++j;
}
if (location->is_mark()) {
LocationEditRow* erow = manage (new LocationEditRow (_session, location, mark_n));
- erow->set_clock_group (*_clock_group);
+ erow->set_clock_group (*_clock_group);
erow->remove_requested.connect (sigc::mem_fun(*this, &LocationUI::location_remove_requested));
erow->redraw_ranges.connect (sigc::mem_fun(*this, &LocationUI::location_redraw_ranges));
using namespace Box_Helpers;
// this is just too expensive to do when window is not shown
- if (!is_visible()) return;
+ if (!is_mapped()) {
+ return;
+ }
BoxList & loc_children = location_rows.children();
BoxList & range_children = range_rows.children();
if (_session) {
_session->locations()->apply (*this, &LocationUI::map_locations);
}
-
}
void
{
}
-void
-LocationUIWindow::on_show()
+void
+LocationUIWindow::on_map ()
{
+ ArdourDialog::on_map ();
_ui.refresh_location_list();
- ArdourDialog::on_show();
}
bool