Vuo
2.4.4
Loading...
Searching...
No Matches
node
vuo.blackmagic
VuoBlackmagicOutputDevice.c
Go to the documentation of this file.
1
10
#include "
VuoBlackmagicOutputDevice.h
"
11
13
#ifdef VUO_COMPILER
14
VuoModuleMetadata
({
15
"title"
:
"Blackmagic Output Device"
,
16
"description"
:
"Information about a Blackmagic video output device."
,
17
"keywords"
: [ ],
18
"version"
:
"1.0.0"
,
19
"dependencies"
: [
20
"VuoBlackmagicConnection"
,
21
"VuoBlackmagicVideoMode"
,
22
"VuoInteger"
,
23
"VuoText"
24
]
25
});
26
#endif
28
41
VuoBlackmagicOutputDevice
VuoBlackmagicOutputDevice_makeFromJson
(json_object * js)
42
{
43
return
(
VuoBlackmagicOutputDevice
){
44
VuoJson_getObjectValue
(
VuoText
, js,
"name"
, NULL),
45
VuoJson_getObjectValue
(
VuoInteger
, js,
"subDevice"
, 0),
46
VuoJson_getObjectValue
(
VuoBlackmagicConnection
, js,
"connection"
, VuoBlackmagicConnection_Composite),
47
VuoJson_getObjectValue
(
VuoBlackmagicVideoMode
, js,
"videoMode"
, VuoBlackmagicVideoMode_NTSC),
48
};
49
}
50
54
json_object *
VuoBlackmagicOutputDevice_getJson
(
const
VuoBlackmagicOutputDevice
value)
55
{
56
json_object *js = json_object_new_object();
57
58
if
(value.name)
59
json_object_object_add(js,
"name"
,
VuoText_getJson
(value.name));
60
61
if
(value.subDevice)
62
json_object_object_add(js,
"subDevice"
,
VuoInteger_getJson
(value.subDevice));
63
64
json_object_object_add(js,
"connection"
,
VuoBlackmagicConnection_getJson
(value.connection));
65
66
json_object_object_add(js,
"videoMode"
,
VuoBlackmagicVideoMode_getJson
(value.videoMode));
67
68
return
js;
69
}
70
74
char
*
VuoBlackmagicOutputDevice_getSummary
(
const
VuoBlackmagicOutputDevice
value)
75
{
76
char
*connection =
VuoBlackmagicConnection_getSummary
(value.connection);
77
char
*mode =
VuoBlackmagicVideoMode_getSummary
(value.videoMode);
78
79
char
*summary;
80
if
(value.name)
81
summary =
VuoText_format
(
"%s<br>Sub-device %lld<br>Connection: %s<br>Mode: %s"
,
82
value.name, value.subDevice, connection, mode);
83
else
84
summary =
VuoText_format
(
"First available Blackmagic output device<br>Connection: %s<br>Mode: %s"
,
85
connection, mode);
86
87
free(connection);
88
free(mode);
89
return
summary;
90
}
91
95
char
*
VuoBlackmagicOutputDevice_getShortSummary
(
const
VuoBlackmagicOutputDevice
value)
96
{
97
if
(value.name)
98
return
VuoText_format
(
"%s, sub-device %lld"
, value.name, value.subDevice);
99
else
100
return
strdup(
"First available Blackmagic output device"
);
101
}
102
106
VuoBlackmagicOutputDevice
VuoBlackmagicOutputDevice_make
(
const
VuoText
name,
const
VuoInteger
subDevice,
const
VuoBlackmagicConnection
connection,
const
VuoBlackmagicVideoMode
videoMode)
107
{
108
return
(
VuoBlackmagicOutputDevice
){name, subDevice, connection, videoMode};
109
}
110
114
bool
VuoBlackmagicOutputDevice_areEqual
(
const
VuoBlackmagicOutputDevice
value1,
const
VuoBlackmagicOutputDevice
value2)
115
{
116
if
(!
VuoText_areEqual
(value1.name, value2.name))
117
return
false
;
118
119
if
(value1.subDevice != value2.subDevice)
120
return
false
;
121
122
if
(!
VuoBlackmagicConnection_areEqual
(value1.connection, value2.connection))
123
return
false
;
124
125
if
(!
VuoBlackmagicVideoMode_areEqual
(value1.videoMode, value2.videoMode))
126
return
false
;
127
128
return
true
;
129
}
130
134
bool
VuoBlackmagicOutputDevice_isLessThan
(
const
VuoBlackmagicOutputDevice
a,
const
VuoBlackmagicOutputDevice
b)
135
{
136
VuoType_returnInequality
(
VuoText
, a.name, b.name);
137
VuoType_returnInequality
(
VuoInteger
, a.subDevice, b.subDevice);
138
VuoType_returnInequality
(
VuoBlackmagicConnection
, a.connection, b.connection);
139
VuoType_returnInequality
(
VuoBlackmagicVideoMode
, a.videoMode, b.videoMode);
140
return
false
;
141
}
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8