1110{
1111 auto &project = context.
project;
1115
1116
1117
1118
1122"Timer Recording cannot be used with more than one open project.\n\nPlease close any additional projects and try again."),
1123 XO(
"Timer Recording"),
1124 wxICON_INFORMATION | wxOK);
1125 return;
1126 }
1127
1128
1129
1130
1131
1132 if ((undoManager.UnsavedChanges()) &&
1136"Timer Recording cannot be used while you have unsaved changes.\n\nPlease save or close this project and try again."),
1137 XO(
"Timer Recording"),
1138 wxICON_INFORMATION | wxOK);
1139 return;
1140 }
1141
1142
1143
1144
1145
1148 const int numberOfSelected{ selectedTracks.numberOfSelected };
1149 const bool allSameRate{ selectedTracks.allSameRate };
1150
1151 if (!allSameRate) {
1153 "for recording must all have the same sampling rate"),
1154 XO(
"Mismatched Sampling Rates"),
1155 wxICON_ERROR | wxCENTRE);
1156
1157 return;
1158 }
1159
1161 if (existingTracks.empty()) {
1162 if (numberOfSelected > 0 && rateOfSelected !=
1165 "Too few tracks are selected for recording at this sample rate.\n"
1166 "(Audacity requires two channels at the same sample rate for\n"
1167 "each stereo track)"),
1168 XO(
"Too Few Compatible Tracks Selected"),
1169 wxICON_ERROR | wxCENTRE);
1170
1171 return;
1172 }
1173 }
1174
1175
1176
1178
1179
1180
1181
1182
1184 &window, project, bProjectSaved);
1185 int modalResult = dialog.ShowModal();
1186 if (modalResult == wxID_CANCEL)
1187 {
1188
1189 }
1190 else
1191 {
1192
1193
1194 #if 0
1195
1196 bool bPreferNewTrack;
1197 gPrefs->Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
1198 if (bPreferNewTrack) {
1199 window.Rewind(false);
1200 } else {
1201 window.SkipEnd(false);
1202 }
1203 #endif
1204
1205 int iTimerRecordingOutcome = dialog.RunWaitDialog();
1206 switch (iTimerRecordingOutcome) {
1208
1210 break;
1212
1213
1214
1215
1216
1217
1219 break;
1221
1222 break;
1224 wxTheApp->CallAfter( []{
1225
1226 wxCommandEvent evt{ wxEVT_MENU, wxID_EXIT };
1227 wxTheApp->AddPendingEvent( evt );
1228 } );
1230 break;
1231
1232#ifdef __WINDOWS__
1233 case POST_TIMER_RECORD_RESTART:
1234
1236 system("shutdown /r /f /t 30");
1237 break;
1238 case POST_TIMER_RECORD_SHUTDOWN:
1239
1241 system("shutdown /s /f /t 30");
1242 break;
1243#endif
1244 }
1245 }
1246}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
PropertiesOfSelected GetPropertiesOfSelected(const AudacityProject &proj)
@ POST_TIMER_RECORD_CLOSE
@ POST_TIMER_RECORD_CANCEL
@ POST_TIMER_RECORD_CANCEL_WAIT
@ POST_TIMER_RECORD_NOTHING
static Settings & settings()
AudacityProject & project
static WritableSampleTrackArray ChooseExistingRecordingTracks(AudacityProject &proj, bool selectedOnly, double targetRate=RATE_NOT_SELECTED)
static ProjectAudioManager & Get(AudacityProject &project)
void SetTimerRecordCancelled()
static ProjectFileIO & Get(AudacityProject &project)
static ProjectHistory & Get(AudacityProject &project)
static ProjectManager & Get(AudacityProject &project)
void SetSkipSavePrompt(bool bSkip)
static ProjectRate & Get(AudacityProject &project)
static ProjectSettings & Get(AudacityProject &project)
static ProjectWindow & Get(AudacityProject &project)
Dialog for Timer Record, i.e., timed or long recording.
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
static UndoManager & Get(AudacityProject &project)