Skip to content

Commit

Permalink
Add option to prevent sources from being added to default view automa…
Browse files Browse the repository at this point in the history
…tically

Signed-off-by: Ben Chamberland <[email protected]>
  • Loading branch information
chxmberland committed Aug 23, 2024
1 parent ceaf3df commit ed5819c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/app/RvApp/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ Options::Options()
presentFormat = (char*)"";
presentData = (char*)"";

addSourceToDefaultView = true;

#ifdef PLATFORM_DARWIN
fontSize1 = 13;
fontSize2 = 10;
Expand Down Expand Up @@ -493,6 +495,7 @@ Options::parseSourceArgs(const Files& inputFiles)
inSource = true;
sources.resize(sources.size() + 1);
sources.back().singleSource = true;
sources.back().addSourceToDefaultView = true;

SourceArgs& a = sources.back();

Expand Down
7 changes: 5 additions & 2 deletions src/lib/app/RvApp/RvApp/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ struct Options
{
SourceArgs() : audioOffset(0), rangeOffset(0), volume(1), fps(0),
pixelAspect(0), stereoRelativeOffset(0), stereoRightOffset(0),
hascrop(false), hasuncrop(false), singleSource (false),
noMovieAudio(false)
hascrop(false), hasuncrop(false), singleSource(false),
noMovieAudio(false), addSourceToDefaultView(true)
{
cutIn = (std::numeric_limits<int>::max)();
cutOut = (std::numeric_limits<int>::max)();
Expand All @@ -59,6 +59,7 @@ struct Options
float stereoRightOffset;
int cutIn;
int cutOut;
bool addSourceToDefaultView;
std::string fcdl;
std::string lcdl;
std::string flut;
Expand Down Expand Up @@ -341,6 +342,8 @@ struct Options
int fontSize1;
int fontSize2;

bool addSourceToDefaultView;

SendExternalEventVector sendEvents;
};

Expand Down
9 changes: 8 additions & 1 deletion src/lib/app/RvApp/RvGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,14 @@ RvGraph::connectNewSourcesToDefaultViews()
copy(layer->inputs().begin(), layer->inputs().end(), inputs.begin());
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
12 changes: 12 additions & 0 deletions src/lib/app/RvCommon/MuUICommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,12 @@ void initUICommands()
Return, "void",
End),

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

EndArguments);
}

Expand Down Expand Up @@ -2335,4 +2341,10 @@ NODE_IMPLEMENTATION(rvioSetup, void)
// backward compatibility.
}

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

} // Rv namespace
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 @@ -88,6 +88,7 @@ NODE_DECLARATION(validateShotgunToken, Mu::Pointer);
NODE_DECLARATION(launchTLI, void);
NODE_DECLARATION(rvioSetup, void);
NODE_DECLARATION(javascriptMuExport, void);
NODE_DECLARATION(setConnectNewSourcesToDefaultViews, void);


} // Rv
Expand Down

0 comments on commit ed5819c

Please sign in to comment.