13
0

libtemporal: move TempoMap::update() into .cc, add debug output and emit relevant signal at end

This commit is contained in:
Paul Davis 2020-12-31 14:04:25 -07:00
parent 6a9330b2b0
commit 37399f7d50
2 changed files with 18 additions and 1 deletions

View File

@ -2966,3 +2966,20 @@ TempoMap::init ()
_map_mgr.init (new_map);
fetch ();
}
void
TempoMap::update (TempoMap::SharedPtr m)
{
cerr << "SWITCHING TEMPO MAP FROM:\n";
TempoMap::SharedPtr old (_map_mgr.reader());
old->dump (cerr);
cerr << " TO\n";
m->dump (cerr);
_map_mgr.update (m);
/* update thread local map pointer in the calling thread */
_tempo_map_p = _map_mgr.reader();
MapChanged (); /* EMIT SIGNAL */
}

View File

@ -645,7 +645,7 @@ class LIBTEMPORAL_API TempoMap : public PBD::StatefulDestructible
static SharedPtr write_copy() { return _map_mgr.write_copy(); }
static void fetch_writable() { _tempo_map_p = write_copy(); }
static void update (SharedPtr m) { _map_mgr.update (m); _tempo_map_p = _map_mgr.reader(); }
static void update (SharedPtr m);
/* and now on with the rest of the show ... */