Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
23 
24 #include <string>
25 
26 
27 #include "pbd/stateful.h"
28 #include "ardour/ardour.h"
29 #include "ardour/io_processor.h"
30 
31 namespace ARDOUR {
32 
33 class Amp;
34 class PeakMeter;
35 class GainControl;
36 
38 {
39 public:
40  Return (Session&, bool internal = false);
41  virtual ~Return ();
42 
43  void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
44 
45  std::shared_ptr<Amp> amp() const { return _amp; }
46  std::shared_ptr<PeakMeter> meter() const { return _meter; }
47  std::shared_ptr<GainControl> gain_control() const { return _gain_control; }
48 
49  bool metering() const { return _metering; }
50  void set_metering (bool yn) { _metering = yn; }
51 
52  int set_state(const XMLNode&, int version);
53 
54  uint32_t pans_required() const { return _configured_input.n_audio(); }
55 
58 
59  static uint32_t how_many_returns();
60  static std::string name_and_id_new_return (Session&, uint32_t&);
61 
62 protected:
63  XMLNode& state() const;
64 
65  bool _metering;
66  std::shared_ptr<GainControl> _gain_control;
67  std::shared_ptr<Amp> _amp;
68  std::shared_ptr<PeakMeter> _meter;
69 
70 private:
71  /* disallow copy construction */
72  Return (const Return&);
73 
74  void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset = ChanCount::ZERO);
75 };
76 
77 } // namespace ARDOUR
78 
79 
static const ChanCount ZERO
Definition: chan_count.h:208
uint32_t pans_required() const
Definition: return.h:54
std::shared_ptr< GainControl > _gain_control
Definition: return.h:66
bool _metering
Definition: return.h:65
std::shared_ptr< PeakMeter > meter() const
Definition: return.h:46
std::shared_ptr< GainControl > gain_control() const
Definition: return.h:47
void collect_input(BufferSet &bufs, pframes_t nframes, ChanCount offset=ChanCount::ZERO)
std::shared_ptr< PeakMeter > _meter
Definition: return.h:68
XMLNode & state() const
void set_metering(bool yn)
Definition: return.h:50
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:67
static uint32_t how_many_returns()
std::shared_ptr< Amp > amp() const
Definition: return.h:45
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:49
Definition: xml++.h:114
#define LIBARDOUR_API
uint32_t pframes_t
Temporal::samplepos_t samplepos_t