2 Copyright (C) 2002 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.
21 #include <sigc++/bind.h>
22 #include "pbd/error.h"
23 #include "pbd/stacktrace.h"
25 #include "ardour/playlist.h"
26 #include "ardour/rc_configuration.h"
28 #include "gui_thread.h"
29 #include "midi_cut_buffer.h"
30 #include "region_view.h"
31 #include "selection.h"
32 #include "selection_templates.h"
33 #include "time_axis_view.h"
34 #include "automation_time_axis.h"
35 #include "public_editor.h"
36 #include "control_point.h"
41 using namespace ARDOUR;
44 struct AudioRangeComparator {
45 bool operator()(AudioRange a, AudioRange b) {
46 return a.start < b.start;
50 Selection::Selection (const PublicEditor* e)
54 , _no_tracks_changed (false)
58 /* we have disambiguate which remove() for the compiler */
60 void (Selection::*track_remove)(TimeAxisView*) = &Selection::remove;
61 TimeAxisView::CatchDeletion.connect (*this, MISSING_INVALIDATOR, boost::bind (track_remove, this, _1), gui_context());
63 void (Selection::*marker_remove)(Marker*) = &Selection::remove;
64 Marker::CatchDeletion.connect (*this, MISSING_INVALIDATOR, boost::bind (marker_remove, this, _1), gui_context());
66 void (Selection::*point_remove)(ControlPoint*) = &Selection::remove;
67 ControlPoint::CatchDeletion.connect (*this, MISSING_INVALIDATOR, boost::bind (point_remove, this, _1), gui_context());
72 Selection::operator= (const Selection& other)
75 regions = other.regions;
76 tracks = other.tracks;
79 midi_regions = other.midi_regions;
80 midi_notes = other.midi_notes;
87 operator== (const Selection& a, const Selection& b)
89 return a.regions == b.regions &&
90 a.tracks == b.tracks &&
93 a.playlists == b.playlists &&
94 a.midi_notes == b.midi_notes &&
95 a.midi_regions == b.midi_regions;
98 /** Clear everything from the Selection */
109 clear_midi_regions ();
114 Selection::clear_objects ()
121 clear_midi_regions ();
125 Selection::clear_tracks ()
127 if (!tracks.empty()) {
129 if (!_no_tracks_changed) {
136 Selection::clear_time ()
144 Selection::dump_region_layers()
146 cerr << "region selection layer dump" << endl;
147 for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) {
148 cerr << "layer: " << (int)(*i)->region()->layer() << endl;
154 Selection::clear_regions ()
156 if (!regions.empty()) {
157 regions.clear_all ();
159 if (Config->get_link_region_and_track_selection()) {
166 Selection::clear_midi_notes ()
168 if (!midi_notes.empty()) {
169 for (MidiNoteSelection::iterator x = midi_notes.begin(); x != midi_notes.end(); ++x) {
178 Selection::clear_midi_regions ()
180 if (!midi_regions.empty()) {
181 midi_regions.clear ();
182 MidiRegionsChanged ();
187 Selection::clear_playlists ()
189 /* Selections own their playlists */
191 for (PlaylistSelection::iterator i = playlists.begin(); i != playlists.end(); ++i) {
192 /* selections own their own regions, which are copies of the "originals". make them go away */
193 (*i)->drop_regions ();
197 if (!playlists.empty()) {
204 Selection::clear_lines ()
206 if (!lines.empty()) {
213 Selection::clear_markers ()
215 if (!markers.empty()) {
222 Selection::toggle (boost::shared_ptr<Playlist> pl)
224 clear_time(); //enforce object/range exclusivity
226 PlaylistSelection::iterator i;
228 if ((i = find (playlists.begin(), playlists.end(), pl)) == playlists.end()) {
230 playlists.push_back(pl);
239 Selection::toggle (const TrackViewList& track_list)
241 for (TrackViewList::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
247 Selection::toggle (TimeAxisView* track)
249 TrackSelection::iterator i;
251 if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
252 tracks.push_back (track);
257 if (!_no_tracks_changed) {
263 Selection::toggle (const MidiNoteSelection& midi_note_list)
265 clear_time(); //enforce object/range exclusivity
267 for (MidiNoteSelection::const_iterator i = midi_note_list.begin(); i != midi_note_list.end(); ++i) {
273 Selection::toggle (MidiCutBuffer* midi)
275 MidiNoteSelection::iterator i;
277 if ((i = find (midi_notes.begin(), midi_notes.end(), midi)) == midi_notes.end()) {
278 midi_notes.push_back (midi);
280 /* remember that we own the MCB */
282 midi_notes.erase (i);
290 Selection::toggle (RegionView* r)
292 clear_time(); //enforce object/range exclusivity
294 RegionSelection::iterator i;
296 if ((i = find (regions.begin(), regions.end(), r)) == regions.end()) {
306 Selection::toggle (MidiRegionView* mrv)
308 clear_time(); //enforce object/range exclusivity
310 MidiRegionSelection::iterator i;
312 if ((i = find (midi_regions.begin(), midi_regions.end(), mrv)) == midi_regions.end()) {
315 midi_regions.erase (i);
318 MidiRegionsChanged ();
322 Selection::toggle (vector<RegionView*>& r)
324 clear_time(); //enforce object/range exclusivity
326 RegionSelection::iterator i;
328 for (vector<RegionView*>::iterator x = r.begin(); x != r.end(); ++x) {
329 if ((i = find (regions.begin(), regions.end(), (*x))) == regions.end()) {
340 Selection::toggle (framepos_t start, framepos_t end)
342 clear_objects(); //enforce object/range exclusivity
344 AudioRangeComparator cmp;
346 /* XXX this implementation is incorrect */
348 time.push_back (AudioRange (start, end, ++next_time_id));
358 Selection::add (boost::shared_ptr<Playlist> pl)
360 clear_time(); //enforce object/range exclusivity
362 if (find (playlists.begin(), playlists.end(), pl) == playlists.end()) {
364 playlists.push_back(pl);
370 Selection::add (const list<boost::shared_ptr<Playlist> >& pllist)
372 clear_time(); //enforce object/range exclusivity
374 bool changed = false;
376 for (list<boost::shared_ptr<Playlist> >::const_iterator i = pllist.begin(); i != pllist.end(); ++i) {
377 if (find (playlists.begin(), playlists.end(), (*i)) == playlists.end()) {
379 playlists.push_back (*i);
390 Selection::add (const TrackViewList& track_list)
392 TrackViewList added = tracks.add (track_list);
394 if (!added.empty()) {
395 if (!_no_tracks_changed) {
402 Selection::add (TimeAxisView* track)
405 tr.push_back (track);
410 Selection::add (const MidiNoteSelection& midi_list)
412 clear_time(); //enforce object/range exclusivity
414 const MidiNoteSelection::const_iterator b = midi_list.begin();
415 const MidiNoteSelection::const_iterator e = midi_list.end();
417 if (!midi_list.empty()) {
418 midi_notes.insert (midi_notes.end(), b, e);
424 Selection::add (MidiCutBuffer* midi)
426 /* we take ownership of the MCB */
428 if (find (midi_notes.begin(), midi_notes.end(), midi) == midi_notes.end()) {
429 midi_notes.push_back (midi);
435 Selection::add (vector<RegionView*>& v)
437 clear_time(); //enforce object/range exclusivity
439 /* XXX This method or the add (const RegionSelection&) needs to go
442 bool changed = false;
444 for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
445 if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
446 changed = regions.add ((*i));
447 if (Config->get_link_region_and_track_selection() && changed) {
448 add (&(*i)->get_time_axis_view());
459 Selection::add (const RegionSelection& rs)
461 clear_time(); //enforce object/range exclusivity
463 /* XXX This method or the add (const vector<RegionView*>&) needs to go
466 bool changed = false;
468 for (RegionSelection::const_iterator i = rs.begin(); i != rs.end(); ++i) {
469 if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
470 changed = regions.add ((*i));
471 if (Config->get_link_region_and_track_selection() && changed) {
472 add (&(*i)->get_time_axis_view());
483 Selection::add (RegionView* r)
485 clear_time(); //enforce object/range exclusivity
487 if (find (regions.begin(), regions.end(), r) == regions.end()) {
488 bool changed = regions.add (r);
489 if (Config->get_link_region_and_track_selection() && changed) {
490 add (&r->get_time_axis_view());
499 Selection::add (MidiRegionView* mrv)
501 clear_time(); //enforce object/range exclusivity
503 if (find (midi_regions.begin(), midi_regions.end(), mrv) == midi_regions.end()) {
504 midi_regions.push_back (mrv);
505 /* XXX should we do this? */
507 if (Config->get_link_region_and_track_selection()) {
508 add (&mrv->get_time_axis_view());
511 MidiRegionsChanged ();
516 Selection::add (framepos_t start, framepos_t end)
518 clear_objects(); //enforce object/range exclusivity
520 AudioRangeComparator cmp;
522 /* XXX this implementation is incorrect */
524 time.push_back (AudioRange (start, end, ++next_time_id));
534 Selection::move_time (framecnt_t distance)
540 for (list<AudioRange>::iterator i = time.begin(); i != time.end(); ++i) {
541 (*i).start += distance;
542 (*i).end += distance;
549 Selection::replace (uint32_t sid, framepos_t start, framepos_t end)
551 clear_objects(); //enforce object/range exclusivity
553 for (list<AudioRange>::iterator i = time.begin(); i != time.end(); ++i) {
554 if ((*i).id == sid) {
556 time.push_back (AudioRange(start,end, sid));
558 /* don't consolidate here */
561 AudioRangeComparator cmp;
571 Selection::add (boost::shared_ptr<Evoral::ControlList> cl)
573 clear_time(); //enforce object/range exclusivity
575 boost::shared_ptr<ARDOUR::AutomationList> al
576 = boost::dynamic_pointer_cast<ARDOUR::AutomationList>(cl);
578 warning << "Programming error: Selected list is not an ARDOUR::AutomationList" << endmsg;
581 if (find (lines.begin(), lines.end(), al) == lines.end()) {
582 lines.push_back (al);
588 Selection::remove (TimeAxisView* track)
590 list<TimeAxisView*>::iterator i;
591 if ((i = find (tracks.begin(), tracks.end(), track)) != tracks.end()) {
593 if (!_no_tracks_changed) {
600 Selection::remove (ControlPoint* p)
602 PointSelection::iterator i = find (points.begin(), points.end(), p);
603 if (i != points.end ()) {
609 Selection::remove (const TrackViewList& track_list)
611 bool changed = false;
613 for (TrackViewList::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
615 TrackViewList::iterator x = find (tracks.begin(), tracks.end(), *i);
616 if (x != tracks.end()) {
623 if (!_no_tracks_changed) {
630 Selection::remove (const MidiNoteSelection& midi_list)
632 bool changed = false;
634 for (MidiNoteSelection::const_iterator i = midi_list.begin(); i != midi_list.end(); ++i) {
636 MidiNoteSelection::iterator x;
638 if ((x = find (midi_notes.begin(), midi_notes.end(), (*i))) != midi_notes.end()) {
639 midi_notes.erase (x);
650 Selection::remove (MidiCutBuffer* midi)
652 MidiNoteSelection::iterator x;
654 if ((x = find (midi_notes.begin(), midi_notes.end(), midi)) != midi_notes.end()) {
655 /* remember that we own the MCB */
657 midi_notes.erase (x);
663 Selection::remove (boost::shared_ptr<Playlist> track)
665 list<boost::shared_ptr<Playlist> >::iterator i;
666 if ((i = find (playlists.begin(), playlists.end(), track)) != playlists.end()) {
673 Selection::remove (const list<boost::shared_ptr<Playlist> >& pllist)
675 bool changed = false;
677 for (list<boost::shared_ptr<Playlist> >::const_iterator i = pllist.begin(); i != pllist.end(); ++i) {
679 list<boost::shared_ptr<Playlist> >::iterator x;
681 if ((x = find (playlists.begin(), playlists.end(), (*i))) != playlists.end()) {
693 Selection::remove (RegionView* r)
695 if (regions.remove (r)) {
699 if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_time_axis_view())) {
700 remove (&r->get_time_axis_view());
705 Selection::remove (MidiRegionView* mrv)
707 MidiRegionSelection::iterator x;
709 if ((x = find (midi_regions.begin(), midi_regions.end(), mrv)) != midi_regions.end()) {
710 midi_regions.erase (x);
711 MidiRegionsChanged ();
715 /* XXX fix this up ? */
716 if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_time_axis_view())) {
717 remove (&r->get_time_axis_view());
724 Selection::remove (uint32_t selection_id)
730 for (list<AudioRange>::iterator i = time.begin(); i != time.end(); ++i) {
731 if ((*i).id == selection_id) {
741 Selection::remove (framepos_t /*start*/, framepos_t /*end*/)
746 Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac)
748 AutomationSelection::iterator i;
749 if ((i = find (lines.begin(), lines.end(), ac)) != lines.end()) {
756 Selection::set (TimeAxisView* track)
763 Selection::set (const TrackViewList& track_list)
770 Selection::set (const MidiNoteSelection& midi_list)
772 clear_time (); //enforce region/object exclusivity
778 Selection::set (boost::shared_ptr<Playlist> playlist)
780 clear_time (); //enforce region/object exclusivity
786 Selection::set (const list<boost::shared_ptr<Playlist> >& pllist)
788 clear_time(); //enforce region/object exclusivity
794 Selection::set (const RegionSelection& rs)
796 clear_time(); //enforce region/object exclusivity
799 RegionsChanged(); /* EMIT SIGNAL */
803 Selection::set (MidiRegionView* mrv)
805 clear_time(); //enforce region/object exclusivity
811 Selection::set (RegionView* r, bool also_clear_tracks)
813 clear_time(); //enforce region/object exclusivity
815 if (also_clear_tracks && !Config->get_link_region_and_track_selection()) {
816 /* clear_regions() will have done this if the link preference
825 Selection::set (vector<RegionView*>& v)
827 bool had_regions = !regions.empty();
829 clear_time(); //enforce region/object exclusivity
832 if (Config->get_link_region_and_track_selection()) {
834 /* there were regions before, so we're changing the
835 * region selection (likely), thus link region/track
836 * selection. relevant tracks will get selected
837 * as we ::add() below.
840 // make sure to deselect any automation selections
847 /** Set the start and end time of the time selection, without changing
848 * the list of tracks it applies to.
851 Selection::set (framepos_t start, framepos_t end)
853 clear_objects(); //enforce region/object exclusivity
856 if ((start == 0 && end == 0) || end < start) {
861 time.push_back (AudioRange (start, end, ++next_time_id));
863 /* reuse the first entry, and remove all the rest */
865 while (time.size() > 1) {
868 time.front().start = start;
869 time.front().end = end;
876 return time.front().id;
879 /** Set the start and end of the range selection. If more than one range
880 * is currently selected, the start of the earliest range and the end of the
881 * latest range are set. If no range is currently selected, this method
882 * selects a single range from start to end.
884 * @param start New start time.
885 * @param end New end time.
888 Selection::set_preserving_all_ranges (framepos_t start, framepos_t end)
890 clear_objects(); //enforce region/object exclusivity
892 if ((start == 0 && end == 0) || (end < start)) {
897 time.push_back (AudioRange (start, end, ++next_time_id));
899 time.sort (AudioRangeComparator ());
900 time.front().start = start;
901 time.back().end = end;
910 Selection::set (boost::shared_ptr<Evoral::ControlList> ac)
912 clear_time(); //enforce region/object exclusivity
919 Selection::selected (Marker* m)
921 return find (markers.begin(), markers.end(), m) != markers.end();
925 Selection::selected (TimeAxisView* tv)
927 return find (tracks.begin(), tracks.end(), tv) != tracks.end();
931 Selection::selected (RegionView* rv)
933 return find (regions.begin(), regions.end(), rv) != regions.end();
937 Selection::selected (ControlPoint* cp)
939 return find (points.begin(), points.end(), cp) != points.end();
943 Selection::empty (bool internal_selection)
945 bool object_level_empty = regions.empty () &&
948 playlists.empty () &&
951 playlists.empty () &&
956 if (!internal_selection) {
957 return object_level_empty;
960 /* this is intended to really only apply when using a Selection
964 return object_level_empty && midi_notes.empty();
968 Selection::toggle (ControlPoint* cp)
970 clear_time(); //enforce region/object exclusivity
972 cp->set_selected (!cp->get_selected ());
973 PointSelection::iterator i = find (points.begin(), points.end(), cp);
974 if (i == points.end()) {
975 points.push_back (cp);
980 PointsChanged (); /* EMIT SIGNAL */
984 Selection::toggle (vector<ControlPoint*> const & cps)
986 clear_time(); //enforce region/object exclusivity
988 for (vector<ControlPoint*>::const_iterator i = cps.begin(); i != cps.end(); ++i) {
994 Selection::toggle (list<Selectable*> const & selectables)
996 clear_time(); //enforce region/object exclusivity
1000 vector<RegionView*> rvs;
1001 vector<ControlPoint*> cps;
1003 for (std::list<Selectable*>::const_iterator i = selectables.begin(); i != selectables.end(); ++i) {
1004 if ((rv = dynamic_cast<RegionView*> (*i)) != 0) {
1006 } else if ((cp = dynamic_cast<ControlPoint*> (*i)) != 0) {
1009 fatal << _("programming error: ")
1010 << X_("unknown selectable type passed to Selection::toggle()")
1026 Selection::set (list<Selectable*> const & selectables)
1028 clear_time (); //enforce region/object exclusivity
1031 if (Config->get_link_region_and_track_selection ()) {
1039 Selection::add (PointSelection const & s)
1041 clear_time (); //enforce region/object exclusivity
1043 for (PointSelection::const_iterator i = s.begin(); i != s.end(); ++i) {
1044 points.push_back (*i);
1049 Selection::add (list<Selectable*> const & selectables)
1051 clear_time (); //enforce region/object exclusivity
1055 vector<RegionView*> rvs;
1056 vector<ControlPoint*> cps;
1058 for (std::list<Selectable*>::const_iterator i = selectables.begin(); i != selectables.end(); ++i) {
1059 if ((rv = dynamic_cast<RegionView*> (*i)) != 0) {
1061 } else if ((cp = dynamic_cast<ControlPoint*> (*i)) != 0) {
1064 fatal << _("programming error: ")
1065 << X_("unknown selectable type passed to Selection::add()")
1081 Selection::clear_points ()
1083 if (!points.empty()) {
1090 Selection::add (ControlPoint* cp)
1092 clear_time (); //enforce region/object exclusivity
1094 cp->set_selected (true);
1095 points.push_back (cp);
1096 PointsChanged (); /* EMIT SIGNAL */
1100 Selection::add (vector<ControlPoint*> const & cps)
1102 clear_time (); //enforce region/object exclusivity
1104 for (vector<ControlPoint*>::const_iterator i = cps.begin(); i != cps.end(); ++i) {
1105 (*i)->set_selected (true);
1106 points.push_back (*i);
1108 PointsChanged (); /* EMIT SIGNAL */
1112 Selection::set (ControlPoint* cp)
1114 clear_time (); //enforce region/object exclusivity
1116 if (cp->get_selected()) {
1120 for (uint32_t i = 0; i < cp->line().npoints(); ++i) {
1121 cp->line().nth (i)->set_selected (false);
1129 Selection::set (Marker* m)
1131 clear_time (); //enforce region/object exclusivity
1138 Selection::toggle (Marker* m)
1140 MarkerSelection::iterator i;
1142 if ((i = find (markers.begin(), markers.end(), m)) == markers.end()) {
1150 Selection::remove (Marker* m)
1152 MarkerSelection::iterator i;
1154 if ((i = find (markers.begin(), markers.end(), m)) != markers.end()) {
1161 Selection::add (Marker* m)
1163 clear_time (); //enforce region/object exclusivity
1165 if (find (markers.begin(), markers.end(), m) == markers.end()) {
1166 markers.push_back (m);
1172 Selection::add (const list<Marker*>& m)
1174 clear_time (); //enforce region/object exclusivity
1176 markers.insert (markers.end(), m.begin(), m.end());
1184 MarkerSelection::range (framepos_t& s, framepos_t& e)
1189 for (MarkerSelection::iterator i = begin(); i != end(); ++i) {
1191 if ((*i)->position() < s) {
1192 s = (*i)->position();
1195 if ((*i)->position() > e) {
1196 e = (*i)->position();
1200 s = std::min (s, e);
1201 e = std::max (s, e);
1205 Selection::get_state () const
1207 /* XXX: not complete; just sufficient to get track selection state
1208 so that re-opening plugin windows for editor mixer strips works
1211 XMLNode* node = new XMLNode (X_("Selection"));
1213 for (TrackSelection::const_iterator i = tracks.begin(); i != tracks.end(); ++i) {
1214 RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
1215 AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (*i);
1217 XMLNode* t = node->add_child (X_("RouteView"));
1218 t->add_property (X_("id"), atoi (rtv->route()->id().to_s().c_str()));
1220 XMLNode* t = node->add_child (X_("AutomationView"));
1221 t->add_property (X_("id"), atoi (atv->parent_route()->id().to_s().c_str()));
1222 t->add_property (X_("parameter"), EventTypeMap::instance().to_symbol (atv->parameter ()));
1226 for (MarkerSelection::const_iterator i = markers.begin(); i != markers.end(); ++i) {
1227 XMLNode* t = node->add_child (X_("Marker"));
1230 Location* loc = editor->find_location_from_marker (*i, is_start);
1232 t->add_property (X_("id"), atoi (loc->id().to_s().c_str()));
1233 t->add_property (X_("start"), is_start ? X_("yes") : X_("no"));
1240 Selection::set_state (XMLNode const & node, int)
1242 if (node.name() != X_("Selection")) {
1246 XMLNodeList children = node.children ();
1247 for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
1248 if ((*i)->name() == X_("RouteView")) {
1250 XMLProperty* prop_id = (*i)->property (X_("id"));
1252 PBD::ID id (prop_id->value ());
1253 RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (id);
1258 } else if ((*i)->name() == X_("AutomationView")) {
1260 XMLProperty* prop_id = (*i)->property (X_("id"));
1261 XMLProperty* prop_parameter = (*i)->property (X_("parameter"));
1264 assert (prop_parameter);
1266 PBD::ID id (prop_id->value ());
1267 RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (id);
1270 boost::shared_ptr<AutomationTimeAxisView> atv = rtv->automation_child (EventTypeMap::instance().new_parameter (prop_parameter->value ()));
1272 /* the automation could be for an entity that was never saved
1273 in the session file. Don't freak out if we can't find
1282 } else if ((*i)->name() == X_("Marker")) {
1284 XMLProperty* prop_id = (*i)->property (X_("id"));
1285 XMLProperty* prop_start = (*i)->property (X_("start"));
1287 assert (prop_start);
1289 PBD::ID id (prop_id->value ());
1290 Marker* m = editor->find_marker_from_location_id (id, string_is_affirmative (prop_start->value ()));
1303 Selection::remove_regions (TimeAxisView* t)
1305 RegionSelection::iterator i = regions.begin();
1306 while (i != regions.end ()) {
1307 RegionSelection::iterator tmp = i;
1310 if (&(*i)->get_time_axis_view() == t) {
1319 Selection::block_tracks_changed (bool yn)
1321 _no_tracks_changed = yn;