From 0fe84d36f65ecd103595a74c590ceb87488b1f03 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Fri, 29 Jan 2021 03:42:56 -0500 Subject: [PATCH] Keyframe: Get rid of vector aliases, Coord ctor --- bindings/python/openshot.i | 3 ++- src/KeyFrame.cpp | 7 ------- src/KeyFrame.h | 8 +------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/bindings/python/openshot.i b/bindings/python/openshot.i index a58d0bd6..764333aa 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 */ diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index f0287091..2ac57cf8 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 42dd47ae..2601acb3 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);