Move panner bypass state up to the PannerShell so that it is preserved even when...
[ardour2.git] / libs / ardour / capturing_processor.cc
blobc4b463aba7f2ee3b4f110ebcf92de25a42a6680b
1 /*
2 Copyright (C) 2011 Paul Davis
3 Author: Sakari Bergen
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"
25 #include "i18n.h"
27 namespace ARDOUR {
29 CapturingProcessor::CapturingProcessor (Session & session)
30 : Processor (session, X_("capture point"))
31 , block_size (session.engine().frames_per_cycle())
33 realloc_buffers ();
36 CapturingProcessor::~CapturingProcessor()
40 int
41 CapturingProcessor::set_block_size (pframes_t nframes)
43 block_size = nframes;
44 realloc_buffers();
45 return 0;
48 void
49 CapturingProcessor::run (BufferSet& bufs, framepos_t, framepos_t, pframes_t nframes, bool)
51 if (active()) {
52 capture_buffers.read_from (bufs, nframes);
56 bool
57 CapturingProcessor::configure_io (ChanCount in, ChanCount out)
59 Processor::configure_io (in, out);
60 realloc_buffers();
61 return true;
64 bool
65 CapturingProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
67 out = in;
68 return true;
71 void
72 CapturingProcessor::realloc_buffers()
74 capture_buffers.ensure_buffers (_configured_input, block_size);
77 XMLNode &
78 CapturingProcessor::state (bool full)
80 XMLNode& node = Processor::state (full);
82 node.add_property (X_("type"), X_("capture"));
83 return node;
86 } // namespace ARDOUR