2 Copyright (C) 2011 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "ardour/capturing_processor.h"
22 #include "ardour/session.h"
23 #include "ardour/audioengine.h"
29 CapturingProcessor::CapturingProcessor (Session & session, samplecnt_t latency)
30 : Processor (session, X_("capture point"))
31 , block_size (AudioEngine::instance()->samples_per_cycle())
37 CapturingProcessor::~CapturingProcessor()
42 CapturingProcessor::set_block_size (pframes_t nframes)
50 CapturingProcessor::run (BufferSet& bufs, samplepos_t, samplepos_t, double, pframes_t nframes, bool)
53 _delaybuffers.flush ();
56 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
57 for (uint32_t b = 0; b < bufs.count().get (*t); ++b) {
58 _delaybuffers.delay (*t, b, capture_buffers.get (*t, b), bufs.get (*t, b), nframes, 0, 0);
64 CapturingProcessor::configure_io (ChanCount in, ChanCount out)
66 Processor::configure_io (in, out);
67 _delaybuffers.set (out, _latency);
73 CapturingProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out)
80 CapturingProcessor::realloc_buffers()
82 capture_buffers.ensure_buffers (_configured_input, block_size);
83 _delaybuffers.flush ();
87 CapturingProcessor::state ()
89 XMLNode& node = Processor::state ();
91 node.set_property (X_("type"), X_("capture"));