Vuo 2.4.2
Loading...
Searching...
No Matches
VuoBlackmagicVideoMode.cc.in
1/**
2 * @file
3 * VuoBlackmagicVideoMode implementation.
4 *
5 * @copyright Copyright © 2012–2022 Kosada Incorporated.
6 * This code may be modified and distributed under the terms of the MIT License.
7 * For more information, see https://vuo.org/license.
8 */
9
10#include <DeckLinkAPI.h>
11
12#include "type.h"
13extern "C"
14{
15#include "VuoBlackmagicVideoMode.h"
16#include "VuoList_VuoBlackmagicVideoMode.h"
17
18/// @{
19#ifdef VUO_COMPILER
20VuoModuleMetadata({
21 "title" : "Blackmagic Video Mode",
22 "description" : "Video resolution and framerate.",
23 "keywords" : [ ],
24 "version" : "1.0.0",
25 "dependencies" : [
26 "VuoList_VuoBlackmagicVideoMode"
27 ]
28});
29#endif
30/// @}
31}
32
33/**
34 * Decodes the JSON object @c js to create a new value.
35 *
36 * @eg{
37 * "ntsc2398"
38 * }
39 */
40VuoBlackmagicVideoMode VuoBlackmagicVideoMode_makeFromJson(json_object *js)
41{
42 const char *valueAsString = "";
43 if (json_object_get_type(js) == json_type_string)
44 valueAsString = json_object_get_string(js);
45
46%MODE_FROM_JSON%
47}
48
49/**
50 * Encodes @c value as a JSON object.
51 */
52json_object *VuoBlackmagicVideoMode_getJson(const VuoBlackmagicVideoMode value)
53{
54%MODE_TO_JSON%
55}
56
57/**
58 * Returns a list of values that instances of this type can have.
59 */
60VuoList_VuoBlackmagicVideoMode VuoBlackmagicVideoMode_getAllowedValues(void)
61{
62 VuoList_VuoBlackmagicVideoMode l = VuoListCreate_VuoBlackmagicVideoMode();
63%MODE_ALLOWED_VALUES%
64 return l;
65}
66
67/**
68 * Returns a compact string representation of @c value.
69 */
70char *VuoBlackmagicVideoMode_getSummary(const VuoBlackmagicVideoMode value)
71{
72%MODE_SUMMARY%
73}
74
75/**
76 * Returns the @ref VuoBlackmagicVideoMode corresponding to the input `BMDDisplayMode` value.
77 */
78VuoBlackmagicVideoMode VuoBlackmagicVideoMode_makeFromBMDDisplayMode(const uint32_t value)
79{
80%MODE_FROM_BMD%
81}
82
83/**
84 * Returns the `BMDDisplayMode` corresponding to the input `value`.
85 */
86uint32_t VuoBlackmagicVideoMode_getBMDDisplayMode(const VuoBlackmagicVideoMode value)
87{
88%MODE_TO_BMD%
89}
90
91/**
92 * Returns true if the two values are equal.
93 */
94bool VuoBlackmagicVideoMode_areEqual(const VuoBlackmagicVideoMode valueA, const VuoBlackmagicVideoMode valueB)
95{
96 return valueA == valueB;
97}
98
99/**
100 * Returns true if `valueA` is less than `valueB`.
101 */
102bool VuoBlackmagicVideoMode_isLessThan(const VuoBlackmagicVideoMode valueA, const VuoBlackmagicVideoMode valueB)
103{
104 return valueA < valueB;
105}