summaryrefslogtreecommitdiff
path: root/app/bin/macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/macro.c')
-rw-r--r--app/bin/macro.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/app/bin/macro.c b/app/bin/macro.c
index 7105e98..7872df9 100644
--- a/app/bin/macro.c
+++ b/app/bin/macro.c
@@ -30,9 +30,11 @@
#include "misc.h"
#include "param.h"
#include "paths.h"
+#include "include/stringxtc.h"
#include "track.h"
#include "version.h"
#include "common-ui.h"
+#include "include/toolbar.h"
#ifdef UTFCONVERT
#include "include/utf8convert.h"
@@ -181,7 +183,7 @@ static int StartRecord( int cnt, char ** pathName, void * context )
if ( logTable_da.cnt > 11 ) {
lprintf( "StartRecord( %s ) @ %s\n", pathName, ctime(&clock) );
}
- ParamStartRecord();
+ ParamStartRecord(recordF);
WriteTracks( recordF, TRUE );
WriteLayers( recordF );
fprintf( recordF, "REDRAW\n" );
@@ -207,6 +209,7 @@ static void DoRecordButton( void * context )
fprintf( recordF, "%s\nSTEP\n", END_MESSAGE );
fclose( recordF );
recordF = NULL;
+ ParamStartRecord( NULL );
wHide( recordW );
break;
@@ -269,7 +272,8 @@ EXPORT void DoRecord( void * context )
{
if (recordW == NULL) {
char * title = MakeWindowTitle(_("Record"));
- recordW = ParamCreateDialog( &recordPG, title, NULL, NULL, NULL, FALSE, NULL,
+ recordW = ParamCreateDialog( &recordPG, title, NULL, NULL, ParamCancel_Null,
+ FALSE, NULL,
F_RESIZE, NULL );
recordFile_fs = wFilSelCreate( mainW, FS_SAVE, 0, title, sRecordFilePattern,
StartRecord, NULL );
@@ -320,7 +324,8 @@ static wDrawBitMap_p flash_bm;
static long flashTO = 120;
static DIST_T PixelsPerStep = 5;
static long stepTO = 100;
-EXPORT unsigned long playbackTimer;
+EXPORT unsigned long
+playbackTimer; /** if >0 performance measurement in progress */
static wBool_t didPause;
static wBool_t flashTwice = FALSE;
@@ -399,6 +404,8 @@ static void SetPlaybackSpeed(
case 5: playbackDelay = 0; break;
}
playbackSpeed = inx;
+
+ ParamSetInPlayback(inPlayback, playbackDelay);
}
@@ -958,6 +965,12 @@ static void PlaybackSetup( void )
nRegressionFail = 0;
}
+void
+SetInPlayback(wBool_t state)
+{
+ inPlayback = state;
+ ParamSetInPlayback(state, playbackDelay);
+}
static void Playback( void )
{
@@ -973,10 +986,11 @@ static void Playback( void )
char *demoFileName = NULL;
useCurrentLayer = FALSE;
- inPlayback = TRUE;
+ SetInPlayback( TRUE );
EnableButtons( FALSE );
// lastCmd = otherCmd;
playbackTimer = 0;
+ ParamTurnOffDelays(false);
if (demoWinOnTop) {
wWinTop( mainW );
demoWinOnTop = FALSE;
@@ -1009,7 +1023,7 @@ static void Playback( void )
if ( paramFile == NULL ) {
NoticeMessage( MSG_OPEN_FAIL, _("Continue"), NULL, _("Demo"), demoFileName,
strerror(errno) );
- inPlayback = FALSE;
+ SetInPlayback( FALSE );
SetUserLocale();
return;
}
@@ -1030,7 +1044,7 @@ static void Playback( void )
demoFileName );
fclose( paramFile );
paramFile = NULL;
- inPlayback = FALSE;
+ SetInPlayback( FALSE );
SetUserLocale();
return;
}
@@ -1059,7 +1073,7 @@ static void Playback( void )
/* empty paramLine */
} else if (ReadTrack( paramLine ) ) {
if ( paramFile == NULL ) {
- inPlayback = FALSE;
+ SetInPlayback(FALSE );
break;
}
} else if (strncmp( paramLine, "STEP", 5 ) == 0) {
@@ -1081,7 +1095,7 @@ static void Playback( void )
wPause( 1000 );
EnableButtons( FALSE );
} else {
- inPlayback = FALSE;
+ SetInPlayback(FALSE);
SetUserLocale();
return;
}
@@ -1103,7 +1117,7 @@ static void Playback( void )
wWinTop( demoW );
demoWinOnTop = TRUE;
EnableButtons( TRUE );
- inPlayback = FALSE;
+ SetInPlayback(FALSE);
SetUserLocale();
return;
}
@@ -1211,6 +1225,7 @@ static void Playback( void )
}
} else if (strncmp( paramLine, "TIMESTART", 9 ) == 0 ) {
playbackTimer = wGetTimer();
+ ParamTurnOffDelays(true);
} else if (strncmp( paramLine, "TIMEEND", 7 ) == 0 ) {
if (playbackTimer == 0) {
NoticeMessage( MSG_PLAYBACK_TIMEEND, _("Ok"), NULL );
@@ -1219,6 +1234,7 @@ static void Playback( void )
sprintf( message, _("Elapsed time %lu\n"), playbackTimer );
wTextAppend( demoT, message );
playbackTimer = 0;
+ ParamTurnOffDelays(false);
}
} else if (strncmp( paramLine, "MEMSTATS", 8 ) == 0 ) {
wTextAppend( demoT, wMemStats() );
@@ -1299,7 +1315,7 @@ static void Playback( void )
if (pauseDemo) {
EnableButtons( TRUE );
pauseDemo = FALSE;
- inPlayback = FALSE;
+ SetInPlayback(FALSE);
SetUserLocale();
return;
}
@@ -1312,7 +1328,7 @@ static void Playback( void )
fclose( documentFile );
documentFile = NULL;
}
- inPlayback = FALSE;
+ SetInPlayback(FALSE);
PlaybackQuit();
SetUserLocale();
}
@@ -1381,7 +1397,7 @@ static void DoDemoButton( void * command )
/* quit */
if ( inPlayback ) {
// We will exit the loop in Playback() after the current command
- inPlayback = FALSE;
+ SetInPlayback(FALSE);
} else {
// We're waiting for the user to press 'Step'
PlaybackQuit();
@@ -1408,7 +1424,8 @@ static void DemoDlgUpdate(
static void CreateDemoW( void )
{
char * title = MakeWindowTitle(_("Demo"));
- demoW = ParamCreateDialog( &demoPG, title, NULL, NULL, NULL, FALSE, NULL,
+ demoW = ParamCreateDialog( &demoPG, title, NULL, NULL, ParamCancel_Null, FALSE,
+ NULL,
F_RESIZE, DemoDlgUpdate );
wListAddValue( demoSpeedL, _("Slowest"), NULL, I2VP(0) );