Ardour  8.12
surround_send.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2023 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_surround_send_h__
21 #define __ardour_surround_send_h__
22 
23 #include "ardour/processor.h"
24 #include "ardour/send.h"
25 
26 namespace ARDOUR
27 {
28 class Amp;
29 class SurroundPannable;
30 class MuteMaster;
31 class GainControl;
32 
34 {
35 public:
36  SurroundSend (Session&, std::shared_ptr<MuteMaster>);
37  virtual ~SurroundSend ();
38 
39  /* methods for the UI to access SurroundSend controls */
40  std::shared_ptr<GainControl> gain_control () const { return _gain_control; }
41  std::shared_ptr<SurroundPannable> pannable (size_t chn = 0) const;
42 
43  uint32_t n_pannables () const;
44 
45  PBD::Signal0<void> NPannablesChanged;
46  PBD::Signal0<void> PanChanged;
47 
48  /* Route/processor interface */
49  bool can_support_io_configuration (const ChanCount& in, ChanCount& out) { return in == out; }
52  void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
53  bool display_to_user() const;
54  bool does_routing() const { return true; }
55 
57 
58  /* Latent Send */
60  void set_delay_out (samplecnt_t, size_t bus = 0);
61  void update_delaylines (bool rt_ok);
62  samplecnt_t get_delay_in () const { return _delay_in; }
63  samplecnt_t get_delay_out () const { return _delay_out; }
65 
66  /* These may only be called by a SurroundReturn (to which we are attached) from within its ::run() * method */
67  BufferSet const& bufs () const { return _mixbufs; }
68 
69  std::shared_ptr<SurroundPannable> const& pan_param (size_t chn, timepos_t& s, timepos_t& e) const;
70  std::shared_ptr<AutomationControl> send_enable_control () const { return _send_enable_control; }
71 
72 protected:
73  int set_state (const XMLNode&, int version);
74  XMLNode& state () const;
75 
76 private:
77  void ensure_mixbufs ();
78  gain_t target_gain () const;
80  void add_pannable ();
81 
84 
86  int32_t _surround_id;
90  bool _has_state;
92 
93  std::vector<std::shared_ptr<SurroundPannable>> _pannable;
94 
95  std::shared_ptr<AutomationControl> _send_enable_control;
96  std::shared_ptr<GainControl> _gain_control;
97  std::shared_ptr<Amp> _amp;
98  std::shared_ptr<MuteMaster> _mute_master;
99  std::shared_ptr<DelayLine> _send_delay;
100  std::shared_ptr<DelayLine> _thru_delay;
101 
103 };
104 
105 } // namespace ARDOUR
106 
107 #endif /* __ardour_surround_send_h__ */
PBD::ScopedConnectionList _change_connections
std::shared_ptr< GainControl > gain_control() const
Definition: surround_send.h:40
bool display_to_user() const
std::shared_ptr< GainControl > _gain_control
Definition: surround_send.h:96
std::shared_ptr< SurroundPannable > const & pan_param(size_t chn, timepos_t &s, timepos_t &e) const
std::shared_ptr< DelayLine > _thru_delay
std::shared_ptr< MuteMaster > _mute_master
Definition: surround_send.h:98
std::shared_ptr< Amp > _amp
Definition: surround_send.h:97
XMLNode & state() const
uint32_t n_pannables() const
SurroundSend(Session &, std::shared_ptr< MuteMaster >)
std::shared_ptr< DelayLine > _send_delay
Definition: surround_send.h:99
PBD::Signal0< void > NPannablesChanged
Definition: surround_send.h:45
void set_delay_in(samplecnt_t)
samplecnt_t get_delay_in() const
Definition: surround_send.h:62
PBD::Signal0< void > PanChanged
Definition: surround_send.h:46
bool does_routing() const
Definition: surround_send.h:54
BufferSet const & bufs() const
Definition: surround_send.h:67
bool can_support_io_configuration(const ChanCount &in, ChanCount &out)
Definition: surround_send.h:49
int set_block_size(pframes_t)
std::vector< std::shared_ptr< SurroundPannable > > _pannable
Definition: surround_send.h:93
void cycle_start(pframes_t)
bool configure_io(ChanCount in, ChanCount out)
std::shared_ptr< AutomationControl > send_enable_control() const
Definition: surround_send.h:70
int set_state(const XMLNode &, int version)
void run(BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool)
std::shared_ptr< AutomationControl > _send_enable_control
Definition: surround_send.h:95
std::shared_ptr< SurroundPannable > pannable(size_t chn=0) const
std::string describe_parameter(Evoral::Parameter param)
void update_delaylines(bool rt_ok)
samplecnt_t signal_latency() const
gain_t target_gain() const
void set_delay_out(samplecnt_t, size_t bus=0)
samplecnt_t get_delay_out() const
Definition: surround_send.h:63
Definition: xml++.h:114
#define LIBARDOUR_API
uint32_t pframes_t
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t