13
0

update default speaker position list

This commit is contained in:
Robin Gareus 2014-01-11 23:29:46 +01:00
parent 0669bb455b
commit 7ac05ccfa5

View File

@ -149,32 +149,73 @@ Speakers::move_speaker (int id, const AngularVector& new_position)
void
Speakers::setup_default_speakers (uint32_t n)
{
double o = 90.0;
/* default assignment of speaker position for n speakers */
assert (n>0);
switch (n) {
case 1:
add_speaker (AngularVector (0.0, 0.0));
add_speaker (AngularVector (o +0.0, 0.0));
break;
case 2:
add_speaker (AngularVector (0.0, 0.0));
add_speaker (AngularVector (180.0, 0,0));
add_speaker (AngularVector (o +60.0, 0.0));
add_speaker (AngularVector (o -60.0, 0.0));
break;
case 3:
/* top, bottom kind-of-left & bottom kind-of-right */
add_speaker (AngularVector (90.0, 0.0));
add_speaker (AngularVector (215.0, 0,0));
add_speaker (AngularVector (335.0, 0,0));
add_speaker (AngularVector (o +60.0, 0.0));
add_speaker (AngularVector (o -60.0, 0.0));
add_speaker (AngularVector (o +180.0, 0.0));
break;
case 4:
/* clockwise from top left */
add_speaker (AngularVector (135.0, 0.0));
add_speaker (AngularVector (45.0, 0.0));
add_speaker (AngularVector (335.0, 0.0));
add_speaker (AngularVector (215.0, 0.0));
/* 4.0 with regular spacing */
add_speaker (AngularVector (o +45.0, 0.0));
add_speaker (AngularVector (o -45.0, 0.0));
add_speaker (AngularVector (o +135.0, 0.0));
add_speaker (AngularVector (o -135.0, 0.0));
break;
case 5:
/* 5.0 with regular spacing */
add_speaker (AngularVector (o +72.0, 0.0));
add_speaker (AngularVector (o -72.0, 0.0));
add_speaker (AngularVector (o +0.0, 0.0));
add_speaker (AngularVector (o +144.0, 0.0));
add_speaker (AngularVector (o -144.0, 0.0));
break;
case 6:
/* 6.0 with regular spacing */
add_speaker (AngularVector (o +60.0, 0.0));
add_speaker (AngularVector (o -60.0, 0.0));
add_speaker (AngularVector (o +0.0, 0.0));
add_speaker (AngularVector (o +120.0, 0.0));
add_speaker (AngularVector (o -120.0, 0.0));
add_speaker (AngularVector (o +180.0, 0.0));
break;
case 7:
/* 7.0 with regular front spacing */
add_speaker (AngularVector (o +45.0, 0.0));
add_speaker (AngularVector (o -45.0, 0.0));
add_speaker (AngularVector (o +0.0, 0.0));
add_speaker (AngularVector (o +90.0, 0.0));
add_speaker (AngularVector (o -90.0, 0.0));
add_speaker (AngularVector (o +150.0, 0.0));
add_speaker (AngularVector (o -150.0, 0.0));
break;
case 10:
/* 5+4 with 45°/90° spacing */
add_speaker (AngularVector (o +45.0, 0.0));
add_speaker (AngularVector (o -45.0, 0.0));
add_speaker (AngularVector (o +0.0, 0.0));
add_speaker (AngularVector (o +135.0, 0.0));
add_speaker (AngularVector (o -135.0, 0.0));
add_speaker (AngularVector (o +45.0, 60.0));
add_speaker (AngularVector (o -45.0, 60.0));
add_speaker (AngularVector (o +135.0, 60.0));
add_speaker (AngularVector (o -135.0, 60.0));
add_speaker (AngularVector (o +0.0, 90.0));
break;
default: