mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-19 20:52:43 -04:00
UI: Add pause support
Adds support for pausing recordings. When settings are eligible for recordings, a pause button will appear next to the recording button. If the settings are not eligible, it will warn the user in the output settings that they cannot pause recordings if those settings are used.
This commit is contained in:
1 parent
942ca6f709
commit
eab10d48b2
22 files changed
+385
-42
No files matched your search
@@ -241,17 +241,28 @@ void OBSBasicStatusBar::UpdateStreamTime()
|
||||
}
|
||||
}
|
||||
|
||||
extern volatile bool recording_paused;
|
||||
|
||||
void OBSBasicStatusBar::UpdateRecordTime()
|
||||
{
|
||||
totalRecordSeconds++;
|
||||
bool paused = os_atomic_load_bool(&recording_paused);
|
||||
|
||||
int seconds = totalRecordSeconds % 60;
|
||||
int totalMinutes = totalRecordSeconds / 60;
|
||||
int minutes = totalMinutes % 60;
|
||||
int hours = totalMinutes / 60;
|
||||
if (!paused)
|
||||
totalRecordSeconds++;
|
||||
|
||||
QString text;
|
||||
text.sprintf("REC: %02d:%02d:%02d", hours, minutes, seconds);
|
||||
|
||||
if (paused) {
|
||||
text = QStringLiteral("REC: PAUSED");
|
||||
} else {
|
||||
int seconds = totalRecordSeconds % 60;
|
||||
int totalMinutes = totalRecordSeconds / 60;
|
||||
int minutes = totalMinutes % 60;
|
||||
int hours = totalMinutes / 60;
|
||||
|
||||
text.sprintf("REC: %02d:%02d:%02d", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
recordTime->setText(text);
|
||||
recordTime->setMinimumWidth(recordTime->width());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user