ardour
delivery.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License as published by the Free
6  Software Foundation; either version 2 of the License, or (at your option)
7  any later version.
8 
9  This program is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12  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  675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 #ifndef __ardour_delivery_h__
20 #define __ardour_delivery_h__
21 
22 #include <string>
23 
25 #include "ardour/types.h"
26 #include "ardour/chan_count.h"
27 #include "ardour/io_processor.h"
28 
29 namespace ARDOUR {
30 
31 class BufferSet;
32 class IO;
33 class MuteMaster;
34 class PannerShell;
35 class Panner;
36 class Pannable;
37 
39 {
40 public:
41  enum Role {
42  /* main outputs - delivers out-of-place to port buffers, and cannot be removed */
43  Main = 0x1,
44  /* send - delivers to port buffers, leaves input buffers untouched */
45  Send = 0x2,
46  /* insert - delivers to port buffers and receives in-place from port buffers */
47  Insert = 0x4,
48  /* listen - internal send used only to deliver to control/monitor bus */
49  Listen = 0x8,
50  /* aux - internal send used to deliver to any bus, by user request */
51  Aux = 0x10
52  };
53 
54  static bool role_requires_output_ports (Role r) { return r == Main || r == Send || r == Insert; }
55 
56  bool does_routing() const { return true; }
57 
58  /* Delivery to an existing output */
59 
61 
62  /* Delivery to a new output owned by this object */
63 
65  ~Delivery ();
66 
67  bool set_name (const std::string& name);
68  std::string display_name() const;
69 
70  Role role() const { return _role; }
71  bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
72  bool configure_io (ChanCount in, ChanCount out);
73 
74  void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
75 
76  /* supplemental method used with MIDI */
77 
78  void flush_buffers (framecnt_t nframes);
79  void no_outs_cuz_we_no_monitor(bool);
80  void transport_stopped (framepos_t frame);
81  void realtime_locate ();
82 
83  BufferSet& output_buffers() { return *_output_buffers; }
84 
85  PBD::Signal0<void> MuteChange;
86 
87  XMLNode& state (bool full);
88  int set_state (const XMLNode&, int version);
89 
90  /* Panning */
91 
92  static int disable_panners (void);
93  static void reset_panners ();
94 
95  boost::shared_ptr<PannerShell> panner_shell() const { return _panshell; }
96  boost::shared_ptr<Panner> panner() const;
97 
98  void unpan ();
99  void reset_panner ();
100  void defer_pan_reset ();
101  void allow_pan_reset ();
102 
103  uint32_t pans_required() const { return _configured_input.n_audio(); }
104  virtual uint32_t pan_outs() const;
105 
106  protected:
111 
112  gain_t target_gain ();
113 
114  private:
117 
118  static bool panners_legal;
119  static PBD::Signal0<void> PannersLegal;
120 
121  void panners_became_legal ();
123  void output_changed (IOChange, void*);
124 
126 };
127 
128 
129 } // namespace ARDOUR
130 
131 #endif // __ardour__h__
132 
bool _no_outs_cuz_we_no_monitor
Definition: delivery.h:115
uint32_t pans_required() const
Definition: delivery.h:103
Role role() const
Definition: delivery.h:70
uint32_t pframes_t
Definition: types.h:61
float gain_t
Definition: types.h:58
PBD::Signal0< void > MuteChange
Definition: delivery.h:85
static bool role_requires_output_ports(Role r)
Definition: delivery.h:54
int64_t framecnt_t
Definition: types.h:76
bool _no_panner_reset
Definition: delivery.h:125
Definition: amp.h:29
BufferSet & output_buffers()
Definition: delivery.h:83
gain_t _current_gain
Definition: delivery.h:109
bool does_routing() const
Definition: delivery.h:56
int64_t framepos_t
Definition: types.h:66
static bool panners_legal
Definition: delivery.h:118
#define LIBARDOUR_API
const char * name
boost::shared_ptr< PannerShell > _panshell
Definition: delivery.h:110
BufferSet * _output_buffers
Definition: delivery.h:108
Definition: xml++.h:95
PBD::ScopedConnection panner_legal_c
Definition: delivery.h:122
boost::shared_ptr< MuteMaster > _mute_master
Definition: delivery.h:116
static PBD::Signal0< void > PannersLegal
Definition: delivery.h:119
boost::shared_ptr< PannerShell > panner_shell() const
Definition: delivery.h:95