Skip to content

Commit

Permalink
implement syncPrivateData() to update visibility etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Feb 27, 2018
1 parent 77369b1 commit 5b8e1f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions FFmpeg/WriteFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,12 @@ class WriteFFmpegPlugin
virtual void changedParam(const InstanceChangedArgs &args, const string &paramName) OVERRIDE FINAL;
virtual void changedClip(const InstanceChangedArgs &args, const string &clipName) OVERRIDE FINAL;
virtual void onOutputFileChanged(const string &filename, bool setColorSpace) OVERRIDE FINAL;
/** @brief The sync private data action, called when the effect needs to sync any private data to persistent parameters */
virtual void syncPrivateData(void) OVERRIDE FINAL
{
updateVisibility();
updatePixelFormat();
}

/** @brief the effect is about to be actively edited by a user, called when the first user interface is opened on an instance */
virtual void beginEdit(void) OVERRIDE FINAL;
Expand Down Expand Up @@ -1665,8 +1671,8 @@ WriteFFmpegPlugin::WriteFFmpegPlugin(OfxImageEffectHandle handle,
_mbDecision = fetchChoiceParam(kParamMBDecision);
#endif

updateVisibility();
updatePixelFormat();
// finally
syncPrivateData();
}

WriteFFmpegPlugin::~WriteFFmpegPlugin()
Expand Down
9 changes: 8 additions & 1 deletion RunScript/RunScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ class RunScriptPlugin
// override the roi call
virtual void getRegionsOfInterest(const RegionsOfInterestArguments &args, RegionOfInterestSetter &rois) OVERRIDE FINAL;

/** @brief The sync private data action, called when the effect needs to sync any private data to persistent parameters */
virtual void syncPrivateData(void) OVERRIDE FINAL
{
updateVisibility();
}

private:
void updateVisibility(void);

Expand Down Expand Up @@ -226,7 +232,8 @@ RunScriptPlugin::RunScriptPlugin(OfxImageEffectHandle handle)
_validate = fetchBooleanParam(kParamValidate);
assert(_script && _validate);

updateVisibility();
// finally
syncPrivateData();
}

void
Expand Down

0 comments on commit 5b8e1f6

Please sign in to comment.