@@ -409,10 +409,14 @@ Region::draw ( int X, int Y, int W, int H ) | |||||
int ch = h() / _clip->channels(); | int ch = h() / _clip->channels(); | ||||
for ( int i = _clip->channels(); i--; ) | for ( int i = _clip->channels(); i--; ) | ||||
draw_waveform( rx, y() + (i * ch), rw, ch, _clip, i, | |||||
// draw_waveform( rx, y() + (i * ch), rw, ch, _clip, i, | |||||
// _start + offset, min( (_end - _start) - offset, _end), | |||||
// _scale, _selected ? _color : fl_invert_color( _color ) ); | |||||
draw_waveform( rx, X, y() + (i * ch), W, ch, _clip, i, | |||||
_start + offset, min( (_end - _start) - offset, _end), | _start + offset, min( (_end - _start) - offset, _end), | ||||
_scale, _selected ? _color : fl_invert_color( _color ) ); | _scale, _selected ? _color : fl_invert_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_color( FL_BLACK ); | ||||
@@ -126,6 +126,7 @@ struct Timeline : public Fl_Group | |||||
{ | { | ||||
Timeline *tl = (Timeline *)v; | Timeline *tl = (Timeline *)v; | ||||
printf( "draw_clip: %d,%d %dx%d\n", X, Y, W, H ); | |||||
fl_push_clip( X, Y, W, H ); | fl_push_clip( X, Y, W, H ); | ||||
fl_color( rand() ); | fl_color( rand() ); | ||||
@@ -145,7 +146,7 @@ struct Timeline : public Fl_Group | |||||
X = tracks->x() + Fl::box_dx( tracks->child( 0 )->box() ) + 1; | X = tracks->x() + Fl::box_dx( tracks->child( 0 )->box() ) + 1; | ||||
Y = tracks->y(); | Y = tracks->y(); | ||||
W = tracks->w() - Fl::box_dw( tracks->child( 0 )->box() ) - 2; | |||||
W = tracks->w() - Fl::box_dw( tracks->child( 0 )->box() ) - 1; | |||||
H = tracks->h(); | H = tracks->h(); | ||||
@@ -61,6 +61,8 @@ Track::draw ( void ) | |||||
fl_clip_box( x(), y(), w(), h(), X, Y, W, H ); | fl_clip_box( x(), y(), w(), h(), X, Y, W, H ); | ||||
// printf( "track::draw %d,%d %dx%d\n", X,Y,W,H ); | |||||
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) | for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) | ||||
(*r)->draw_box( X, Y, W, H ); | (*r)->draw_box( X, Y, W, H ); | ||||
@@ -31,20 +31,23 @@ | |||||
/** draw a portion of /clip/'s waveform. coordinates are the portion to draw */ | /** draw a portion of /clip/'s waveform. coordinates are the portion to draw */ | ||||
void | void | ||||
draw_waveform ( int X, int Y, int W, int H, Audio_File *_clip, int channel, nframes_t _start, nframes_t _end, float _scale, Fl_Color color ) | |||||
draw_waveform ( int ox, int X, int Y, int W, int H, Audio_File *_clip, int channel, nframes_t _start, nframes_t _end, float _scale, Fl_Color color ) | |||||
{ | { | ||||
fl_push_clip( X, Y, W, H ); | fl_push_clip( X, Y, W, H ); | ||||
int j; | int j; | ||||
int start = timeline->ts_to_x( _start ); | |||||
// int start = timeline->ts_to_x( _start ); | |||||
int start = timeline->ts_to_x( _start ) + (X - ox); | |||||
const Peaks *pk = _clip->peaks( channel ); | const Peaks *pk = _clip->peaks( channel ); | ||||
_start = timeline->x_to_ts( start ); | |||||
pk->fill_buffer( _start, _start + timeline->x_to_ts( W ) ); | pk->fill_buffer( _start, _start + timeline->x_to_ts( W ) ); | ||||
j = start; | j = start; | ||||
for ( int x = X; x < X + W; ++x, ++j ) | |||||
for ( int x = X; x <= X + W; ++x, ++j ) | |||||
{ | { | ||||
Peak p = (*pk)[ j ]; | Peak p = (*pk)[ j ]; | ||||
@@ -70,7 +73,7 @@ draw_waveform ( int X, int Y, int W, int H, Audio_File *_clip, int channel, nfra | |||||
fl_begin_line(); | fl_begin_line(); | ||||
j = start; | j = start; | ||||
for ( int x = X; x < X + W; ++x, ++j ) | |||||
for ( int x = X; x <= X + W; ++x, ++j ) | |||||
{ | { | ||||
Peak p = (*pk)[ j ]; | Peak p = (*pk)[ j ]; | ||||
@@ -84,7 +87,7 @@ draw_waveform ( int X, int Y, int W, int H, Audio_File *_clip, int channel, nfra | |||||
fl_begin_line(); | fl_begin_line(); | ||||
j = start; | j = start; | ||||
for ( int x = X; x < X + W; ++x, ++j ) | |||||
for ( int x = X; x <= X + W; ++x, ++j ) | |||||
{ | { | ||||
Peak p = (*pk)[ j ]; | Peak p = (*pk)[ j ]; | ||||
@@ -26,4 +26,4 @@ | |||||
#include "Audio_File.H" | #include "Audio_File.H" | ||||
void draw_waveform ( int X, int Y, int W, int H, Audio_File *_clip, int channel, nframes_t _start, nframes_t _end, float _scale, Fl_Color color ); | |||||
void draw_waveform ( int rx, int X, int Y, int W, int H, Audio_File *_clip, int channel, nframes_t _start, nframes_t _end, float _scale, Fl_Color color ); |