Browse Source

Timeline: Fix bug causing occasional duplicate 'create' entries in snapshots.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
a99f707bda
13 changed files with 27 additions and 34 deletions
  1. +2
    -5
      timeline/src/Audio_Region.C
  2. +3
    -1
      timeline/src/Audio_Sequence.C
  3. +0
    -6
      timeline/src/Cursor_Point.C
  4. +0
    -1
      timeline/src/Cursor_Point.H
  5. +3
    -2
      timeline/src/Engine/Audio_Region.C
  6. +2
    -2
      timeline/src/Engine/Track.C
  7. +7
    -1
      timeline/src/Sequence.C
  8. +0
    -6
      timeline/src/Tempo_Point.C
  9. +0
    -1
      timeline/src/Tempo_Point.H
  10. +5
    -1
      timeline/src/Tempo_Sequence.C
  11. +0
    -6
      timeline/src/Time_Point.C
  12. +0
    -1
      timeline/src/Time_Point.H
  13. +5
    -1
      timeline/src/Time_Sequence.C

+ 2
- 5
timeline/src/Audio_Region.C View File

@@ -167,18 +167,15 @@ Audio_Region::Audio_Region ( Audio_File *c )
log_create();
}

/* used when DND importing */
/* used when DND importing and when recording. must not invoke log_create() */
Audio_Region::Audio_Region ( Audio_File *c, Sequence *t, nframes_t o )
{
init();
_clip = c;
_sequence = t;
_r->offset = 0;
_r->start = o;
_r->length = _clip->length();

sequence()->add( this );

int sum = 0;
const char *s = rindex( _clip->name(), '/' );
if ( ! s )
@@ -192,7 +189,7 @@ Audio_Region::Audio_Region ( Audio_File *c, Sequence *t, nframes_t o )

_box_color = (Fl_Color)sum;

log_create();
t->add( this );
}

Audio_Region::~Audio_Region ( )


+ 3
- 1
timeline/src/Audio_Sequence.C View File

@@ -328,8 +328,10 @@ Audio_Sequence::handle ( int m )

free( file );

// Audio_Region *r =
Audio_Region *r =
new Audio_Region( c, this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - x() ) );
r->log_create();

redraw();


+ 0
- 6
timeline/src/Cursor_Point.C View File

@@ -109,12 +109,6 @@ Cursor_Point::set ( Log_Entry &e )


void
Cursor_Point::log_children ( void ) const
{
log_create();
}


int
Cursor_Point::handle ( int m )


+ 0
- 1
timeline/src/Cursor_Point.H View File

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

virtual void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
void log_children ( void ) const;

Cursor_Point ( );



+ 3
- 2
timeline/src/Engine/Audio_Region.C View File

@@ -226,7 +226,7 @@ Audio_Region::prepare ( void )

DMESSAGE( "Preparing capture region" );

log_start();
// log_start();
}

/** write /nframes/ from /buf/ to source. /buf/ is interleaved and
@@ -267,7 +267,8 @@ Audio_Region::finalize ( nframes_t frame )
_clip->close();
_clip->open();

log_end();
log_create();
// log_end();

return true;
}

+ 2
- 2
timeline/src/Engine/Track.C View File

@@ -273,7 +273,7 @@ Track::record ( Capture *c, nframes_t frame )
/* open it again for reading in the GUI thread */
// Audio_File *af = Audio_File::from_file( c->audio_file->name() );
/* must acquire the FLTK lock because adding a widget might interfere with drawing */
Fl::lock();
// Fl::lock();

/* must acquire a write lock because the Audio_Region constructor
* will add the region to the specified sequence, which might affect playback */
@@ -283,7 +283,7 @@ Track::record ( Capture *c, nframes_t frame )

timeline->unlock();

Fl::unlock();
// Fl::unlock();

c->region->prepare();
}


+ 7
- 1
timeline/src/Sequence.C View File

@@ -188,7 +188,13 @@ Sequence::add ( Sequence_Widget *r )
{
// Logger _log( this );

if ( r->sequence() && r->sequence() != this )
if ( r->sequence() == this )
{
WARNING( "Programming error: attempt to add sequence widget to the same sequence twice" );
return;
}

if ( r->sequence() )
{
/* This method can be called from the Capture thread as well as the GUI thread, so we must lock FLTK before redraw */
r->redraw();


+ 0
- 6
timeline/src/Tempo_Point.C View File

@@ -83,12 +83,6 @@ Tempo_Point::set ( Log_Entry &e )
_make_label();
}

void
Tempo_Point::log_children ( void ) const
{
log_create();
}

int
Tempo_Point::handle ( int m )
{


+ 0
- 1
timeline/src/Tempo_Point.H View File

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

virtual void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
void log_children ( void ) const;

Tempo_Point ( );



+ 5
- 1
timeline/src/Tempo_Sequence.C View File

@@ -62,7 +62,11 @@ Tempo_Sequence::handle ( int m )

if ( Tempo_Point::edit( &t ) )
{
add( new Tempo_Point( timeline->x_to_offset( Fl::event_x() ), t ) );
timeline->wrlock();
new Tempo_Point( timeline->x_to_offset( Fl::event_x() ), t );

timeline->unlock();

timeline->redraw();
}


+ 0
- 6
timeline/src/Time_Point.C View File

@@ -93,12 +93,6 @@ Time_Point::set ( Log_Entry &e )
_make_label();
}

void
Time_Point::log_children ( void ) const
{
log_create();
}

int
Time_Point::handle ( int m )
{


+ 0
- 1
timeline/src/Time_Point.H View File

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

virtual void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
void log_children ( void ) const;

Time_Point ( );



+ 5
- 1
timeline/src/Time_Sequence.C View File

@@ -65,7 +65,11 @@ Time_Sequence::handle ( int m )

if ( Time_Point::edit( &t ) )
{
add( new Time_Point( timeline->x_to_offset( Fl::event_x() ), t.beats_per_bar, t.beat_type ) );
timeline->wrlock();

new Time_Point( timeline->x_to_offset( Fl::event_x() ), t.beats_per_bar, t.beat_type );

timeline->unlock();

timeline->redraw();
}


Loading…
Cancel
Save