+/*
+ Copyright (C) 2012 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
+#ifdef COMPILER_MSVC
+#include <malloc.h>
+#endif
+
#include "pbd/cartesian.h"
#include "pbd/compose.h"
VBAPanner::factory
};
-extern "C" { PanPluginDescriptor* panner_descriptor () { return &_descriptor; } }
+extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
VBAPanner::Signal::Signal (Session&, VBAPanner&, uint32_t, uint32_t n_speakers)
{
}
void
-VBAPanner::Signal::Signal::resize_gains (uint32_t n)
+VBAPanner::Signal::resize_gains (uint32_t n)
{
gains.assign (n, 0.0);
}
assert (sz == obufs.count().n_audio());
- int8_t outputs[sz]; // on the stack, no malloc
+ int8_t *outputs = (int8_t*)alloca(sz); // on the stack, no malloc
/* set initial state of each output "record"
*/
/* at this point, we can test a speaker's status:
- (outputs[o] & 1) <= in use before
- (outputs[o] & 2) <= in use this time
- (outputs[o] & 3) == 3 <= in use both times
- outputs[o] == 0 <= not in use either time
+ (*outputs[o] & 1) <= in use before
+ (*outputs[o] & 2) <= in use this time
+ (*outputs[o] & 3) == 3 <= in use both times
+ *outputs[o] == 0 <= not in use either time
*/
{
_pannable->pan_width_control->set_value (min (1.0, max (-1.0, w)));
}
+
+void
+VBAPanner::reset ()
+{
+ set_position (0);
+ set_width (1);
+
+ update ();
+}