浏览代码

UI: Warn user if recording format unsupported

If the recording format is unsupported or doesn't support multiple
tracks, warn the user to check their settings.
jp9000 10 年之前
父节点
当前提交
556fde66ae
共有 4 个文件被更改,包括 14 次插入3 次删除
  1. 4 0
      obs/data/locale/en-US.ini
  2. 3 1
      obs/window-basic-main-outputs.cpp
  3. 6 1
      obs/window-basic-main.cpp
  4. 1 1
      obs/window-basic-main.hpp

+ 4 - 0
obs/data/locale/en-US.ini

@@ -62,6 +62,10 @@ Output.ConnectFail.InvalidStream="Could not access the specified channel or stre
 Output.ConnectFail.Error="An unexpected error occurred when trying to connect to the server.  More information in the log file."
 Output.ConnectFail.Disconnected="Disconnected from server."
 
+# output recording-related messages
+Output.RecordFail.Title="Failed to start recording"
+Output.RecordFail.Unsupported="The output format is either unsupported or does not support more than one audio track.  Please check your settings and try again."
+
 # output recording messages
 Output.BadPath.Title="Bad File Path"
 Output.BadPath.Text="The configured file output path is invalid.  Please check your settings to confirm that a valid file path has been set."

+ 3 - 1
obs/window-basic-main-outputs.cpp

@@ -35,8 +35,10 @@ static void OBSStartRecording(void *data, calldata_t *params)
 static void OBSStopRecording(void *data, calldata_t *params)
 {
 	BasicOutputHandler *output = static_cast<BasicOutputHandler*>(data);
+	int code = (int)calldata_int(params, "code");
 
-	QMetaObject::invokeMethod(output->main, "RecordingStop");
+	QMetaObject::invokeMethod(output->main,
+			"RecordingStop", Q_ARG(int, code));
 	output->activeRefs--;
 
 	UNUSED_PARAMETER(params);

+ 6 - 1
obs/window-basic-main.cpp

@@ -2712,10 +2712,15 @@ void OBSBasic::RecordingStart()
 	ui->recordButton->setText(QTStr("Basic.Main.StopRecording"));
 }
 
-void OBSBasic::RecordingStop()
+void OBSBasic::RecordingStop(int code)
 {
 	ui->statusbar->RecordingStopped();
 	ui->recordButton->setText(QTStr("Basic.Main.StartRecording"));
+
+	if (code == OBS_OUTPUT_UNSUPPORTED)
+		QMessageBox::information(this,
+				QTStr("Output.RecordFail.Title"),
+				QTStr("Output.RecordFail.Unsupported"));
 }
 
 void OBSBasic::on_streamButton_clicked()

+ 1 - 1
obs/window-basic-main.hpp

@@ -165,7 +165,7 @@ public slots:
 	void StopRecording();
 
 	void RecordingStart();
-	void RecordingStop();
+	void RecordingStop(int code);
 
 	void SaveProject();