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.
19 #ifndef __libardour_vbap_h__
20 #define __libardour_vbap_h__
25 #include "pbd/cartesian.h"
27 #include "ardour/panner.h"
28 #include "ardour/panner_shell.h"
29 #include "ardour/vbap_speakers.h"
36 class VBAPanner : public Panner
39 VBAPanner (boost::shared_ptr<Pannable>, Speakers& s);
42 void configure_io (const ChanCount& in, const ChanCount& /* ignored - we use Speakers */);
44 ChanCount out() const;
46 static Panner* factory (boost::shared_ptr<Pannable>, Speakers& s);
48 void do_distribute (BufferSet& ibufs, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
49 void do_distribute_automated (BufferSet& ibufs, BufferSet& obufs,
50 framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers);
52 void set_azimuth_elevation (double azimuth, double elevation);
54 XMLNode& state (bool full_state);
55 XMLNode& get_state ();
56 int set_state (const XMLNode&, int version);
58 boost::shared_ptr<AutomationControl> azimuth_control (uint32_t signal);
59 boost::shared_ptr<AutomationControl> evelation_control (uint32_t signal);
61 std::string describe_parameter (Evoral::Parameter param);
65 PBD::AngularVector direction;
67 double desired_gains[3];
69 int desired_outputs[3];
70 boost::shared_ptr<AutomationControl> azimuth_control;
71 boost::shared_ptr<AutomationControl> elevation_control;
73 Signal (Session&, VBAPanner&, uint32_t which);
76 std::vector<Signal*> _signals;
78 VBAPSpeakers& _speakers;
80 void compute_gains (double g[3], int ls[3], int azi, int ele);
82 void do_distribute_one (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes, uint32_t which);
83 void do_distribute_one_automated (AudioBuffer& src, BufferSet& obufs,
84 framepos_t start, framepos_t end, pframes_t nframes,
85 pan_t** buffers, uint32_t which);
90 #endif /* __libardour_vbap_h__ */