Timeline: Fix 'Vary Color' region drawing mode. Also, tweak appearance.
This commit is contained in:
parent
4bf4a1ef14
commit
a1336880b5
|
@ -559,16 +559,15 @@ Audio_Region::draw ( void )
|
||||||
nframes_t loop_frames_needed = _loop ? _loop : total_frames_needed;
|
nframes_t loop_frames_needed = _loop ? _loop : total_frames_needed;
|
||||||
int loop_peaks_needed = timeline->ts_to_x( loop_frames_needed );
|
int loop_peaks_needed = timeline->ts_to_x( loop_frames_needed );
|
||||||
|
|
||||||
Fl_Color c = Fl::get_color( _color );
|
Fl_Color fg_color = FL_FOREGROUND_COLOR;
|
||||||
|
Fl_Color bg_color = FL_BACKGROUND_COLOR;
|
||||||
|
|
||||||
if ( recording() )
|
if ( !active_r() )
|
||||||
{
|
{
|
||||||
// loop_peaks_needed = timeline->ts_to_x( _range.length );
|
fg_color = fl_inactive(fg_color);
|
||||||
c = FL_BLACK;
|
bg_color = fl_inactive(bg_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = fl_color_add_alpha( c, 220 );
|
|
||||||
|
|
||||||
if ( ! fo ) /* first loop... */
|
if ( ! fo ) /* first loop... */
|
||||||
{
|
{
|
||||||
if ( _loop )
|
if ( _loop )
|
||||||
|
@ -639,7 +638,7 @@ Audio_Region::draw ( void )
|
||||||
loop_peaks_needed,
|
loop_peaks_needed,
|
||||||
ch,
|
ch,
|
||||||
pbuf + i, peaks, channels,
|
pbuf + i, peaks, channels,
|
||||||
c );
|
fg_color, bg_color );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -258,7 +258,7 @@ Sequence_Region::draw ( void )
|
||||||
void
|
void
|
||||||
Sequence_Region::draw_label ( const char *label, Fl_Align align, Fl_Color color, int xo, int yo )
|
Sequence_Region::draw_label ( const char *label, Fl_Align align, Fl_Color color, int xo, int yo )
|
||||||
{
|
{
|
||||||
fl_color( FL_WHITE );
|
fl_color( active_r() ? FL_FOREGROUND_COLOR : fl_inactive( FL_FOREGROUND_COLOR ) );
|
||||||
fl_font( FL_HELVETICA_ITALIC, 10 );
|
fl_font( FL_HELVETICA_ITALIC, 10 );
|
||||||
fl_draw( label, line_x() + Fl::box_dx( box() ), y() + Fl::box_dy( box() ), abs_w() - Fl::box_dw( box() ), h() - Fl::box_dh( box() ), align );
|
fl_draw( label, line_x() + Fl::box_dx( box() ), y() + Fl::box_dy( box() ), abs_w() - Fl::box_dw( box() ), h() - Fl::box_dh( box() ), align );
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ Waveform::scale ( Peak *pbuf, int npeaks, float gain )
|
||||||
void
|
void
|
||||||
Waveform::draw ( int X, int Y, int W, int H,
|
Waveform::draw ( int X, int Y, int W, int H,
|
||||||
const Peak *pbuf, int peaks, int skip,
|
const Peak *pbuf, int peaks, int skip,
|
||||||
Fl_Color color )
|
Fl_Color fg_color, Fl_Color bg_color )
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
@ -69,6 +69,8 @@ Waveform::draw ( int X, int Y, int W, int H,
|
||||||
|
|
||||||
if ( ! W )
|
if ( ! W )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
fg_color = fl_color_add_alpha( Fl::get_color( fg_color ), 200 );
|
||||||
|
|
||||||
if ( Waveform::fill )
|
if ( Waveform::fill )
|
||||||
{
|
{
|
||||||
|
@ -81,14 +83,11 @@ Waveform::draw ( int X, int Y, int W, int H,
|
||||||
|
|
||||||
const float diff = fabs( p.max - p.min );
|
const float diff = fabs( p.max - p.min );
|
||||||
|
|
||||||
if ( diff > 2.0f )
|
if ( diff > 2.0f )
|
||||||
fl_color( FL_RED );
|
fl_color( FL_RED );
|
||||||
else
|
else
|
||||||
if ( Waveform::vary_color )
|
fl_color( fl_color_average( fg_color, bg_color, diff * 0.5f ) );
|
||||||
fl_color( fl_color_average( FL_WHITE, color, diff * 0.5f ) );
|
|
||||||
else
|
|
||||||
fl_color( color );
|
|
||||||
|
|
||||||
const int ty = mid - ( halfheight * p.min );
|
const int ty = mid - ( halfheight * p.min );
|
||||||
const int by = mid - ( halfheight * p.max );
|
const int by = mid - ( halfheight * p.max );
|
||||||
fl_line( x, ty, x, by );
|
fl_line( x, ty, x, by );
|
||||||
|
@ -96,8 +95,8 @@ Waveform::draw ( int X, int Y, int W, int H,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fl_color( color );
|
fl_color( fg_color );
|
||||||
|
|
||||||
fl_begin_complex_polygon();
|
fl_begin_complex_polygon();
|
||||||
|
|
||||||
j = start;
|
j = start;
|
||||||
|
@ -116,7 +115,7 @@ Waveform::draw ( int X, int Y, int W, int H,
|
||||||
|
|
||||||
if ( Waveform::outline )
|
if ( Waveform::outline )
|
||||||
{
|
{
|
||||||
fl_color( fl_darker( fl_darker( color ) ) );
|
fl_color( bg_color );
|
||||||
|
|
||||||
fl_line_style( FL_SOLID, 0 );
|
fl_line_style( FL_SOLID, 0 );
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,6 @@ public:
|
||||||
static void scale ( Peak *pbuf, int npeaks, float gain );
|
static void scale ( Peak *pbuf, int npeaks, float gain );
|
||||||
static void draw ( int X, int Y, int W, int H,
|
static void draw ( int X, int Y, int W, int H,
|
||||||
const Peak *pbuf, int peaks, int skip,
|
const Peak *pbuf, int peaks, int skip,
|
||||||
Fl_Color color );
|
Fl_Color fg_color, Fl_Color bg_color );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue