ardour
io_processor.h
Go to the documentation of this file.
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 
26 #include <glibmm/threads.h>
27 
28 #include "pbd/undo.h"
29 
30 #include "ardour/ardour.h"
31 #include "ardour/processor.h"
32 
33 class XMLNode;
34 
35 namespace ARDOUR {
36 
37 class Session;
38 class IO;
39 class Route;
40 
44 {
45  public:
46  IOProcessor (Session&, bool with_input, bool with_output,
47  const std::string& proc_name, const std::string io_name="",
48  ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false);
50  const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO);
51  virtual ~IOProcessor ();
52 
53  bool set_name (const std::string& str);
54 
55  bool does_routing() const { return true; }
56 
57  virtual ChanCount natural_output_streams() const;
58  virtual ChanCount natural_input_streams () const;
59 
60  boost::shared_ptr<IO> input() { return _input; }
61  boost::shared_ptr<const IO> input() const { return _input; }
62  boost::shared_ptr<IO> output() { return _output; }
63  boost::shared_ptr<const IO> output() const { return _output; }
64  void set_input (boost::shared_ptr<IO>);
65  void set_output (boost::shared_ptr<IO>);
66 
67  void silence (framecnt_t nframes);
68  void disconnect ();
69 
70  void increment_port_buffer_offset (pframes_t);
71 
72  virtual bool feeds (boost::shared_ptr<Route> other) const;
73 
74  PBD::Signal2<void,IOProcessor*,bool> AutomationPlaybackChanged;
75  PBD::Signal2<void,IOProcessor*,uint32_t> AutomationChanged;
76 
77  XMLNode& state (bool full_state);
78  int set_state (const XMLNode&, int version);
79 
80  static void prepare_for_reset (XMLNode& state, const std::string& name);
81 
82  protected:
85 
86  private:
87  /* disallow copy construction */
88  IOProcessor (const IOProcessor&);
89 
90  virtual int set_state_2X (const XMLNode &, int);
91 
92  bool _own_input;
94 
95 };
96 
97 } // namespace ARDOUR
98 
99 #endif /* __ardour_redirect_h__ */
PBD::Signal2< void, IOProcessor *, bool > AutomationPlaybackChanged
Definition: io_processor.h:74
bool does_routing() const
Definition: io_processor.h:55
uint32_t pframes_t
Definition: types.h:61
boost::shared_ptr< IO > _output
Definition: io_processor.h:84
int64_t framecnt_t
Definition: types.h:76
Definition: amp.h:29
boost::shared_ptr< IO > input()
Definition: io_processor.h:60
#define LIBARDOUR_API
boost::shared_ptr< const IO > output() const
Definition: io_processor.h:63
const char * name
boost::shared_ptr< IO > _input
Definition: io_processor.h:83
Definition: xml++.h:95
boost::shared_ptr< IO > output()
Definition: io_processor.h:62
boost::shared_ptr< const IO > input() const
Definition: io_processor.h:61
PBD::Signal2< void, IOProcessor *, uint32_t > AutomationChanged
Definition: io_processor.h:75