Browse Source

Timeline: Fix graphics corruption. Also, indicate loop point by modifying waveform color.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
8eef38f0cc
4 changed files with 21 additions and 44 deletions
  1. +3
    -19
      timeline/src/Audio_Region.C
  2. +8
    -5
      timeline/src/Sequence_Point.C
  3. +1
    -6
      timeline/src/Sequence_Point.H
  4. +9
    -14
      timeline/src/Waveform.C

+ 3
- 19
timeline/src/Audio_Region.C View File

@@ -565,6 +565,8 @@ Audio_Region::draw ( void )
int peaks;
Peak *pbuf = NULL;
// Fl_Color c = _color;

do {

nframes_t start = _r->offset;
@@ -640,9 +642,6 @@ Audio_Region::draw ( void )
// DMESSAGE( "using cached peaks" );
}

Fl_Color c = _color;


// c = fl_color_average( FL_BLACK, FL_RED, 0.20 );

if ( peaks && pbuf )
@@ -668,27 +667,12 @@ Audio_Region::draw ( void )

xo += loop_peaks_needed;

c = fl_color_average( FL_GRAY, _color, 0.70 );
}
while ( _loop && xo < W );

timeline->draw_measure_lines( X, Y, W, H );

if ( _loop && offset < _loop )
{
const int x = timeline->ts_to_x( _loop - offset );

/* FIXME: is there no way to draw these symbols direclty? */

fl_push_matrix();
fl_translate( X + x + 2, y() + h() - 7 );
fl_scale( - 8, 8 );
draw_full_arrow_symbol( FL_WHITE );
fl_pop_matrix();
}

if ( _adjusting_gain )
{
fl_color( fl_color_add_alpha( FL_DARK1, 127 ) );


+ 8
- 5
timeline/src/Sequence_Point.C View File

@@ -109,21 +109,24 @@ Sequence_Point::draw_box ( void )
// Sequence_Widget::draw_box();

const int X = x() - (abs_w() >> 1);
// const int Y = y() + Fl::box_dy( box() );
/* // const int Y = y() + Fl::box_dy( box() ); */

const int Y = y();

fl_color( color() );
/* fl_draw_box( FL_ASYM_BOX, x() - ( abs_w() / 2 ), y(), abs_w(), h(), color() ); */

/* fl_color( color() ); */

fl_push_matrix();
fl_translate( X, Y + ( h() >> 3 ) );
fl_scale( w(), h() - ( h() >> 3 ) );
fl_translate( X, Y );
fl_scale( abs_w(), h() );

draw_marker( color() );

fl_pop_matrix();

// fl_line( X, Y, X, Y + h() - Fl::box_dh( box() ) );
/* fl_color( FL_WHITE ); */
/* fl_line( x(), y(), x(), y() + h() ); */
}

void


+ 1
- 6
timeline/src/Sequence_Point.H View File

@@ -60,12 +60,7 @@ public:

virtual int x ( void ) const
{
const int x = Sequence_Widget::x();

if ( x >= sequence()->x() + sequence()->w() )
return sequence()->x() + sequence()->w() + abs_w();
else
return x;
return line_x();
}

nframes_t length ( void ) const { return timeline->x_to_ts( abs_w() ); }


+ 9
- 14
timeline/src/Waveform.C View File

@@ -66,6 +66,9 @@ Waveform::draw ( int X, int Y, int W, int H,
const int ty = Y + halfheight;

W = min( peaks, W );

if ( ! W )
return;
if ( Waveform::fill )
{
@@ -93,29 +96,21 @@ Waveform::draw ( int X, int Y, int W, int H,
}
else
{

// fl_color( fl_color_add_alpha( color, 127 ) );
fl_color( color );
fl_begin_complex_polygon();
j = start;
for ( int x = X; x < X + W; x++, j += skip )
fl_vertex( x, ty - ( halfheight * pbuf[ j ].min ) );

// fl_end_line();

// fl_begin_line();

j = start + ( W * skip );

// j = start + ( W * skip );
for ( int x = X + W; x >= X; x--, j -= skip )
fl_vertex( x, ty - ( halfheight * pbuf[ j ].max ) );
fl_end_complex_polygon();

// fl_line_style( FL_SOLID, 0 );
}
}



Loading…
Cancel
Save