Make normalize region work again.
This commit is contained in:
parent
9e23dd5878
commit
f042e887e0
43
Region.C
43
Region.C
|
@ -94,8 +94,6 @@ Region::trim ( enum trim_e t, int X )
|
||||||
_start += td;
|
_start += td;
|
||||||
|
|
||||||
_offset += td;
|
_offset += td;
|
||||||
|
|
||||||
// resize();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
|
@ -104,9 +102,6 @@ Region::trim ( enum trim_e t, int X )
|
||||||
long td = timeline.x_to_ts( d );
|
long td = timeline.x_to_ts( d );
|
||||||
|
|
||||||
_end -= td;
|
_end -= td;
|
||||||
|
|
||||||
// resize();
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -115,8 +110,6 @@ Region::trim ( enum trim_e t, int X )
|
||||||
}
|
}
|
||||||
|
|
||||||
_track->redraw();
|
_track->redraw();
|
||||||
// redraw();
|
|
||||||
// parent()->redraw();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,12 +164,16 @@ Region::handle ( int m )
|
||||||
// Fl::local_grab( this );
|
// Fl::local_grab( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( Fl::event_button() == 2 )
|
||||||
|
{
|
||||||
|
normalize();
|
||||||
|
_track->redraw();
|
||||||
|
}
|
||||||
|
|
||||||
ret = Track_Widget::handle( m );
|
ret = Track_Widget::handle( m );
|
||||||
return ret | 1;
|
return ret | 1;
|
||||||
|
|
||||||
/* if ( Fl::event_button() == 2 ) */
|
|
||||||
/* normalize(); */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -270,23 +267,6 @@ Region::handle ( int m )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** must be called whenever zoom is adjusted */
|
|
||||||
void
|
|
||||||
Region::resize ( void )
|
|
||||||
{
|
|
||||||
int X = timeline.ts_to_x( _offset );
|
|
||||||
|
|
||||||
assert( _end >= _start );
|
|
||||||
|
|
||||||
int W = timeline.ts_to_x( _end - _start );
|
|
||||||
|
|
||||||
printf( "%dx%d\n", X, W );
|
|
||||||
|
|
||||||
// if ( W )
|
|
||||||
// Fl_Widget::resize( X, y(), W, h() );
|
|
||||||
}
|
|
||||||
|
|
||||||
int measure = 40;
|
|
||||||
|
|
||||||
/* Draw (part of) region. OX is pixel offset from start of timeline, X
|
/* Draw (part of) region. OX is pixel offset from start of timeline, X
|
||||||
Y W and H are the portion of the widget to draw (arrived at by
|
Y W and H are the portion of the widget to draw (arrived at by
|
||||||
|
@ -366,3 +346,12 @@ Region::draw ( int X, int Y, int W, int H )
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Region::normalize ( void )
|
||||||
|
{
|
||||||
|
printf( "normalize: start=%lu end=%lu\n", _start, _end );
|
||||||
|
|
||||||
|
_scale = _clip->peaks()->normalization_factor( _start, _end );
|
||||||
|
}
|
||||||
|
|
1
Region.H
1
Region.H
|
@ -224,4 +224,5 @@ public:
|
||||||
void draw ( int X, int Y, int W, int H );
|
void draw ( int X, int Y, int W, int H );
|
||||||
void resize ( void );
|
void resize ( void );
|
||||||
|
|
||||||
|
void normalize ( void );
|
||||||
};
|
};
|
||||||
|
|
10
Waveform.C
10
Waveform.C
|
@ -114,13 +114,3 @@ draw_waveform ( int X, int Y, int W, int H, Clip *_clip, nframes_t _start, nfram
|
||||||
|
|
||||||
fl_pop_clip();
|
fl_pop_clip();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* void */
|
|
||||||
/* Waveform::normalize ( void ) */
|
|
||||||
/* { */
|
|
||||||
/* printf( "normalize: start=%lu end=%lu\n", _start, _end ); */
|
|
||||||
|
|
||||||
/* _scale = _clip->peaks()->normalization_factor( _start, _end ); */
|
|
||||||
|
|
||||||
/* redraw(); */
|
|
||||||
/* } */
|
|
||||||
|
|
Loading…
Reference in New Issue