Fix to stacked layering for the case when a region is dragged to overlap another. Remove unused signal LayeringChanged from Playlist. Cleanups in AudioRegion, and ensure that region envelopes cannot become empty when regions are split (and maybe in some other cases too). Empty envelopes cause crashes when e.g. AutomationList::truncate_at_start() is called.

git-svn-id: svn://localhost/ardour2/trunk@2513 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2007-10-04 16:26:02 +00:00
parent 79db28b0b8
commit 811426b5b3
4 changed files with 10 additions and 24 deletions

View file

@ -398,7 +398,6 @@ AudioStreamView::redisplay_diskstream ()
region_views.erase (i);
} else {
(*i)->enable_display(true);
(*i)->set_y_position_and_height(0, height);
}
i = tmp;

View file

@ -215,7 +215,6 @@ StreamView::playlist_modified (boost::shared_ptr<Diskstream> ds)
if (ds->playlist()) {
layers = ds->playlist()->top_layer() + 1;
update_contents_y_position_and_height ();
redisplay_diskstream ();
}
}
@ -235,17 +234,16 @@ StreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
playlist_connections.clear();
undisplay_diskstream ();
/* update layers count and the y positions and heights of our regions */
layers = ds->playlist()->top_layer() + 1;
update_contents_y_position_and_height ();
/* draw it */
redisplay_diskstream ();
/* catch changes */
playlist_connections.push_back (ds->playlist()->Modified.connect (bind (mem_fun (*this, &StreamView::playlist_modified_weak), ds)));
/* update layers count and the y positions and heights of our regions */
layers = ds->playlist()->top_layer() + 1;
update_contents_y_position_and_height ();
}
void

View file

@ -117,7 +117,6 @@ class Playlist : public SessionObject, public boost::enable_shared_from_this<Pla
sigc::signal<void> Modified;
sigc::signal<void> NameChanged;
sigc::signal<void> LengthChanged;
sigc::signal<void> LayeringChanged;
static string bump_name (string old_name, Session&);
static string bump_name_once (string old_name);

View file

@ -128,9 +128,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, nframes_t
, _envelope (new AutomationList(Parameter(EnvelopeAutomation), 0.0, 2.0, 1.0))
{
/* return to default fades if the existing ones are too long */
_fade_in_disabled = 0;
_fade_out_disabled = 0;
init ();
if (_flags & LeftOfSplit) {
if (_fade_in->back()->when >= _length) {
@ -154,8 +152,6 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, nframes_t
_scale_amplitude = other->_scale_amplitude;
listen_to_my_curves ();
assert(_type == DataType::AUDIO);
}
@ -168,8 +164,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other)
_scale_amplitude = other->_scale_amplitude;
_envelope = other->_envelope;
_fade_in_disabled = 0;
_fade_out_disabled = 0;
set_default_fades ();
listen_to_my_curves ();
@ -187,14 +182,12 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, const XMLNode& nod
afs->HeaderPositionOffsetChanged.connect (mem_fun (*this, &AudioRegion::source_offset_changed));
}
set_default_fades ();
init ();
if (set_state (node)) {
throw failed_constructor();
}
listen_to_my_curves ();
assert(_type == DataType::AUDIO);
}
@ -204,15 +197,12 @@ AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node)
, _fade_out (new AutomationList(Parameter(FadeOutAutomation), 0.0, 2.0, 1.0))
, _envelope (new AutomationList(Parameter(EnvelopeAutomation), 0.0, 2.0, 1.0))
{
set_default_fades ();
_scale_amplitude = 1.0;
init ();
if (set_state (node)) {
throw failed_constructor();
}
listen_to_my_curves ();
assert(_type == DataType::AUDIO);
}
@ -551,7 +541,7 @@ AudioRegion::state (bool full)
default_env = true;
}
}
if (default_env) {
child->add_property ("default", "yes");
} else {
@ -616,7 +606,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
child = (*niter);
if (child->name() == "Envelope") {
_envelope->clear ();
if ((prop = child->property ("default")) != 0 || _envelope->set_state (*child)) {