diff --git a/Region.C b/Region.C index 6b090ea..c2a2cc9 100644 --- a/Region.C +++ b/Region.C @@ -94,12 +94,14 @@ Region::init ( void ) /* copy constructor */ Region::Region ( const Region & rhs ) { - _offset = rhs._offset; - _track = rhs._track; - _clip = rhs._clip; - _start = rhs._start; - _end = rhs._end; - _scale = rhs._scale; + _offset = rhs._offset; + _track = rhs._track; + _clip = rhs._clip; + _start = rhs._start; + _end = rhs._end; + _scale = rhs._scale; + _box_color = rhs._box_color; + _color = rhs._color; log_create(); } @@ -126,6 +128,22 @@ Region::Region ( Audio_File *c, Track *t, nframes_t o ) _track->add( this ); + int sum = 0; + const char *s = rindex( _clip->name(), '/' ); + for ( int i = strlen( s ); i--; ) + sum += s[ i ]; + + while ( sum >> 8 ) + sum = (sum & 0xFF) + (sum >> 8); + + _color = (Fl_Color)sum; + +/* _color = fl_color_average( FL_YELLOW, (Fl_Color)sum, 0.80 ); */ + +// _color = FL_YELLOW; + + _box_color = FL_WHITE; + log_create(); } @@ -431,7 +449,7 @@ Region::draw ( int X, int Y, int W, int H ) // _scale, _selected ? _color : fl_invert_color( _color ) ); draw_waveform( rx, X, (y() + Fl::box_dy( box() )) + (i * ch), W, ch, _clip, i, _start + offset, min( (_end - _start) - offset, _end), - _scale, _selected ? _color : fl_invert_color( _color ) ); + _scale, _selected ? fl_invert_color( _color ) : _color ); timeline->draw_measure_lines( rx, Y, rw, H, _box_color ); diff --git a/Track_Header.C b/Track_Header.C index d7573a5..74970b3 100644 --- a/Track_Header.C +++ b/Track_Header.C @@ -46,7 +46,7 @@ Track_Header::Track_Header ( int X, int Y, int W, int H, const char *L ) : _name = NULL; _track = NULL; _selected = false; - _size = 3; + _size = 1; Fl_Group::size( w(), height() ); diff --git a/Waveform.C b/Waveform.C index daf2a1d..715684f 100644 --- a/Waveform.C +++ b/Waveform.C @@ -58,7 +58,7 @@ draw_waveform ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int chann p.min *= _scale; // FIXME: cache this stuff. - fl_color( fl_color_average( FL_RED, color, fabs( p.max - p.min ) ) ); + fl_color( fl_color_average( FL_RED, color, fabs( p.max - p.min ) - 1.0 ) ); if ( p.min < -1.0 || p.max > 1.0 ) fl_color( FL_RED );