Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
21 
22 #include "ardour/processor.h"
23 #include "ardour/send.h"
24 
25 namespace ARDOUR
26 {
27 class Amp;
28 class SurroundPannable;
29 class MuteMaster;
30 class GainControl;
31 
33 {
34 public:
35  SurroundSend (Session&, std::shared_ptr<MuteMaster>);
36  virtual ~SurroundSend ();
37 
38  /* methods for the UI to access SurroundSend controls */
39  std::shared_ptr<GainControl> gain_control () const { return _gain_control; }
40  std::shared_ptr<SurroundPannable> pannable (size_t chn = 0) const;
41 
42  uint32_t n_pannables () const;
43 
46 
47  /* Route/processor interface */
48  bool can_support_io_configuration (const ChanCount& in, ChanCount& out) { return in == out; }
51  void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
52  bool display_to_user() const;
53  bool does_routing() const { return true; }
54 
56 
57  /* Latent Send */
59  void set_delay_out (samplecnt_t, size_t bus = 0);
60  void update_delaylines (bool rt_ok);
61  samplecnt_t get_delay_in () const { return _delay_in; }
62  samplecnt_t get_delay_out () const { return _delay_out; }
64 
65  /* These may only be called by a SurroundReturn (to which we are attached) from within its ::run() * method */
66  BufferSet const& bufs () const { return _mixbufs; }
67 
68  std::shared_ptr<SurroundPannable> const& pan_param (size_t chn, timepos_t& s, timepos_t& e) const;
69  std::shared_ptr<AutomationControl> send_enable_control () const { return _send_enable_control; }
70 
71 protected:
72  int set_state (const XMLNode&, int version);
73  XMLNode& state () const;
74 
75 private:
76  void ensure_mixbufs ();
77  gain_t target_gain () const;
79  void add_pannable ();
80 
83 
85  int32_t _surround_id;
89  bool _has_state;
91 
92  std::vector<std::shared_ptr<SurroundPannable>> _pannable;
93 
94  std::shared_ptr<AutomationControl> _send_enable_control;
95  std::shared_ptr<GainControl> _gain_control;
96  std::shared_ptr<Amp> _amp;
97  std::shared_ptr<MuteMaster> _mute_master;
98  std::shared_ptr<DelayLine> _send_delay;
99  std::shared_ptr<DelayLine> _thru_delay;
100 
102 };
103 
104 } // namespace ARDOUR
105 
PBD::ScopedConnectionList _change_connections
std::shared_ptr< GainControl > gain_control() const
Definition: surround_send.h:39
bool display_to_user() const
std::shared_ptr< GainControl > _gain_control
Definition: surround_send.h:95
std::shared_ptr< SurroundPannable > const & pan_param(size_t chn, timepos_t &s, timepos_t &e) const
std::shared_ptr< DelayLine > _thru_delay
Definition: surround_send.h:99
std::shared_ptr< MuteMaster > _mute_master
Definition: surround_send.h:97
std::shared_ptr< Amp > _amp
Definition: surround_send.h:96
XMLNode & state() const
uint32_t n_pannables() const
SurroundSend(Session &, std::shared_ptr< MuteMaster >)
std::shared_ptr< DelayLine > _send_delay
Definition: surround_send.h:98
PBD::Signal< void()> PanChanged
Definition: surround_send.h:45
void set_delay_in(samplecnt_t)
samplecnt_t get_delay_in() const
Definition: surround_send.h:61
bool does_routing() const
Definition: surround_send.h:53
BufferSet const & bufs() const
Definition: surround_send.h:66
bool can_support_io_configuration(const ChanCount &in, ChanCount &out)
Definition: surround_send.h:48
int set_block_size(pframes_t)
std::vector< std::shared_ptr< SurroundPannable > > _pannable
Definition: surround_send.h:92
void cycle_start(pframes_t)
bool configure_io(ChanCount in, ChanCount out)
std::shared_ptr< AutomationControl > send_enable_control() const
Definition: surround_send.h:69
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:94
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
PBD::Signal< void()> NPannablesChanged
Definition: surround_send.h:44
void set_delay_out(samplecnt_t, size_t bus=0)
samplecnt_t get_delay_out() const
Definition: surround_send.h:62
Definition: xml++.h:114
#define LIBARDOUR_API
uint32_t pframes_t
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t