Move panner bypass state up to the PannerShell so that it is preserved even when...
[ardour2.git] / libs / ardour / panner.cc
bloba182f0b99c32ecfda119bcc3f0906f2a21087170
1 /*
2 Copyright (C) 2004-2011 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 #include "ardour/audio_buffer.h"
21 #include "ardour/buffer_set.h"
22 #include "ardour/debug.h"
23 #include "ardour/panner.h"
24 #include "ardour/pannable.h"
25 #include "ardour/session.h"
26 #include "ardour/utils.h"
28 #include "i18n.h"
30 using namespace std;
31 using namespace ARDOUR;
33 Panner::Panner (boost::shared_ptr<Pannable> p)
34 : _pannable (p)
38 Panner::~Panner ()
40 DEBUG_TRACE(PBD::DEBUG::Destruction, string_compose ("panner @ %1 destructor, pannable is %2\n", this, _pannable));
43 XMLNode&
44 Panner::get_state ()
46 return *(new XMLNode (X_("Panner")));
49 void
50 Panner::distribute (BufferSet& ibufs, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
52 uint32_t which = 0;
54 for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
55 distribute_one (*src, obufs, gain_coeff, nframes, which);
59 void
60 Panner::distribute_automated (BufferSet& ibufs, BufferSet& obufs,
61 framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
63 uint32_t which = 0;
65 for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
66 distribute_one_automated (*src, obufs, start, end, nframes, buffers, which);
70 void
71 Panner::set_automation_style (AutoStyle style)
73 _pannable->set_automation_style (style);
76 void
77 Panner::set_automation_state (AutoState state)
79 _pannable->set_automation_state (state);
82 AutoState
83 Panner::automation_state () const
85 return _pannable->automation_state();
88 AutoStyle
89 Panner::automation_style () const
91 return _pannable->automation_style ();
94 bool
95 Panner::touching () const
97 return _pannable->touching ();
100 set<Evoral::Parameter>
101 Panner::what_can_be_automated() const
103 return _pannable->what_can_be_automated ();
106 string
107 Panner::describe_parameter (Evoral::Parameter p)
109 return _pannable->describe_parameter (p);
112 string
113 Panner::value_as_string (boost::shared_ptr<AutomationControl> ac) const
115 return _pannable->value_as_string (ac);
119 Panner::set_state (XMLNode const &, int)
121 return 0;