diff --git a/bindings/python/openshot.i b/bindings/python/openshot.i index f468bc35b..764333aa6 100644 --- a/bindings/python/openshot.i +++ b/bindings/python/openshot.i @@ -156,6 +156,7 @@ %{ #include #include + #include static std::vector _keys{"num", "den"}; static int fracError = 0; @@ -179,7 +180,7 @@ } } const std::string __getitem__(int index) { - if (index < _keys.size()) { + if (index < static_cast(_keys.size())) { return _keys[index]; } /* Otherwise, raise an exception */ @@ -206,7 +207,7 @@ return map1; } /* Display methods */ - const std::string __string__() { + const std::string __str__() { std::ostringstream result; result << $self->num << ":" << $self->den; return result.str(); diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index f0287091f..2ac57cf80 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -128,13 +128,6 @@ Keyframe::Keyframe(double value) { // Constructor which takes a vector of Points Keyframe::Keyframe(const std::vector& points) : Points(points) {}; -// Constructor which takes a vector of std::pair tuples (and adds them all) -Keyframe::Keyframe(const std::vector& coordinates) { - for (const auto& co : coordinates) { - AddPoint(Point(co)); - } -} - // Add a new point on the key-frame. Each point has a primary coordinate, // a left handle, and a right handle. void Keyframe::AddPoint(Point p) { diff --git a/src/KeyFrame.h b/src/KeyFrame.h index 42dd47aee..2601acb35 100644 --- a/src/KeyFrame.h +++ b/src/KeyFrame.h @@ -62,9 +62,6 @@ namespace openshot { std::vector Points; ///< Vector of all Points public: - using CoordinateVec = std::vector; - using PointsVec = std::vector; - /// Default constructor for the Keyframe class Keyframe() = default; @@ -72,10 +69,7 @@ namespace openshot { Keyframe(double value); /// Constructor which adds a supplied vector of Points - Keyframe(const PointsVec& points); - - /// Constructor which takes a vector of std::pair tuples - Keyframe(const CoordinateVec& coordinates); + Keyframe(const std::vector& points); /// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle. void AddPoint(Point p); diff --git a/tests/KeyFrame_Tests.cpp b/tests/KeyFrame_Tests.cpp index e3a1d06a5..f4718dccb 100644 --- a/tests/KeyFrame_Tests.cpp +++ b/tests/KeyFrame_Tests.cpp @@ -510,18 +510,4 @@ TEST(Point_Vector_Constructor) CHECK_CLOSE(30.0f, k1.GetValue(10), 0.0001); } -TEST(Coordinate_Vector_Constructor) -{ - std::vector coordinates{ - Coordinate(1, 100), Coordinate(10, 500), Coordinate(1000, 80000) - }; - Keyframe k1(coordinates); - - CHECK_EQUAL(1001, k1.GetLength()); - - auto p1 = k1.GetPoint(2); - CHECK_CLOSE(80000.0f, p1.co.Y, 0.00001); -} - - }; // SUITE