Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib/app/RvApp/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,8 @@ namespace Rv
presentFormat = (char*)"";
presentData = (char*)"";

addSourceToDefaultView = true;

#ifdef PLATFORM_DARWIN
fontSize1 = 13;
fontSize2 = 10;
Expand Down Expand Up @@ -533,6 +535,7 @@ namespace Rv
inSource = true;
sources.resize(sources.size() + 1);
sources.back().singleSource = true;
sources.back().addSourceToDefaultView = true;

SourceArgs& a = sources.back();

Expand Down
4 changes: 4 additions & 0 deletions src/lib/app/RvApp/RvApp/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace Rv
, hasuncrop(false)
, singleSource(false)
, noMovieAudio(false)
, addSourceToDefaultView(true)
{
cutIn = (std::numeric_limits<int>::max)();
cutOut = (std::numeric_limits<int>::max)();
Expand All @@ -68,6 +69,7 @@ namespace Rv
float stereoRightOffset;
int cutIn;
int cutOut;
bool addSourceToDefaultView;
std::string fcdl;
std::string lcdl;
std::string flut;
Expand Down Expand Up @@ -350,6 +352,8 @@ namespace Rv
int fontSize1;
int fontSize2;

bool addSourceToDefaultView;

SendExternalEventVector sendEvents;
};

Expand Down
11 changes: 10 additions & 1 deletion src/lib/app/RvApp/RvGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,16 @@ namespace Rv
copy(m_newSources.begin(), m_newSources.end(),
inputs.begin() + layer->inputs().size());
HOP_ZONE(HOP_ZONE_COLOR_12);
layer->setInputs(inputs);

if (Rv::Options::sharedOptions().addSourceToDefaultView)
{
layer->setInputs(inputs);
}
else
{
cout << "INFO: Disabled adding sources to default views"
<< endl;
}
}

m_newSources.clear();
Expand Down
11 changes: 11 additions & 0 deletions src/lib/app/RvCommon/MuUICommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ namespace Rv

new Function(c, "rvioSetup", rvioSetup, None, Return, "void", End),

new Function(c, "setConnectNewSourcesToDefaultViews",
setConnectNewSourcesToDefaultViews, None, Return,
"void", Parameters, new Param(c, "enable", "bool"),
End),

EndArguments);
}

Expand Down Expand Up @@ -2367,4 +2372,10 @@ namespace Rv
// maintain backward compatibility.
}

NODE_IMPLEMENTATION(setConnectNewSourcesToDefaultViews, void)
{
bool enable = NODE_ARG(0, bool);
Rv::Options::sharedOptions().addSourceToDefaultView = enable;
}

} // namespace Rv
1 change: 1 addition & 0 deletions src/lib/app/RvCommon/RvCommon/MuUICommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ namespace Rv
NODE_DECLARATION(rvioSetup, void);
NODE_DECLARATION(javascriptMuExport, void);
NODE_DECLARATION(framebufferPixelValue, Mu::Vector4f);
NODE_DECLARATION(setConnectNewSourcesToDefaultViews, void);

} // namespace Rv

Expand Down
Loading