diff options
author | Robin Gareus <robin@gareus.org> | 2014-01-15 09:37:20 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-01-15 09:37:20 +0100 |
commit | 58def58bf50f29e42babdb5de7ca34819c00909f (patch) | |
tree | 75ac1c64665e5a33e074cb2011f0d3f955fcf72b /libs/panners/vbap/vbap.cc | |
parent | 35c170937de6150ae09154f96e4920d30e83f6ce (diff) |
VBAP GUI convention: top == front ^= azimuth == .5
This allows to move from stereo,mono panners to VBAP and back
and also facilitates sharing pannables of all currently
existing panners with semantically similar results.
(somewhat dirty solution, this retains PBD::spherical_to_cartesian
and maps angles pretty much everywhere else)
Diffstat (limited to 'libs/panners/vbap/vbap.cc')
-rw-r--r-- | libs/panners/vbap/vbap.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/panners/vbap/vbap.cc b/libs/panners/vbap/vbap.cc index e15e2abb4c..2ab91cf3c4 100644 --- a/libs/panners/vbap/vbap.cc +++ b/libs/panners/vbap/vbap.cc @@ -122,7 +122,7 @@ VBAPanner::update () if (_signals.size() > 1) { double w = - (_pannable->pan_width_control->get_value()); - double signal_direction = _pannable->pan_azimuth_control->get_value() - (w/2); + double signal_direction = 1.0 - (_pannable->pan_azimuth_control->get_value() + (w/2)); double grd_step_per_signal = w / (_signals.size() - 1); for (vector<Signal*>::iterator s = _signals.begin(); s != _signals.end(); ++s) { @@ -137,7 +137,7 @@ VBAPanner::update () signal_direction += grd_step_per_signal; } } else if (_signals.size() == 1) { - double center = _pannable->pan_azimuth_control->get_value() * 360.0; + double center = (1.0 - _pannable->pan_azimuth_control->get_value()) * 360.0; /* width has no role to play if there is only 1 signal: VBAP does not do "diffusion" of a single channel */ @@ -421,7 +421,7 @@ VBAPanner::value_as_string (boost::shared_ptr<AutomationControl> ac) const switch (ac->parameter().type()) { case PanAzimuthAutomation: /* direction */ - return string_compose (_("%1\u00B0"), int (rint (val * 360.0))); + return string_compose (_("%1\u00B0"), (int (rint (val * 360.0))+180)%360); case PanWidthAutomation: /* diffusion */ return string_compose (_("%1%%"), (int) floor (100.0 * fabs(val))); @@ -475,11 +475,11 @@ VBAPanner::set_elevation (double e) void VBAPanner::reset () { - set_position (0); + set_position (.5); if (_signals.size() > 1) { set_width (1.0 - (1.0 / (double)_signals.size())); } else { - set_width (0); + set_width (1.0); } set_elevation (0); |