length_clock (X_("locationlength"), true, X_("LocationEditRowClock"), true, false, true),
cd_check_button (_("CD")),
hide_check_button (_("Hide")),
+ lock_check_button (_("Lock")),
+ glue_check_button (_("Glue")),
scms_check_button (_("SCMS")),
preemph_check_button (_("Pre-Emphasis"))
end_go_button.set_name ("LocationEditGoButton");
cd_check_button.set_name ("LocationEditCdButton");
hide_check_button.set_name ("LocationEditHideButton");
+ lock_check_button.set_name ("LocationEditLockButton");
+ glue_check_button.set_name ("LocationEditGlueButton");
remove_button.set_name ("LocationEditRemoveButton");
isrc_label.set_name ("LocationEditNumberLabel");
isrc_entry.set_name ("LocationEditNameEntry");
cd_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::cd_toggled));
hide_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::hide_toggled));
+ lock_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::lock_toggled));
+ glue_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::glue_toggled));
remove_button.signal_clicked().connect(sigc::mem_fun(*this, &LocationEditRow::remove_button_pressed));
location = loc;
- if (!location) return;
+ if (!location) {
+ return;
+ }
+
+ ++i_am_the_modifier;
if (!hide_check_button.get_parent()) {
item_table.attach (hide_check_button, 5, 6, 0, 1, FILL, Gtk::FILL, 4, 0);
+ item_table.attach (lock_check_button, 6, 7, 0, 1, FILL, Gtk::FILL, 4, 0);
+ item_table.attach (glue_check_button, 7, 8, 0, 1, FILL, Gtk::FILL, 4, 0);
}
hide_check_button.set_active (location->is_hidden());
+ lock_check_button.set_active (location->locked());
+ glue_check_button.set_active (location->position_lock_style() == MusicTime);
if (location->is_auto_loop() || location-> is_auto_punch()) {
// use label instead of entry
item_table.attach (cd_check_button, 4, 5, 0, 1, FILL, FILL, 4, 0);
}
if (!remove_button.get_parent()) {
- item_table.attach (remove_button, 6, 7, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (remove_button, 8, 9, 0, 1, FILL, FILL, 4, 0);
}
if (location->is_session_range()) {
}
hide_check_button.show();
+ lock_check_button.show();
+ glue_check_button.show();
}
start_clock.set (location->start(), true);
length_clock.hide();
}
- start_clock.set_sensitive (!location->locked());
- end_clock.set_sensitive (!location->locked());
- length_clock.set_sensitive (!location->locked());
+ set_clock_sensitivity ();
+
+ --i_am_the_modifier;
location->start_changed.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::start_changed, this, _1), gui_context());
location->end_changed.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::end_changed, this, _1), gui_context());
location->name_changed.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::name_changed, this, _1), gui_context());
location->changed.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::location_changed, this, _1), gui_context());
location->FlagsChanged.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::flags_changed, this, _1, _2), gui_context());
+ location->LockChanged.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::lock_changed, this, _1), gui_context());
+ location->PositionLockStyleChanged.connect (connections, invalidator (*this), ui_bind (&LocationEditRow::position_lock_style_changed, this, _1), gui_context());
}
void
void
LocationEditRow::clock_changed (LocationPart part)
{
- if (i_am_the_modifier || !location) return;
+ if (i_am_the_modifier || !location) {
+ return;
+ }
switch (part) {
case LocStart:
default:
break;
}
-
}
void
void
LocationEditRow::hide_toggled ()
{
- if (i_am_the_modifier || !location) return;
+ if (i_am_the_modifier || !location) {
+ return;
+ }
location->set_hidden (hide_check_button.get_active(), this);
}
+void
+LocationEditRow::lock_toggled ()
+{
+ if (i_am_the_modifier || !location) {
+ return;
+ }
+
+ if (location->locked()) {
+ location->unlock ();
+ } else {
+ location->lock ();
+ }
+}
+
+void
+LocationEditRow::glue_toggled ()
+{
+ if (i_am_the_modifier || !location) {
+ return;
+ }
+
+ if (location->position_lock_style() == AudioTime) {
+ location->set_position_lock_style (MusicTime);
+ } else {
+ location->set_position_lock_style (AudioTime);
+ }
+}
+
void
LocationEditRow::remove_button_pressed ()
{
end_clock.set (location->end());
length_clock.set (location->length());
- start_clock.set_sensitive (!location->locked());
- end_clock.set_sensitive (!location->locked());
- length_clock.set_sensitive (!location->locked());
+ set_clock_sensitivity ();
i_am_the_modifier--;
void
LocationEditRow::flags_changed (ARDOUR::Location *loc, void *src)
{
- ENSURE_GUI_THREAD (*this, &LocationEditRow::flags_changed, loc, src)
-
- if (!location) return;
+ if (!location) {
+ return;
+ }
i_am_the_modifier++;
cd_check_button.set_active (location->is_cd_marker());
hide_check_button.set_active (location->is_hidden());
+ glue_check_button.set_active (location->position_lock_style() == MusicTime);
+
+ i_am_the_modifier--;
+}
+
+void
+LocationEditRow::lock_changed (ARDOUR::Location *loc)
+{
+ if (!location) {
+ return;
+ }
+
+ i_am_the_modifier++;
+
+ lock_check_button.set_active (location->locked());
+
+ set_clock_sensitivity ();
+
+ i_am_the_modifier--;
+}
+
+void
+LocationEditRow::position_lock_style_changed (ARDOUR::Location* loc)
+{
+ if (!location) {
+ return;
+ }
+
+ i_am_the_modifier++;
+
+ glue_check_button.set_active (location->position_lock_style() == MusicTime);
i_am_the_modifier--;
}
if (_session) {
nframes_t where = _session->audible_frame();
_session->locations()->next_available_name(markername,"mark");
- Location *location = new Location (where, where, markername, Location::IsMark);
+ Location *location = new Location (*_session, where, where, markername, Location::IsMark);
if (Config->get_name_new_markers()) {
newest_location = location;
}
if (_session) {
nframes_t where = _session->audible_frame();
_session->locations()->next_available_name(rangename,"unnamed");
- Location *location = new Location (where, where, rangename, Location::IsRangeMarker);
+ Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker);
_session->begin_reversible_command (_("add range marker"));
XMLNode &before = _session->locations()->get_state();
_session->locations()->add (location, true);
SessionHandlePtr::session_going_away ();
}
+void
+LocationEditRow::set_clock_sensitivity ()
+{
+ start_clock.set_sensitive (!location->locked());
+ end_clock.set_sensitive (!location->locked());
+ length_clock.set_sensitive (!location->locked());
+}
+
/*------------------------*/
LocationUIWindow::LocationUIWindow ()