MCPcopy Create free account
hub / github.com/audacity/audacity / WaitForStart

Method WaitForStart

src/TimerRecordDialog.cpp:1074–1122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072}
1073
1074ProgressResult TimerRecordDialog::WaitForStart()
1075{
1076 // MY: The Waiting For Start dialog now shows what actions will occur after recording has completed
1077 auto sPostAction = Verbatim(
1078 m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() );
1079
1080 // Two column layout.
1081 TimerProgressDialog::MessageTable columns{
1082 {
1083 XO("Waiting to start recording at:") ,
1084 XO("Recording duration:") ,
1085 XO("Scheduled to stop at:") ,
1086 {} ,
1087 XO("Automatic Save enabled:") ,
1088 XO("Automatic Export enabled:") ,
1089 XO("Action after Timer Recording:") ,
1090 },
1091 {
1092 GetDisplayDate(m_DateTime_Start),
1093 Verbatim( m_TimeSpan_Duration.Format() ),
1094 GetDisplayDate(m_DateTime_End) ,
1095 {} ,
1096 (m_bAutoSaveEnabled ? XO("Yes") : XO("No")) ,
1097 (m_bAutoExportEnabled ? XO("Yes") : XO("No")) ,
1098 sPostAction ,
1099 },
1100 };
1101
1102 wxDateTime startWait_DateTime = wxDateTime::UNow();
1103 wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime;
1104 TimerProgressDialog progress(waitDuration.GetMilliseconds().GetValue(),
1105 XO("Audacity Timer Record - Waiting for Start"),
1106 columns,
1107 pdlgHideStopButton | pdlgConfirmStopCancel | pdlgHideElapsedTime,
1108 /* i18n-hint: "in" means after a duration of time,
1109 which is shown below this string */
1110 XO("Recording will commence in:"));
1111
1112 auto updateResult = ProgressResult::Success;
1113 bool bIsRecording = false;
1114 while (updateResult == ProgressResult::Success && !bIsRecording)
1115 {
1116 updateResult = progress.UpdateProgress();
1117 using namespace std::chrono;
1118 std::this_thread::sleep_for(kTimerInterval);
1119 bIsRecording = (m_DateTime_Start <= wxDateTime::UNow());
1120 }
1121 return updateResult;
1122}
1123
1124ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions)
1125{

Callers 1

RunWaitDialogMethod · 0.95

Calls 3

VerbatimFunction · 0.85
GetValueMethod · 0.45
UpdateProgressMethod · 0.45

Tested by

no test coverage detected