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 "ardour/panner.h"
26 #include "ardour/vbap_speakers.h"
32 class VBAPanner : public StreamPanner {
34 VBAPanner (Panner& parent, Evoral::Parameter param, Speakers& s);
37 static StreamPanner* factory (Panner& parent, Evoral::Parameter param, Speakers& s);
38 static std::string name;
40 void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
41 void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
42 framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers);
44 void set_azimuth_elevation (double azimuth, double elevation);
46 XMLNode& state (bool full_state);
47 XMLNode& get_state ();
48 int set_state (const XMLNode&, int version);
50 /* there never was any old-school automation */
52 int load (std::istream&, std::string path, uint32_t&) { return 0; }
57 double desired_gains[3];
59 int desired_outputs[3];
61 VBAPSpeakers& _speakers;
63 void compute_gains (double g[3], int ls[3], int azi, int ele);
70 #endif /* __libardour_vbap_h__ */