Ardour  8.12
monitor_port.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Robin Gareus <robin@gareus.org>
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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _ardour_monitor_port_h_
20 #define _ardour_monitor_port_h_
21 
22 #include <memory>
23 #include <set>
24 
26 
27 #include "pbd/rcu.h"
28 
29 #include "ardour/audio_buffer.h"
30 #include "ardour/port_engine.h"
31 
32 namespace ARDOUR {
33 
34 class LIBARDOUR_API MonitorPort : public boost::noncopyable
35 {
36 public:
38 
40  bool silent () const;
42 
43  void add_port (std::string const&);
44  void remove_port (std::string const&, bool instantly = false);
45  bool monitoring (std::string const& = "") const;
46  void active_monitors (std::list <std::string>&) const;
47  void set_active_monitors (std::list <std::string> const&);
48  void clear_ports (bool instantly);
49 
50  PBD::Signal2<void, std::string, bool> MonitorInputChanged;
51 
52 protected:
53  friend class PortManager;
56 
57 private:
58  struct MonitorInfo {
60  {
61  gain = 0;
62  remove = false;
63  }
64 
65  float gain;
66  bool remove;
67  };
68 
69  void collect (std::shared_ptr<MonitorInfo>, Sample*, pframes_t, std::string const&);
71 
72  typedef std::map<std::string, std::shared_ptr<MonitorInfo> > MonitorPorts;
74 
80  bool _silent;
81 };
82 
83 }
84 
85 #endif
AudioBuffer & get_audio_buffer(pframes_t)
bool silent() const
bool monitoring(std::string const &="") const
void collect(std::shared_ptr< MonitorInfo >, Sample *, pframes_t, std::string const &)
void clear_ports(bool instantly)
void add_port(std::string const &)
void active_monitors(std::list< std::string > &) const
void finalize(pframes_t)
void set_buffer_size(pframes_t)
void set_active_monitors(std::list< std::string > const &)
SerializedRCUManager< MonitorPorts > _monitor_ports
Definition: monitor_port.h:73
PBD::Signal2< void, std::string, bool > MonitorInputChanged
Definition: monitor_port.h:50
ArdourZita::VMResampler _src
Definition: monitor_port.h:76
std::map< std::string, std::shared_ptr< MonitorInfo > > MonitorPorts
Definition: monitor_port.h:72
void remove_port(std::string const &, bool instantly=false)
void monitor(PortEngine &, pframes_t)
AudioBuffer * _buffer
Definition: monitor_port.h:75
#define LIBARDOUR_API
PBD::PropertyDescriptor< gain_t > gain
uint32_t pframes_t