2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_monitor_processor_h__
21 #define __ardour_monitor_processor_h__
25 #include "pbd/signals.h"
27 #include "ardour/types.h"
28 #include "ardour/processor.h"
36 class MonitorProcessor : public Processor
39 MonitorProcessor (Session&);
41 bool display_to_user() const;
43 void run (BufferSet& /*bufs*/, sframes_t /*start_frame*/, sframes_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/);
45 XMLNode& state (bool full);
46 int set_state (const XMLNode&, int /* version */);
48 bool configure_io (ChanCount in, ChanCount out);
49 bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
51 void set_cut_all (bool);
52 void set_dim_all (bool);
53 void set_polarity (uint32_t, bool invert);
54 void set_cut (uint32_t, bool cut);
55 void set_dim (uint32_t, bool dim);
56 void set_solo (uint32_t, bool);
59 void set_dim_level (gain_t);
60 void set_solo_boost_level (gain_t);
62 gain_t dim_level() const { return _dim_level; }
63 gain_t solo_boost_level() const { return _solo_boost_level; }
65 bool dimmed (uint32_t chn) const;
66 bool soloed (uint32_t chn) const;
67 bool inverted (uint32_t chn) const;
68 bool cut (uint32_t chn) const;
69 bool cut_all () const;
70 bool dim_all () const;
73 PBD::Signal0<void> Changed;
76 struct ChannelRecord {
84 : current_gain(1.0), cut(1.0), dim(false), polarity(1.0), soloed (false) {}
87 std::vector<ChannelRecord> _channels;
93 volatile gain_t _dim_level;
94 volatile gain_t _solo_boost_level;
96 void allocate_channels (uint32_t);
101 #endif /* __ardour_monitor_processor_h__ */