Changed Processor interface to support out-of-place processors, for Panner.
[ardour.git] / libs / ardour / ardour / io_processor.h
1 /*
2     Copyright (C) 2001 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_redirect_h__
21 #define __ardour_redirect_h__
22
23 #include <string>
24 #include <vector>
25 #include <set>
26 #include <map>
27 #include <boost/shared_ptr.hpp>
28 #include <sigc++/signal.h>
29
30 #include <glibmm/thread.h>
31
32 #include <pbd/undo.h>
33
34 #include <ardour/ardour.h>
35 #include <ardour/processor.h>
36 #include <ardour/io.h>
37 #include <ardour/automation_event.h>
38
39 using std::map;
40 using std::set;
41 using std::string;
42 using std::vector;
43
44 class XMLNode;
45
46 namespace ARDOUR {
47
48 class Session;
49
50 /** A mixer strip element (Processor) with Jack ports (IO).
51  */
52 class IOProcessor : public Processor
53 {
54   public:
55         IOProcessor (Session&, const string& name, Placement,
56                   int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1);
57         IOProcessor (const IOProcessor&);
58         virtual ~IOProcessor ();
59         
60         virtual ChanCount output_streams() const { return _io->n_outputs(); }
61         virtual ChanCount input_streams () const { return _io->n_inputs(); }
62         virtual ChanCount natural_output_streams() const { return _io->n_outputs(); }
63         virtual ChanCount natural_input_streams () const { return _io->n_inputs(); }
64
65         boost::shared_ptr<IO>       io()       { return _io; }
66         boost::shared_ptr<const IO> io() const { return _io; }
67         
68         virtual void automation_snapshot (nframes_t now) { _io->automation_snapshot(now); }
69
70         virtual void run_in_place (BufferSet& in, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
71
72         void silence (nframes_t nframes, nframes_t offset);
73
74         sigc::signal<void,IOProcessor*,bool>     AutomationPlaybackChanged;
75         sigc::signal<void,IOProcessor*,uint32_t> AutomationChanged;
76         
77         XMLNode& state (bool full_state);
78         int set_state (const XMLNode&);
79         
80   protected:
81         boost::shared_ptr<IO> _io;
82 };
83
84 } // namespace ARDOUR
85
86 #endif /* __ardour_redirect_h__ */