Initial commit

This commit is contained in:
2023-08-29 19:55:48 +02:00
commit 7c2eec4446
473 changed files with 40947 additions and 0 deletions

View File

@@ -0,0 +1,134 @@
exports.__esModule = true;
module.exports = function (ActionAPI) {
ActionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var shotID = properties.shotID != undefined && properties.shotID.length > 0 ? properties.shotID : 'none';
if (connectionID != 'none') {
if (shotID != 'none') {
var connection = ActionAPI.getConnection('wirecast-bridge', connectionID);
if (connection && connection.instance) {
connection.instance
.clearShotIfLive(shotID)
.then(function () {
status('Shot has been clear if live', 'info');
})["catch"](function (error) {
status(error, 'error');
});
}
}
else
status('No shot specified', 'error');
}
else
status('No connection specified', 'error');
});
function filterValues(values) {
var newValues = [
{ id: 'none', text: 'None' }
];
for (var i = 0; i < values.length; i++)
if (values[i].text != 'Clear Layer')
newValues.push(values[i]);
return newValues;
}
ActionAPI.onOpenEditor(function (EditorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var shotID = properties.shotID != undefined ? properties.shotID : 'none';
var connection = ActionAPI.getConnection('wirecast-bridge', connectionID);
var connectionField = {
id: 'connectionID',
name: 'Connection',
type: 'connection',
connectionType: 'wirecast-bridge',
value: connectionID
};
var shotsField = {
id: 'shotID',
name: 'Shot',
type: 'select',
values: [],
value: shotID
};
if (connectionID != 'none')
shotsField.values = [
{ id: '%loading%', text: 'Please wait for shots dropdown to load' }
];
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var shotID = properties.shotID != undefined ? properties.shotID : 'none';
var connection = ActionAPI.getConnection('wirecast-bridge', connectionID);
var connectionField = {
id: 'connectionID',
name: 'Connection',
type: 'connection',
connectionType: 'wirecast-bridge',
value: connectionID
};
var shotsField = {
id: 'shotID',
name: 'Shot',
type: 'select',
values: [],
value: shotID
};
if (connectionID != 'none') {
shotsField.values = [
{ id: '%loading%', text: 'Please wait for shots dropdown to load' }
];
}
var sendFields = function () {
shotsField.value = shotID;
EditorAPI.setFields([
connectionField,
shotsField
]);
};
if (connection != undefined && connection.instance != undefined) {
connection.instance.getShotsList(null, function (shots) {
shotsField.values = filterValues(shots.map(function (shot) {
return { id: shot.id, text: shot.name };
}));
sendFields();
});
}
else
sendFields();
EditorAPI.onFieldChanges(function (fields) {
var fieldObject = EditorAPI.tools.objectifyFieldsValues(fields);
connectionField.value = fieldObject.connectionID;
shotsField.value = fieldObject.shotID;
EditorAPI.saveProperties({ connectionID: fieldObject.connectionID, shotID: fieldObject.shotID });
if (connectionID != fieldObject.connectionID) {
connectionID = fieldObject.connectionID;
if (fieldObject.connectionID != 'none') {
shotsField.values = [
{ id: '%loading%', text: 'Please wait for shots dropdown to load' }
];
EditorAPI.setFields([
connectionField,
shotsField
]);
connection = ActionAPI.getConnection('wirecast-bridge', fieldObject.connectionID);
if (connection && connection.instance) {
connection.instance.getShotsList(null, function (shots) {
shotsField.values = filterValues(shots.map(function (shot) {
return { id: shot.id, text: shot.name };
}));
sendFields();
});
}
}
else {
shotsField.values = [];
sendFields();
}
}
});
var sendFields = function () {
EditorAPI.setFields([
connectionField,
shotsField
]);
};
});
};
//# sourceMappingURL=clearIfLive.js.map