Ardour  9.2-79-gba93f2fe52
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 "pbd/undo.h"
28 
29 #include "ardour/ardour.h"
30 #include "ardour/processor.h"
31 
32 class XMLNode;
33 
34 namespace ARDOUR {
35 
36 class Session;
37 class IO;
38 class Route;
39 
42 {
43 public:
44  IOProcessor (Session&, bool with_input, bool with_output,
45  const std::string& proc_name, const std::string io_name="",
46  ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false);
47 
48  IOProcessor (Session&, std::shared_ptr<IO> input, std::shared_ptr<IO> output,
49  const std::string& proc_name, Temporal::TimeDomainProvider const &, bool sendish=false);
50 
51  virtual ~IOProcessor ();
52 
53  bool set_name (const std::string& str);
54 
55  bool does_routing() const { return true; }
56 
58  virtual ChanCount natural_input_streams () const;
59 
60  std::shared_ptr<IO> input() { return _input; }
61  std::shared_ptr<const IO> input() const { return _input; }
62  std::shared_ptr<IO> output() { return _output; }
63  std::shared_ptr<const IO> output() const { return _output; }
64 
65  void set_input (std::shared_ptr<IO>);
66  void set_output (std::shared_ptr<IO>);
67 
68  void silence (samplecnt_t nframes, samplepos_t start_sample);
69  void disconnect ();
70 
71  virtual bool feeds (std::shared_ptr<Route> other) const;
72 
75 
76  XMLNode& state () const;
77  int set_state (const XMLNode&, int version);
78 
79  static void prepare_for_reset (XMLNode& state, const std::string& name);
80 
81  uint32_t bit_slot() const { return _bitslot; }
82 
83 protected:
84  std::shared_ptr<IO> _input;
85  std::shared_ptr<IO> _output;
86 
87  /* used by PortInsert, Send & Return*/
88  std::string validate_name (std::string const& new_name, std::string const& canonical_name) const;
89  uint32_t _bitslot;
90 
91 private:
92  /* disallow copy construction */
94 
95  virtual int set_state_2X (const XMLNode &, int);
96 
97  bool _own_input;
99 
100 };
101 
102 } // namespace ARDOUR
103 
static void prepare_for_reset(XMLNode &state, const std::string &name)
PBD::Signal< void(IOProcessor *, bool)> AutomationPlaybackChanged
Definition: io_processor.h:73
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:85
uint32_t bit_slot() const
Definition: io_processor.h:81
std::shared_ptr< IO > input()
Definition: io_processor.h:60
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:61
void silence(samplecnt_t nframes, samplepos_t start_sample)
std::shared_ptr< IO > _input
Definition: io_processor.h:84
std::shared_ptr< const IO > output() const
Definition: io_processor.h:63
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:74
std::shared_ptr< IO > output()
Definition: io_processor.h:62
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:55
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