Ardour  8.12
io_processor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
5  * Copyright (C) 2016-2019 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef __ardour_redirect_h__
23 #define __ardour_redirect_h__
24 
25 #include <memory>
26 #include <string>
27 
28 #include <glibmm/threads.h>
29 
30 #include "pbd/undo.h"
31 
32 #include "ardour/ardour.h"
33 #include "ardour/processor.h"
34 
35 class XMLNode;
36 
37 namespace ARDOUR {
38 
39 class Session;
40 class IO;
41 class Route;
42 
45 {
46 public:
47  IOProcessor (Session&, bool with_input, bool with_output,
48  const std::string& proc_name, const std::string io_name="",
49  ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false);
50 
51  IOProcessor (Session&, std::shared_ptr<IO> input, std::shared_ptr<IO> output,
52  const std::string& proc_name, Temporal::TimeDomainProvider const &, bool sendish=false);
53 
54  virtual ~IOProcessor ();
55 
56  bool set_name (const std::string& str);
57 
58  bool does_routing() const { return true; }
59 
61  virtual ChanCount natural_input_streams () const;
62 
63  std::shared_ptr<IO> input() { return _input; }
64  std::shared_ptr<const IO> input() const { return _input; }
65  std::shared_ptr<IO> output() { return _output; }
66  std::shared_ptr<const IO> output() const { return _output; }
67 
68  void set_input (std::shared_ptr<IO>);
69  void set_output (std::shared_ptr<IO>);
70 
71  void silence (samplecnt_t nframes, samplepos_t start_sample);
72  void disconnect ();
73 
74  virtual bool feeds (std::shared_ptr<Route> other) const;
75 
76  PBD::Signal2<void,IOProcessor*,bool> AutomationPlaybackChanged;
77  PBD::Signal2<void,IOProcessor*,uint32_t> AutomationChanged;
78 
79  XMLNode& state () const;
80  int set_state (const XMLNode&, int version);
81 
82  static void prepare_for_reset (XMLNode& state, const std::string& name);
83 
84  uint32_t bit_slot() const { return _bitslot; }
85 
86 protected:
87  std::shared_ptr<IO> _input;
88  std::shared_ptr<IO> _output;
89 
90  /* used by PortInsert, Send & Return*/
91  std::string validate_name (std::string const& new_name, std::string const& canonical_name) const;
92  uint32_t _bitslot;
93 
94 private:
95  /* disallow copy construction */
97 
98  virtual int set_state_2X (const XMLNode &, int);
99 
102 
103 };
104 
105 } // namespace ARDOUR
106 
107 #endif /* __ardour_redirect_h__ */
static void prepare_for_reset(XMLNode &state, const std::string &name)
void set_output(std::shared_ptr< IO >)
void set_input(std::shared_ptr< IO >)
PBD::Signal2< void, IOProcessor *, bool > AutomationPlaybackChanged
Definition: io_processor.h:76
IOProcessor(Session &, std::shared_ptr< IO > input, std::shared_ptr< IO > output, const std::string &proc_name, Temporal::TimeDomainProvider const &, bool sendish=false)
PBD::Signal2< void, IOProcessor *, uint32_t > AutomationChanged
Definition: io_processor.h:77
std::shared_ptr< IO > _output
Definition: io_processor.h:88
uint32_t bit_slot() const
Definition: io_processor.h:84
std::shared_ptr< IO > input()
Definition: io_processor.h:63
IOProcessor(const IOProcessor &)
int set_state(const XMLNode &, int version)
XMLNode & state() const
virtual ChanCount natural_input_streams() const
virtual ~IOProcessor()
virtual int set_state_2X(const XMLNode &, int)
std::shared_ptr< const IO > input() const
Definition: io_processor.h:64
void silence(samplecnt_t nframes, samplepos_t start_sample)
std::shared_ptr< IO > _input
Definition: io_processor.h:87
std::shared_ptr< const IO > output() const
Definition: io_processor.h:66
std::string validate_name(std::string const &new_name, std::string const &canonical_name) const
std::shared_ptr< IO > output()
Definition: io_processor.h:65
IOProcessor(Session &, bool with_input, bool with_output, const std::string &proc_name, const std::string io_name="", ARDOUR::DataType default_type=DataType::AUDIO, bool sendish=false)
virtual bool feeds(std::shared_ptr< Route > other) const
bool does_routing() const
Definition: io_processor.h:58
virtual ChanCount natural_output_streams() const
bool set_name(const std::string &str)
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t