summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/delayline.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-06-11 16:31:29 +0200
committerRobin Gareus <robin@gareus.org>2014-06-11 16:31:29 +0200
commit626b2daa8294e8ddb5526c1c6a9540f72b2bd063 (patch)
treeb82ac669fc8d9d39f39e9a45f74519823e33ec14 /libs/ardour/ardour/delayline.h
parent621e92f2681ec0134d1e64ec7265c0a588553d0d (diff)
add delayline implementaion (in prep for latency compensation)
Diffstat (limited to 'libs/ardour/ardour/delayline.h')
-rw-r--r--libs/ardour/ardour/delayline.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/libs/ardour/ardour/delayline.h b/libs/ardour/ardour/delayline.h
new file mode 100644
index 0000000000..56a6de0c63
--- /dev/null
+++ b/libs/ardour/ardour/delayline.h
@@ -0,0 +1,69 @@
+/*
+ Copyright (C) 2006, 2013 Paul Davis
+ Copyright (C) 2013, 2014 Robin Gareus <robin@gareus.org>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __ardour_delayline_h__
+#define __ardour_delayline_h__
+
+#include "ardour/types.h"
+#include "ardour/processor.h"
+
+namespace ARDOUR {
+
+class BufferSet;
+class ChanCount;
+class Session;
+
+/** Meters peaks on the input and stores them for access.
+ */
+class LIBARDOUR_API DelayLine : public Processor {
+public:
+
+ DelayLine (Session& s, const std::string& name);
+ ~DelayLine ();
+
+ bool display_to_user() const { return false; }
+
+ void run (BufferSet&, framepos_t, framepos_t, pframes_t, bool);
+ void set_delay(framecnt_t signal_delay);
+ framecnt_t get_delay() { return _pending_delay; }
+
+ bool configure_io (ChanCount in, ChanCount out);
+ bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
+
+ void flush();
+ void realtime_handle_transport_stopped () { flush(); }
+ void realtime_locate () { flush(); }
+ void monitoring_changed() { flush(); }
+
+ XMLNode& state (bool full);
+
+private:
+ friend class IO;
+ framecnt_t _delay, _pending_delay;
+ framecnt_t _bsiz, _pending_bsiz;
+ frameoffset_t _roff, _woff;
+ boost::shared_ptr<Sample> _buf;
+ boost::shared_ptr<Sample> _pending_buf;
+ boost::shared_ptr<MidiBuffer> _midi_buf;
+ bool _pending_flush;
+};
+
+} // namespace ARDOUR
+
+#endif // __ardour_meter_h__