+
+void
+Panner::setup_speakers (uint32_t nouts)
+{
+ switch (nouts) {
+ case 3:
+ outputs.push_back (Output (0.5, 0));
+ outputs.push_back (Output (0, 1.0));
+ outputs.push_back (Output (1.0, 1.0));
+ break;
+ case 4:
+ outputs.push_back (Output (0, 0));
+ outputs.push_back (Output (1.0, 0));
+ outputs.push_back (Output (1.0, 1.0));
+ outputs.push_back (Output (0, 1.0));
+ break;
+
+ case 5: //square+offcenter center
+ outputs.push_back (Output (0, 0));
+ outputs.push_back (Output (1.0, 0));
+ outputs.push_back (Output (1.0, 1.0));
+ outputs.push_back (Output (0, 1.0));
+ outputs.push_back (Output (0.5, 0.75));
+ break;
+
+ default:
+ /* XXX horrible placement. FIXME */
+ for (uint32_t n = 0; n < nouts; ++n) {
+ outputs.push_back (Output (0.1 * n, 0.1 * n));
+ }
+ }
+
+ VBAPSpeakers& speakers (_session.get_speakers());
+
+ speakers.clear_speakers ();
+
+ for (vector<Output>::iterator o = outputs.begin(); o != outputs.end(); ++o) {
+ double azimuth;
+ double elevation;
+
+ cart_to_azi_ele ((*o).x + 1.0, (*o).y + 1.0, (*o).z, azimuth, elevation);
+ speakers.add_speaker (azimuth, elevation);
+ }
+}