Skip to content

Commit

Permalink
GUI: Add an extra opts for user specified arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiatka committed Aug 19, 2024
1 parent 4682cf6 commit 8bd1caf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
7 changes: 6 additions & 1 deletion gui/QT/option/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ const static struct{
const char *parent;
const char *limit;
} optionList[] = {
{"extraOpts", Option::StringOpt, "", "", false, "", ""},
{"video.source", Option::StringOpt, " -t ", "", false, "", ""},
{"video.source.embeddedAudioAvailable", Option::SilentOpt, "", "", false, "", ""},
{"testcard.width", Option::StringOpt, ":", "", false, "video.source", "testcard"},
Expand Down Expand Up @@ -298,8 +299,10 @@ std::string Settings::getControlPort() const{
std::string Settings::getLaunchParams() const{
std::string out;

out += getOption("extraOpts").getLaunchOption();

if(getOption("preview").isEnabled()){
out += "--capture-filter preview";
out += " --capture-filter preview";
out += ":key=" + getSessRndKey();
}

Expand Down Expand Up @@ -346,6 +349,8 @@ std::string Settings::getLaunchParams() const{
std::string Settings::getPreviewParams() const{
std::string out;

out += getOption("extraOpts").getLaunchOption();

out += " --capture-filter preview";
out += ":key=" + getSessRndKey();
out += ",every:0";
Expand Down
1 change: 1 addition & 0 deletions gui/QT/option/settings_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ void SettingsUi::initSettingsWin(Ui::Settings *ui){
addControl(new CheckboxUi(ui->decodeAccelCheck, settings, "decode.hwaccel"));
addControl(new CheckboxUi(ui->errorsFatalBox, settings, "errors_fatal"));
addControl(new LineEditUi(ui->encryptionLineEdit, settings, "encryption"));
addControl(new LineEditUi(ui->extraOptsLineEdit, settings, "extraOpts"));
addControl(new CheckboxUi(ui->advModeCheck, settings, "advanced"));

addDeviceTabs();
Expand Down
14 changes: 12 additions & 2 deletions gui/QT/ui/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<x>0</x>
<y>0</y>
<width>323</width>
<height>363</height>
<height>360</height>
</rect>
</property>
</widget>
Expand Down Expand Up @@ -499,7 +499,7 @@
<item row="1" column="1">
<widget class="QLineEdit" name="encryptionLineEdit"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="advModeCheck">
<property name="toolTip">
<string>Show all input/output modules as reported by UltraGrid. Note that most of the hidden devices are not useful.</string>
Expand All @@ -509,6 +509,16 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="cap_filers_label">
<property name="text">
<string>Extra options</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="extraOptsLineEdit"/>
</item>
</layout>
</widget>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion gui/QT/window/ultragrid_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void UltragridWindow::refresh(){

void UltragridWindow::setupPreviewCallbacks(){
const char * const opts[] = {
"video.source", "audio.source", "audio.source.channels", "encryption"
"video.source", "audio.source", "audio.source.channels", "encryption", "extraOpts"
};

for(const auto &i : opts){
Expand Down

0 comments on commit 8bd1caf

Please sign in to comment.