Browse Source

Add emacs-like redo.

pull/167/head
Nicolò Balzarotti nixo 9 years ago
parent
commit
aebe16893c
7 changed files with 33 additions and 1 deletions
  1. +9
    -0
      nonlib/Loggable.C
  2. +1
    -0
      nonlib/Loggable.H
  3. +6
    -0
      timeline/src/Project.C
  4. +1
    -0
      timeline/src/Project.H
  5. +6
    -1
      timeline/src/TLE.fl
  6. +9
    -0
      timeline/src/Timeline.C
  7. +1
    -0
      timeline/src/Timeline.H

+ 9
- 0
nonlib/Loggable.C View File

@@ -541,6 +541,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


+ 1
- 0
nonlib/Loggable.H 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 );



+ 6
- 0
timeline/src/Project.C 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 )
{


+ 1
- 0
timeline/src/Project.H 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; }
};

+ 6
- 1
timeline/src/TLE.fl 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}


+ 9
- 0
timeline/src/Timeline.C View File

@@ -2088,6 +2088,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 )
{


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

@@ -246,6 +246,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;



Loading…
Cancel
Save