2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <gtkmm2ext/utils.h>
24 #include <gtkmm2ext/stop_signal.h>
25 #include <gtkmm2ext/window_title.h>
27 #include <ardour/utils.h>
28 #include <ardour/configuration.h>
29 #include <ardour/session.h>
30 #include <pbd/memento_command.h>
32 #include "ardour_ui.h"
34 #include "location_ui.h"
37 #include "gui_thread.h"
41 using namespace ARDOUR;
44 using namespace Gtkmm2ext;
46 LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
47 : location(0), session(0),
48 item_table (1, 7, false),
49 start_set_button (_("Set")),
50 start_go_button (_("Go")),
51 start_clock (X_("locationstart"), true, X_("LocationEditRowClock"), true),
52 end_set_button (_("Set")),
53 end_go_button (_("Go")),
54 end_clock (X_("locationend"), true, X_("LocationEditRowClock"), true),
55 length_clock (X_("locationlength"), true, X_("LocationEditRowClock"), true, true),
56 cd_check_button (_("CD")),
57 hide_check_button (_("Hidden")),
58 remove_button (_("Remove")),
59 scms_check_button (_("SCMS")),
60 preemph_check_button (_("Pre-Emphasis"))
64 i_am_the_modifier = 0;
66 number_label.set_name ("LocationEditNumberLabel");
67 name_label.set_name ("LocationEditNameLabel");
68 name_entry.set_name ("LocationEditNameEntry");
69 start_set_button.set_name ("LocationEditSetButton");
70 start_go_button.set_name ("LocationEditGoButton");
71 end_set_button.set_name ("LocationEditSetButton");
72 end_go_button.set_name ("LocationEditGoButton");
73 cd_check_button.set_name ("LocationEditCdButton");
74 hide_check_button.set_name ("LocationEditHideButton");
75 remove_button.set_name ("LocationEditRemoveButton");
76 isrc_label.set_name ("LocationEditNumberLabel");
77 isrc_entry.set_name ("LocationEditNameEntry");
78 scms_check_button.set_name ("LocationEditCdButton");
79 preemph_check_button.set_name ("LocationEditCdButton");
80 performer_label.set_name ("LocationEditNumberLabel");
81 performer_entry.set_name ("LocationEditNameEntry");
82 composer_label.set_name ("LocationEditNumberLabel");
83 composer_entry.set_name ("LocationEditNameEntry");
86 isrc_label.set_text ("ISRC: ");
87 isrc_label.set_size_request (30, -1);
88 performer_label.set_text ("Performer: ");
89 performer_label.set_size_request (60, -1);
90 composer_label.set_text ("Composer: ");
91 composer_label.set_size_request (60, -1);
93 isrc_entry.set_size_request (112, -1);
94 isrc_entry.set_max_length(12);
95 isrc_entry.set_editable (true);
97 performer_entry.set_size_request (100, -1);
98 performer_entry.set_editable (true);
100 composer_entry.set_size_request (100, -1);
101 composer_entry.set_editable (true);
103 cd_track_details_hbox.pack_start (isrc_label, false, false);
104 cd_track_details_hbox.pack_start (isrc_entry, false, false);
105 cd_track_details_hbox.pack_start (scms_check_button, false, false);
106 cd_track_details_hbox.pack_start (preemph_check_button, false, false);
107 cd_track_details_hbox.pack_start (performer_label, false, false);
108 cd_track_details_hbox.pack_start (performer_entry, true, true);
109 cd_track_details_hbox.pack_start (composer_label, false, false);
110 cd_track_details_hbox.pack_start (composer_entry, true, true);
112 isrc_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::isrc_entry_changed));
113 performer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::performer_entry_changed));
114 composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
115 scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
116 preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
122 item_table.attach (number_label, 0, 1, 0, 1, FILL, FILL, 3, 0);
124 start_hbox.pack_start (start_go_button, false, false);
125 start_hbox.pack_start (start_clock, false, false);
126 start_hbox.pack_start (start_set_button, false, false);
128 item_table.attach (start_hbox, 2, 3, 0, 1, FILL, FILL, 4, 0);
131 start_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocStart));
132 start_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocStart));
133 start_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocStart));
136 end_hbox.pack_start (end_go_button, false, false);
137 end_hbox.pack_start (end_clock, false, false);
138 end_hbox.pack_start (end_set_button, false, false);
140 //item_table.attach (end_hbox, 2, 3, 0, 1, 0, 0, 4, 0);
142 end_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocEnd));
143 end_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd));
144 end_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocEnd));
146 // item_table.attach (length_clock, 3, 4, 0, 1, 0, 0, 4, 0);
147 length_clock.ValueChanged.connect (bind ( mem_fun(*this, &LocationEditRow::clock_changed), LocLength));
149 // item_table.attach (cd_check_button, 4, 5, 0, 1, 0, Gtk::FILL, 4, 0);
150 // item_table.attach (hide_check_button, 5, 6, 0, 1, 0, Gtk::FILL, 4, 0);
151 // item_table.attach (remove_button, 7, 8, 0, 1, 0, Gtk::FILL, 4, 0);
153 cd_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::cd_toggled));
154 hide_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::hide_toggled));
156 remove_button.signal_clicked().connect(mem_fun(*this, &LocationEditRow::remove_button_pressed));
158 pack_start(item_table, true, true);
164 LocationEditRow::~LocationEditRow()
167 start_changed_connection.disconnect();
168 end_changed_connection.disconnect();
169 name_changed_connection.disconnect();
170 changed_connection.disconnect();
171 flags_changed_connection.disconnect();
176 LocationEditRow::set_session (Session *sess)
180 if (!session) return;
182 start_clock.set_session (session);
183 end_clock.set_session (session);
184 length_clock.set_session (session);
189 LocationEditRow::set_number (int num)
194 number_label.set_text (string_compose ("%1", number));
199 LocationEditRow::set_location (Location *loc)
202 start_changed_connection.disconnect();
203 end_changed_connection.disconnect();
204 name_changed_connection.disconnect();
205 changed_connection.disconnect();
206 flags_changed_connection.disconnect();
211 if (!location) return;
213 if (!hide_check_button.get_parent()) {
214 item_table.attach (hide_check_button, 6, 7, 0, 1, FILL, Gtk::FILL, 4, 0);
216 hide_check_button.set_active (location->is_hidden());
218 if (location->is_auto_loop() || location-> is_auto_punch()) {
219 // use label instead of entry
221 name_label.set_text (location->name());
222 name_label.set_size_request (80, -1);
224 if (!name_label.get_parent()) {
225 item_table.attach (name_label, 1, 2, 0, 1, FILL, Gtk::FILL, 4, 0);
232 name_entry.set_text (location->name());
233 name_entry.set_size_request (100, -1);
234 name_entry.set_editable (true);
235 name_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::name_entry_changed));
237 if (!name_entry.get_parent()) {
238 item_table.attach (name_entry, 1, 2, 0, 1, FILL | EXPAND, FILL, 4, 0);
242 if (!cd_check_button.get_parent()) {
243 item_table.attach (cd_check_button, 5, 6, 0, 1, FILL, Gtk::FILL, 4, 0);
245 if (!remove_button.get_parent()) {
246 item_table.attach (remove_button, 7, 8, 0, 1, FILL, Gtk::FILL, 4, 0);
249 /* XXX i can't find a way to hide the button without messing up
250 the row spacing, so make it insensitive (paul).
253 if (location->is_end() || location->is_start()) {
254 remove_button.set_sensitive (false);
257 cd_check_button.set_active (location->is_cd_marker());
258 cd_check_button.show();
260 if (location->start() == session->current_start_frame()) {
261 cd_check_button.set_sensitive (false);
263 cd_check_button.set_sensitive (true);
266 hide_check_button.show();
269 start_clock.set (location->start(), true);
272 if (!location->is_mark()) {
273 if (!end_hbox.get_parent()) {
274 item_table.attach (end_hbox, 3, 4, 0, 1, FILL, FILL, 4, 0);
276 if (!length_clock.get_parent()) {
277 item_table.attach (length_clock, 4, 5, 0, 1, FILL, FILL, 4, 0);
280 end_clock.set (location->end(), true);
281 length_clock.set (location->length(), true);
283 end_set_button.show();
284 end_go_button.show();
290 end_set_button.hide();
291 end_go_button.hide();
297 start_changed_connection = location->start_changed.connect (mem_fun(*this, &LocationEditRow::start_changed));
298 end_changed_connection = location->end_changed.connect (mem_fun(*this, &LocationEditRow::end_changed));
299 name_changed_connection = location->name_changed.connect (mem_fun(*this, &LocationEditRow::name_changed));
300 changed_connection = location->changed.connect (mem_fun(*this, &LocationEditRow::location_changed));
301 flags_changed_connection = location->FlagsChanged.connect (mem_fun(*this, &LocationEditRow::flags_changed));
305 LocationEditRow::name_entry_changed ()
307 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::name_entry_changed));
308 if (i_am_the_modifier || !location) return;
310 location->set_name (name_entry.get_text());
315 LocationEditRow::isrc_entry_changed ()
317 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::isrc_entry_changed));
319 if (i_am_the_modifier || !location) return;
321 if (isrc_entry.get_text() != "" ) {
323 location->cd_info["isrc"] = isrc_entry.get_text();
326 location->cd_info.erase("isrc");
331 LocationEditRow::performer_entry_changed ()
333 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::performer_entry_changed));
335 if (i_am_the_modifier || !location) return;
337 if (performer_entry.get_text() != "") {
338 location->cd_info["performer"] = performer_entry.get_text();
340 location->cd_info.erase("performer");
345 LocationEditRow::composer_entry_changed ()
347 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::composer_entry_changed));
349 if (i_am_the_modifier || !location) return;
351 if (composer_entry.get_text() != "") {
352 location->cd_info["composer"] = composer_entry.get_text();
354 location->cd_info.erase("composer");
360 LocationEditRow::set_button_pressed (LocationPart part)
362 if (!location) return;
366 location->set_start (session->transport_frame ());
369 location->set_end (session->transport_frame ());
377 LocationEditRow::go_button_pressed (LocationPart part)
379 if (!location) return;
383 ARDOUR_UI::instance()->do_transport_locate (location->start());
386 ARDOUR_UI::instance()->do_transport_locate (location->end());
394 LocationEditRow::clock_changed (LocationPart part)
396 if (i_am_the_modifier || !location) return;
400 location->set_start (start_clock.current_time());
403 location->set_end (end_clock.current_time());
406 location->set_end (location->start() + length_clock.current_duration());
414 LocationEditRow::cd_toggled ()
416 if (i_am_the_modifier || !location) {
420 if (cd_check_button.get_active() == location->is_cd_marker()) {
424 if (cd_check_button.get_active()) {
425 if (location->start() <= session->current_start_frame()) {
426 error << _("You cannot put a CD marker at the start of the session") << endmsg;
427 cd_check_button.set_active (false);
432 location->set_cd (cd_check_button.get_active(), this);
434 if (location->is_cd_marker() && !(location->is_mark())) {
436 if (location->cd_info.find("isrc") != location->cd_info.end()) {
437 isrc_entry.set_text(location->cd_info["isrc"]);
439 if (location->cd_info.find("performer") != location->cd_info.end()) {
440 performer_entry.set_text(location->cd_info["performer"]);
442 if (location->cd_info.find("composer") != location->cd_info.end()) {
443 composer_entry.set_text(location->cd_info["composer"]);
445 if (location->cd_info.find("scms") != location->cd_info.end()) {
446 scms_check_button.set_active(true);
448 if (location->cd_info.find("preemph") != location->cd_info.end()) {
449 preemph_check_button.set_active(true);
452 if (!cd_track_details_hbox.get_parent()) {
453 item_table.attach (cd_track_details_hbox, 1, 8, 1, 2, FILL | EXPAND, FILL, 4, 0);
455 // item_table.resize(2, 7);
456 cd_track_details_hbox.show_all();
458 } else if (cd_track_details_hbox.get_parent()){
460 item_table.remove (cd_track_details_hbox);
461 // item_table.resize(1, 7);
462 redraw_ranges(); /* EMIT_SIGNAL */
467 LocationEditRow::hide_toggled ()
469 if (i_am_the_modifier || !location) return;
471 location->set_hidden (hide_check_button.get_active(), this);
475 LocationEditRow::remove_button_pressed ()
477 if (!location) return;
479 remove_requested(location); /* EMIT_SIGNAL */
485 LocationEditRow::scms_toggled ()
487 if (i_am_the_modifier || !location) return;
489 if (scms_check_button.get_active()) {
490 location->cd_info["scms"] = "on";
492 location->cd_info.erase("scms");
498 LocationEditRow::preemph_toggled ()
500 if (i_am_the_modifier || !location) return;
502 if (preemph_check_button.get_active()) {
503 location->cd_info["preemph"] = "on";
505 location->cd_info.erase("preemph");
510 LocationEditRow::end_changed (ARDOUR::Location *loc)
512 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::end_changed), loc));
514 if (!location) return;
516 // update end and length
519 end_clock.set (location->end());
520 length_clock.set (location->length());
526 LocationEditRow::start_changed (ARDOUR::Location *loc)
528 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::start_changed), loc));
530 if (!location) return;
532 // update end and length
535 start_clock.set (location->start());
537 if (location->start() == session->current_start_frame()) {
538 cd_check_button.set_sensitive (false);
540 cd_check_button.set_sensitive (true);
547 LocationEditRow::name_changed (ARDOUR::Location *loc)
549 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::name_changed), loc));
551 if (!location) return;
553 // update end and length
556 name_entry.set_text(location->name());
557 name_label.set_text(location->name());
564 LocationEditRow::location_changed (ARDOUR::Location *loc)
566 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::location_changed), loc));
568 if (!location) return;
572 start_clock.set (location->start());
573 end_clock.set (location->end());
574 length_clock.set (location->length());
581 LocationEditRow::flags_changed (ARDOUR::Location *loc, void *src)
583 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::flags_changed), loc, src));
585 if (!location) return;
589 cd_check_button.set_active (location->is_cd_marker());
590 hide_check_button.set_active (location->is_hidden());
595 LocationUI::LocationUI ()
596 : ArdourDialog ("locations dialog"),
597 add_location_button (_("Add New Location")),
598 add_range_button (_("Add New Range"))
600 i_am_the_modifier = 0;
602 WindowTitle title(Glib::get_application_name());
603 title += _("Locations");
605 set_title(title.get_string());
606 set_wmclass(X_("ardour_locations"), "Ardour");
608 set_name ("LocationWindow");
610 get_vbox()->pack_start (location_hpacker);
612 location_vpacker.set_border_width (10);
613 location_vpacker.set_spacing (5);
615 location_vpacker.pack_start (loop_edit_row, false, false);
616 location_vpacker.pack_start (punch_edit_row, false, false);
618 location_rows.set_name("LocationLocRows");
619 location_rows_scroller.add (location_rows);
620 location_rows_scroller.set_name ("LocationLocRowsScroller");
621 location_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
622 location_rows_scroller.set_size_request (-1, 130);
624 loc_frame_box.set_spacing (5);
625 loc_frame_box.set_border_width (5);
626 loc_frame_box.set_name("LocationFrameBox");
628 loc_frame_box.pack_start (location_rows_scroller, true, true);
630 add_location_button.set_name ("LocationAddLocationButton");
631 loc_frame_box.pack_start (add_location_button, false, false);
633 loc_frame.set_name ("LocationLocEditorFrame");
634 loc_frame.set_label (_("Location (CD Index) Markers"));
635 loc_frame.add (loc_frame_box);
636 loc_range_panes.pack1(loc_frame, true, false);
639 range_rows.set_name("LocationRangeRows");
640 range_rows_scroller.add (range_rows);
641 range_rows_scroller.set_name ("LocationRangeRowsScroller");
642 range_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
643 range_rows_scroller.set_size_request (-1, 130);
645 range_frame_box.set_spacing (5);
646 range_frame_box.set_name("LocationFrameBox");
647 range_frame_box.set_border_width (5);
648 range_frame_box.pack_start (range_rows_scroller, true, true);
650 add_range_button.set_name ("LocationAddRangeButton");
651 range_frame_box.pack_start (add_range_button, false, false);
653 range_frame.set_name ("LocationRangeEditorFrame");
654 range_frame.set_label (_("Range (CD Track) Markers"));
655 range_frame.add (range_frame_box);
656 loc_range_panes.pack2(range_frame, true, false);
657 location_vpacker.pack_start (loc_range_panes, true, true);
659 location_hpacker.pack_start (location_vpacker, true, true);
661 add_location_button.signal_clicked().connect (mem_fun(*this, &LocationUI::add_new_location));
662 add_range_button.signal_clicked().connect (mem_fun(*this, &LocationUI::add_new_range));
664 //add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
669 LocationUI::~LocationUI()
675 gint LocationUI::do_location_remove (ARDOUR::Location *loc)
677 /* this is handled internally by Locations, but there's
678 no point saving state etc. when we know the marker
686 session->begin_reversible_command (_("remove marker"));
687 XMLNode &before = session->locations()->get_state();
688 session->locations()->remove (loc);
689 XMLNode &after = session->locations()->get_state();
690 session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
691 session->commit_reversible_command ();
696 void LocationUI::location_remove_requested (ARDOUR::Location *loc)
698 // must do this to prevent problems when destroying
699 // the effective sender of this event
701 Glib::signal_idle().connect (bind (mem_fun(*this, &LocationUI::do_location_remove), loc));
705 void LocationUI::location_redraw_ranges ()
715 LocationUI::location_added (Location* location)
717 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::location_added), location));
719 if (location->is_auto_punch()) {
720 punch_edit_row.set_location(location);
722 else if (location->is_auto_loop()) {
723 loop_edit_row.set_location(location);
726 refresh_location_list ();
731 LocationUI::location_removed (Location* location)
733 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::location_removed), location));
735 if (location->is_auto_punch()) {
736 punch_edit_row.set_location(0);
738 else if (location->is_auto_loop()) {
739 loop_edit_row.set_location(0);
742 refresh_location_list ();
746 struct LocationSortByStart {
747 bool operator() (Location *a, Location *b) {
748 return a->start() < b->start();
753 LocationUI::map_locations (Locations::LocationList& locations)
755 Locations::LocationList::iterator i;
759 Locations::LocationList temp = locations;
760 LocationSortByStart cmp;
765 Box_Helpers::BoxList & loc_children = location_rows.children();
766 Box_Helpers::BoxList & range_children = range_rows.children();
767 LocationEditRow * erow;
769 for (n = 0, i = locations.begin(); i != locations.end(); ++n, ++i) {
773 if (location->is_mark()) {
775 erow = manage (new LocationEditRow(session, location, mark_n));
776 erow->remove_requested.connect (mem_fun(*this, &LocationUI::location_remove_requested));
777 erow->redraw_ranges.connect (mem_fun(*this, &LocationUI::location_redraw_ranges));
778 loc_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
780 else if (location->is_auto_punch()) {
781 punch_edit_row.set_session (session);
782 punch_edit_row.set_location (location);
784 else if (location->is_auto_loop()) {
785 loop_edit_row.set_session (session);
786 loop_edit_row.set_location (location);
789 erow = manage (new LocationEditRow(session, location));
790 erow->remove_requested.connect (mem_fun(*this, &LocationUI::location_remove_requested));
791 range_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
795 range_rows.show_all();
796 location_rows.show_all();
800 LocationUI::add_new_location()
805 nframes_t where = session->audible_frame();
806 session->locations()->next_available_name(markername,"mark");
807 Location *location = new Location (where, where, markername, Location::IsMark);
808 session->begin_reversible_command (_("add marker"));
809 XMLNode &before = session->locations()->get_state();
810 session->locations()->add (location, true);
811 XMLNode &after = session->locations()->get_state();
812 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
813 session->commit_reversible_command ();
819 LocationUI::add_new_range()
824 nframes_t where = session->audible_frame();
825 session->locations()->next_available_name(rangename,"unnamed");
826 Location *location = new Location (where, where, rangename, Location::IsRangeMarker);
827 session->begin_reversible_command (_("add range marker"));
828 XMLNode &before = session->locations()->get_state();
829 session->locations()->add (location, true);
830 XMLNode &after = session->locations()->get_state();
831 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
832 session->commit_reversible_command ();
838 LocationUI::refresh_location_list_s (Change ignored)
840 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::refresh_location_list_s), ignored));
842 refresh_location_list ();
846 LocationUI::refresh_location_list ()
848 ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::refresh_location_list));
849 using namespace Box_Helpers;
851 BoxList & loc_children = location_rows.children();
852 BoxList & range_children = range_rows.children();
854 loc_children.clear();
855 range_children.clear();
858 session->locations()->apply (*this, &LocationUI::map_locations);
864 LocationUI::set_session(ARDOUR::Session* sess)
866 ArdourDialog::set_session (sess);
869 session->locations()->changed.connect (mem_fun(*this, &LocationUI::refresh_location_list));
870 session->locations()->StateChanged.connect (mem_fun(*this, &LocationUI::refresh_location_list_s));
871 session->locations()->added.connect (mem_fun(*this, &LocationUI::location_added));
872 session->locations()->removed.connect (mem_fun(*this, &LocationUI::location_removed));
873 session->GoingAway.connect (mem_fun(*this, &LocationUI::session_gone));
875 refresh_location_list ();
879 LocationUI::session_gone()
881 ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::session_gone));
885 using namespace Box_Helpers;
886 BoxList & loc_children = location_rows.children();
887 BoxList & range_children = range_rows.children();
889 loc_children.clear();
890 range_children.clear();
892 loop_edit_row.set_session (0);
893 loop_edit_row.set_location (0);
895 punch_edit_row.set_session (0);
896 punch_edit_row.set_location (0);
898 ArdourDialog::session_gone ();
902 LocationUI::on_delete_event (GdkEventAny* ev)