summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/playlist.h9
-rw-r--r--libs/ardour/audio_diskstream.cc2
-rw-r--r--libs/ardour/audio_playlist.cc4
-rw-r--r--libs/ardour/audioregion.cc45
-rw-r--r--libs/ardour/automation_list.cc1
-rw-r--r--libs/ardour/crossfade.cc6
-rw-r--r--libs/ardour/diskstream.cc2
-rw-r--r--libs/ardour/midi_playlist.cc2
-rw-r--r--libs/ardour/playlist.cc169
-rw-r--r--libs/ardour/region.cc13
10 files changed, 174 insertions, 79 deletions
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 8bcdc5540b..fb734458d5 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -130,11 +130,12 @@ class Playlist : public SessionObject
XMLNode& get_template ();
PBD::Signal1<void,bool> InUse;
- PBD::Signal0<void> Modified;
+ PBD::Signal0<void> ContentsChanged;
PBD::Signal1<void,boost::weak_ptr<Region> > RegionAdded;
PBD::Signal1<void,boost::weak_ptr<Region> > RegionRemoved;
PBD::Signal0<void> NameChanged;
PBD::Signal0<void> LengthChanged;
+ PBD::Signal0<void> LayeringChanged;
PBD::Signal1<void,std::list< Evoral::RangeMove<nframes_t> > const &> RangesMoved;
static std::string bump_name (std::string old_name, Session&);
@@ -201,7 +202,8 @@ class Playlist : public SessionObject
std::set<boost::shared_ptr<Region> > pending_adds;
std::set<boost::shared_ptr<Region> > pending_removes;
RegionList pending_bounds;
- bool pending_modified;
+ bool pending_contents_change;
+ bool pending_layering;
bool pending_length;
std::list< Evoral::RangeMove<nframes_t> > pending_range_moves;
bool save_on_thaw;
@@ -240,12 +242,13 @@ class Playlist : public SessionObject
void delay_notifications ();
void release_notifications ();
virtual void flush_notifications ();
+ void clear_pending ();
void notify_region_removed (boost::shared_ptr<Region>);
void notify_region_added (boost::shared_ptr<Region>);
void notify_length_changed ();
void notify_layering_changed ();
- void notify_modified ();
+ void notify_contents_changed ();
void notify_state_changed (Change);
void notify_region_moved (boost::shared_ptr<Region>);
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index fb225671e9..db1a343d17 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -1451,7 +1451,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
process. this problem is deferred to the UI.
*/
- _playlist->Modified();
+ _playlist->LayeringChanged(); // XXX this may not get the UI to do the right thing
} else {
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index 1ecba28653..7f75d44852 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -738,7 +738,7 @@ AudioPlaylist::crossfade_changed (Change)
that occured.
*/
- notify_modified ();
+ notify_contents_changed ();
}
bool
@@ -760,7 +760,7 @@ AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> re
parent_wants_notify = Playlist::region_changed (what_changed, region);
if ((parent_wants_notify || (what_changed & our_interests))) {
- notify_modified ();
+ notify_contents_changed ();
}
return true;
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 5a99c164d9..729398cf21 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -294,6 +294,8 @@ AudioRegion::connect_to_header_position_offset_changed ()
void
AudioRegion::listen_to_my_curves ()
{
+ cerr << _name << ": listeing my own curves\n";
+
_envelope->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::envelope_changed, this));
_fade_in->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fade_in_changed, this));
_fade_out->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fade_out_changed, this));
@@ -637,8 +639,15 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
const XMLNodeList& nlist = node.children();
const XMLProperty *prop;
LocaleGuard lg (X_("POSIX"));
+ boost::shared_ptr<Playlist> the_playlist (_playlist.lock());
+
+ freeze ();
+ if (the_playlist) {
+ the_playlist->freeze ();
+ }
Region::set_live_state (node, version, what_changed, false);
+ cerr << "After region SLS, wc = " << what_changed << endl;
uint32_t old_flags = _flags;
@@ -661,23 +670,32 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
if ((old_flags ^ _flags) & Muted) {
what_changed = Change (what_changed|MuteChanged);
+ cerr << _name << " mute changed\n";
}
if ((old_flags ^ _flags) & Opaque) {
what_changed = Change (what_changed|OpacityChanged);
+ cerr << _name << " opacity changed\n";
}
if ((old_flags ^ _flags) & Locked) {
what_changed = Change (what_changed|LockChanged);
+ cerr << _name << " lock changed\n";
}
if ((prop = node.property ("scale-gain")) != 0) {
- _scale_amplitude = atof (prop->value().c_str());
- what_changed = Change (what_changed|ScaleAmplitudeChanged);
+ float a = atof (prop->value().c_str());
+ if (a != _scale_amplitude) {
+ _scale_amplitude = a;
+ what_changed = Change (what_changed|ScaleAmplitudeChanged);
+ cerr << _name << " amp changed\n";
+ }
} else {
_scale_amplitude = 1.0;
}
/* Now find envelope description and other misc child items */
+ _envelope->freeze ();
+
for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
XMLNode *child;
@@ -685,6 +703,7 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
child = (*niter);
+#if 0
if (child->name() == "Envelope") {
_envelope->clear ();
@@ -696,6 +715,9 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
_envelope->set_max_xval (_length);
_envelope->truncate_end (_length);
+ cerr << _name << " envelope changd\n";
+
+
} else if (child->name() == "FadeIn") {
_fade_in->clear ();
@@ -716,6 +738,7 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
set_fade_in_active (false);
}
}
+ cerr << _name << " fadein changd\n";
} else if (child->name() == "FadeOut") {
@@ -737,14 +760,24 @@ AudioRegion::set_live_state (const XMLNode& node, int version, Change& what_chan
set_fade_out_active (false);
}
}
+ cerr << _name << " fadeout changd\n";
}
+#endif
}
+ _envelope->thaw ();
+ thaw ("");
+
if (send) {
+ cerr << _name << ": audio final change: " << hex << what_changed << dec << endl;
send_change (what_changed);
}
+ if (the_playlist) {
+ the_playlist->thaw ();
+ }
+
return 0;
}
@@ -836,8 +869,6 @@ AudioRegion::set_fade_in (FadeShape shape, nframes_t len)
}
_fade_in->thaw ();
-
- send_change (FadeInChanged);
}
void
@@ -903,8 +934,6 @@ AudioRegion::set_fade_out (FadeShape shape, nframes_t len)
}
_fade_out->thaw ();
-
- send_change (FadeOutChanged);
}
void
@@ -1175,7 +1204,7 @@ AudioRegion::set_scale_amplitude (gain_t g)
/* tell the diskstream we're in */
if (pl) {
- pl->Modified();
+ pl->ContentsChanged();
}
/* tell everybody else */
@@ -1245,7 +1274,7 @@ AudioRegion::normalize_to (float target_dB)
boost::shared_ptr<Playlist> pl (playlist());
if (pl) {
- pl->Modified();
+ pl->ContentsChanged();
}
/* tell everybody else */
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 3ecf3f0172..479674aee6 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -219,6 +219,7 @@ AutomationList::thaw ()
ControlList::thaw();
if (_changed_when_thawed) {
+ _changed_when_thawed = false;
StateChanged(); /* EMIT SIGNAL */
}
}
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc
index 75f2bae587..fd59982f62 100644
--- a/libs/ardour/crossfade.cc
+++ b/libs/ardour/crossfade.cc
@@ -72,7 +72,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<Audio
nframes_t length,
nframes_t position,
AnchorPoint ap)
- : AudioRegion (in->session(), position, length, "foobar"),
+ : AudioRegion (in->session(), position, length, in->name() + string ("<>") + out->name()),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
@@ -89,7 +89,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<Audio
}
Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioRegion> b, CrossfadeModel model, bool act)
- : AudioRegion (a->session(), 0, 0, "foobar"),
+ : AudioRegion (a->session(), 0, 0, a->name() + string ("<>") + b->name()),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
{
@@ -107,7 +107,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioR
}
Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
- : AudioRegion (playlist.session(), 0, 0, "foobar"),
+ : AudioRegion (playlist.session(), 0, 0, "unnamed crossfade"),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 7920f3b279..a4f8c22e28 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -339,7 +339,7 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
reset_write_sources (false);
}
- _playlist->Modified.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_modified, this));
+ _playlist->ContentsChanged.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_modified, this));
_playlist->DropReferences.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist)));
_playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1));
}
diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc
index 789c91b236..1721647c7c 100644
--- a/libs/ardour/midi_playlist.cc
+++ b/libs/ardour/midi_playlist.cc
@@ -435,7 +435,7 @@ MidiPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> reg
parent_wants_notify = Playlist::region_changed (what_changed, region);
if ((parent_wants_notify || (what_changed & our_interests))) {
- notify_modified ();
+ notify_contents_changed ();
}
return true;
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index e638a7a6b0..689c1fe35b 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -251,8 +251,9 @@ Playlist::init (bool hide)
{
g_atomic_int_set (&block_notifications, 0);
g_atomic_int_set (&ignore_state_changes, 0);
- pending_modified = false;
+ pending_contents_change = false;
pending_length = false;
+ pending_layering = false;
first_set_state = true;
_refcnt = 0;
_hidden = hide;
@@ -270,7 +271,7 @@ Playlist::init (bool hide)
freeze_length = 0;
_explicit_relayering = false;
- Modified.connect_same_thread (*this, boost::bind (&Playlist::mark_session_dirty, this));
+ ContentsChanged.connect_same_thread (*this, boost::bind (&Playlist::mark_session_dirty, this));
}
Playlist::~Playlist ()
@@ -343,13 +344,28 @@ Playlist::release_notifications ()
}
void
-Playlist::notify_modified ()
+Playlist::notify_contents_changed ()
{
if (holding_state ()) {
- pending_modified = true;
+ pending_contents_change = true;
} else {
- pending_modified = false;
- Modified(); /* EMIT SIGNAL */
+ pending_contents_change = false;
+ cerr << _name << "send contents change @ " << get_microseconds() << endl;
+ ContentsChanged(); /* EMIT SIGNAL */
+ cerr << _name << "done with cc @ " << get_microseconds() << endl;
+ }
+}
+
+void
+Playlist::notify_layering_changed ()
+{
+ if (holding_state ()) {
+ pending_layering = true;
+ } else {
+ pending_layering = false;
+ cerr << _name << "send layering @ " << get_microseconds() << endl;
+ LayeringChanged(); /* EMIT SIGNAL */
+ cerr << _name << "done with layering @ " << get_microseconds() << endl;
}
}
@@ -358,7 +374,7 @@ Playlist::notify_region_removed (boost::shared_ptr<Region> r)
{
if (holding_state ()) {
pending_removes.insert (r);
- pending_modified = true;
+ pending_contents_change = true;
pending_length = true;
} else {
/* this might not be true, but we have to act
@@ -366,9 +382,9 @@ Playlist::notify_region_removed (boost::shared_ptr<Region> r)
*/
pending_length = false;
LengthChanged (); /* EMIT SIGNAL */
- pending_modified = false;
+ pending_contents_change = false;
RegionRemoved (boost::weak_ptr<Region> (r)); /* EMIT SIGNAL */
- Modified (); /* EMIT SIGNAL */
+ ContentsChanged (); /* EMIT SIGNAL */
}
}
@@ -399,14 +415,16 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
if (holding_state()) {
pending_adds.insert (r);
- pending_modified = true;
+ pending_contents_change = true;
pending_length = true;
} else {
pending_length = false;
LengthChanged (); /* EMIT SIGNAL */
- pending_modified = false;
+ pending_contents_change = false;
RegionAdded (boost::weak_ptr<Region> (r)); /* EMIT SIGNAL */
- Modified (); /* EMIT SIGNAL */
+ cerr << _name << "send3 contents changed @ " << get_microseconds() << endl;
+ ContentsChanged (); /* EMIT SIGNAL */
+ cerr << _name << "done contents changed @ " << get_microseconds() << endl;
}
}
@@ -418,8 +436,10 @@ Playlist::notify_length_changed ()
} else {
pending_length = false;
LengthChanged(); /* EMIT SIGNAL */
- pending_modified = false;
- Modified (); /* EMIT SIGNAL */
+ pending_contents_change = false;
+ cerr << _name << "send4 contents change @ " << get_microseconds() << endl;
+ ContentsChanged (); /* EMIT SIGNAL */
+ cerr << _name << "done contents change @ " << get_microseconds() << endl;
}
}
@@ -428,7 +448,9 @@ Playlist::flush_notifications ()
{
set<boost::shared_ptr<Region> > dependent_checks_needed;
set<boost::shared_ptr<Region> >::iterator s;
- uint32_t n = 0;
+ uint32_t regions_changed = false;
+ bool check_length = false;
+ nframes64_t old_length = 0;
if (in_flush) {
return;
@@ -436,6 +458,14 @@ Playlist::flush_notifications ()
in_flush = true;
+ if (!pending_bounds.empty() || !pending_removes.empty() || !pending_adds.empty()) {
+ regions_changed = true;
+ if (!pending_length) {
+ old_length = _get_maximum_extent ();
+ check_length = true;
+ }
+ }
+
/* we have no idea what order the regions ended up in pending
bounds (it could be based on selection order, for example).
so, to preserve layering in the "most recently moved is higher"
@@ -449,37 +479,42 @@ Playlist::flush_notifications ()
if (_session.config.get_layer_model() == MoveAddHigher) {
timestamp_layer_op (*r);
}
-
- pending_length = true;
dependent_checks_needed.insert (*r);
-
- n++;
}
for (s = pending_removes.begin(); s != pending_removes.end(); ++s) {
remove_dependents (*s);
+ cerr << _name << " sends RegionRemoved\n";
RegionRemoved (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
- n++;
}
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
+ cerr << _name << " sends RegionAdded\n";
RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
dependent_checks_needed.insert (*s);
- n++;
}
- if ((freeze_length != _get_maximum_extent()) || pending_length) {
- pending_length = 0;
+ if (check_length) {
+ if (old_length != _get_maximum_extent()) {
+ pending_length = true;
+ cerr << _name << " length has changed\n";
+ }
+ }
+
+ if (pending_length || (freeze_length != _get_maximum_extent())) {
+ pending_length = false;
+ cerr << _name << " sends LengthChanged\n";
LengthChanged(); /* EMIT SIGNAL */
- n++;
}
- if (n || pending_modified) {
+ if (regions_changed || pending_contents_change) {
if (!in_set_state) {
relayer ();
}
- pending_modified = false;
- Modified (); /* EMIT SIGNAL */
+ pending_contents_change = false;
+ cerr << _name << " sends 5 contents change @ " << get_microseconds() << endl;
+ ContentsChanged (); /* EMIT SIGNAL */
+ cerr << _name << "done contents change @ " << get_microseconds() << endl;
}
for (s = dependent_checks_needed.begin(); s != dependent_checks_needed.end(); ++s) {
@@ -487,15 +522,24 @@ Playlist::flush_notifications ()
}
if (!pending_range_moves.empty ()) {
+ cerr << _name << " sends RangesMoved\n";
RangesMoved (pending_range_moves);
}
+
+ clear_pending ();
+ in_flush = false;
+}
+
+void
+Playlist::clear_pending ()
+{
pending_adds.clear ();
pending_removes.clear ();
pending_bounds.clear ();
pending_range_moves.clear ();
-
- in_flush = false;
+ pending_contents_change = false;
+ pending_length = false;
}
/*************************************************************
@@ -638,6 +682,7 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
{
RegionList::iterator i;
nframes_t old_length = 0;
+ int ret = -1;
if (!holding_state()) {
old_length = _get_maximum_extent();
@@ -648,6 +693,8 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
region->set_playlist (boost::weak_ptr<Playlist>());
}
+ /* XXX should probably freeze here .... */
+
for (i = regions.begin(); i != regions.end(); ++i) {
if (*i == region) {
@@ -668,13 +715,14 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
}
notify_region_removed (region);
- return 0;
+ ret = 0;
+ break;
}
}
+ /* XXX and thaw ... */
-
- return -1;
+ return ret;
}
void
@@ -1348,6 +1396,11 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
notify_region_moved (region);
}
+
+ /* don't notify about layer changes, since we are the only object that can initiate
+ them, and we notify in ::relayer()
+ */
+
if (what_changed & our_interests) {
save = true;
}
@@ -1381,8 +1434,10 @@ Playlist::clear (bool with_signals)
if (with_signals) {
pending_length = false;
LengthChanged ();
- pending_modified = false;
- Modified ();
+ pending_contents_change = false;
+ cerr << _name << "send2 contents change @ " << get_microseconds() << endl;
+ ContentsChanged ();
+ cerr << _name << "done with contents changed @ " << get_microseconds() << endl;
}
}
@@ -1842,12 +1897,16 @@ Playlist::set_state (const XMLNode& node, int version)
Change what_changed = Change (0);
- if (region->set_live_state (*child, version, what_changed, true)) {
- error << _("Playlist: cannot reset region state from XML") << endmsg;
+ region->freeze ();
+
+ if (region->set_live_state (*child, version, what_changed, false)) {
+ region->thaw ("");
continue;
}
- } else if ((region = RegionFactory::create (_session, *child, true)) == 0) {
+ } else if ((region = RegionFactory::create (_session, *child, true)) != 0) {
+ region->freeze ();
+ } else {
error << _("Playlist: cannot create region from XML") << endmsg;
continue;
}
@@ -1856,14 +1915,10 @@ Playlist::set_state (const XMLNode& node, int version)
// So that layer_op ordering doesn't get screwed up
region->set_last_layer_op( region->layer());
-
+ region->thaw ("");
}
}
- notify_modified ();
-
- thaw ();
-
/* update dependents, which was not done during add_region_internal
due to in_set_state being true
*/
@@ -1872,6 +1927,10 @@ Playlist::set_state (const XMLNode& node, int version)
check_dependents (*r, false);
}
+ clear_pending (); // this makes thaw() do nothing
+ thaw ();
+ notify_contents_changed ();
+
in_set_state--;
first_set_state = false;
return 0;
@@ -1993,11 +2052,7 @@ Playlist::set_edit_mode (EditMode mode)
void
Playlist::relayer ()
{
- /* don't send multiple Modified notifications
- when multiple regions are relayered.
- */
-
- freeze ();
+ bool changed = false;
/* Build up a new list of regions on each layer, stored in a set of lists
each of which represent some period of time on some layer. The idea
@@ -2093,21 +2148,17 @@ Playlist::relayer ()
for (int k = start_division; k <= end_division; ++k) {
layers[j][k].push_back (*i);
}
+
+ if ((*i)->layer() != j) {
+ changed = true;
+ }
(*i)->set_layer (j);
}
- /* sending Modified means that various kinds of layering
- models operate correctly at the GUI
- level. slightly inefficient, but only slightly.
-
- We force a Modified signal here in case no layers actually
- changed.
- */
-
- notify_modified ();
-
- thaw ();
+ if (changed) {
+ notify_layering_changed ();
+ }
}
/* XXX these layer functions are all deprecated */
@@ -2454,7 +2505,7 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
relayer ();
check_dependents (region, false);
- notify_modified();
+ notify_contents_changed();
}
}
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 09f60926c4..1f4d6f0f91 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -1148,6 +1148,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
sscanf (prop->value().c_str(), "%" PRIu32, &val);
if (val != _start) {
what_changed = Change (what_changed|StartChanged);
+ cerr << _name << " start changed\n";
_start = val;
}
} else {
@@ -1158,6 +1159,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
sscanf (prop->value().c_str(), "%" PRIu32, &val);
if (val != _length) {
what_changed = Change (what_changed|LengthChanged);
+ cerr << _name << " length changed\n";
_last_length = _length;
_length = val;
}
@@ -1170,6 +1172,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
sscanf (prop->value().c_str(), "%" PRIu32, &val);
if (val != _position) {
what_changed = Change (what_changed|PositionChanged);
+ cerr << _name << " position changed\n";
_last_position = _position;
_position = val;
}
@@ -1183,6 +1186,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
x = (layer_t) atoi (prop->value().c_str());
if (x != _layer) {
what_changed = Change (what_changed|LayerChanged);
+ cerr << _name << " layer changed\n";
_layer = x;
}
} else {
@@ -1193,6 +1197,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
sscanf (prop->value().c_str(), "%" PRIu32, &val);
if (val != _sync_position) {
what_changed = Change (what_changed|SyncOffsetChanged);
+ cerr << _name << " sync changed\n";
_sync_position = val;
}
} else {
@@ -1281,6 +1286,7 @@ Region::set_live_state (const XMLNode& node, int /*version*/, Change& what_chang
}
if (send) {
+ cerr << _name << ": final change to be sent: " << hex << what_changed << dec << endl;
send_change (what_changed);
}
@@ -1346,12 +1352,13 @@ Region::thaw (const string& /*why*/)
recompute_at_end ();
}
- StateChanged (what_changed);
+ send_change (what_changed);
}
void
Region::send_change (Change what_changed)
{
+
{
Glib::Mutex::Lock lm (_lock);
if (_frozen) {
@@ -1360,7 +1367,9 @@ Region::send_change (Change what_changed)
}
}
+ cerr << _name << " actually sends " << hex << what_changed << dec << " @" << get_microseconds() << endl;
StateChanged (what_changed);
+ cerr << _name << " done with " << hex << what_changed << dec << " @" << get_microseconds() << endl;
if (!(_flags & DoNotSendPropertyChanges)) {
@@ -1370,7 +1379,9 @@ Region::send_change (Change what_changed)
try {
boost::shared_ptr<Region> rptr = shared_from_this();
+ cerr << _name << " actually sends prop change " << hex << what_changed << dec << " @ " << get_microseconds() << endl;
RegionPropertyChanged (rptr);
+ cerr << _name << " done with prop change @ " << get_microseconds() << endl;
} catch (...) {
/* no shared_ptr available, relax; */
}