Minor cleanups.

This commit is contained in:
Jonathan Moore Liles 2008-03-12 11:06:13 -05:00
parent 0101ee43b9
commit beda8a0d36
3 changed files with 46 additions and 36 deletions

View File

@ -464,7 +464,7 @@ Region::draw ( int X, int Y, int W, int H )
_scale, selected() ? fl_invert_color( _color ) : _color ); _scale, selected() ? fl_invert_color( _color ) : _color );
// timeline->draw_measure_lines( rx, Y, rw, H, _box_color ); timeline->draw_measure_lines( rx, Y, rw, H, _box_color );
fl_color( FL_BLACK ); fl_color( FL_BLACK );
fl_line( rx, Y, rx, Y + H ); fl_line( rx, Y, rx, Y + H );

View File

@ -99,33 +99,27 @@ protected:
if ( ! strcmp( s, ":x" ) ) if ( ! strcmp( s, ":x" ) )
_offset = atol( v ); _offset = atol( v );
else else if ( ! strcmp( s, ":l" ) )
if ( ! strcmp( s, ":l" ) )
_start = atol( v ); _start = atol( v );
else else if ( ! strcmp( s, ":r" ) )
if ( ! strcmp( s, ":r" ) )
_end = atol( v ); _end = atol( v );
else else if ( ! strcmp( s, ":selected" ) )
if ( ! strcmp( s, ":selected" ) )
{ {
if ( atoi( v ) ) if ( atoi( v ) )
select(); select();
else else
deselect(); deselect();
} }
else else if ( ! strcmp( s, ":gain" ) )
if ( ! strcmp( s, ":gain" ) )
_scale = atof( v ); _scale = atof( v );
else else if ( ! strcmp( s, ":source" ) )
if ( ! strcmp( s, ":source" ) )
{ {
if ( ! ( _clip = Audio_File::from_file( v ) ) ) if ( ! ( _clip = Audio_File::from_file( v ) ) )
{ {
printf( "Grave error: could not open source \"%s\"\n", v ); printf( "Grave error: could not open source \"%s\"\n", v );
} }
} }
else else if ( ! strcmp( s, ":track" ) )
if ( ! strcmp( s, ":track" ) )
{ {
int i; int i;
sscanf( v, "%X", &i ); sscanf( v, "%X", &i );

20
Track.C
View File

@ -86,11 +86,24 @@ Track::draw ( void )
fl_clip_box( x(), y(), w(), h(), X, Y, W, H ); fl_clip_box( x(), y(), w(), h(), X, Y, W, H );
if ( pushed() && pushed()->track() == this )
{
/* make sure the pushed widget is above all others */
remove( pushed() );
add( pushed() );
}
int xfades = 0;
// printf( "track::draw %d,%d %dx%d\n", X,Y,W,H ); // printf( "track::draw %d,%d %dx%d\n", X,Y,W,H );
timeline->draw_measure_lines( x(), y(), w(), h(), color() );
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw_box( X, Y, W, H ); (*r)->draw_box( X, Y, W, H );
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw( X, Y, W, H ); (*r)->draw( X, Y, W, H );
@ -112,6 +125,8 @@ Track::draw ( void )
/* completely inside */ /* completely inside */
continue; continue;
++xfades;
Rectangle b( (*r)->x(), Rectangle b( (*r)->x(),
o->y(), o->y(),
(o->x() + o->w()) - (*r)->x(), (o->x() + o->w()) - (*r)->x(),
@ -133,7 +148,9 @@ Track::draw ( void )
} }
for ( list <Track_Widget *>::const_reverse_iterator r = _widgets.rbegin(); r != _widgets.rend(); r++ ) // printf( "There are %d xfades\n", xfades );
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
{ {
Track_Widget *o = overlaps( *r ); Track_Widget *o = overlaps( *r );
@ -184,7 +201,6 @@ Track::draw ( void )
} }
} }
timeline->draw_measure_lines( x(), y(), w(), h(), color() );
fl_pop_clip(); fl_pop_clip();
} }