diff --git a/nonlib/Loggable.C b/nonlib/Loggable.C index c467ffc..68da4c5 100644 --- a/nonlib/Loggable.C +++ b/nonlib/Loggable.C @@ -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 diff --git a/nonlib/Loggable.H b/nonlib/Loggable.H index 2b1242c..cb3703c 100644 --- a/nonlib/Loggable.H +++ b/nonlib/Loggable.H @@ -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 ); diff --git a/timeline/src/Project.C b/timeline/src/Project.C index f92375f..3991674 100644 --- a/timeline/src/Project.C +++ b/timeline/src/Project.C @@ -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 ) { diff --git a/timeline/src/Project.H b/timeline/src/Project.H index a1a67a4..8e295fd 100644 --- a/timeline/src/Project.H +++ b/timeline/src/Project.H @@ -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; } }; diff --git a/timeline/src/TLE.fl b/timeline/src/TLE.fl index e54de7f..3d7db05 100644 --- a/timeline/src/TLE.fl +++ b/timeline/src/TLE.fl @@ -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} diff --git a/timeline/src/Timeline.C b/timeline/src/Timeline.C index 9e97ec5..ab66a3f 100644 --- a/timeline/src/Timeline.C +++ b/timeline/src/Timeline.C @@ -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 ) { diff --git a/timeline/src/Timeline.H b/timeline/src/Timeline.H index d9c940f..e54afba 100644 --- a/timeline/src/Timeline.H +++ b/timeline/src/Timeline.H @@ -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;