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/signals.h>
27 #include "ardour/panner.h"
33 class VBAPanner : public StreamPanner {
35 VBAPanner (Panner& parent, Evoral::Parameter param, VBAPSpeakers& s);
38 void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
39 void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
40 nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
42 void set_azimuth_elevation (double azimuth, double elevation);
44 XMLNode& state (bool full_state);
45 XMLNode& get_state ();
46 int set_state (const XMLNode&, int version);
48 /* there never was any old-school automation */
50 int load (std::istream&, std::string path, uint32_t&) { return 0; }
53 double _azimuth; /* direction for the signal source */
54 double _elevation; /* elevation of the signal source */
57 double desired_gains[3];
59 int desired_outputs[3];
61 PBD::ScopedConnection speaker_connection;
63 VBAPSpeakers& _speakers;
65 void compute_gains (double g[3], int ls[3], int azi, int ele);
73 #endif /* __libardour_vbap_h__ */