13
0

Completed playlist copy constructor. Also fixed issue with layering in

Playlist::set_state().


git-svn-id: svn://localhost/trunk/ardour2@401 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sampo Savolainen 2006-03-16 21:49:44 +00:00
parent 58375e9dfb
commit eea23395af
2 changed files with 32 additions and 13 deletions

View File

@ -95,7 +95,6 @@ AudioPlaylist::AudioPlaylist (const AudioPlaylist& other, string name, bool hidd
AudioRegion *out = dynamic_cast<AudioRegion*>( (*out_n) );
Crossfade *new_fade = new Crossfade( *(*xfades), in, out);
add_crossfade(*new_fade);
cerr << "Here we go!" << endl;
break;
}
@ -106,9 +105,6 @@ AudioPlaylist::AudioPlaylist (const AudioPlaylist& other, string name, bool hidd
}
}
in_o++;
in_n++;
}

View File

@ -98,15 +98,32 @@ Playlist::Playlist (const Playlist& other, string namestr, bool hide)
{
init (hide);
_edit_mode = other._edit_mode;
RegionList tmp;
other.copy_regions (tmp);
in_set_state = true;
for (list<Region*>::iterator x = tmp.begin(); x != tmp.end(); ++x) {
add_region_internal( (*x), (*x)->position() );
}
in_set_state = false;
_splicing = other._splicing;
_nudging = other._nudging;
other.copy_regions (regions);
_edit_mode = other._edit_mode;
for (list<Region*>::iterator x = regions.begin(); x != regions.end(); ++x) {
(*x)->set_playlist (this);
}
in_set_state = false;
in_flush = false;
in_partition = false;
subcnt = 0;
_read_data_count = 0;
_frozen = other._frozen;
save_on_thaw = false;
layer_op_counter = other.layer_op_counter;
freeze_length = other.freeze_length;
}
Playlist::Playlist (const Playlist& other, jack_nframes_t start, jack_nframes_t cnt, string str, bool hide)
@ -413,8 +430,10 @@ Playlist::flush_notifications ()
}
if (n || pending_modified) {
possibly_splice ();
relayer ();
if (!in_set_state) {
possibly_splice ();
relayer ();
}
pending_modified = false;
Modified (); /* EMIT SIGNAL */
}
@ -1330,9 +1349,13 @@ Playlist::set_state (const XMLNode& node)
add_region (*region, region->position(), 1.0, false);
// So that layer_op ordering doesn't get screwed up
region->set_last_layer_op( region->layer());
}
}
/* update dependents, which was not done during add_region_internal
due to in_set_state being true
*/
@ -1340,7 +1363,7 @@ Playlist::set_state (const XMLNode& node)
for (RegionList::iterator r = regions.begin(); r != regions.end(); ++r) {
check_dependents (**r, false);
}
in_set_state = false;
return 0;