61a5734df22a65cef054d46c29e5058c472a4c0d
[ardour.git] / libs / ardour / ardour / unknown_processor.h
1 /*
2     Copyright (C) 2010 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_unknown_processor_h__
21 #define __ardour_unknown_processor_h__
22
23 #include "ardour/processor.h"
24
25 namespace ARDOUR {
26
27 /** A stub Processor that can be used in place of a `real' one that cannot be
28  *  created for some reason; usually because it requires a plugin which is not
29  *  present.  UnknownProcessors are special-cased in a few places, notably
30  *  in route configuration and signal processing, so that on encountering them
31  *  configuration or processing stops.
32  *
33  *  When a Processor is missing from a Route, the following processors cannot
34  *  be configured, as the missing Processor's output port configuration is
35  *  unknown.
36  *
37  *  The main utility of the UnknownProcessor is that it allows state
38  *  to be preserved, so that, for example, loading and re-saving a
39  *  session on a machine without a particular plugin will not corrupt
40  *  the session.
41  */
42 class UnknownProcessor : public Processor
43 {
44 public:
45         UnknownProcessor (Session &, XMLNode const &);
46
47         /* These processors are hidden from view */
48         bool display_to_user () const {
49                 return false;
50         }
51
52         bool can_support_io_configuration (const ChanCount &, ChanCount &) {
53                 return false;
54         }
55
56         XMLNode & state (bool);
57
58 private:
59         XMLNode _state;
60 };
61
62 }
63
64 #endif