From 752c118f2eee4c587bbb22ca67ae45213e198032 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 7 Dec 2016 05:21:44 -0800 Subject: [PATCH] UI: Add replay buffer options to simple output mode --- UI/data/locale/en-US.ini | 16 +- UI/forms/OBSBasicSettings.ui | 383 +++++++++++++++++++------------ UI/window-basic-main-outputs.cpp | 34 ++- UI/window-basic-main-outputs.hpp | 1 + UI/window-basic-main.cpp | 52 ++++- UI/window-basic-main.hpp | 1 + UI/window-basic-settings.cpp | 69 ++++++ UI/window-basic-settings.hpp | 2 + 8 files changed, 400 insertions(+), 158 deletions(-) diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index 86b94374a..ed9b139a3 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -58,6 +58,7 @@ Hours="Hours" Minutes="Minutes" Seconds="Seconds" Deprecated="Deprecated" +ReplayBuffer="Replay Buffer" # quick transitions QuickTransitions.SwapScenes="Swap Preview/Output Scenes After Transitioning" @@ -123,6 +124,8 @@ Output.RecordNoSpace.Title="Insufficient disk space" Output.RecordNoSpace.Msg="There is not sufficient disk space to continue recording." Output.RecordError.Title="Recording error" Output.RecordError.Msg="An unspecified error occurred while recording." +Output.ReplayBuffer.NoHotkey.Title="No hotkey set!" +Output.ReplayBuffer.NoHotkey.Msg="No hotkey set for replay buffer. Please set a hotkey to use for saving replay recordings." # output recording messages Output.BadPath.Title="Bad File Path" @@ -304,9 +307,12 @@ Basic.Main.Scenes="Scenes" Basic.Main.Sources="Sources" Basic.Main.Connecting="Connecting..." Basic.Main.StartRecording="Start Recording" +Basic.Main.StartReplayBuffer="Start Replay Buffer" Basic.Main.StartStreaming="Start Streaming" Basic.Main.StopRecording="Stop Recording" Basic.Main.StoppingRecording="Stopping Recording..." +Basic.Main.StopReplayBuffer="Stop Replay Buffer" +Basic.Main.StoppingReplayBuffer="Stopping Replay Buffer..." Basic.Main.StopStreaming="Stop Streaming" Basic.Main.StoppingStreaming="Stopping Stream..." Basic.Main.ForceStopStreaming="Stop Streaming (discard delay)" @@ -414,6 +420,12 @@ Basic.Settings.Output.Mode="Output Mode" Basic.Settings.Output.Mode.Simple="Simple" Basic.Settings.Output.Mode.Adv="Advanced" Basic.Settings.Output.Mode.FFmpeg="FFmpeg Output" +Basic.Settings.Output.UseReplayBuffer="Replay Buffer Mode" +Basic.Settings.Output.ReplayBuffer.SecondsMax="Maximum Replay Time (Seconds)" +Basic.Settings.Output.ReplayBuffer.MegabytesMax="Maximum Memory (Megabytes)" +Basic.Settings.Output.ReplayBuffer.Estimate="Estimated memory usage: %1 MB" +Basic.Settings.Output.ReplayBuffer.EstimateUnknown="Cannot estimate memory usage. Please set maximum memory limit." +Basic.Settings.Output.ReplayBuffer.HotkeyMessage="(Note: Make sure to set a hotkey for the replay buffer in the hotkeys section)" Basic.Settings.Output.Simple.SavePath="Recording Path" Basic.Settings.Output.Simple.RecordingQuality="Recording Quality" Basic.Settings.Output.Simple.RecordingQuality.Stream="Same as stream" @@ -562,8 +574,8 @@ Basic.Settings.Hotkeys.Pair="Key combinations shared with '%1' act as toggles" # basic mode hotkeys Basic.Hotkeys.StartStreaming="Start Streaming" Basic.Hotkeys.StopStreaming="Stop Streaming" -Basic.Hotkeys.StartRecording="Start Recording" -Basic.Hotkeys.StopRecording="Stop Recording" +Basic.Hotkeys.StartRecording="Start Recording/Replay Buffer" +Basic.Hotkeys.StopRecording="Stop Recording/Replay Buffer" Basic.Hotkeys.SelectScene="Switch to scene" # system tray diff --git a/UI/forms/OBSBasicSettings.ui b/UI/forms/OBSBasicSettings.ui index edab32ac8..8c9ccdb61 100644 --- a/UI/forms/OBSBasicSettings.ui +++ b/UI/forms/OBSBasicSettings.ui @@ -7,7 +7,7 @@ 0 0 981 - 667 + 720 @@ -739,6 +739,25 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + 170 + 0 + + + + Basic.Settings.Output.Simple.SavePath + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + simpleOutputPath + + + @@ -760,25 +779,6 @@ - - - - - 170 - 0 - - - - Basic.Settings.Output.Simple.SavePath - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - simpleOutputPath - - - @@ -789,6 +789,29 @@ + + + + Basic.Settings.Output.Simple.RecordingQuality + + + simpleOutRecQuality + + + + + + + + + + Basic.Settings.Output.Format + + + simpleOutRecFormat + + + @@ -823,32 +846,6 @@ - - - - Basic.Settings.Output.Format - - - simpleOutRecFormat - - - - - - - - - - Basic.Settings.Output.Simple.RecordingQuality - - - simpleOutRecQuality - - - - - - @@ -859,6 +856,9 @@ + + + @@ -872,6 +872,91 @@ + + + + Basic.Settings.Output.UseReplayBuffer + + + true + + + + + + + + + + ReplayBuffer + + + + QFormLayout::AllNonFixedFieldsGrow + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Basic.Settings.Output.ReplayBuffer.SecondsMax + + + + + + + sec + + + 5 + + + 21600 + + + 15 + + + + + + + Basic.Settings.Output.ReplayBuffer.MegabytesMax + + + + + + + MB + + + 20 + + + 8192 + + + 512 + + + + + + + + + + + + + + Basic.Settings.Output.ReplayBuffer.HotkeyMessage + + + @@ -2545,8 +2630,8 @@ 0 0 - 80 - 16 + 98 + 28 @@ -3384,12 +3469,12 @@ setCurrentIndex(int) - 310 - 29 + 159 + 30 241 - 34 + 30 @@ -3400,12 +3485,12 @@ setCurrentIndex(int) - 250 - 39 + 586 + 38 - 250 - 39 + 401 + 102 @@ -3416,12 +3501,12 @@ setVisible(bool) - 250 - 39 + 640 + 180 - 250 - 39 + 640 + 229 @@ -3432,12 +3517,12 @@ setVisible(bool) - 250 - 39 + 640 + 180 - 250 - 39 + 383 + 229 @@ -3448,12 +3533,12 @@ setVisible(bool) - 250 - 39 + 640 + 180 - 250 - 39 + 640 + 255 @@ -3464,12 +3549,12 @@ setVisible(bool) - 250 - 39 + 640 + 180 - 250 - 39 + 383 + 255 @@ -3480,12 +3565,12 @@ setCurrentIndex(int) - 259 - 48 + 232 + 71 241 - 30 + 83 @@ -3496,12 +3581,12 @@ setEnabled(bool) - 259 - 60 + 168 + 97 - 228 - 50 + 250 + 97 @@ -3512,12 +3597,12 @@ setEnabled(bool) - 259 - 39 + 168 + 82 - 228 - 29 + 232 + 82 @@ -3528,12 +3613,12 @@ setEnabled(bool) - 259 - 60 + 168 + 86 - 228 - 50 + 232 + 86 @@ -3544,12 +3629,12 @@ setCurrentIndex(int) - 259 - 60 + 250 + 80 - 259 - 60 + 250 + 82 @@ -3560,12 +3645,12 @@ setEnabled(bool) - 250 - 39 + 653 + 408 - 250 - 39 + 397 + 434 @@ -3576,12 +3661,12 @@ setEnabled(bool) - 250 - 39 + 653 + 408 - 250 - 39 + 653 + 457 @@ -3592,12 +3677,12 @@ setEnabled(bool) - 250 - 39 + 653 + 408 - 250 - 39 + 653 + 434 @@ -3608,12 +3693,12 @@ setEnabled(bool) - 250 - 39 + 588 + 513 - 250 - 39 + 332 + 539 @@ -3624,12 +3709,12 @@ setEnabled(bool) - 250 - 39 + 588 + 513 - 250 - 39 + 588 + 539 @@ -3640,12 +3725,12 @@ setEnabled(bool) - 250 - 39 + 588 + 513 - 250 - 39 + 332 + 565 @@ -3656,12 +3741,12 @@ setEnabled(bool) - 250 - 39 + 588 + 513 - 250 - 39 + 588 + 565 @@ -3672,12 +3757,12 @@ setEnabled(bool) - 720 - 280 + 951 + 349 346 - 306 + 375 @@ -3688,12 +3773,12 @@ setEnabled(bool) - 761 - 280 + 951 + 349 - 778 - 306 + 951 + 375 @@ -3704,12 +3789,12 @@ setEnabled(bool) - 820 - 280 + 951 + 349 - 810 - 329 + 951 + 398 @@ -3720,12 +3805,12 @@ setEnabled(bool) - 862 - 280 + 951 + 349 - 859 - 352 + 951 + 421 @@ -3736,12 +3821,12 @@ setEnabled(bool) - 866 - 280 + 951 + 349 - 866 - 375 + 951 + 444 @@ -3752,12 +3837,12 @@ setVisible(bool) - 250 - 39 + 640 + 180 - 250 - 39 + 640 + 203 @@ -3768,12 +3853,12 @@ setEnabled(bool) - 404 - 193 + 705 + 225 - 404 - 219 + 705 + 248 @@ -3784,12 +3869,12 @@ setEnabled(bool) - 404 - 245 + 705 + 271 - 404 - 271 + 705 + 294 diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index 7bae3a29d..c9e4b6cfa 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -306,8 +306,21 @@ SimpleOutput::SimpleOutput(OBSBasic *main_) : BasicOutputHandler(main_) LoadRecordingPreset(); if (!ffmpegOutput) { - fileOutput = obs_output_create("ffmpeg_muxer", - "simple_file_output", nullptr, nullptr); + replayBuffer = config_get_bool(main->Config(), + "SimpleOutput", "RecRB"); + if (replayBuffer) { + const char *str = config_get_string(main->Config(), + "Hotkeys", "ReplayBuffer"); + obs_data_t *hotkey = obs_data_create_from_json(str); + fileOutput = obs_output_create("replay_buffer", + Str("ReplayBuffer"), nullptr, hotkey); + + obs_data_release(hotkey); + } else { + fileOutput = obs_output_create("ffmpeg_muxer", + "simple_file_output", nullptr, nullptr); + } + if (!fileOutput) throw "Failed to create recording output " "(simple output)"; @@ -660,6 +673,10 @@ bool SimpleOutput::StartRecording() "FilenameFormatting"); bool overwriteIfExists = config_get_bool(main->Config(), "Output", "OverwriteIfExists"); + int rbTime = config_get_int(main->Config(), "SimpleOutput", + "RecRBTime"); + int rbSize = config_get_int(main->Config(), "SimpleOutput", + "RecRBSize"); os_dir_t *dir = path ? os_opendir(path) : nullptr; @@ -695,8 +712,17 @@ bool SimpleOutput::StartRecording() } obs_data_t *settings = obs_data_create(); - obs_data_set_string(settings, ffmpegOutput ? "url" : "path", - strPath.c_str()); + if (replayBuffer) { + obs_data_set_string(settings, "directory", path); + obs_data_set_string(settings, "format", filenameFormat); + obs_data_set_string(settings, "extension", format); + obs_data_set_int(settings, "max_time_sec", rbTime); + obs_data_set_int(settings, "max_size_mb", + usingRecordingPreset ? rbSize : 0); + } else { + obs_data_set_string(settings, ffmpegOutput ? "url" : "path", + strPath.c_str()); + } obs_data_set_string(settings, "muxer_settings", mux); obs_output_update(fileOutput, settings); diff --git a/UI/window-basic-main-outputs.hpp b/UI/window-basic-main-outputs.hpp index 74a73a60e..e9d442284 100644 --- a/UI/window-basic-main-outputs.hpp +++ b/UI/window-basic-main-outputs.hpp @@ -8,6 +8,7 @@ struct BasicOutputHandler { bool streamingActive = false; bool recordingActive = false; bool delayActive = false; + bool replayBuffer = false; OBSBasic *main; OBSSignal startRecording; diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 9580e9b68..4aa21cfe5 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -847,6 +847,9 @@ bool OBSBasic::InitBasicConfigDefaults() "Stream"); config_set_default_string(basicConfig, "SimpleOutput", "RecEncoder", SIMPLE_ENCODER_X264); + config_set_default_bool(basicConfig, "SimpleOutput", "RecRB", false); + config_set_default_int(basicConfig, "SimpleOutput", "RecRBTime", 20); + config_set_default_int(basicConfig, "SimpleOutput", "RecRBSize", 512); config_set_default_bool (basicConfig, "AdvOut", "ApplyServiceSettings", true); @@ -1041,6 +1044,16 @@ void OBSBasic::ResetOutputs() outputHandler.reset(advOut ? CreateAdvancedOutputHandler(this) : CreateSimpleOutputHandler(this)); + + if (outputHandler->replayBuffer) + ui->recordButton->setText( + QTStr("Basic.Main.StartReplayBuffer")); + else + ui->recordButton->setText( + QTStr("Basic.Main.StartRecording")); + + if (sysTrayRecord) + sysTrayRecord->setText(ui->recordButton->text()); } else { outputHandler->Update(); } @@ -3905,11 +3918,31 @@ void OBSBasic::StreamingStop(int code) } } +#define RP_NO_HOTKEY_TITLE QTStr("Output.ReplayBuffer.NoHotkey.Title") +#define RP_NO_HOTKEY_TEXT QTStr("Output.ReplayBuffer.NoHotkey.Msg") + void OBSBasic::StartRecording() { if (outputHandler->RecordingActive()) return; + if (outputHandler->replayBuffer) { + obs_output_t *output = outputHandler->fileOutput; + obs_data_t *hotkeys = obs_hotkeys_save_output(output); + obs_data_array_t *bindings = obs_data_get_array(hotkeys, + "ReplayBuffer.Save"); + size_t count = obs_data_array_count(bindings); + obs_data_array_release(bindings); + obs_data_release(hotkeys); + + if (!count) { + QMessageBox::information(this, + RP_NO_HOTKEY_TITLE, + RP_NO_HOTKEY_TEXT); + return; + } + } + if (api) api->on_event(OBS_FRONTEND_EVENT_RECORDING_STARTING); @@ -3919,7 +3952,10 @@ void OBSBasic::StartRecording() void OBSBasic::RecordStopping() { - ui->recordButton->setText(QTStr("Basic.Main.StoppingRecording")); + if (outputHandler->replayBuffer) + ui->recordButton->setText(QTStr("Basic.Main.StoppingReplayBuffer")); + else + ui->recordButton->setText(QTStr("Basic.Main.StoppingRecording")); if (sysTrayRecord) sysTrayRecord->setText(ui->recordButton->text()); @@ -3942,7 +3978,11 @@ void OBSBasic::StopRecording() void OBSBasic::RecordingStart() { ui->statusbar->RecordingStarted(outputHandler->fileOutput); - ui->recordButton->setText(QTStr("Basic.Main.StopRecording")); + + if (outputHandler->replayBuffer) + ui->recordButton->setText(QTStr("Basic.Main.StopReplayBuffer")); + else + ui->recordButton->setText(QTStr("Basic.Main.StopRecording")); if (sysTrayRecord) sysTrayRecord->setText(ui->recordButton->text()); @@ -3959,7 +3999,11 @@ void OBSBasic::RecordingStart() void OBSBasic::RecordingStop(int code) { ui->statusbar->RecordingStopped(); - ui->recordButton->setText(QTStr("Basic.Main.StartRecording")); + + if (outputHandler->replayBuffer) + ui->recordButton->setText(QTStr("Basic.Main.StartReplayBuffer")); + else + ui->recordButton->setText(QTStr("Basic.Main.StartRecording")); if (sysTrayRecord) sysTrayRecord->setText(ui->recordButton->text()); @@ -4696,6 +4740,8 @@ void OBSBasic::SystemTrayInit() exit = new QAction(QTStr("Exit"), trayIcon); + sysTrayRecord->setText(ui->recordButton->text()); + connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(IconActivated(QSystemTrayIcon::ActivationReason))); diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index ed477d0a4..3de906518 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -86,6 +86,7 @@ class OBSBasic : public OBSMainWindow { friend class OBSBasicPreview; friend class OBSBasicStatusBar; friend class OBSBasicSourceSelect; + friend class OBSBasicSettings; friend struct OBSStudioAPI; enum class MoveDir { diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index c0f65743a..0c45c65aa 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -44,6 +44,7 @@ #include "qt-wrappers.hpp" #include "window-basic-main.hpp" #include "window-basic-settings.hpp" +#include "window-basic-main-outputs.hpp" #include @@ -299,6 +300,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) HookWidget(ui->simpleOutRecQuality, COMBO_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->simpleOutRecEncoder, COMBO_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->simpleOutMuxCustom, EDIT_CHANGED, OUTPUTS_CHANGED); + HookWidget(ui->simpleReplayBuf, CHECK_CHANGED, OUTPUTS_CHANGED); + HookWidget(ui->simpleRBSecMax, SCROLL_CHANGED, OUTPUTS_CHANGED); + HookWidget(ui->simpleRBMegsMax, SCROLL_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->advOutEncoder, COMBO_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->advOutUseRescale, CHECK_CHANGED, OUTPUTS_CHANGED); HookWidget(ui->advOutRescale, CBEDIT_CHANGED, OUTPUTS_CHANGED); @@ -525,6 +529,14 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) this, SLOT(SimpleRecordingEncoderChanged())); connect(ui->simpleOutEnforce, SIGNAL(toggled(bool)), this, SLOT(SimpleRecordingEncoderChanged())); + connect(ui->simpleReplayBuf, SIGNAL(toggled(bool)), + this, SLOT(SimpleReplayBufferChanged())); + connect(ui->simpleOutputVBitrate, SIGNAL(valueChanged(int)), + this, SLOT(SimpleReplayBufferChanged())); + connect(ui->simpleOutputABitrate, SIGNAL(currentIndexChanged(int)), + this, SLOT(SimpleReplayBufferChanged())); + connect(ui->simpleRBSecMax, SIGNAL(valueChanged(int)), + this, SLOT(SimpleReplayBufferChanged())); connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(SimpleRecordingEncoderChanged())); @@ -1216,6 +1228,12 @@ void OBSBasicSettings::LoadSimpleOutputSettings() "RecEncoder"); const char *muxCustom = config_get_string(main->Config(), "SimpleOutput", "MuxerCustom"); + bool replayBuf = config_get_bool(main->Config(), "SimpleOutput", + "RecRB"); + int rbTime = config_get_int(main->Config(), "SimpleOutput", + "RecRBTime"); + int rbSize = config_get_int(main->Config(), "SimpleOutput", + "RecRBSize"); curPreset = preset; curQSVPreset = qsvPreset; @@ -1252,6 +1270,10 @@ void OBSBasicSettings::LoadSimpleOutputSettings() ui->simpleOutMuxCustom->setText(muxCustom); + ui->simpleReplayBuf->setChecked(replayBuf); + ui->simpleRBSecMax->setValue(rbTime); + ui->simpleRBMegsMax->setValue(rbSize); + SimpleStreamingEncoderChanged(); } @@ -1555,6 +1577,7 @@ void OBSBasicSettings::LoadOutputSettings() ui->outputMode->setEnabled(false); ui->outputModeLabel->setEnabled(false); ui->simpleRecordingGroupBox->setEnabled(false); + ui->replayBufferGroupBox->setEnabled(false); ui->advOutTopContainer->setEnabled(false); ui->advOutRecTopContainer->setEnabled(false); ui->advOutRecTypeContainer->setEnabled(false); @@ -2489,6 +2512,9 @@ void OBSBasicSettings::SaveOutputSettings() SaveComboData(ui->simpleOutRecQuality, "SimpleOutput", "RecQuality"); SaveComboData(ui->simpleOutRecEncoder, "SimpleOutput", "RecEncoder"); SaveEdit(ui->simpleOutMuxCustom, "SimpleOutput", "MuxerCustom"); + SaveCheckBox(ui->simpleReplayBuf, "SimpleOutput", "RecRB"); + SaveSpinBox(ui->simpleRBSecMax, "SimpleOutput", "RecRBTime"); + SaveSpinBox(ui->simpleRBMegsMax, "SimpleOutput", "RecRBSize"); curAdvStreamEncoder = GetComboData(ui->advOutEncoder); @@ -2636,6 +2662,15 @@ void OBSBasicSettings::SaveHotkeySettings() obs_data_release(data); obs_data_array_release(array); } + + const char *id = obs_obj_get_id(main->outputHandler->fileOutput); + if (strcmp(id, "replay_buffer") == 0) { + obs_data_t *hotkeys = obs_hotkeys_save_output( + main->outputHandler->fileOutput); + config_set_string(config, "Hotkeys", "ReplayBuffer", + obs_data_get_json(hotkeys)); + obs_data_release(hotkeys); + } } #define MINOR_SEPARATOR \ @@ -3292,6 +3327,7 @@ void OBSBasicSettings::SimpleRecordingQualityChanged() ui->simpleOutRecFormatLabel->setVisible(!losslessQuality); SimpleRecordingEncoderChanged(); + SimpleReplayBufferChanged(); } void OBSBasicSettings::SimpleStreamingEncoderChanged() @@ -3364,6 +3400,39 @@ void OBSBasicSettings::SimpleStreamingEncoderChanged() ui->simpleOutPreset->setCurrentIndex(idx); } +#define ESTIMATE_STR "Basic.Settings.Output.ReplayBuffer.Estimate" +#define ESTIMATE_UNKNOWN_STR \ + "Basic.Settings.Output.ReplayBuffer.EstimateUnknown" + +void OBSBasicSettings::SimpleReplayBufferChanged() +{ + QString qual = ui->simpleOutRecQuality->currentData().toString(); + bool replayBufferEnabled = ui->simpleReplayBuf->isChecked(); + bool lossless = qual == "Lossless"; + bool streamQuality = qual == "Stream"; + + ui->simpleRBMegsMax->setVisible(!streamQuality); + ui->simpleRBMegsMaxLabel->setVisible(!streamQuality); + + int vbitrate = ui->simpleOutputVBitrate->value(); + int abitrate = ui->simpleOutputABitrate->currentText().toInt(); + int seconds = ui->simpleRBSecMax->value(); + + int64_t memMB = int64_t(seconds) * int64_t(vbitrate + abitrate) * + 1000 / 8 / 1024 / 1024; + if (memMB < 1) memMB = 1; + + if (streamQuality) + ui->simpleRBEstimate->setText( + QTStr(ESTIMATE_STR).arg( + QString::number(int(memMB)))); + else + ui->simpleRBEstimate->setText(QTStr(ESTIMATE_UNKNOWN_STR)); + + ui->replayBufferGroupBox->setVisible(!lossless && replayBufferEnabled); + ui->simpleReplayBuf->setVisible(!lossless); +} + #define SIMPLE_OUTPUT_WARNING(str) \ QTStr("Basic.Settings.Output.Simple.Warn." str) diff --git a/UI/window-basic-settings.hpp b/UI/window-basic-settings.hpp index 3c7b26f86..b552fc1d4 100644 --- a/UI/window-basic-settings.hpp +++ b/UI/window-basic-settings.hpp @@ -290,6 +290,8 @@ private slots: void SimpleRecordingEncoderChanged(); void SimpleRecordingQualityLosslessWarning(int idx); + void SimpleReplayBufferChanged(); + void SimpleStreamingEncoderChanged(); protected: