Loading...
Searching...
No Matches
TrackedObjectBase.cpp
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "TrackedObjectBase.h"
#include "Json.h"
namespace openshot
{
// Default constructor, delegating
TrackedObjectBase::TrackedObjectBase() : TrackedObjectBase("") {}
// Constructor
TrackedObjectBase::TrackedObjectBase(std::string _id)
: visible(1.0), draw_box(1), id(_id) {}
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);
new_choice["name"] = name;
new_choice["value"] = value;
new_choice["selected"] = (value == selected_value);
// return JsonValue
return new_choice;
}
} // namespace openshot
Json.h
Header file for JSON class.
TrackedObjectBase.h
Header file for the TrackedObjectBase class.
openshot::TrackedObjectBase
This abstract class is the base class of all Tracked Objects.
Definition TrackedObjectBase.h:35
openshot::TrackedObjectBase::add_property_choice_json
Json::Value add_property_choice_json(std::string name, int value, int selected_value) const
Generate JSON choice for a property (dropdown properties)
Definition TrackedObjectBase.cpp:28
openshot::TrackedObjectBase::TrackedObjectBase
TrackedObjectBase()
Default constructor.
Definition TrackedObjectBase.cpp:22
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29