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.
24 #include <gtkmm2ext/utils.h>
25 #include <gtkmm2ext/stop_signal.h>
27 #include <ardour/utils.h>
28 #include <ardour/configuration.h>
29 #include <ardour/session.h>
31 #include "ardour_ui.h"
33 #include "location_ui.h"
36 #include "gui_thread.h"
40 using namespace ARDOUR;
42 using namespace Gtkmm2ext;
44 LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
45 : location(0), session(0),
46 item_table (1, 7, false),
47 start_set_button (_("Set")),
48 start_go_button (_("Go")),
49 start_clock (X_("LocationEditRowClock"), true),
50 end_set_button (_("Set")),
51 end_go_button (_("Go")),
52 end_clock (X_("LocationEditRowClock"), true),
53 length_clock (X_("LocationEditRowClock"), true, true),
54 cd_check_button (_("CD")),
55 hide_check_button (_("Hidden")),
56 remove_button (_("Remove")),
57 scms_check_button (_("SCMS")),
58 preemph_check_button (_("Pre-Emphasis"))
62 i_am_the_modifier = 0;
64 number_label.set_name ("LocationEditNumberLabel");
65 name_label.set_name ("LocationEditNameLabel");
66 name_entry.set_name ("LocationEditNameEntry");
67 start_set_button.set_name ("LocationEditSetButton");
68 start_go_button.set_name ("LocationEditGoButton");
69 end_set_button.set_name ("LocationEditSetButton");
70 end_go_button.set_name ("LocationEditGoButton");
71 cd_check_button.set_name ("LocationEditCdButton");
72 hide_check_button.set_name ("LocationEditHideButton");
73 remove_button.set_name ("LocationEditRemoveButton");
74 isrc_label.set_name ("LocationEditNumberLabel");
75 isrc_entry.set_name ("LocationEditNameEntry");
76 scms_check_button.set_name ("LocationEditCdButton");
77 preemph_check_button.set_name ("LocationEditCdButton");
78 performer_label.set_name ("LocationEditNumberLabel");
79 performer_entry.set_name ("LocationEditNameEntry");
80 composer_label.set_name ("LocationEditNumberLabel");
81 composer_entry.set_name ("LocationEditNameEntry");
84 isrc_label.set_text ("ISRC: ");
85 isrc_label.set_size_request (30, -1);
86 performer_label.set_text ("Performer: ");
87 performer_label.set_size_request (60, -1);
88 composer_label.set_text ("Composer: ");
89 composer_label.set_size_request (60, -1);
91 isrc_entry.set_size_request (112, -1);
92 isrc_entry.set_max_length(12);
93 isrc_entry.set_editable (true);
95 performer_entry.set_size_request (100, -1);
96 performer_entry.set_editable (true);
98 composer_entry.set_size_request (100, -1);
99 composer_entry.set_editable (true);
101 cd_track_details_hbox.pack_start (isrc_label, false, false);
102 cd_track_details_hbox.pack_start (isrc_entry, false, false);
103 cd_track_details_hbox.pack_start (scms_check_button, false, false);
104 cd_track_details_hbox.pack_start (preemph_check_button, false, false);
105 cd_track_details_hbox.pack_start (performer_label, false, false);
106 cd_track_details_hbox.pack_start (performer_entry, true, true);
107 cd_track_details_hbox.pack_start (composer_label, false, false);
108 cd_track_details_hbox.pack_start (composer_entry, true, true);
110 isrc_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::isrc_entry_changed));
111 isrc_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
112 isrc_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
114 performer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::performer_entry_changed));
115 performer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
116 performer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
118 composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
119 composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
120 composer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
122 scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
123 preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
129 item_table.attach (number_label, 0, 1, 0, 1, FILL, FILL, 3, 0);
131 start_hbox.pack_start (start_go_button, false, false);
132 start_hbox.pack_start (start_clock, false, false);
133 start_hbox.pack_start (start_set_button, false, false);
135 item_table.attach (start_hbox, 2, 3, 0, 1, FILL, FILL, 4, 0);
138 start_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocStart));
139 start_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocStart));
140 start_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocStart));
143 end_hbox.pack_start (end_go_button, false, false);
144 end_hbox.pack_start (end_clock, false, false);
145 end_hbox.pack_start (end_set_button, false, false);
147 //item_table.attach (end_hbox, 2, 3, 0, 1, 0, 0, 4, 0);
149 end_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocEnd));
150 end_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd));
151 end_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocEnd));
153 // item_table.attach (length_clock, 3, 4, 0, 1, 0, 0, 4, 0);
154 length_clock.ValueChanged.connect (bind ( mem_fun(*this, &LocationEditRow::clock_changed), LocLength));
156 // item_table.attach (cd_check_button, 4, 5, 0, 1, 0, Gtk::FILL, 4, 0);
157 // item_table.attach (hide_check_button, 5, 6, 0, 1, 0, Gtk::FILL, 4, 0);
158 // item_table.attach (remove_button, 7, 8, 0, 1, 0, Gtk::FILL, 4, 0);
160 cd_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::cd_toggled));
161 hide_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::hide_toggled));
163 remove_button.signal_clicked().connect(mem_fun(*this, &LocationEditRow::remove_button_pressed));
165 pack_start(item_table, true, true);
171 LocationEditRow::~LocationEditRow()
174 start_changed_connection.disconnect();
175 end_changed_connection.disconnect();
176 name_changed_connection.disconnect();
177 changed_connection.disconnect();
178 flags_changed_connection.disconnect();
183 LocationEditRow::set_session (Session *sess)
187 if (!session) return;
189 start_clock.set_session (session);
190 end_clock.set_session (session);
191 length_clock.set_session (session);
196 LocationEditRow::set_number (int num)
201 number_label.set_text (string_compose ("%1", number));
206 LocationEditRow::set_location (Location *loc)
209 start_changed_connection.disconnect();
210 end_changed_connection.disconnect();
211 name_changed_connection.disconnect();
212 changed_connection.disconnect();
213 flags_changed_connection.disconnect();
218 if (!location) return;
220 if (!hide_check_button.get_parent()) {
221 item_table.attach (hide_check_button, 6, 7, 0, 1, FILL, Gtk::FILL, 4, 0);
223 hide_check_button.set_active (location->is_hidden());
225 if (location->is_auto_loop() || location->is_auto_punch()) {
226 // use label instead of entry
228 name_label.set_text (location->name());
229 name_label.set_size_request (80, -1);
231 if (!name_label.get_parent()) {
232 item_table.attach (name_label, 1, 2, 0, 1, FILL, Gtk::FILL, 4, 0);
239 name_entry.set_text (location->name());
240 name_entry.set_size_request (100, -1);
241 name_entry.set_editable (true);
242 name_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::name_entry_changed));
243 name_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
244 name_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
246 if (!name_entry.get_parent()) {
247 item_table.attach (name_entry, 1, 2, 0, 1, FILL | EXPAND, FILL, 4, 0);
251 if (!cd_check_button.get_parent()) {
252 item_table.attach (cd_check_button, 5, 6, 0, 1, FILL, Gtk::FILL, 4, 0);
254 if (!remove_button.get_parent()) {
255 item_table.attach (remove_button, 7, 8, 0, 1, FILL, Gtk::FILL, 4, 0);
258 /* XXX i can't find a way to hide the button without messing up
259 the row spacing, so make it insensitive (paul).
262 if (location->is_end()) {
263 remove_button.set_sensitive (false);
266 cd_check_button.set_active (location->is_cd_marker());
267 cd_check_button.show();
268 hide_check_button.show();
271 start_clock.set (location->start(), true);
274 if (!location->is_mark()) {
275 if (!end_hbox.get_parent()) {
276 item_table.attach (end_hbox, 3, 4, 0, 1, FILL, FILL, 4, 0);
278 if (!length_clock.get_parent()) {
279 item_table.attach (length_clock, 4, 5, 0, 1, FILL, FILL, 4, 0);
282 end_clock.set (location->end(), true);
283 length_clock.set (location->length(), true);
285 end_set_button.show();
286 end_go_button.show();
291 end_set_button.hide();
292 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));
306 LocationEditRow::entry_focus_event (GdkEventFocus* ev)
309 ARDOUR_UI::instance()->allow_focus (true);
311 ARDOUR_UI::instance()->allow_focus (false);
318 LocationEditRow::name_entry_changed ()
320 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::name_entry_changed));
321 if (i_am_the_modifier || !location) return;
323 location->set_name (name_entry.get_text());
328 LocationEditRow::isrc_entry_changed ()
330 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::isrc_entry_changed));
332 if (i_am_the_modifier || !location) return;
334 if (isrc_entry.get_text() != "" ) {
336 location->cd_info["isrc"] = isrc_entry.get_text();
339 location->cd_info.erase("isrc");
344 LocationEditRow::performer_entry_changed ()
346 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::performer_entry_changed));
348 if (i_am_the_modifier || !location) return;
350 if (performer_entry.get_text() != "") {
351 location->cd_info["performer"] = performer_entry.get_text();
353 location->cd_info.erase("performer");
358 LocationEditRow::composer_entry_changed ()
360 ENSURE_GUI_THREAD(mem_fun(*this, &LocationEditRow::composer_entry_changed));
362 if (i_am_the_modifier || !location) return;
364 if (composer_entry.get_text() != "") {
365 location->cd_info["composer"] = composer_entry.get_text();
367 location->cd_info.erase("composer");
373 LocationEditRow::set_button_pressed (LocationPart part)
375 if (!location) return;
379 location->set_start (session->transport_frame ());
382 location->set_end (session->transport_frame ());
390 LocationEditRow::go_button_pressed (LocationPart part)
392 if (!location) return;
396 ARDOUR_UI::instance()->do_transport_locate (location->start());
399 ARDOUR_UI::instance()->do_transport_locate (location->end());
407 LocationEditRow::clock_changed (LocationPart part)
409 if (i_am_the_modifier || !location) return;
413 location->set_start (start_clock.current_time());
416 location->set_end (end_clock.current_time());
419 location->set_end (location->start() + length_clock.current_duration());
427 LocationEditRow::cd_toggled ()
430 if (i_am_the_modifier || !location) return;
431 location->set_cd (cd_check_button.get_active(), this);
433 if (location->is_cd_marker() && !(location->is_mark())) {
435 if (location->cd_info.find("isrc") != location->cd_info.end()) {
436 isrc_entry.set_text(location->cd_info["isrc"]);
438 if (location->cd_info.find("performer") != location->cd_info.end()) {
439 performer_entry.set_text(location->cd_info["performer"]);
441 if (location->cd_info.find("composer") != location->cd_info.end()) {
442 composer_entry.set_text(location->cd_info["composer"]);
444 if (location->cd_info.find("scms") != location->cd_info.end()) {
445 scms_check_button.set_active(true);
447 if (location->cd_info.find("preemph") != location->cd_info.end()) {
448 preemph_check_button.set_active(true);
451 if(!cd_track_details_hbox.get_parent()) {
452 item_table.attach (cd_track_details_hbox, 1, 8, 1, 2, FILL | EXPAND, FILL, 4, 0);
454 // item_table.resize(2, 7);
455 cd_track_details_hbox.show_all();
457 } else if (cd_track_details_hbox.get_parent()){
459 item_table.remove (cd_track_details_hbox);
460 // item_table.resize(1, 7);
461 redraw_ranges(); /* EMIT_SIGNAL */
468 LocationEditRow::hide_toggled ()
470 if (i_am_the_modifier || !location) return;
472 location->set_hidden (hide_check_button.get_active(), this);
476 LocationEditRow::remove_button_pressed ()
478 if (!location) return;
480 remove_requested(location); /* EMIT_SIGNAL */
486 LocationEditRow::scms_toggled ()
488 if (i_am_the_modifier || !location) return;
490 if (scms_check_button.get_active()) {
491 location->cd_info["scms"] = "on";
493 location->cd_info.erase("scms");
499 LocationEditRow::preemph_toggled ()
501 if (i_am_the_modifier || !location) return;
503 if (preemph_check_button.get_active()) {
504 location->cd_info["preemph"] = "on";
506 location->cd_info.erase("preemph");
511 LocationEditRow::end_changed (ARDOUR::Location *loc)
513 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::end_changed), loc));
515 if (!location) return;
517 // update end and length
520 end_clock.set (location->end());
521 length_clock.set (location->length());
527 LocationEditRow::start_changed (ARDOUR::Location *loc)
529 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::start_changed), loc));
531 if (!location) return;
533 // update end and length
536 start_clock.set (location->start());
542 LocationEditRow::name_changed (ARDOUR::Location *loc)
544 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::name_changed), loc));
546 if (!location) return;
548 // update end and length
551 name_entry.set_text(location->name());
552 name_label.set_text(location->name());
559 LocationEditRow::location_changed (ARDOUR::Location *loc)
561 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::location_changed), loc));
563 if (!location) return;
567 start_clock.set (location->start());
568 end_clock.set (location->end());
569 length_clock.set (location->length());
576 LocationEditRow::flags_changed (ARDOUR::Location *loc, void *src)
578 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationEditRow::flags_changed), loc, src));
580 if (!location) return;
584 cd_check_button.set_active (location->is_cd_marker());
585 hide_check_button.set_active (location->is_hidden());
590 LocationUI::LocationUI ()
591 : ArdourDialog ("location dialog"),
592 add_location_button (_("Add New Location")),
593 add_range_button (_("Add New Range"))
595 i_am_the_modifier = 0;
597 set_title(_("ardour: locations"));
598 set_wmclass(_("ardour_locations"), "Ardour");
600 set_name ("LocationWindow");
601 signal_delete_event().connect (bind (ptr_fun (just_hide_it), static_cast<Window*>(this)));
603 add (location_hpacker);
606 location_vpacker.set_border_width (10);
607 location_vpacker.set_spacing (5);
610 location_vpacker.pack_start (loop_edit_row, false, false);
611 location_vpacker.pack_start (punch_edit_row, false, false);
613 location_rows.set_name("LocationLocRows");
614 location_rows_scroller.add_with_viewport (location_rows);
615 location_rows_scroller.set_name ("LocationLocRowsScroller");
616 location_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
617 location_rows_scroller.set_size_request (-1, 130);
619 loc_frame_box.set_spacing (5);
620 loc_frame_box.set_border_width (5);
621 loc_frame_box.set_name("LocationFrameBox");
623 loc_frame_box.pack_start (location_rows_scroller, true, true);
625 add_location_button.set_name ("LocationAddLocationButton");
626 loc_frame_box.pack_start (add_location_button, false, false);
628 loc_frame.set_name ("LocationLocEditorFrame");
629 loc_frame.set_label (_("Location (CD Index) Markers"));
630 loc_frame.add (loc_frame_box);
631 loc_range_panes.pack1(loc_frame, true, false);
634 range_rows.set_name("LocationRangeRows");
635 range_rows_scroller.add_with_viewport (range_rows);
636 range_rows_scroller.set_name ("LocationRangeRowsScroller");
637 range_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
638 range_rows_scroller.set_size_request (-1, 130);
640 range_frame_box.set_spacing (5);
641 range_frame_box.set_name("LocationFrameBox");
642 range_frame_box.set_border_width (5);
643 range_frame_box.pack_start (range_rows_scroller, true, true);
645 add_range_button.set_name ("LocationAddRangeButton");
646 range_frame_box.pack_start (add_range_button, false, false);
648 range_frame.set_name ("LocationRangeEditorFrame");
649 range_frame.set_label (_("Range (CD Track) Markers"));
650 range_frame.add (range_frame_box);
651 loc_range_panes.pack2(range_frame, true, false);
652 location_vpacker.pack_start (loc_range_panes, true, true);
654 location_hpacker.pack_start (location_vpacker, true, true);
656 add_location_button.signal_clicked().connect (mem_fun(*this, &LocationUI::add_new_location));
657 add_range_button.signal_clicked().connect (mem_fun(*this, &LocationUI::add_new_range));
659 //add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
664 LocationUI::~LocationUI()
670 gint LocationUI::do_location_remove (ARDOUR::Location *loc)
672 /* this is handled internally by Locations, but there's
673 no point saving state etc. when we know the marker
681 session->begin_reversible_command (_("remove marker"));
682 session->add_undo (session->locations()->get_memento());
683 session->locations()->remove (loc);
684 session->add_redo_no_execute (session->locations()->get_memento());
685 session->commit_reversible_command ();
690 void LocationUI::location_remove_requested (ARDOUR::Location *loc)
692 // must do this to prevent problems when destroying
693 // the effective sender of this event
695 Glib::signal_idle().connect (bind (mem_fun(*this, &LocationUI::do_location_remove), loc));
699 void LocationUI::location_redraw_ranges ()
709 LocationUI::location_added (Location* location)
711 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::location_added), location));
713 if (location->is_auto_punch()) {
714 punch_edit_row.set_location(location);
716 else if (location->is_auto_loop()) {
717 loop_edit_row.set_location(location);
720 refresh_location_list ();
725 LocationUI::location_removed (Location* location)
727 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::location_removed), location));
729 if (location->is_auto_punch()) {
730 punch_edit_row.set_location(0);
732 else if (location->is_auto_loop()) {
733 loop_edit_row.set_location(0);
736 refresh_location_list ();
740 struct LocationSortByStart {
741 bool operator() (Location *a, Location *b) {
742 return a->start() < b->start();
747 LocationUI::map_locations (Locations::LocationList& locations)
749 Locations::LocationList::iterator i;
753 Locations::LocationList temp = locations;
754 LocationSortByStart cmp;
759 Box_Helpers::BoxList & loc_children = location_rows.children();
760 Box_Helpers::BoxList & range_children = range_rows.children();
761 LocationEditRow * erow;
763 for (n = 0, i = locations.begin(); i != locations.end(); ++n, ++i) {
767 if (location->is_mark()) {
769 erow = manage (new LocationEditRow(session, location, mark_n));
770 erow->remove_requested.connect (mem_fun(*this, &LocationUI::location_remove_requested));
771 erow->redraw_ranges.connect (mem_fun(*this, &LocationUI::location_redraw_ranges));
772 loc_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
774 else if (location->is_auto_punch()) {
775 punch_edit_row.set_session (session);
776 punch_edit_row.set_location (location);
778 else if (location->is_auto_loop()) {
779 loop_edit_row.set_session (session);
780 loop_edit_row.set_location (location);
783 erow = manage (new LocationEditRow(session, location));
784 erow->remove_requested.connect (mem_fun(*this, &LocationUI::location_remove_requested));
785 range_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
789 range_rows.show_all();
790 location_rows.show_all();
794 LocationUI::add_new_location()
797 jack_nframes_t where = session->audible_frame();
798 Location *location = new Location (where, where, "mark", Location::IsMark);
799 session->begin_reversible_command (_("add marker"));
800 session->add_undo (session->locations()->get_memento());
801 session->locations()->add (location, true);
802 session->add_redo_no_execute (session->locations()->get_memento());
803 session->commit_reversible_command ();
809 LocationUI::add_new_range()
812 jack_nframes_t where = session->audible_frame();
813 Location *location = new Location (where, where, "unnamed");
814 session->begin_reversible_command (_("add range marker"));
815 session->add_undo (session->locations()->get_memento());
816 session->locations()->add (location, true);
817 session->add_redo_no_execute (session->locations()->get_memento());
818 session->commit_reversible_command ();
824 LocationUI::refresh_location_list_s (Change ignored)
826 ENSURE_GUI_THREAD(bind (mem_fun(*this, &LocationUI::refresh_location_list_s), ignored));
828 refresh_location_list ();
832 LocationUI::refresh_location_list ()
834 ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::refresh_location_list));
835 using namespace Box_Helpers;
837 BoxList & loc_children = location_rows.children();
838 BoxList & range_children = range_rows.children();
840 loc_children.clear();
841 range_children.clear();
844 session->locations()->apply (*this, &LocationUI::map_locations);
850 LocationUI::set_session(ARDOUR::Session* sess)
852 ArdourDialog::set_session (sess);
855 session->locations()->changed.connect (mem_fun(*this, &LocationUI::refresh_location_list));
856 session->locations()->StateChanged.connect (mem_fun(*this, &LocationUI::refresh_location_list_s));
857 session->locations()->added.connect (mem_fun(*this, &LocationUI::location_added));
858 session->locations()->removed.connect (mem_fun(*this, &LocationUI::location_removed));
859 session->going_away.connect (mem_fun(*this, &LocationUI::session_gone));
861 refresh_location_list ();
865 LocationUI::session_gone()
867 ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::session_gone));
871 using namespace Box_Helpers;
872 BoxList & loc_children = location_rows.children();
873 BoxList & range_children = range_rows.children();
875 loc_children.clear();
876 range_children.clear();
878 loop_edit_row.set_session (0);
879 loop_edit_row.set_location (0);
881 punch_edit_row.set_session (0);
882 punch_edit_row.set_location (0);
884 ArdourDialog::session_gone();