Ardour  8.12
return.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2013-2017 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 #ifndef __ardour_return_h__
23 #define __ardour_return_h__
24 
25 #include <string>
26 
27 
28 #include "pbd/stateful.h"
29 #include "ardour/ardour.h"
30 #include "ardour/io_processor.h"
31 
32 namespace ARDOUR {
33 
34 class Amp;
35 class PeakMeter;
36 class GainControl;
37 
39 {
40 public:
41  Return (Session&, bool internal = false);
42  virtual ~Return ();
43 
44  void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
45 
46  std::shared_ptr<Amp> amp() const { return _amp; }
47  std::shared_ptr<PeakMeter> meter() const { return _meter; }
48  std::shared_ptr<GainControl> gain_control() const { return _gain_control; }
49 
50  bool metering() const { return _metering; }
51  void set_metering (bool yn) { _metering = yn; }
52 
53  int set_state(const XMLNode&, int version);
54 
55  uint32_t pans_required() const { return _configured_input.n_audio(); }
56 
59 
60  static uint32_t how_many_returns();
61  static std::string name_and_id_new_return (Session&, uint32_t&);
62 
63 protected:
64  XMLNode& state() const;
65 
66  bool _metering;
67  std::shared_ptr<GainControl> _gain_control;
68  std::shared_ptr<Amp> _amp;
69  std::shared_ptr<PeakMeter> _meter;
70 
71 private:
72  /* disallow copy construction */
73  Return (const Return&);
74 
75  void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset = ChanCount::ZERO);
76 };
77 
78 } // namespace ARDOUR
79 
80 #endif /* __ardour_return_h__ */
81 
static const ChanCount ZERO
Definition: chan_count.h:209
uint32_t pans_required() const
Definition: return.h:55
std::shared_ptr< GainControl > _gain_control
Definition: return.h:67
bool _metering
Definition: return.h:66
std::shared_ptr< PeakMeter > meter() const
Definition: return.h:47
std::shared_ptr< GainControl > gain_control() const
Definition: return.h:48
void collect_input(BufferSet &bufs, pframes_t nframes, ChanCount offset=ChanCount::ZERO)
std::shared_ptr< PeakMeter > _meter
Definition: return.h:69
XMLNode & state() const
void set_metering(bool yn)
Definition: return.h:51
Return(const Return &)
bool configure_io(ChanCount in, ChanCount out)
virtual ~Return()
void run(BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool)
int set_state(const XMLNode &, int version)
std::shared_ptr< Amp > _amp
Definition: return.h:68
static uint32_t how_many_returns()
std::shared_ptr< Amp > amp() const
Definition: return.h:46
Return(Session &, bool internal=false)
static std::string name_and_id_new_return(Session &, uint32_t &)
bool can_support_io_configuration(const ChanCount &in, ChanCount &out)
bool metering() const
Definition: return.h:50
Definition: xml++.h:114
#define LIBARDOUR_API
uint32_t pframes_t
Temporal::samplepos_t samplepos_t