TrackedObject: DRY out with delegating ctors

This commit is contained in:
FeRD (Frank Dana)
2021-06-04 20:10:14 -04:00
parent 1edaf80153
commit 8fab146f34
2 changed files with 35 additions and 39 deletions

View File

@@ -36,22 +36,15 @@
namespace openshot
{
// Blank constructor
TrackedObjectBase::TrackedObjectBase() : visible(1.0), draw_box(1)
{
// Initializes the id as ""
id = "";
childClipId = "";
}
// Default constructor, delegating
TrackedObjectBase::TrackedObjectBase() : TrackedObjectBase("") {}
// Default constructor
TrackedObjectBase::TrackedObjectBase(std::string _id) : visible(1.0)
{
Id(_id);
childClipId = "";
}
// Constructor
TrackedObjectBase::TrackedObjectBase(std::string _id)
: visible(1.0), draw_box(1), id(_id), childClipId("") {}
Json::Value TrackedObjectBase::add_property_choice_json(std::string name, int value, int selected_value) const
Json::Value TrackedObjectBase::add_property_choice_json(
std::string name, int value, int selected_value) const
{
// Create choice
Json::Value new_choice = Json::Value(Json::objectValue);