Browse Source

Minor cleanups.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
beda8a0d36
3 changed files with 48 additions and 38 deletions
  1. +1
    -1
      Region.C
  2. +29
    -35
      Region.H
  3. +18
    -2
      Track.C

+ 1
- 1
Region.C View File

@@ -464,7 +464,7 @@ Region::draw ( int X, int Y, int W, int H )
_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_line( rx, Y, rx, Y + H );


+ 29
- 35
Region.H View File

@@ -99,42 +99,36 @@ protected:

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

assert( t );

t->add( this );
}
deselect();
}
else if ( ! strcmp( s, ":gain" ) )
_scale = atof( v );
else if ( ! strcmp( s, ":source" ) )
{
if ( ! ( _clip = Audio_File::from_file( v ) ) )
{
printf( "Grave error: could not open source \"%s\"\n", v );
}
}
else if ( ! strcmp( s, ":track" ) )
{
int i;
sscanf( v, "%X", &i );
Track *t = (Track*)Loggable::find( i );

assert( t );

t->add( this );
}


free( s );


+ 18
- 2
Track.C View File

@@ -86,11 +86,24 @@ Track::draw ( void )

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 );

timeline->draw_measure_lines( x(), y(), w(), h(), color() );

for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw_box( X, Y, W, H );


for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw( X, Y, W, H );

@@ -112,6 +125,8 @@ Track::draw ( void )
/* completely inside */
continue;

++xfades;

Rectangle b( (*r)->x(),
o->y(),
(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 );

@@ -184,7 +201,6 @@ Track::draw ( void )
}
}

timeline->draw_measure_lines( x(), y(), w(), h(), color() );

fl_pop_clip();
}


Loading…
Cancel
Save