Skip to content

Commit 9f32f5e

Browse files
committed
std:: prefixes for ClipBase
1 parent b64a100 commit 9f32f5e

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

include/ClipBase.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include "KeyFrame.h"
4444
#include "Json.h"
4545

46-
using namespace std;
47-
4846
namespace openshot {
4947

5048
/**
@@ -55,18 +53,18 @@ namespace openshot {
5553
*/
5654
class ClipBase {
5755
protected:
58-
string id; ///< ID Property for all derived Clip and Effect classes.
56+
std::string id; ///< ID Property for all derived Clip and Effect classes.
5957
float position; ///< The position on the timeline where this clip should start playing
6058
int layer; ///< The layer this clip is on. Lower clips are covered up by higher clips.
6159
float start; ///< The position in seconds to start playing (used to trim the beginning of a clip)
6260
float end; ///< The position in seconds to end playing (used to trim the ending of a clip)
63-
string previous_properties; ///< This string contains the previous JSON properties
61+
std::string previous_properties; ///< This string contains the previous JSON properties
6462

6563
/// Generate JSON for a property
66-
Json::Value add_property_json(string name, float value, string type, string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame);
64+
Json::Value add_property_json(std::string name, float value, std::string type, std::string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame);
6765

6866
/// Generate JSON choice for a property (dropdown properties)
69-
Json::Value add_property_choice_json(string name, int value, int selected_value);
67+
Json::Value add_property_choice_json(std::string name, int value, int selected_value);
7068

7169
public:
7270

@@ -80,29 +78,29 @@ namespace openshot {
8078
bool operator>= ( ClipBase& a) { return (Position() >= a.Position()); }
8179

8280
/// Get basic properties
83-
string Id() { return id; } ///< Get the Id of this clip object
81+
std::string Id() { return id; } ///< Get the Id of this clip object
8482
float Position() { return position; } ///< Get position on timeline (in seconds)
8583
int Layer() { return layer; } ///< Get layer of clip on timeline (lower number is covered by higher numbers)
8684
float Start() { return start; } ///< Get start position (in seconds) of clip (trim start of video)
8785
float End() { return end; } ///< Get end position (in seconds) of clip (trim end of video)
8886
float Duration() { return end - start; } ///< Get the length of this clip (in seconds)
8987

9088
/// Set basic properties
91-
void Id(string value) { id = value; } ///> Set the Id of this clip object
89+
void Id(std::string value) { id = value; } ///> Set the Id of this clip object
9290
void Position(float value) { position = value; } ///< Set position on timeline (in seconds)
9391
void Layer(int value) { layer = value; } ///< Set layer of clip on timeline (lower number is covered by higher numbers)
9492
void Start(float value) { start = value; } ///< Set start position (in seconds) of clip (trim start of video)
9593
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
9694

9795
/// Get and Set JSON methods
98-
virtual string Json() = 0; ///< Generate JSON string of this object
99-
virtual void SetJson(string value) = 0; ///< Load JSON string into this object
96+
virtual std::string Json() = 0; ///< Generate JSON string of this object
97+
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
10098
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
10199
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
102100

103101
/// Get all properties for a specific frame (perfect for a UI to display the current state
104102
/// of all properties at any time)
105-
virtual string PropertiesJSON(int64_t requested_frame) = 0;
103+
virtual std::string PropertiesJSON(int64_t requested_frame) = 0;
106104

107105
virtual ~ClipBase() = default;
108106
};

src/ClipBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void ClipBase::SetJsonValue(Json::Value root) {
6565
}
6666

6767
// Generate JSON for a property
68-
Json::Value ClipBase::add_property_json(string name, float value, string type, string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) {
68+
Json::Value ClipBase::add_property_json(std::string name, float value, std::string type, std::string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) {
6969

7070
// Requested Point
7171
Point requested_point(requested_frame, requested_frame);
@@ -101,7 +101,7 @@ Json::Value ClipBase::add_property_json(string name, float value, string type, s
101101
return prop;
102102
}
103103

104-
Json::Value ClipBase::add_property_choice_json(string name, int value, int selected_value) {
104+
Json::Value ClipBase::add_property_choice_json(std::string name, int value, int selected_value) {
105105

106106
// Create choice
107107
Json::Value new_choice = Json::Value(Json::objectValue);

0 commit comments

Comments
 (0)