@@ -61,10 +61,10 @@ namespace openshot {
6161 std::string previous_properties; // /< This string contains the previous JSON properties
6262
6363 // / Generate JSON for a property
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);
64+ 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 ;
6565
6666 // / Generate JSON choice for a property (dropdown properties)
67- Json::Value add_property_choice_json (std::string name, int value, int selected_value);
67+ Json::Value add_property_choice_json (std::string name, int value, int selected_value) const ;
6868
6969 public:
7070
@@ -78,12 +78,12 @@ namespace openshot {
7878 bool operator >= ( ClipBase& a) { return (Position () >= a.Position ()); }
7979
8080 // / Get basic properties
81- std::string Id () { return id; } // /< Get the Id of this clip object
82- float Position () { return position; } // /< Get position on timeline (in seconds)
83- int Layer () { return layer; } // /< Get layer of clip on timeline (lower number is covered by higher numbers)
84- float Start () { return start; } // /< Get start position (in seconds) of clip (trim start of video)
85- float End () { return end; } // /< Get end position (in seconds) of clip (trim end of video)
86- float Duration () { return end - start; } // /< Get the length of this clip (in seconds)
81+ std::string Id () const { return id; } // /< Get the Id of this clip object
82+ float Position () const { return position; } // /< Get position on timeline (in seconds)
83+ int Layer () const { return layer; } // /< Get layer of clip on timeline (lower number is covered by higher numbers)
84+ float Start () const { return start; } // /< Get start position (in seconds) of clip (trim start of video)
85+ float End () const { return end; } // /< Get end position (in seconds) of clip (trim end of video)
86+ float Duration () const { return end - start; } // /< Get the length of this clip (in seconds)
8787
8888 // / Set basic properties
8989 void Id (std::string value) { id = value; } // /> Set the Id of this clip object
@@ -93,14 +93,14 @@ namespace openshot {
9393 void End (float value) { end = value; } // /< Set end position (in seconds) of clip (trim end of video)
9494
9595 // / Get and Set JSON methods
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
98- virtual Json::Value JsonValue () = 0; // /< Generate Json::JsonValue for this object
99- virtual void SetJsonValue (Json::Value root) = 0; // /< Load Json::JsonValue into this object
96+ virtual std::string Json () const = 0; // /< Generate JSON string of this object
97+ virtual void SetJson (const std::string value) = 0; // /< Load JSON string into this object
98+ virtual Json::Value JsonValue () const = 0; // /< Generate Json::Value for this object
99+ virtual void SetJsonValue (const Json::Value root) = 0; // /< Load Json::Value into this object
100100
101101 // / Get all properties for a specific frame (perfect for a UI to display the current state
102102 // / of all properties at any time)
103- virtual std::string PropertiesJSON (int64_t requested_frame) = 0;
103+ virtual std::string PropertiesJSON (int64_t requested_frame) const = 0;
104104
105105 virtual ~ClipBase () = default ;
106106 };
0 commit comments