Browse Source

Rebuffer when an audio region is moved.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
c79d48c663
6 changed files with 25 additions and 4 deletions
  1. +3
    -2
      Timeline/Audio_Region.C
  2. +13
    -0
      Timeline/Audio_Sequence.C
  3. +2
    -0
      Timeline/Audio_Sequence.H
  4. +1
    -0
      Timeline/Loggable.H
  5. +6
    -0
      Timeline/Sequence.H
  6. +0
    -2
      Timeline/Sequence_Widget.C

+ 3
- 2
Timeline/Audio_Region.C View File

@@ -25,7 +25,6 @@
#include <FL/Fl_Menu_Item.H>
#include <stdio.h>


#include "Sequence.H"
#include "Audio_Region.H"
#include "Timeline.H"
@@ -210,7 +209,7 @@ Audio_Region::handle ( int m )

int ret;

if ( Sequence_Region::handle( m ) )
if ( m != FL_RELEASE && Sequence_Region::handle( m ) )
return 1;

Logger _log( this );
@@ -361,6 +360,8 @@ Audio_Region::handle ( int m )

copied = false;

sequence()->handle_widget_change( _r->start, _r->length );

return 1;
}
case FL_DRAG:


+ 13
- 0
Timeline/Audio_Sequence.C View File

@@ -25,6 +25,7 @@
#include "Track.H"

#include "Engine/Audio_File.H" // for ::from_file()
#include "Transport.H" // for locate()

Audio_Sequence::Audio_Sequence ( Track *track ) : Sequence( track )
{
@@ -116,6 +117,18 @@ deurlify ( char *url )
}


void
Audio_Sequence::handle_widget_change ( nframes_t start, nframes_t length )
{
/* a region has changed. we may need to rebuffer... */

/* trigger rebuffer */
/* FIXME: we really only need to rebuffer *this* sequence! */
/* FIXME: how does this fit into the selection? */
if ( start > transport->frame || start + length > transport->frame )
transport->locate( transport->frame );
}

void
Audio_Sequence::draw ( void )
{


+ 2
- 0
Timeline/Audio_Sequence.H View File

@@ -39,6 +39,8 @@ protected:
}


void handle_widget_change ( nframes_t start, nframes_t length );

public:

LOG_CREATE_FUNC( Audio_Sequence );


+ 1
- 0
Timeline/Loggable.H View File

@@ -231,6 +231,7 @@ protected:

void log_start ( void );
void log_end ( void );

void log_create ( void ) const;
void log_destroy ( void ) const;



+ 6
- 0
Timeline/Sequence.H View File

@@ -60,8 +60,14 @@ protected:
std::list <Sequence_Widget *> _widgets;
Sequence_Widget *event_widget ( void );


public:

/* child classes should implement this if they need to take
special action when a widget is changed/moved/resized. /start/
and /length/ define the affected region */
virtual void handle_widget_change ( nframes_t start, nframes_t length ) { (void)(start + length); }

/* welcome to C++ */
LOG_NAME_FUNC( Sequence );



+ 0
- 2
Timeline/Sequence_Widget.C View File

@@ -95,8 +95,6 @@ Sequence_Widget::end_drag ( void )

timeline->unlock();

/* TODO: perhaps trigger rebuffer here? */

delete _r;
_r = &_range;



Loading…
Cancel
Save