2 * Copyright (C) 2005-2006 Jesse Chappell <jesse@essej.net>
3 * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
5 * Copyright (C) 2008-2012 Carl Hetherington <carl@carlh.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "ardour/buffer_set.h"
23 #include "ardour/debug.h"
24 #include "ardour/panner.h"
25 #include "ardour/pannable.h"
30 using namespace ARDOUR;
32 Panner::Panner (boost::shared_ptr<Pannable> p)
35 // boost_debug_shared_ptr_mark_interesting (this, "panner");
41 DEBUG_TRACE(PBD::DEBUG::Destruction, string_compose ("panner @ %1 destructor, pannable is %2 @ %3\n", this, _pannable, &_pannable));
47 return *(new XMLNode (X_("Panner")));
51 Panner::distribute (BufferSet& ibufs, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
55 for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
56 distribute_one (*src, obufs, gain_coeff, nframes, which);
61 Panner::distribute_automated (BufferSet& ibufs, BufferSet& obufs,
62 samplepos_t start, samplepos_t end, pframes_t nframes, pan_t** buffers)
66 for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
67 distribute_one_automated (*src, obufs, start, end, nframes, buffers, which);
72 Panner::set_automation_state (AutoState state)
74 _pannable->set_automation_state (state);
78 Panner::automation_state () const
80 return _pannable->automation_state();
84 Panner::touching () const
86 return _pannable->touching ();
89 set<Evoral::Parameter>
90 Panner::what_can_be_automated() const
92 return _pannable->what_can_be_automated ();
96 Panner::describe_parameter (Evoral::Parameter p)
98 return _pannable->describe_parameter (p);
102 Panner::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
104 return _pannable->value_as_string (ac);
108 Panner::set_state (XMLNode const &, int)