OpenShot Library | libopenshot  0.2.6
TrackedObjectBase.cpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Source file for the TrackedObjectBase class
4  * @author Jonathan Thomas <jonathan@openshot.org>
5  * @author Brenno Caldato <brenno.caldato@outlook.com>
6  *
7  * @ref License
8  */
9 
10 /* LICENSE
11  *
12  * Copyright (c) 2008-2019 OpenShot Studios, LLC
13  * <http://www.openshotstudios.com/>. This file is part of
14  * OpenShot Library (libopenshot), an open-source project dedicated to
15  * delivering high quality video editing and animation solutions to the
16  * world. For more information visit <http://www.openshot.org/>.
17  *
18  * OpenShot Library (libopenshot) is free software: you can redistribute it
19  * and/or modify it under the terms of the GNU Lesser General Public License
20  * as published by the Free Software Foundation, either version 3 of the
21  * License, or (at your option) any later version.
22  *
23  * OpenShot Library (libopenshot) is distributed in the hope that it will be
24  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU Lesser General Public License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License
29  * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
30  */
31 
32 #include "TrackedObjectBase.h"
33 
34 #include "Json.h"
35 
36 namespace openshot
37 {
38 
39  // Default constructor, delegating
41 
42  // Constructor
44  : visible(1.0), draw_box(1), id(_id), childClipId("") {}
45 
47  std::string name, int value, int selected_value) const
48  {
49  // Create choice
50  Json::Value new_choice = Json::Value(Json::objectValue);
51  new_choice["name"] = name;
52  new_choice["value"] = value;
53  new_choice["selected"] = (value == selected_value);
54 
55  // return JsonValue
56  return new_choice;
57  }
58 } // namespace openshot
Json::Value add_property_choice_json(std::string name, int value, int selected_value) const
Generate JSON choice for a property (dropdown properties)
This abstract class is the base class of all Tracked Objects.
Header file for JSON class.
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:46
Header file for the TrackedObjectBase class.
TrackedObjectBase()
Default constructor.