Clean up channel config definitions.

This commit is contained in:
Jonathan Moore Liles 2008-03-13 16:55:13 -05:00
parent c6de6b85d6
commit 153dc533ba
1 changed files with 26 additions and 12 deletions

View File

@ -22,24 +22,36 @@
/* 2D Panner widget. Supports various multichannel configurations. */ /* 2D Panner widget. Supports various multichannel configurations. */
enum {
NONE = -1,
R = 90,
L = 270,
C = 0,
FL = 315,
FR = 45,
RL = 225,
RR = 135,
};
/* multichannel layouts, in degrees */ /* multichannel layouts, in degrees */
int Panner::_configs[][12] = int Panner::_configs[][12] =
{ {
/* none */ /* none, error condition? */
{ -1 }, { NONE },
/* mono */ /* mono, panner disabled */
{ -1 }, { NONE },
/* stereo */ /* stereo */
{ 270, 90 }, { L, R },
{ -1 }, /* stereo + mono */
{ L, R, C },
/* quad */ /* quad */
{ 315, 45, 225, 135 }, { FL, FR, RL, RR },
/* 5.1 */ /* 5.1 */
{ 315, 45, 225, 135, 0 }, { FL, FR, RL, RR, C },
{ -1 }, /* no such config */
{ NONE },
/* 7.1 */ /* 7.1 */
{ 315, 45, 225, 135, 0, 270, 90 }, { FL, FR, RL, RR, C, L, R },
}; };
@ -84,7 +96,9 @@ Panner::draw ( void )
{ {
int a = _configs[ _outs ][ i ]; int a = _configs[ _outs ][ i ];
a += 90; // FIXME: this is a hack... Why does fl_arc seem to put 0 degrees at 3 o'clock and inverted?
a -= 90;
a = 360 - a;
fl_arc( tx, ty, tw, th, a - 3, a + 3 ); fl_arc( tx, ty, tw, th, a - 3, a + 3 );
} }