Browse Source

Make deletion of container widgets undoable!

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
aa0f65af21
6 changed files with 43 additions and 10 deletions
  1. +6
    -0
      Timeline/Annotation_Sequence.H
  2. +6
    -0
      Timeline/Audio_Sequence.C
  3. +7
    -0
      Timeline/Control_Sequence.C
  4. +13
    -7
      Timeline/Sequence.C
  5. +1
    -0
      Timeline/Sequence.H
  6. +10
    -3
      Timeline/Track.C

+ 6
- 0
Timeline/Annotation_Sequence.H View File

@@ -83,9 +83,15 @@ public:

~Annotation_Sequence ( )
{
Loggable::block_start();

clear();

log_destroy();

track()->remove( this );

Loggable::block_end();
}

int handle ( int m )


+ 6
- 0
Timeline/Audio_Sequence.C View File

@@ -49,9 +49,15 @@ Audio_Sequence::Audio_Sequence ( Track *track ) : Sequence( track )

Audio_Sequence::~Audio_Sequence ( )
{
Loggable::block_start();

clear();

log_destroy();

track()->remove( this );

Loggable::block_end();
}




+ 7
- 0
Timeline/Control_Sequence.C View File

@@ -52,6 +52,11 @@ Control_Sequence::Control_Sequence ( Track *track ) : Sequence( 0 )

Control_Sequence::~Control_Sequence ( )
{

Loggable::block_start();

clear();

log_destroy();

engine->lock();
@@ -65,6 +70,8 @@ Control_Sequence::~Control_Sequence ( )
delete _output;

_output = NULL;

Loggable::block_end();
}

void


+ 13
- 7
Timeline/Sequence.C View File

@@ -61,14 +61,9 @@ Sequence::init ( void )
// clear_visible_focus();
}

Sequence::~Sequence ( )
void
Sequence::clear ( void )
{

DMESSAGE( "destroying sequence" );

if ( _name )
free( _name );

for ( std::list <Sequence_Widget*>::iterator i = _widgets.begin();
i != _widgets.end(); ++i )
{
@@ -82,6 +77,17 @@ Sequence::~Sequence ( )
_widgets.clear();
}

Sequence::~Sequence ( )
{
DMESSAGE( "destroying sequence" );

if ( _name )
free( _name );

if ( _widgets.size() )
FATAL( "programming error: leaf destructor must call Sequence::clear()!" );
}

nframes_t
Sequence::x_to_offset ( int X )
{


+ 1
- 0
Timeline/Sequence.H View File

@@ -92,6 +92,7 @@ public:
}

void sort ( void );
void clear ( void );

nframes_t next ( nframes_t from ) const;
nframes_t prev ( nframes_t from ) const;


+ 10
- 3
Timeline/Track.C View File

@@ -247,6 +247,14 @@ Track::Track ( const char *L, int channels ) :

Track::~Track ( )
{
Loggable::block_start();

takes = NULL;
control = NULL;
annotation = NULL;

Fl_Group::clear();

log_destroy();

timeline->remove_track( this );
@@ -256,12 +264,11 @@ Track::~Track ( )
configure_outputs( 0 );

_sequence = NULL;
takes = NULL;
control = NULL;
annotation = NULL;

if ( _name )
free( _name );

Loggable::block_end();
}




Loading…
Cancel
Save