@@ -56,10 +56,10 @@ namespace openshot {
5656 std::string previous_properties; // /< This string contains the previous JSON properties
5757
5858 // / Generate JSON for a property
59- 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);
59+ Json::Value add_property_json (std::string name, float value, std::string type, std::string memo, const Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) const ;
6060
6161 // / Generate JSON choice for a property (dropdown properties)
62- Json::Value add_property_choice_json (std::string name, int value, int selected_value);
62+ Json::Value add_property_choice_json (std::string name, int value, int selected_value) const ;
6363
6464 public:
6565
@@ -73,12 +73,12 @@ namespace openshot {
7373 bool operator >= ( ClipBase& a) { return (Position () >= a.Position ()); }
7474
7575 // / Get basic properties
76- std::string Id () { return id; } // /< Get the Id of this clip object
77- float Position () { return position; } // /< Get position on timeline (in seconds)
78- int Layer () { return layer; } // /< Get layer of clip on timeline (lower number is covered by higher numbers)
79- float Start () { return start; } // /< Get start position (in seconds) of clip (trim start of video)
80- float End () { return end; } // /< Get end position (in seconds) of clip (trim end of video)
81- float Duration () { return end - start; } // /< Get the length of this clip (in seconds)
76+ std::string Id () const { return id; } // /< Get the Id of this clip object
77+ float Position () const { return position; } // /< Get position on timeline (in seconds)
78+ int Layer () const { return layer; } // /< Get layer of clip on timeline (lower number is covered by higher numbers)
79+ float Start () const { return start; } // /< Get start position (in seconds) of clip (trim start of video)
80+ float End () const { return end; } // /< Get end position (in seconds) of clip (trim end of video)
81+ float Duration () const { return end - start; } // /< Get the length of this clip (in seconds)
8282
8383 // / Set basic properties
8484 void Id (std::string value) { id = value; } // /> Set the Id of this clip object
@@ -88,14 +88,14 @@ namespace openshot {
8888 void End (float value) { end = value; } // /< Set end position (in seconds) of clip (trim end of video)
8989
9090 // / Get and Set JSON methods
91- virtual std::string Json () = 0; // /< Generate JSON string of this object
92- virtual void SetJson (std::string value) = 0; // /< Load JSON string into this object
93- virtual Json::Value JsonValue () = 0; // /< Generate Json::JsonValue for this object
94- virtual void SetJsonValue (Json::Value root) = 0; // /< Load Json::JsonValue into this object
91+ virtual std::string Json () const = 0; // /< Generate JSON string of this object
92+ virtual void SetJson (const std::string value) = 0; // /< Load JSON string into this object
93+ virtual Json::Value JsonValue () const = 0; // /< Generate Json::Value for this object
94+ virtual void SetJsonValue (const Json::Value root) = 0; // /< Load Json::Value into this object
9595
9696 // / Get all properties for a specific frame (perfect for a UI to display the current state
9797 // / of all properties at any time)
98- virtual std::string PropertiesJSON (int64_t requested_frame) = 0;
98+ virtual std::string PropertiesJSON (int64_t requested_frame) const = 0;
9999
100100 virtual ~ClipBase () = default ;
101101 };
0 commit comments