Remove duplication of enum definition

This commit is contained in:
Paul Licameli 2020-04-23 10:04:02 -04:00
parent d373e27840
commit 1689050c9c
3 changed files with 17 additions and 28 deletions

View File

@ -80,18 +80,6 @@ enum {
CONTROL_GROUP_EXPORT
};
// Post Timer Recording Actions
// Ensure this matches the enum in Menus.cpp
enum {
POST_TIMER_RECORD_STOPPED = -3,
POST_TIMER_RECORD_CANCEL_WAIT,
POST_TIMER_RECORD_CANCEL,
POST_TIMER_RECORD_NOTHING,
POST_TIMER_RECORD_CLOSE,
POST_TIMER_RECORD_RESTART,
POST_TIMER_RECORD_SHUTDOWN
};
// The slow timer interval is used to update the start and end times, which only show
// time to the nearest second. So we only need an update once a second.
const int kSlowTimerInterval = 1000; // ms

View File

@ -36,6 +36,20 @@ enum TimerRecordCompletedActions {
TR_ACTION_EXPORTED = 0x00000002
};
enum {
POST_TIMER_RECORD_STOPPED = -3,
POST_TIMER_RECORD_CANCEL_WAIT,
POST_TIMER_RECORD_CANCEL,
POST_TIMER_RECORD_NOTHING = 0,
POST_TIMER_RECORD_CLOSE,
#ifdef __WINDOWS__
POST_TIMER_RECORD_RESTART,
POST_TIMER_RECORD_SHUTDOWN
#endif
};
class AudacityProject;
class TimerRecordPathCtrl final : public wxTextCtrl

View File

@ -71,18 +71,6 @@ bool MakeReadyToPlay(AudacityProject &project)
return true;
}
// Post Timer Recording Actions
// Ensure this matches the enum in TimerRecordDialog.cpp
enum {
POST_TIMER_RECORD_STOPPED = -3,
POST_TIMER_RECORD_CANCEL_WAIT,
POST_TIMER_RECORD_CANCEL,
POST_TIMER_RECORD_NOTHING,
POST_TIMER_RECORD_CLOSE,
POST_TIMER_RECORD_RESTART,
POST_TIMER_RECORD_SHUTDOWN
};
// Returns true if this project was stopped, otherwise false.
// (it may though have stopped another project playing)
bool DoStopPlaying(const CommandContext &context)
@ -371,20 +359,19 @@ void OnTimerRecord(const CommandContext &context)
} );
ProjectManager::Get(project).SetSkipSavePrompt(true);
break;
#ifdef __WINDOWS__
case POST_TIMER_RECORD_RESTART:
// Restart System
ProjectManager::Get(project).SetSkipSavePrompt(true);
#ifdef __WINDOWS__
system("shutdown /r /f /t 30");
#endif
break;
case POST_TIMER_RECORD_SHUTDOWN:
// Shutdown System
ProjectManager::Get(project).SetSkipSavePrompt(true);
#ifdef __WINDOWS__
system("shutdown /s /f /t 30");
#endif
break;
#endif
}
}
}