Browse Source

Improve panner layout rendering.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
c6de6b85d6
2 changed files with 23 additions and 22 deletions
  1. +21
    -19
      Panner.C
  2. +2
    -3
      Panner.H

+ 21
- 19
Panner.C View File

@@ -25,16 +25,20 @@
/* multichannel layouts, in degrees */ /* multichannel layouts, in degrees */
int Panner::_configs[][12] = int Panner::_configs[][12] =
{ {
/* none */
{ -1 },
/* mono */ /* mono */
{ -1 }, { -1 },
/* stereo */ /* stereo */
{ 270, 90, -1 },
{ 270, 90 },
{ -1 },
/* quad */ /* quad */
{ 315, 45, 225, 135, -1 },
{ 315, 45, 225, 135 },
/* 5.1 */ /* 5.1 */
{ 315, 45, 225, 135, 0, -1 },
{ 315, 45, 225, 135, 0 },
{ -1 },
/* 7.1 */ /* 7.1 */
{ 315, 45, 225, 135, 0, 270, 90, -1 },
{ 315, 45, 225, 135, 0, 270, 90 },


}; };


@@ -47,6 +51,9 @@ Panner::event_point ( void )


bbox( X, Y, W, H ); bbox( X, Y, W, H );


W -= pw();
H -= ph();

for ( int i = _ins; i--; ) for ( int i = _ins; i--; )
{ {
Point *p = &_points[ i ]; Point *p = &_points[ i ];
@@ -70,26 +77,21 @@ Panner::draw ( void )


bbox( tx, ty, tw, th ); bbox( tx, ty, tw, th );


fl_color( FL_GRAY );

switch ( _outs )
fl_color( FL_WHITE );
if ( _configs[ _outs ][0] >= 0 )
{ {
case 2: /* stereo */

case 4: /* quad */
fl_line( x(), y(), x()+ w(), y() + h() );
fl_line( x() + w(), y(), x(), y() + h() );
break;
case 5: /* 5.1 */
fl_line( x(), y(), x() + w(), y() + h() );
fl_line( x() + w(), y(), x(), y() + h() );
fl_line( x() + (w() / 2), y(), x() + (w() / 2), y() + (h() / 2) );
break;
for ( int i = _outs; i--; )
{
int a = _configs[ _outs ][ i ];


a += 90;


fl_arc( tx, ty, tw, th, a - 3, a + 3 );
}
} }



tw -= pw();
th -= ph();


for ( int i = _ins; i--; ) for ( int i = _ins; i--; )
{ {


+ 2
- 3
Panner.H View File

@@ -52,8 +52,8 @@ class Panner : public Fl_Widget


void bbox ( int &X, int &Y, int &W, int &H ) void bbox ( int &X, int &Y, int &W, int &H )
{ {
W = w() - Fl::box_dw( box() ) - pw();
H = h() - Fl::box_dh( box() ) - ph();
W = w() - Fl::box_dw( box() );
H = h() - Fl::box_dh( box() );
X = x() + Fl::box_dx( box() ); X = x() + Fl::box_dx( box() );
Y = y() + Fl::box_dy( box() ); Y = y() + Fl::box_dy( box() );
} }
@@ -72,7 +72,6 @@ public:
_points.push_back( Point( 1, -1 ) ); _points.push_back( Point( 1, -1 ) );


_outs = 5; _outs = 5;

} }


virtual ~Panner ( ) { } virtual ~Panner ( ) { }


Loading…
Cancel
Save