added TempoMap::Changed signal
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 15 Sep 2017 03:07:07 +0000 (23:07 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Sep 2017 15:40:54 +0000 (11:40 -0400)
nutemp/t.cc
nutemp/t.h

index c8336ccde8d8c1d341f41d9015fa6a8b8de855a4..b39fb4f3da1cc97c3f9c04425a41933646caf1a5 100644 (file)
@@ -498,6 +498,7 @@ TempoMap::rebuild (superclock_t limit)
         */
 
        bool hit_dirty = false;
+       superclock_t first_dirty = 0;
 
        for (tmp = _points.begin(); tmp != _points.end(); ) {
 
@@ -507,6 +508,7 @@ TempoMap::rebuild (superclock_t limit)
                                continue;
                        }
                        hit_dirty = true;
+                       first_dirty = tmp->sclock();
                }
 
                TempoMapPoints::iterator next = tmp;
@@ -567,6 +569,9 @@ TempoMap::rebuild (superclock_t limit)
                prev = tmp;
                tmp = next;
        }
+
+       Changed (first_dirty, _points.back().sclock()); /* EMIT SIGNAL */
+       cerr << "Rebuilt " << first_dirty << " .. " << _points.back().sclock() << endl;
 }
 
 bool
index be54c136ba4de2f11e10a4d6fcd4101bb3c3bc0b..b734dcead81646d6f485582296fec71c4d2a3c76 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <glibmm/threads.h>
 
+#include "pbd/signals.h"
+
 #include "evoral/Beats.hpp"
 
 #include "ardour/ardour.h"
@@ -361,6 +363,8 @@ class LIBARDOUR_API TempoMap
        void dump (std::ostream&);
        void rebuild (superclock_t limit);
 
+       PBD::Signal2<void,superclock_t,superclock_t> Changed;
+
    private:
        TempoMapPoints _points;
        framecnt_t     _sample_rate;