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&);
40 MonitorProcessor (Session&, const XMLNode& name);
42 bool display_to_user() const;
44 void run (BufferSet& /*bufs*/, sframes_t /*start_frame*/, sframes_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/);
46 XMLNode& state (bool full);
47 int set_state (const XMLNode&, int /* version */);
49 bool configure_io (ChanCount in, ChanCount out);
50 bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
52 void set_cut_all (bool);
53 void set_dim_all (bool);
54 void set_polarity (uint32_t, bool invert);
55 void set_cut (uint32_t, bool cut);
56 void set_dim (uint32_t, bool dim);
57 void set_solo (uint32_t, bool);
60 void set_dim_level (gain_t);
61 void set_solo_boost_level (gain_t);
63 gain_t dim_level() const { return _dim_level; }
64 gain_t solo_boost_level() const { return _solo_boost_level; }
66 bool dimmed (uint32_t chn) const;
67 bool soloed (uint32_t chn) const;
68 bool inverted (uint32_t chn) const;
69 bool cut (uint32_t chn) const;
70 bool cut_all () const;
71 bool dim_all () const;
74 PBD::Signal0<void> Changed;
77 struct ChannelRecord {
85 : current_gain(1.0), cut(1.0), dim(false), polarity(1.0), soloed (false) {}
88 std::vector<ChannelRecord> _channels;
94 volatile gain_t _dim_level;
95 volatile gain_t _solo_boost_level;
97 void allocate_channels (uint32_t);
102 #endif /* __ardour_monitor_processor_h__ */