Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
23 
24 #include <memory>
25 #include <string>
26 
27 #include <glibmm/threads.h>
28 
29 #include "pbd/undo.h"
30 
31 #include "ardour/ardour.h"
32 #include "ardour/processor.h"
33 
34 class XMLNode;
35 
36 namespace ARDOUR {
37 
38 class Session;
39 class IO;
40 class Route;
41 
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);
49 
50  IOProcessor (Session&, std::shared_ptr<IO> input, std::shared_ptr<IO> output,
51  const std::string& proc_name, Temporal::TimeDomainProvider const &, bool sendish=false);
52 
53  virtual ~IOProcessor ();
54 
55  bool set_name (const std::string& str);
56 
57  bool does_routing() const { return true; }
58 
60  virtual ChanCount natural_input_streams () const;
61 
62  std::shared_ptr<IO> input() { return _input; }
63  std::shared_ptr<const IO> input() const { return _input; }
64  std::shared_ptr<IO> output() { return _output; }
65  std::shared_ptr<const IO> output() const { return _output; }
66 
67  void set_input (std::shared_ptr<IO>);
68  void set_output (std::shared_ptr<IO>);
69 
70  void silence (samplecnt_t nframes, samplepos_t start_sample);
71  void disconnect ();
72 
73  virtual bool feeds (std::shared_ptr<Route> other) const;
74 
77 
78  XMLNode& state () const;
79  int set_state (const XMLNode&, int version);
80 
81  static void prepare_for_reset (XMLNode& state, const std::string& name);
82 
83  uint32_t bit_slot() const { return _bitslot; }
84 
85 protected:
86  std::shared_ptr<IO> _input;
87  std::shared_ptr<IO> _output;
88 
89  /* used by PortInsert, Send & Return*/
90  std::string validate_name (std::string const& new_name, std::string const& canonical_name) const;
91  uint32_t _bitslot;
92 
93 private:
94  /* disallow copy construction */
96 
97  virtual int set_state_2X (const XMLNode &, int);
98 
99  bool _own_input;
101 
102 };
103 
104 } // namespace ARDOUR
105 
static void prepare_for_reset(XMLNode &state, const std::string &name)
PBD::Signal< void(IOProcessor *, bool)> AutomationPlaybackChanged
Definition: io_processor.h:75
void set_output(std::shared_ptr< IO >)
void set_input(std::shared_ptr< IO >)
IOProcessor(Session &, std::shared_ptr< IO > input, std::shared_ptr< IO > output, const std::string &proc_name, Temporal::TimeDomainProvider const &, bool sendish=false)
std::shared_ptr< IO > _output
Definition: io_processor.h:87
uint32_t bit_slot() const
Definition: io_processor.h:83
std::shared_ptr< IO > input()
Definition: io_processor.h:62
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:63
void silence(samplecnt_t nframes, samplepos_t start_sample)
std::shared_ptr< IO > _input
Definition: io_processor.h:86
std::shared_ptr< const IO > output() const
Definition: io_processor.h:65
std::string validate_name(std::string const &new_name, std::string const &canonical_name) const
PBD::Signal< void(IOProcessor *, uint32_t)> AutomationChanged
Definition: io_processor.h:76
std::shared_ptr< IO > output()
Definition: io_processor.h:64
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:57
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