2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "ardour/audio_buffer.h"
21 #include "ardour/unknown_processor.h"
26 using namespace ARDOUR;
28 UnknownProcessor::UnknownProcessor (Session& s, XMLNode const & state)
31 , have_ioconfig (false)
35 XMLProperty const * prop = state.property (X_("name"));
37 set_name (prop->value ());
38 _display_to_user = true;
42 XMLNodeList kids = state.children ();
43 for (XMLNodeIterator i = kids.begin(); i != kids.end(); ++i) {
44 if ((*i)->name() == X_("ConfiguredInput")) {
46 saved_input = new ChanCount(**i);
48 if ((*i)->name() == X_("ConfiguredOutput")) {
50 saved_output = new ChanCount(**i);
53 have_ioconfig = (have_io == 3);
56 UnknownProcessor::~UnknownProcessor () {
62 UnknownProcessor::state (bool)
64 return *(new XMLNode (_state));
68 UnknownProcessor::can_support_io_configuration (const ChanCount &in, ChanCount & out) {
69 if (have_ioconfig && in == *saved_input) {
77 UnknownProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
82 // silence excess output buffers
83 for (uint32_t i = saved_input->n_audio(); i < saved_output->n_audio(); ++i) {
84 bufs.get_audio (i).silence (nframes);