Fix broken whitespace. I'd apologize for the compile times if it was my fault :D
[ardour.git] / libs / ardour / ardour / panner_shell.h
1 /*
2     Copyright (C) 2004-2011 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_panner_shell_h__
21 #define __ardour_panner_shell_h__
22
23 #include <cmath>
24 #include <cassert>
25 #include <vector>
26 #include <string>
27 #include <iostream>
28
29 #include <boost/noncopyable.hpp>
30
31 #include "pbd/cartesian.h"
32
33 #include "ardour/types.h"
34 #include "ardour/session_object.h"
35
36 namespace ARDOUR {
37
38 class Session;
39 class Panner;
40 class BufferSet;
41 class AudioBuffer;
42 class Speakers;
43 class Pannable;
44
45 /** Class to manage panning by instantiating and controlling
46  *  the appropriate specific PannerBase objects for a given
47  *  in/out configuration.
48  */
49 class PannerShell : public SessionObject
50 {
51 public:
52         PannerShell (std::string name, Session&, boost::shared_ptr<Pannable>);
53         virtual ~PannerShell ();
54
55         std::string describe_parameter (Evoral::Parameter param);
56
57         bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; };
58         void configure_io (ChanCount in, ChanCount out);
59
60         /// The fundamental Panner function
61         void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes);
62
63
64         XMLNode& get_state (void);
65         XMLNode& state (bool full);
66         int      set_state (const XMLNode&, int version);
67
68         PBD::Signal0<void> Changed; /* panner and/or outputs count changed */
69
70         boost::shared_ptr<Panner> panner() const { return _panner; }
71         boost::shared_ptr<Pannable> pannable() const { return _pannable; }
72
73   private:
74         void distribute_no_automation (BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
75         boost::shared_ptr<Panner> _panner;
76         boost::shared_ptr<Pannable> _pannable;
77
78         static float current_automation_version_number;
79 };
80
81 } // namespace ARDOUR
82
83 #endif /* __ardour_panner_shell_h__ */