The great audio processing overhaul.
[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 <boost/shared_ptr.hpp>
25 #include <sigc++/signal.h>
26
27 #include <glibmm/thread.h>
28
29 #include "pbd/undo.h"
30
31 #include "ardour/ardour.h"
32 #include "ardour/processor.h"
33
34 using std::string;
35
36 class XMLNode;
37
38 namespace ARDOUR {
39
40 class Session;
41 class IO;
42
43 /** A mixer strip element (Processor) with Jack ports (IO).
44  */
45 class IOProcessor : public Processor
46 {
47   public:
48         IOProcessor (Session&, const string& proc_name, const string io_name="",
49                      ARDOUR::DataType default_type = DataType::AUDIO);
50         IOProcessor (Session&, IO* io, const string& proc_name,
51                      ARDOUR::DataType default_type = DataType::AUDIO);
52         virtual ~IOProcessor ();
53         
54         virtual ChanCount output_streams() const;
55         virtual ChanCount input_streams () const;
56         virtual ChanCount natural_output_streams() const;
57         virtual ChanCount natural_input_streams () const;
58
59         boost::shared_ptr<IO>       io()       { return _io; }
60         boost::shared_ptr<const IO> io() const { return _io; }
61         
62         virtual void automation_snapshot (nframes_t now, bool force);
63
64         virtual void run_in_place (BufferSet& in, nframes_t start, nframes_t end, nframes_t nframes) = 0;
65         void silence (nframes_t nframes);
66
67         sigc::signal<void,IOProcessor*,bool>     AutomationPlaybackChanged;
68         sigc::signal<void,IOProcessor*,uint32_t> AutomationChanged;
69         
70         XMLNode& state (bool full_state);
71         int set_state (const XMLNode&);
72         
73   protected:
74         boost::shared_ptr<IO> _io;
75
76   private:
77         /* disallow copy construction */
78         IOProcessor (const IOProcessor&);
79
80 };
81
82 } // namespace ARDOUR
83
84 #endif /* __ardour_redirect_h__ */