diff --git a/Peaks.C b/Peaks.C index b0d6a41..c163970 100644 --- a/Peaks.C +++ b/Peaks.C @@ -47,7 +47,7 @@ Peaks::fill_buffer ( int s, int e ) const { /* looks like we're going to have to switch to a higher resolution peak file or read directly from the source */ - read_peaks( s, e, e - s / timeline.fpp, timeline.fpp ); + read_peaks( s, e, (e - s) / timeline.fpp, timeline.fpp ); } else { @@ -82,7 +82,7 @@ Peaks::downsample ( int s, int e, float *mhi, float *mlo ) const int Peaks::clip_read_peaks ( Peak *peaks, int npeaks, int chunksize ) const { - float *fbuf = new float[ chunksize ]; + sample_t *fbuf = new sample_t[ chunksize ]; size_t len; @@ -116,7 +116,7 @@ Peaks::clip_read_peaks ( Peak *peaks, int npeaks, int chunksize ) const void Peaks::read_peaks ( int s, int e, int npeaks, int chunksize ) const { -// printf( "reading peaks %d @ %d\n", npeaks, chunksize ); + printf( "reading peaks %d @ %d\n", npeaks, chunksize ); if ( peakbuf.size < npeaks ) { diff --git a/Region.C b/Region.C index e290326..c4fd2c3 100644 --- a/Region.C +++ b/Region.C @@ -44,7 +44,8 @@ Region::init ( void ) box( FL_PLASTIC_UP_BOX ); _track = NULL; - _offset = 0; +// _offset = 0; + _offset = timeline.x_to_ts( x() ); } Region::Region ( const Region & rhs ) : Waveform( rhs ) @@ -73,25 +74,21 @@ Region::trim ( enum trim_e t, int X ) case LEFT: { int d = X - x(); -// _start += d; - if ( d < 0 && - _start < timeline.x_to_ts( x() + d ) ) - { - _start = 0; - break; - } - else - _start = timeline.x_to_ts( x() + d ); -// _start += timeline.x_to_ts( d ); + + _start += timeline.x_to_ts( d ); Fl_Widget::resize( x() + d, y(), w() - d, h() ); + + _offset = timeline.x_to_ts( x() ); + break; } case RIGHT: { int d = (x() + w()) - X; -// _end = _start + w() - d; - _end = timeline.x_to_ts( _start + w() - d ); + + _end = _start + timeline.x_to_ts( w() - d ); + Fl_Widget::resize( x(), y(), w() - d, h() ); break; } diff --git a/Waveform.C b/Waveform.C index 6b42e70..8e49084 100644 --- a/Waveform.C +++ b/Waveform.C @@ -65,7 +65,7 @@ Waveform::draw ( int X, int Y, int W, int H ) { fl_push_clip( X, Y, W, H ); - fl_push_matrix(); +// fl_push_matrix(); int j; @@ -136,7 +136,7 @@ Waveform::draw ( int X, int Y, int W, int H ) fl_line_style( FL_SOLID, 0 ); - fl_pop_matrix(); +// fl_pop_matrix(); fl_pop_clip(); } diff --git a/Waveform.H b/Waveform.H index 743ba43..e1107fd 100644 --- a/Waveform.H +++ b/Waveform.H @@ -60,7 +60,6 @@ public: _clip = rhs._clip; _start = rhs._start; _end = rhs._end; - _scale = rhs._scale; }