You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Clip: GetEffect implementation
This commit is contained in:
@@ -169,6 +169,9 @@ namespace openshot {
|
||||
/// Return the list of effects on the timeline
|
||||
std::list<openshot::EffectBase*> Effects() { return effects; };
|
||||
|
||||
/// Look up an effect by ID
|
||||
openshot::EffectBase* GetEffect(const std::string& id);
|
||||
|
||||
/// @brief Get an openshot::Frame object for a specific frame number of this timeline.
|
||||
///
|
||||
/// @returns The requested frame (containing the image)
|
||||
@@ -253,8 +256,6 @@ namespace openshot {
|
||||
openshot::Keyframe has_audio; ///< An optional override to determine if this clip has audio (-1=undefined, 0=no, 1=yes)
|
||||
openshot::Keyframe has_video; ///< An optional override to determine if this clip has video (-1=undefined, 0=no, 1=yes)
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // OPENSHOT_CLIP_H
|
||||
|
||||
12
src/Clip.cpp
12
src/Clip.cpp
@@ -368,6 +368,18 @@ std::shared_ptr<Frame> Clip::GetFrame(int64_t requested_frame)
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
// Look up an effect by ID
|
||||
openshot::EffectBase* Clip::GetEffect(const std::string& id)
|
||||
{
|
||||
// Find the matching effect (if any)
|
||||
for (const auto& effect : effects) {
|
||||
if (effect->Id() == id) {
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Get file extension
|
||||
std::string Clip::get_file_extension(std::string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user