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

This commit is contained in:
Jonathan Moore Liles 2012-06-05 02:23:21 -07:00
parent c0375e614a
commit 8eef38f0cc
4 changed files with 21 additions and 44 deletions

View File

@ -565,6 +565,8 @@ Audio_Region::draw ( void )
int peaks; int peaks;
Peak *pbuf = NULL; Peak *pbuf = NULL;
// Fl_Color c = _color;
do { do {
nframes_t start = _r->offset; nframes_t start = _r->offset;
@ -640,9 +642,6 @@ Audio_Region::draw ( void )
// DMESSAGE( "using cached peaks" ); // DMESSAGE( "using cached peaks" );
} }
Fl_Color c = _color;
// c = fl_color_average( FL_BLACK, FL_RED, 0.20 ); // c = fl_color_average( FL_BLACK, FL_RED, 0.20 );
if ( peaks && pbuf ) if ( peaks && pbuf )
@ -668,27 +667,12 @@ Audio_Region::draw ( void )
xo += loop_peaks_needed; xo += loop_peaks_needed;
c = fl_color_average( FL_GRAY, _color, 0.70 );
} }
while ( _loop && xo < W ); while ( _loop && xo < W );
timeline->draw_measure_lines( X, Y, W, H ); 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 ) if ( _adjusting_gain )
{ {
fl_color( fl_color_add_alpha( FL_DARK1, 127 ) ); fl_color( fl_color_add_alpha( FL_DARK1, 127 ) );

View File

@ -109,21 +109,24 @@ Sequence_Point::draw_box ( void )
// Sequence_Widget::draw_box(); // Sequence_Widget::draw_box();
const int X = x() - (abs_w() >> 1); 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(); 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_push_matrix();
fl_translate( X, Y + ( h() >> 3 ) ); fl_translate( X, Y );
fl_scale( w(), h() - ( h() >> 3 ) ); fl_scale( abs_w(), h() );
draw_marker( color() ); draw_marker( color() );
fl_pop_matrix(); 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 void

View File

@ -60,12 +60,7 @@ public:
virtual int x ( void ) const virtual int x ( void ) const
{ {
const int x = Sequence_Widget::x(); return line_x();
if ( x >= sequence()->x() + sequence()->w() )
return sequence()->x() + sequence()->w() + abs_w();
else
return x;
} }
nframes_t length ( void ) const { return timeline->x_to_ts( abs_w() ); } nframes_t length ( void ) const { return timeline->x_to_ts( abs_w() ); }

View File

@ -67,6 +67,9 @@ Waveform::draw ( int X, int Y, int W, int H,
W = min( peaks, W ); W = min( peaks, W );
if ( ! W )
return;
if ( Waveform::fill ) if ( Waveform::fill )
{ {
if ( Waveform::vary_color ) if ( Waveform::vary_color )
@ -93,8 +96,6 @@ Waveform::draw ( int X, int Y, int W, int H,
} }
else else
{ {
// fl_color( fl_color_add_alpha( color, 127 ) );
fl_color( color ); fl_color( color );
fl_begin_complex_polygon(); fl_begin_complex_polygon();
@ -104,18 +105,12 @@ Waveform::draw ( int X, int Y, int W, int H,
for ( int x = X; x < X + W; x++, j += skip ) for ( int x = X; x < X + W; x++, j += skip )
fl_vertex( x, ty - ( halfheight * pbuf[ j ].min ) ); fl_vertex( x, ty - ( halfheight * pbuf[ j ].min ) );
// fl_end_line(); // j = start + ( W * skip );
// fl_begin_line();
j = start + ( W * skip );
for ( int x = X + W; x >= X; x--, j -= skip ) for ( int x = X + W; x >= X; x--, j -= skip )
fl_vertex( x, ty - ( halfheight * pbuf[ j ].max ) ); fl_vertex( x, ty - ( halfheight * pbuf[ j ].max ) );
fl_end_complex_polygon(); fl_end_complex_polygon();
// fl_line_style( FL_SOLID, 0 );
} }
} }