Insert imported regions at offset of drop.
This commit is contained in:
parent
3b02169d31
commit
6b48c0d629
3
Region.H
3
Region.H
|
@ -50,4 +50,7 @@ public:
|
|||
|
||||
Track * track ( void ) { return _track; }
|
||||
void track ( Track *t ) { _track = t; }
|
||||
|
||||
nframes_t offset ( void ) { return _offset; }
|
||||
void offset ( nframes_t o ) { _offset = o; }
|
||||
};
|
||||
|
|
10
Track.H
10
Track.H
|
@ -106,15 +106,19 @@ public:
|
|||
|
||||
Clip *c = Clip::from_file( file );
|
||||
|
||||
// free( file );
|
||||
|
||||
if ( ! c )
|
||||
{
|
||||
free( file );
|
||||
return 0;
|
||||
}
|
||||
|
||||
this->add( new Region( c ) );
|
||||
|
||||
Region *r = new Region( c );
|
||||
|
||||
r->offset( timeline.x_to_ts( Fl::event_x() ) );
|
||||
r->position( Fl::event_x(), r->y() );
|
||||
|
||||
this->add( r );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue