Skip to content

Commit

Permalink
Add getArgsForSourceFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Aug 5, 2024
1 parent f424fda commit 9794bbc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/shared/WobblyProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4128,8 +4128,15 @@ void WobblyProject::presetsToScript(std::string &script) const {
}


const char *getArgsForSourceFilter() {
if (source_filter == "bs.VideoSource")
return ", rff=True";
return "";
}


void WobblyProject::sourceToScript(std::string &script, bool save_node) const {
std::string src = "src = c." + source_filter + "(r'" + handleSingleQuotes(input_file) + "')\n";
std::string src = "src = c." + source_filter + "(r'" + handleSingleQuotes(input_file) + "'" + getArgsForSourceFilter() +")\n";

if (save_node) {
script +=
Expand Down
10 changes: 8 additions & 2 deletions src/wibbly/WibblyJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ void WibblyJob::headerToScript(std::string &script) const {
"\n";
}

const char *getArgsForSourceFilter() {
if (source_filter == "bs.VideoSource")
return ", rff=True";
return "";
}


void WibblyJob::sourceToScript(std::string &script) const {
std::string fixed_input_file = handleSingleQuotes(input_file);
Expand All @@ -246,10 +252,10 @@ void WibblyJob::sourceToScript(std::string &script) const {
" if isinstance(src, vs.VideoOutputTuple):\n"
" src = src[0]\n"
" except KeyError:\n"
" src = c." + source_filter + "(r'" + fixed_input_file + "')\n"
" src = c." + source_filter + "(r'" + fixed_input_file + "'" + getArgsForSourceFilter() + ")\n"
" src.set_output(index=1)\n"
"else:\n"
" src = c." + source_filter + "(r'" + fixed_input_file + "')\n"
" src = c." + source_filter + "(r'" + fixed_input_file + "'" + getArgsForSourceFilter() + ")\n"
" src.set_output(index=1)\n"
" wibbly_last_input_file = r'" + fixed_input_file + "'\n"
"\n";
Expand Down
7 changes: 6 additions & 1 deletion src/wobbly/WobblyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3878,6 +3878,11 @@ void WobblyWindow::openProject() {
}
}

const char *getArgsForSourceFilter() {
if (source_filter == "bs.VideoSource")
return ", rff=True";
return "";
}

void WobblyWindow::realOpenVideo(const QString &path) {
try {
Expand All @@ -3897,7 +3902,7 @@ void WobblyWindow::realOpenVideo(const QString &path) {
"\n"
"c = vs.core\n"
"\n"
"c.%1(r'%2').set_output()\n");
"c.%1(r'%2'" + getArgsForSourceFilter() +").set_output()\n");
script = script.arg(source_filter).arg(QString::fromStdString(handleSingleQuotes(path.toStdString())));

QApplication::setOverrideCursor(Qt::WaitCursor);
Expand Down

0 comments on commit 9794bbc

Please sign in to comment.