Browse Source

WIP

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
2cc273ccc6
3 changed files with 14 additions and 11 deletions
  1. +10
    -7
      Region.C
  2. +3
    -3
      Region.H
  3. +1
    -1
      Track.C

+ 10
- 7
Region.C View File

@@ -300,16 +300,19 @@ Region::resize ( void )

int measure = 40;

/* Draw (part of) region. Start is */
/* 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
intersection of the clip and relative to OX) */
void
Region::draw ( int X, int Y, int W, int H )
Region::draw ( int OX, int X, int Y, int W, int H )
{
if ( ! ( W > 0 && H > 0 ) )
return;

if ( _offset > timeline.xoffset + timeline.x_to_ts( _track->w() ) ||
( _offset < timeline.xoffset &&
_offset + (_end - _start) < timeline.xoffset ) )
int ox = timeline.ts_to_x( _offset );

if ( ox > OX + _track->w() ||
ox < OX && ox + w() < OX )
return;

int rw = timeline.ts_to_x( _end - _start );
@@ -318,9 +321,9 @@ Region::draw ( int X, int Y, int W, int H )

/* calculate waveform offset due to scrolling */
nframes_t offset = 0;
if ( _offset < timeline.xoffset )
if ( ox < OX )
{
offset = timeline.xoffset - _offset;
offset = timeline.x_to_ts( OX - ox );

rw = timeline.ts_to_x( (_end - _start) - offset );
}


+ 3
- 3
Region.H View File

@@ -80,7 +80,7 @@ public:
nframes_t length ( void ) const { return _end - _start; }

virtual void
draw ( int X, int Y, int W, int H )
draw ( int OX, int X, int Y, int W, int H )
{
fl_draw_box( FL_FLAT_BOX, X, Y, W, H, _box_color );
}
@@ -97,7 +97,7 @@ class Tempo : public Track_Widget
float _tempo;

void
draw ( int X, int Y, int W, int H )
draw ( int OX, int X, int Y, int W, int H )
{


@@ -130,7 +130,7 @@ public:
Region ( Clip *c );

int handle ( int m );
void draw ( int X, int Y, int W, int H );
void draw ( int OX, int X, int Y, int W, int H );
void resize ( void );

};

+ 1
- 1
Track.C View File

@@ -36,7 +36,7 @@ Track::draw ( void )
for ( list <Track_Widget *>::iterator r = _regions.begin(); r != _regions.end(); r++ )
{
// (*r)->draw( timeline.xoffset + x(), y(), w(), h() );
(*r)->draw( x(), y(), w(), h() );
(*r)->draw( timeline.ts_to_x( timeline.xoffset ), x(), y(), w(), h() );
}

fl_pop_clip();


Loading…
Cancel
Save