Make Region's _beat a PBD::Property.
[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 LIBARDOUR_API UnknownProcessor : public Processor
43 {
44 public:
45         UnknownProcessor (Session &, XMLNode const &);
46         virtual ~UnknownProcessor ();
47
48         bool can_support_io_configuration (const ChanCount &, ChanCount &);
49         void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, double /*speed*/, pframes_t /*nframes*/, bool /*result_required*/);
50
51         XMLNode & state (bool);
52
53 private:
54         XMLNode _state;
55         bool      have_ioconfig;
56         ChanCount *saved_input;
57         ChanCount *saved_output;
58 };
59
60 }
61
62 #endif