Skip to content

Commit

Permalink
Merge branch 'develop' into frac-python-types
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Dec 4, 2020
2 parents 68abf00 + e8b4dde commit 2a9cf28
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 12 deletions.
1 change: 1 addition & 0 deletions bindings/python/openshot.i
Expand Up @@ -221,6 +221,7 @@
%include "effects/Bars.h"
%include "effects/Blur.h"
%include "effects/Brightness.h"
%include "effects/Caption.h"
%include "effects/ChromaKey.h"
%include "effects/ColorShift.h"
%include "effects/Crop.h"
Expand Down
1 change: 1 addition & 0 deletions bindings/ruby/openshot.i
Expand Up @@ -206,6 +206,7 @@
%include "effects/Bars.h"
%include "effects/Blur.h"
%include "effects/Brightness.h"
%include "effects/Caption.h"
%include "effects/ChromaKey.h"
%include "effects/ColorShift.h"
%include "effects/Crop.h"
Expand Down
4 changes: 2 additions & 2 deletions src/Clip.h
Expand Up @@ -185,7 +185,7 @@ namespace openshot {
void AddEffect(openshot::EffectBase* effect);

/// Close the internal reader
void Close();
void Close() override;

/// Return the list of effects on the timeline
std::list<openshot::EffectBase*> Effects() { return effects; };
Expand All @@ -198,7 +198,7 @@ namespace openshot {
///
/// @returns A new openshot::Frame object
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number);
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override;

/// @brief Get an openshot::Frame object for a specific frame number of this timeline. The image size and number
/// of samples can be customized to match the Timeline, or any custom output. Extra samples will be moved to the
Expand Down
4 changes: 3 additions & 1 deletion src/ImageReader.h
Expand Up @@ -48,6 +48,8 @@

namespace openshot
{
// Forward decls
class CacheBase;

/**
* @brief This class uses the ImageMagick++ libraries, to open image files, and return
Expand Down Expand Up @@ -90,7 +92,7 @@ namespace openshot
void Close() override;

/// Get the cache object used by this reader (always returns NULL for this object)
CacheMemory* GetCache() override { return NULL; };
CacheBase* GetCache() override { return NULL; };

/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
/// return the same Frame, since they all share the same image data.
Expand Down
4 changes: 3 additions & 1 deletion src/QtHtmlReader.h
Expand Up @@ -49,6 +49,8 @@ class QImage;

namespace openshot
{
// Forward decls
class CacheBase;

/**
* @brief This class uses Qt libraries, to create frames with rendered HTML, and return
Expand Down Expand Up @@ -115,7 +117,7 @@ namespace openshot
void Close() override;

/// Get the cache object used by this reader (always returns NULL for this object)
openshot::CacheMemory* GetCache() override { return NULL; };
CacheBase* GetCache() override { return NULL; };

/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
/// return the same Frame, since they all share the same image data.
Expand Down
4 changes: 3 additions & 1 deletion src/QtImageReader.h
Expand Up @@ -42,6 +42,8 @@

namespace openshot
{
// Forward decl
class CacheBase;

/**
* @brief This class uses the Qt library, to open image files, and return
Expand Down Expand Up @@ -88,7 +90,7 @@ namespace openshot
void Close() override;

/// Get the cache object used by this reader (always returns NULL for this object)
CacheMemory* GetCache() override { return NULL; };
CacheBase* GetCache() override { return NULL; };

/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
/// return the same Frame, since they all share the same image data.
Expand Down
4 changes: 3 additions & 1 deletion src/QtTextReader.h
Expand Up @@ -49,6 +49,8 @@ class QImage;

namespace openshot
{
// Forward decls
class CacheBase;

/**
* @brief This class uses Qt libraries, to create frames with "Text", and return
Expand Down Expand Up @@ -126,7 +128,7 @@ namespace openshot
void Close() override;

/// Get the cache object used by this reader (always returns NULL for this object)
openshot::CacheMemory* GetCache() override { return NULL; };
CacheBase* GetCache() override { return NULL; };

/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
/// return the same Frame, since they all share the same image data.
Expand Down
2 changes: 1 addition & 1 deletion src/Timeline.cpp
Expand Up @@ -289,7 +289,7 @@ void Timeline::RemoveClip(Clip* clip)
}

// Look up a clip
openshot::ClipBase* Timeline::GetClip(const std::string& id)
openshot::Clip* Timeline::GetClip(const std::string& id)
{
// Find the matching clip (if any)
for (const auto& clip : clips) {
Expand Down
2 changes: 1 addition & 1 deletion src/Timeline.h
Expand Up @@ -265,7 +265,7 @@ namespace openshot {
std::list<openshot::Clip*> Clips() { return clips; };

/// Look up a single clip by ID
openshot::ClipBase* GetClip(const std::string& id);
openshot::Clip* GetClip(const std::string& id);

/// Look up a clip effect by ID
openshot::EffectBase* GetClipEffect(const std::string& id);
Expand Down
2 changes: 1 addition & 1 deletion tests/ImageWriter_Tests.cpp
Expand Up @@ -85,7 +85,7 @@ TEST(Gif)
// Basic Reader state queries
CHECK_EQUAL("ImageReader", r1.Name());

CacheMemory* c = r1.GetCache();
CacheBase* c = r1.GetCache();
CHECK_EQUAL(true, c == nullptr);

CHECK_EQUAL(false, r1.IsOpen());
Expand Down
12 changes: 9 additions & 3 deletions tests/Timeline_Tests.cpp
Expand Up @@ -437,20 +437,26 @@ TEST(GetClip_by_id)
std::string clip2_id("CLIP00002");
clip2.Id(clip2_id);
clip2.Layer(2);
clip2.Waveform(true);

t.AddClip(&clip1);
t.AddClip(&clip2);

auto matched = t.GetClip(clip1_id);
// We explicitly want to get returned a Clip*, here
Clip* matched = t.GetClip(clip1_id);
CHECK_EQUAL(clip1_id, matched->Id());
CHECK_EQUAL(1, matched->Layer());

auto matched2 = t.GetClip(clip2_id);
Clip* matched2 = t.GetClip(clip2_id);
CHECK_EQUAL(clip2_id, matched2->Id());
CHECK_EQUAL(false, matched2->Layer() < 2);

auto matched3 = t.GetClip("BAD_ID");
Clip* matched3 = t.GetClip("BAD_ID");
CHECK_EQUAL(true, matched3 == nullptr);

// Ensure we can access the Clip API interfaces after lookup
CHECK_EQUAL(false, matched->Waveform());
CHECK_EQUAL(true, matched2->Waveform());
}

TEST(GetClipEffect_by_id)
Expand Down

0 comments on commit 2a9cf28

Please sign in to comment.