From d14a3b924e3bf9e986a202a1192f86f7ed2d964f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Jul 2023 15:34:37 -0600 Subject: [PATCH] locations now follow session time domain, always (probably) (GUI edition) --- gtk2_ardour/editor.h | 1 - gtk2_ardour/editor_markers.cc | 46 ----------------------------------- gtk2_ardour/location_ui.cc | 36 --------------------------- gtk2_ardour/location_ui.h | 3 --- 4 files changed, 86 deletions(-) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 364d7e4938..8c7f327c0c 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1849,7 +1849,6 @@ private: void toggle_tempo_type (); void ramp_to_next_tempo (); void toggle_marker_menu_lock (); - void toggle_marker_menu_glue (); void marker_menu_hide (); void marker_menu_set_origin (); void marker_menu_loop_range (); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 6f2f29576c..677ca29db1 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1104,12 +1104,6 @@ Editor::build_marker_menu (Location* loc) lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock)); } - items.push_back (CheckMenuElem (_("Glue to Bars and Beats"))); - Gtk::CheckMenuItem* glue_item = static_cast (&items.back()); - glue_item->set_active (loc->position_time_domain() == Temporal::BeatTime); - - glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue)); - items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); @@ -1138,13 +1132,6 @@ Editor::build_range_marker_menu (Location* loc, bool loop_or_punch, bool session items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range))); - items.push_back (SeparatorElem()); - items.push_back (CheckMenuElem (_("Glue to Bars and Beats"))); - - Gtk::CheckMenuItem* glue_item = static_cast (&items.back()); - glue_item->set_active (loc->position_time_domain() == Temporal::BeatTime); - glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue)); - items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Loudness Assistant..."), sigc::mem_fun(*this, &Editor::loudness_assistant_marker))); items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_range))); @@ -1959,39 +1946,6 @@ Editor::jump_to_loop_marker (bool start) } } -void -Editor::toggle_marker_menu_glue () -{ - ArdourMarker* marker; - - if ((marker = reinterpret_cast (marker_menu_item->get_data ("marker"))) == 0) { - fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg; - abort(); /*NOTREACHED*/ - } - - Location* loc; - bool ignored; - - loc = find_location_from_marker (marker, ignored); - - if (!loc) { - return; - } - - begin_reversible_command (_("change marker lock style")); - XMLNode &before = _session->locations()->get_state(); - - if (loc->position_time_domain() == Temporal::BeatTime) { - loc->set_position_time_domain (Temporal::AudioTime); - } else { - loc->set_position_time_domain (Temporal::BeatTime); - } - - XMLNode &after = _session->locations()->get_state(); - _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - commit_reversible_command (); -} - void Editor::toggle_marker_lines () { diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 757d3a5e7d..1515ae8343 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -67,7 +67,6 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) , cd_check_button (_("CD")) , hide_check_button (_("Hide")) , lock_check_button (_("Lock")) - , glue_check_button (_("Glue")) , _clock_group (0) { @@ -83,7 +82,6 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) cd_check_button.set_name ("LocationEditCdButton"); hide_check_button.set_name ("LocationEditHideButton"); lock_check_button.set_name ("LocationEditLockButton"); - glue_check_button.set_name ("LocationEditGlueButton"); isrc_label.set_name ("LocationEditNumberLabel"); isrc_entry.set_name ("LocationEditNameEntry"); scms_check_button.set_name ("LocationEditCdButton"); @@ -168,7 +166,6 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) 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)); @@ -250,7 +247,6 @@ LocationEditRow::set_location (Location *loc) 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); Glib::DateTime gdt(Glib::DateTime::create_now_local (location->timestamp())); string date = gdt.format ("%F %H:%M"); @@ -259,7 +255,6 @@ LocationEditRow::set_location (Location *loc) } hide_check_button.set_active (location->is_hidden()); lock_check_button.set_active (location->locked()); - glue_check_button.set_active (location->position_time_domain() == Temporal::BeatTime); if (location->is_auto_loop() || location-> is_auto_punch()) { // use label instead of entry @@ -304,7 +299,6 @@ LocationEditRow::set_location (Location *loc) hide_check_button.show(); lock_check_button.show(); - glue_check_button.show(); } start_clock.set (location->start(), true); @@ -359,7 +353,6 @@ LocationEditRow::set_location (Location *loc) location->Changed.connect (connections, invalidator (*this), boost::bind (&LocationEditRow::location_changed, this), gui_context()); location->FlagsChanged.connect (connections, invalidator (*this), boost::bind (&LocationEditRow::flags_changed, this), gui_context()); location->LockChanged.connect (connections, invalidator (*this), boost::bind (&LocationEditRow::lock_changed, this), gui_context()); - location->TimeDomainChanged.connect (connections, invalidator (*this), boost::bind (&LocationEditRow::time_domain_changed, this), gui_context()); } void @@ -565,20 +558,6 @@ LocationEditRow::lock_toggled () } } -void -LocationEditRow::glue_toggled () -{ - if (i_am_the_modifier || !location) { - return; - } - - if (location->position_time_domain() == Temporal::AudioTime) { - location->set_position_time_domain (Temporal::BeatTime); - } else { - location->set_position_time_domain (Temporal::AudioTime); - } -} - void LocationEditRow::remove_button_pressed () { @@ -689,7 +668,6 @@ LocationEditRow::flags_changed () cd_check_button.set_active (location->is_cd_marker()); hide_check_button.set_active (location->is_hidden()); - glue_check_button.set_active (location->position_time_domain() == Temporal::BeatTime); i_am_the_modifier--; } @@ -710,20 +688,6 @@ LocationEditRow::lock_changed () i_am_the_modifier--; } -void -LocationEditRow::time_domain_changed () -{ - if (!location) { - return; - } - - i_am_the_modifier++; - - glue_check_button.set_active (location->position_time_domain() == Temporal::BeatTime); - - i_am_the_modifier--; -} - void LocationEditRow::focus_name() { diff --git a/gtk2_ardour/location_ui.h b/gtk2_ardour/location_ui.h index b0e48d62e5..5d65bfef70 100644 --- a/gtk2_ardour/location_ui.h +++ b/gtk2_ardour/location_ui.h @@ -98,7 +98,6 @@ protected: Gtk::CheckButton cd_check_button; Gtk::CheckButton hide_check_button; Gtk::CheckButton lock_check_button; - Gtk::CheckButton glue_check_button; ArdourWidgets::ArdourButton remove_button; @@ -134,7 +133,6 @@ protected: void cd_toggled (); void hide_toggled (); void lock_toggled (); - void glue_toggled (); void remove_button_pressed (); void scms_toggled (); @@ -146,7 +144,6 @@ protected: void location_changed (); void flags_changed (); void lock_changed (); - void time_domain_changed (); void set_clock_editable_status (); void show_cd_track_details ();