Browse Source

Make normalize region work again.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
f042e887e0
3 changed files with 17 additions and 37 deletions
  1. +16
    -27
      Region.C
  2. +1
    -0
      Region.H
  3. +0
    -10
      Waveform.C

+ 16
- 27
Region.C View File

@@ -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
- 0
Region.H View File

@@ -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 );
}; };

+ 0
- 10
Waveform.C View File

@@ -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…
Cancel
Save