pull/167/merge
Nicolò Balzarotti 2021-02-01 20:12:12 -05:00 committed by GitHub
commit 356d373770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 1 deletions

View File

@ -549,6 +549,15 @@ Loggable::undo ( void )
}
void
Loggable::redo ( void )
{
if (! _fp)
return;
_undo_offset = ftell( _fp );
}
/** write a snapshot of the current state of all loggable objects to
* file handle /fp/ */
bool

View File

@ -177,6 +177,7 @@ public:
static bool open ( const char *filename );
static bool close ( void );
static void undo ( void );
static void redo ( void );
static void compact ( void );

View File

@ -134,6 +134,12 @@ Project::undo ( void )
Loggable::undo();
}
void
Project::redo ( void )
{
Loggable::redo();
}
bool
Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date, char **created_by )
{

View File

@ -62,5 +62,6 @@ public:
static bool open ( void ) { return _is_open; }
static bool create ( const char *name, const char *template_name );
static void undo ( void );
static void redo ( void );
static const char *created_on ( void ) { return _created_on; }
};

View File

@ -456,7 +456,12 @@ free(path);}
MenuItem {} {
label Undo
callback {timeline->command_undo();}
xywh {5 5 40 25} shortcut 0x4007a divider
xywh {5 5 40 25} shortcut 0x4007a
}
MenuItem {} {
label Redo
callback {timeline->command_redo();}
xywh {5 5 40 25} shortcut 0x40079 divider
}
MenuItem {} {
label {Select None}

View File

@ -2103,6 +2103,15 @@ Timeline::command_undo ( void )
track_lock.unlock();
}
void
Timeline::command_redo ( void )
{
/* FIXME: sequence lock too? */
track_lock.wrlock();
Project::redo();
track_lock.unlock();
}
bool
Timeline::command_load ( const char *name, const char *display_name )
{

View File

@ -248,6 +248,7 @@ public:
void command_move_track_up ( Track *track );
void command_move_track_down ( Track *track );
void command_undo ( void );
void command_redo ( void );
int find_track ( const Track * track ) const;