2 Copyright (C) 2001 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.
27 #include <sigc++/bind.h>
29 #include <pbd/xml++.h>
30 #include <pbd/enumwriter.h>
32 #include <ardour/io_processor.h>
33 #include <ardour/session.h>
34 #include <ardour/utils.h>
35 #include <ardour/send.h>
36 #include <ardour/port_insert.h>
37 #include <ardour/plugin_insert.h>
42 using namespace ARDOUR;
45 IOProcessor::IOProcessor (Session& s, const string& name, Placement p,
46 int input_min, int input_max,
47 int output_min, int output_max,
50 : Processor(s, name, p)
51 , _io (new IO(s, name, input_min, input_max, output_min, output_max, dtype, public_ports))
59 IOProcessor::~IOProcessor ()
65 IOProcessor::state (bool full_state)
67 XMLNode& node = Processor::state(full_state);
69 node.add_child_nocopy (_io->state (full_state));
75 IOProcessor::set_state (const XMLNode& node)
77 const XMLProperty *prop;
78 const XMLNode *io_node = 0;
80 Processor::set_state(node);
82 XMLNodeList nlist = node.children();
83 XMLNodeIterator niter;
85 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
86 if ((*niter)->name() == IO::state_node_name) {
89 } else if ((*niter)->name() == "Redirect") {
90 XMLNodeList rlist = (*niter)->children();
91 XMLNodeIterator riter;
93 for (riter = rlist.begin(); riter != rlist.end(); ++riter) {
94 if ( (*riter)->name() == IO::state_node_name) {
95 warning << _("Found legacy IO in a redirect") << endmsg;
104 _io->set_state(*io_node);
106 // legacy sessions: use IO name
107 if ((prop = node.property ("name")) == 0) {
108 set_name(_io->name());
112 error << _("XML node describing a redirect is missing an IO node") << endmsg;
120 IOProcessor::silence (nframes_t nframes, nframes_t offset)
122 _io->silence(nframes, offset);