summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/pi_controller.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-10 03:25:32 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-10 03:25:32 +0000
commit61cade6d59118288e90a405e0f4fbc24d0108814 (patch)
treefe9083a4c005ac239bf5995c16252609dc547869 /libs/ardour/ardour/pi_controller.h
parentf18bcf0cc835ab401d8e28dcc18c72795977752a (diff)
drastic, deep and wide changes to make RouteGroup use boost::shared_ptr<Route> and boost::shared_ptr<RouteList> to better fit into emerging framework for "RT operations" ; torben's changes to MTC slaving code (sorry for bundling)
git-svn-id: svn://localhost/ardour2/branches/3.0@6334 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/pi_controller.h')
-rw-r--r--libs/ardour/ardour/pi_controller.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libs/ardour/ardour/pi_controller.h b/libs/ardour/ardour/pi_controller.h
index f992e6a18c..d3cd0eb6bf 100644
--- a/libs/ardour/ardour/pi_controller.h
+++ b/libs/ardour/ardour/pi_controller.h
@@ -19,6 +19,8 @@
#ifndef __libardour_pi_controller__
#define __libardour_pi_controller__
+#include "ardour/types.h"
+
class PIController {
public:
@@ -48,6 +50,35 @@ class PIController {
int smooth_size;
double smooth_offset;
double current_resample_factor;
+ bool fir_empty;
};
+#define ESTIMATOR_SIZE 16
+
+class PIChaser {
+ public:
+ PIChaser();
+ ~PIChaser();
+
+ double get_ratio( nframes64_t realtime, nframes64_t chasetime, nframes64_t slavetime, bool in_control );
+ void reset();
+ nframes64_t want_locate() { return want_locate_val; }
+
+ private:
+ PIController *pic;
+ nframes64_t realtime_stamps[ESTIMATOR_SIZE];
+ nframes64_t chasetime_stamps[ESTIMATOR_SIZE];
+ int array_index;
+ nframes64_t want_locate_val;
+
+ void feed_estimator( nframes64_t realtime, nframes64_t chasetime );
+ double get_estimate();
+
+ double speed;
+
+ double speed_threshold;
+ nframes64_t pos_threshold;
+};
+
+
#endif /* __libardour_pi_controller__ */