2 Copyright (C) 2006 Paul Davis
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)
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
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.
19 #ifndef __ardour_amp_h__
20 #define __ardour_amp_h__
22 #include "ardour/types.h"
23 #include "ardour/chan_count.h"
24 #include "ardour/processor.h"
32 /** Applies a declick operation to all audio inputs, passing the same number of
33 * audio outputs, and passing through any other types unchanged.
35 class Amp : public Processor {
37 Amp(Session& s, IO& io);
39 bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
40 bool configure_io (ChanCount in, ChanCount out);
42 void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
44 bool apply_gain() const { return _apply_gain; }
45 void apply_gain(bool yn) { _apply_gain = yn; }
47 bool apply_gain_automation() const { return _apply_gain_automation; }
48 void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
50 void muute(bool yn) { _mute = yn; }
52 void set_gain(float current, float desired) {
53 _current_gain = current;
54 _desired_gain = desired;
57 void apply_mute(bool yn, float current=1.0, float desired=0.0) {
59 _current_mute_gain = current;
60 _desired_mute_gain = desired;
63 XMLNode& state (bool full);
65 static void apply_gain (BufferSet& bufs, nframes_t nframes,
66 gain_t initial, gain_t target, bool invert_polarity);
68 static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target);
74 bool _apply_gain_automation;
77 float _current_mute_gain;
78 float _desired_mute_gain;
84 #endif // __ardour_amp_h__