2 Copyright (C) 2006, 2013 Paul Davis
3 Copyright (C) 2013, 2014 Robin Gareus <robin@gareus.org>
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2 of the License, or (at your option)
10 This program is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_delayline_h__
21 #define __ardour_delayline_h__
23 #include <boost/shared_ptr.hpp>
24 #include <boost/shared_array.hpp>
26 #include "ardour/types.h"
27 #include "ardour/processor.h"
35 /** Meters peaks on the input and stores them for access.
37 class LIBARDOUR_API DelayLine : public Processor {
40 DelayLine (Session& s, const std::string& name);
43 bool display_to_user() const { return false; }
45 void run (BufferSet&, framepos_t, framepos_t, double, pframes_t, bool);
46 void set_delay(framecnt_t signal_delay);
47 framecnt_t get_delay() { return _pending_delay; }
49 bool configure_io (ChanCount in, ChanCount out);
50 bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
53 void realtime_handle_transport_stopped () { flush(); }
54 void realtime_locate () { flush(); }
55 void monitoring_changed() { flush(); }
57 XMLNode& state (bool full);
61 framecnt_t _delay, _pending_delay;
62 framecnt_t _bsiz, _pending_bsiz;
63 frameoffset_t _roff, _woff;
64 boost::shared_array<Sample> _buf;
65 boost::shared_array<Sample> _pending_buf;
66 boost::shared_ptr<MidiBuffer> _midi_buf;
72 #endif // __ardour_meter_h__