tweaks to boost debug related code, from a boost debugging session
[ardour.git] / libs / ardour / panner.cc
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 #include "pbd/boost_debug.h"
21
22 #include "ardour/audio_buffer.h"
23 #include "ardour/buffer_set.h"
24 #include "ardour/debug.h"
25 #include "ardour/panner.h"
26 #include "ardour/pannable.h"
27 #include "ardour/session.h"
28 #include "ardour/utils.h"
29
30 #include "i18n.h"
31
32 using namespace std;
33 using namespace ARDOUR;
34
35 Panner::Panner (boost::shared_ptr<Pannable> p)
36 {
37         // boost_debug_shared_ptr_mark_interesting (this, "panner");
38         _pannable = p;
39 }
40
41 Panner::~Panner ()
42 {
43         DEBUG_TRACE(PBD::DEBUG::Destruction, string_compose ("panner @ %1 destructor, pannable is %2 @ %3\n", this, _pannable, &_pannable));
44 }
45
46 XMLNode&
47 Panner::get_state ()
48 {
49         return *(new XMLNode (X_("Panner")));
50 }
51
52 void
53 Panner::distribute (BufferSet& ibufs, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
54 {
55         uint32_t which = 0;
56
57         for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
58                 distribute_one (*src, obufs, gain_coeff, nframes, which);
59         }
60 }
61
62 void
63 Panner::distribute_automated (BufferSet& ibufs, BufferSet& obufs,
64                               framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
65 {
66         uint32_t which = 0;
67
68         for (BufferSet::audio_iterator src = ibufs.audio_begin(); src != ibufs.audio_end(); ++src, ++which) {
69                 distribute_one_automated (*src, obufs, start, end, nframes, buffers, which);
70         }
71 }
72
73 void
74 Panner::set_automation_style (AutoStyle style)
75 {
76         _pannable->set_automation_style (style);
77 }
78
79 void
80 Panner::set_automation_state (AutoState state)
81 {
82         _pannable->set_automation_state (state);
83 }
84
85 AutoState
86 Panner::automation_state () const
87 {
88         return _pannable->automation_state();
89 }
90
91 AutoStyle
92 Panner::automation_style () const
93 {
94         return _pannable->automation_style ();
95 }
96
97 bool
98 Panner::touching () const
99 {
100         return _pannable->touching ();
101 }
102
103 set<Evoral::Parameter>
104 Panner::what_can_be_automated() const
105 {
106         return _pannable->what_can_be_automated ();
107 }
108
109 string
110 Panner::describe_parameter (Evoral::Parameter p)
111 {
112         return _pannable->describe_parameter (p);
113 }
114
115 string
116 Panner::value_as_string (boost::shared_ptr<AutomationControl> ac) const
117 {
118         return _pannable->value_as_string (ac);
119 }
120
121 int
122 Panner::set_state (XMLNode const &, int)
123 {
124         return 0;
125 }