void
Selection::clear_time ()
{
- time.track.reset ();
+ time.track = 0;
time.group = 0;
time.clear();
}
void
-Selection::toggle (const list<TimeAxisViewPtr>& track_list)
+Selection::toggle (const list<TimeAxisView*>& track_list)
{
- for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
+ for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
toggle ( (*i) );
}
}
void
-Selection::toggle (TimeAxisViewPtr track)
+Selection::toggle (TimeAxisView* track)
{
TrackSelection::iterator i;
if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
- void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove;
- boost::weak_ptr<TimeAxisView> w (track);
- track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w));
+ void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
+ track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track));
tracks.push_back (track);
} else {
tracks.erase (i);
}
void
-Selection::add (const list<TimeAxisViewPtr>& track_list)
+Selection::add (const list<TimeAxisView*>& track_list)
{
- list<TimeAxisViewPtr> added = tracks.add (track_list);
+ list<TimeAxisView*> added = tracks.add (track_list);
- for (list<TimeAxisViewPtr>::const_iterator i = added.begin(); i != added.end(); ++i) {
- void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove;
- boost::weak_ptr<TimeAxisView> w (*i);
- (*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w));
+ for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) {
+ void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
+ (*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), (*i)));
}
if (!added.empty()) {
}
void
-Selection::add (TimeAxisViewPtr track)
+Selection::add (TimeAxisView* track)
{
if (find (tracks.begin(), tracks.end(), track) == tracks.end()) {
- void (Selection::*pmf)(TimeAxisViewPtr) = &Selection::remove;
+ void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track));
tracks.push_back (track);
TracksChanged();
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
changed = regions.add ((*i));
if (Config->get_link_region_and_track_selection() && changed) {
- add ((*i)->get_trackview());
+ add (&(*i)->get_trackview());
}
}
}
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
changed = regions.add ((*i));
if (Config->get_link_region_and_track_selection() && changed) {
- add ((*i)->get_trackview());
+ add (&(*i)->get_trackview());
}
}
}
if (find (regions.begin(), regions.end(), r) == regions.end()) {
regions.add (r);
if (Config->get_link_region_and_track_selection()) {
- add (r->get_trackview());
+ add (&r->get_trackview());
}
RegionsChanged ();
}
}
void
-Selection::remove (TimeAxisViewPtr track)
+Selection::remove (TimeAxisView* track)
{
- list<TimeAxisViewPtr>::iterator i;
+ list<TimeAxisView*>::iterator i;
if ((i = find (tracks.begin(), tracks.end(), track)) != tracks.end()) {
tracks.erase (i);
TracksChanged();
}
void
-Selection::remove (boost::weak_ptr<TimeAxisView> w)
-{
- boost::shared_ptr<TimeAxisView> t = w.lock ();
- if (t) {
- remove (t);
- }
-}
-
-void
-Selection::remove (const list<TimeAxisViewPtr>& track_list)
+Selection::remove (const list<TimeAxisView*>& track_list)
{
bool changed = false;
- for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
+ for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
- list<TimeAxisViewPtr>::iterator x;
+ list<TimeAxisView*>::iterator x;
if ((x = find (tracks.begin(), tracks.end(), (*i))) != tracks.end()) {
tracks.erase (x);
}
if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_trackview())) {
- remove (r->get_trackview());
+ remove (&r->get_trackview());
}
}
}
void
-Selection::remove (nframes_t start, nframes_t end)
+Selection::remove (nframes_t /*start*/, nframes_t /*end*/)
{
}
}
void
-Selection::set (TimeAxisViewPtr track)
+Selection::set (TimeAxisView* track)
{
clear_tracks ();
add (track);
}
void
-Selection::set (const list<TimeAxisViewPtr>& track_list)
+Selection::set (const list<TimeAxisView*>& track_list)
{
clear_tracks ();
add (track_list);
}
long
-Selection::set (TimeAxisViewPtr track, nframes_t start, nframes_t end)
+Selection::set (TimeAxisView* track, nframes_t start, nframes_t end)
{
if ((start == 0 && end == 0) || end < start) {
return 0;
time.track = track;
time.group = track->route_group();
} else {
- time.track.reset ();
+ time.track = 0;
time.group = 0;
}
}
bool
-Selection::selected (TimeAxisViewPtr tv)
+Selection::selected (TimeAxisView* tv)
{
return find (tracks.begin(), tracks.end(), tv) != tracks.end();
}