monitor section: make sip/afl/pfl buttons work, add rude solo, mono function, rearrange
[ardour.git] / libs / ardour / ardour / monitor_processor.h
1 /*
2     Copyright (C) 2010 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_monitor_processor_h__
21 #define __ardour_monitor_processor_h__
22
23 #include <vector>
24
25 #include "pbd/signals.h"
26
27 #include "ardour/types.h"
28 #include "ardour/processor.h"
29
30 class XMLNode;
31
32 namespace ARDOUR {
33
34 class Session;
35
36 class MonitorProcessor : public Processor
37 {
38   public:
39         MonitorProcessor (Session&);
40         MonitorProcessor (Session&, const XMLNode& name);
41
42         bool display_to_user() const;
43
44         void run (BufferSet& /*bufs*/, sframes_t /*start_frame*/, sframes_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/);
45
46         XMLNode& state (bool full);
47         int set_state (const XMLNode&, int /* version */);
48
49         bool configure_io (ChanCount in, ChanCount out);
50         bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
51
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);
58         void set_mono (bool);
59
60         void set_dim_level (gain_t);
61         void set_solo_boost_level (gain_t);
62
63         gain_t dim_level() const { return _dim_level; }
64         gain_t solo_boost_level() const { return _solo_boost_level; }
65
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;
72         bool mono () const;
73
74         PBD::Signal0<void> Changed;
75         
76   private:
77         std::vector<gain_t>  current_gain;
78         std::vector<gain_t> _cut;
79         std::vector<bool>   _dim;
80         std::vector<gain_t> _polarity;
81         std::vector<bool>   _soloed;
82         uint32_t             solo_cnt;
83         bool                _dim_all;
84         bool                _cut_all;
85         bool                _mono;
86         volatile gain_t     _dim_level;
87         volatile gain_t     _solo_boost_level;
88 };
89
90 } /* namespace */
91
92 #endif /* __ardour_monitor_processor_h__ */