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,239 @@
exports.__esModule = true;
exports.Mitti = void 0;
var HyperdeckLib = require("hyperdeck-js-lib");
var Mitti = /** @class */ (function () {
function Mitti(ip) {
this.events = {};
this.connected = false;
// console.log(`Connecting to hyperdeck at ${ip}`);
var _this = this;
this.hyperdeck = new HyperdeckLib.Hyperdeck(ip);
this.hyperdeck
.onConnected()
.then(function () {
_this.hyperdeck.getNotifier().on('asynchronousEvent', function (response) {
//console.log('Got an asynchronous event with code ' + response.code + '.');
});
_this.hyperdeck.getNotifier().on('connectionLost', function () {
_this.connected = false;
console.error('Connection lost.');
if (_this.events.connectionlost != undefined)
_this.events.connectionlost();
});
if (_this.events.connected != undefined)
_this.events.connected();
})["catch"](function (error) {
console.log(error);
_this.connected = false;
if (_this.events.connecterror != undefined)
_this.events.connecterror('Failed to connect to hyperdeck.');
});
}
Mitti.prototype.on = function (event, callback) {
if (this.events[event] != undefined)
throw new Error("Event '" + event + "' already created");
else {
this.events[event] = callback;
if (event == 'connected' && this.connected == true)
callback();
}
};
Mitti.prototype.raw = function (command) {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Sending command: ' + command);
_this_1.hyperdeck
.makeRequest(command)
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
resolve(response);
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.getTransportInfo = function () {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Getting transport info');
_this_1.hyperdeck
.makeRequest('transport info')
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
if (response.params != undefined) {
resolve(response.params);
}
else {
reject(new Error('Response contained no params'));
}
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.getClipCount = function () {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Getting clips');
_this_1.hyperdeck
.makeRequest('clips count')
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
if (response.params != undefined) {
if (response.params['clip count'] != undefined) {
resolve(response.params['clip count']);
}
else {
reject(new Error('Response contained no clip count data'));
}
}
else {
reject(new Error('Response contained no params data'));
}
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.getClips = function () {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Getting clips');
_this_1.hyperdeck
.clipsGet()
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
if (response.params != undefined) {
if (response.params['clip count'] != undefined)
delete response.params['clip count'];
resolve(response.params);
}
else {
reject(new Error('Response contained no clip data'));
}
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.selectClip = function (index) {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Selecting clip');
_this_1.hyperdeck
.makeRequest("goto: clip id: " + index)
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
resolve(true);
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.play = function () {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Playing');
_this_1.hyperdeck
.play()
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
resolve(true);
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.stop = function () {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Stopping');
_this_1.hyperdeck
.stop()
.then(function (response) {
//console.log('Got response with code ' + response.code + '.');
resolve(true);
})["catch"](function (errResponse) {
if (!errResponse) {
reject(new Error('The request failed because the hyperdeck connection was lost.'));
}
else {
reject(new Error('The hyperdeck returned an error with status code ' + errResponse.code + '.'));
}
});
});
};
Mitti.prototype.next = function (wrap) {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Next clip');
_this_1.getTransportInfo()
.then(function (transportInfo) {
var newClip = parseInt(transportInfo['clip id']) + 1;
if (wrap == true) {
_this_1.getClipCount()
.then(function (clipCount) {
if (newClip > clipCount)
newClip = 1;
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
})["catch"](reject);
}
else
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
})["catch"](reject);
});
};
Mitti.prototype.previous = function (wrap) {
var _this_1 = this;
return new Promise(function (resolve, reject) {
//console.log('Previous clip');
_this_1.getTransportInfo()
.then(function (transportInfo) {
var newClip = parseInt(transportInfo['clip id']) - 1;
if (wrap == true) {
_this_1.getClipCount()
.then(function (clipCount) {
if (newClip < 1)
newClip = clipCount;
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
})["catch"](reject);
}
else
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
})["catch"](reject);
});
};
return Mitti;
}());
exports.Mitti = Mitti;
//# sourceMappingURL=MittiClass.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,115 @@
exports.__esModule = true;
var MittiClass_1 = require("../MittiClass");
module.exports = function (actionAPI) {
//Handle the action when executed
actionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var clipID = properties.clipID != undefined ? properties.clipID : 'none';
if (connectionID != 'none') {
if (clipID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var ip = connection.properties.ip;
var mitti = new MittiClass_1.Mitti(ip);
mitti.on('connected', function () {
mitti
.selectClip(parseInt(clipID))
.then(function () {
status("Clip " + clipID + " has been selected", 'info');
})["catch"](function (error) {
status(error.message, 'error');
});
});
}
else
status('No clip specified', 'error');
}
else
status('No connection specified', 'error');
});
//Handle the interactive editor
actionAPI.onOpenEditor(function (editorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var clipID = properties.clipID != undefined ? properties.clipID : 'none';
var currentIP;
var currentPort;
var fields = [
{
id: 'connectionID',
name: 'Connection',
type: 'connection',
value: connectionID,
connectionType: 'mitti'
},
{
id: 'clipID',
name: 'Clip',
type: 'select',
value: clipID,
values: []
}
];
function updateAddress(connectionID, callback) {
if (connectionID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var ip = connection.properties.ip;
var port = connection.properties.port;
if (currentIP != ip || currentPort != port) {
currentIP = ip;
currentPort = port;
callback(true);
}
else {
callback(false);
}
}
else {
if (currentIP != null || currentPort != null) {
currentIP = null;
currentPort = null;
callback(true);
}
else {
callback(false);
}
}
}
function updateSources(callback) {
var mitti = new MittiClass_1.Mitti(currentIP);
mitti
.getClips()
.then(function (clips) {
var fieldValues = [];
for (var clipID in clips) {
var query = clips[clipID];
var name = query.split(' ').splice(query.split(' ').length - 3, 2);
fieldValues.push({ id: clipID, text: clipID + " - " + name });
}
fields[1].values = fieldValues;
callback();
})["catch"](function (error) {
fields[1].values = [];
callback();
});
}
function validate(fieldValues) {
fields[0].value = fieldValues.connectionID;
fields[1].value = fieldValues.clipID;
editorAPI.saveProperties({ connectionID: fieldValues.connectionID, clipID: fieldValues.clipID });
updateAddress(fieldValues.connectionID, function (changed) {
if (changed) {
updateSources(function () {
editorAPI.setFields(fields);
});
}
else
editorAPI.setFields(fields);
});
}
validate({ connectionID: connectionID, clipID: clipID });
editorAPI.onFieldChanges(function (fields) {
var fieldValues = editorAPI.tools.objectifyFieldsValues(fields);
validate(fieldValues);
});
});
};
//# sourceMappingURL=clip.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"clip.js","sourceRoot":"","sources":["../../../../../src/Integrations/buildin/mitti/actions/clip.ts"],"names":[],"mappings":";AAIA,4CAAsC;AAEtC,MAAM,CAAC,OAAO,GAAG,UAAC,SAAoB;IACrC,iCAAiC;IACjC,SAAS,CAAC,MAAM,CACf,UAAC,UAA6B,EAAE,MAAgE;QAC/F,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3F,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QACzE,IAAI,YAAY,IAAI,MAAM,EAAE;YAC3B,IAAI,MAAM,IAAI,MAAM,EAAE;gBACrB,IAAI,UAAU,GAAG,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBAChE,IAAI,EAAE,GAAW,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC1C,IAAI,KAAK,GAAG,IAAI,kBAAK,CAAC,EAAE,CAAC,CAAC;gBAE1B,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE;oBACrB,KAAK;yBACH,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;yBAC5B,IAAI,CAAC;wBACL,MAAM,CAAC,UAAQ,MAAM,uBAAoB,EAAE,MAAM,CAAC,CAAC;oBACpD,CAAC,CAAC,CACD,OAAK,CAAA,CAAC,UAAC,KAAY;wBACnB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBAChC,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACH;;gBAAM,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;SAC5C;;YAAM,MAAM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CAAC,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC;YAErC,SAAS,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjG,aAAa,CAAC,WAAW,CAAC,YAAY,EAAE,UAAC,OAAO;gBAC/C,IAAI,OAAO,EAAE;oBACZ,aAAa,CAAC;wBACb,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;oBAC7B,CAAC,CAAC,CAAC;iBACH;;oBAAM,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,QAAQ,CAAC,EAAE,YAAY,cAAA,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;QAEnC,SAAS,CAAC,cAAc,CAAC,UAAC,MAAyB;YAClD,IAAI,WAAW,GAA2B,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAExF,QAAQ,CAAC,WAAW,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}

View File

@@ -0,0 +1,47 @@
exports.__esModule = true;
//TODO: Implement wrap checkbox property in editor
module.exports = function (actionAPI) {
//Handle the action when executed
actionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var wrap = properties.wrap != undefined ? properties.wrap : true;
if (connectionID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var mitti = connection.instance;
mitti
.previous(wrap)
.then(function () {
status("Previous clip has been selected", 'info');
})["catch"](function (error) {
status(error.message, 'error');
});
}
else
status('No connection specified', 'error');
});
//Handle the interactive editor
actionAPI.onOpenEditor(function (editorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var wrap = properties.wrap != undefined ? properties.wrap : true;
editorAPI.onFieldChanges(function (fields) {
var fieldValues = editorAPI.tools.objectifyFieldsValues(fields);
editorAPI.saveProperties({ connectionID: fieldValues.connectionID, wrap: fieldValues.wrap });
});
editorAPI.setFields([
{
id: 'connectionID',
name: 'Connection',
type: 'connection',
value: connectionID,
connectionType: 'mitti'
},
{
id: 'wrap',
name: 'Wrap',
type: 'checkbox',
value: true
}
]);
});
};
//# sourceMappingURL=next.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../../../src/Integrations/buildin/mitti/actions/next.ts"],"names":[],"mappings":";AAMA,kDAAkD;AAElD,MAAM,CAAC,OAAO,GAAG,UAAC,SAAoB;IACrC,iCAAiC;IACjC,SAAS,CAAC,MAAM,CAAC,UAAC,UAAsB,EAAE,MAAgE;QACzG,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3F,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,IAAI,YAAY,IAAI,MAAM,EAAE;YAC3B,IAAI,UAAU,GAAG,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAChE,IAAI,KAAK,GAAG,UAAU,CAAC,QAAiB,CAAC;YAEzC,KAAK;iBACH,QAAQ,CAAC,IAAI,CAAC;iBACd,IAAI,CAAC;gBACL,MAAM,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC,CAAC,CACD,OAAK,CAAA,CAAC,UAAC,KAAY;gBACnB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;SACJ;;YAAM,MAAM,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,+BAA+B;IAC/B,SAAS,CAAC,YAAY,CAAC,UAAC,SAAoB,EAAE,UAAsB;QACnE,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3F,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAEjE,SAAS,CAAC,cAAc,CAAC,UAAC,MAAyB;YAClD,IAAI,WAAW,GAAoB,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAEjF,SAAS,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,SAAS,CAAC;YACnB;gBACC,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,YAAY;gBACnB,cAAc,EAAE,OAAO;aACvB;YACD;gBACC,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,IAAI;aACX;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}

View File

@@ -0,0 +1,38 @@
exports.__esModule = true;
module.exports = function (actionAPI) {
//Handle the action when executed
actionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
if (connectionID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var mitti = connection.instance;
mitti
.play()
.then(function () {
status("Current clip playing", 'info');
})["catch"](function (error) {
status(error.message, 'error');
});
}
else
status('No connection specified', 'error');
});
//Handle the interactive editor
actionAPI.onOpenEditor(function (editorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
editorAPI.onFieldChanges(function (fields) {
var fieldValues = editorAPI.tools.objectifyFieldsValues(fields);
editorAPI.saveProperties({ connectionID: fieldValues.connectionID });
});
editorAPI.setFields([
{
id: 'connectionID',
name: 'Connection',
type: 'connection',
value: connectionID,
connectionType: 'mitti'
}
]);
});
};
//# sourceMappingURL=play.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"play.js","sourceRoot":"","sources":["../../../../../src/Integrations/buildin/mitti/actions/play.ts"],"names":[],"mappings":";AAMA,MAAM,CAAC,OAAO,GAAG,UAAC,SAAoB;IACrC,iCAAiC;IACjC,SAAS,CAAC,MAAM,CAAC,UAAC,UAAsB,EAAE,MAAgE;QACzG,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3F,IAAI,YAAY,IAAI,MAAM,EAAE;YAC3B,IAAI,UAAU,GAAG,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAChE,IAAI,KAAK,GAAG,UAAU,CAAC,QAAiB,CAAC;YAEzC,KAAK;iBACH,IAAI,EAAE;iBACN,IAAI,CAAC;gBACL,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;YACxC,CAAC,CAAC,CACD,OAAK,CAAA,CAAC,UAAC,KAAY;gBACnB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;SACJ;;YAAM,MAAM,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,+BAA+B;IAC/B,SAAS,CAAC,YAAY,CAAC,UAAC,SAAoB,EAAE,UAAsB;QACnE,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;QAE3F,SAAS,CAAC,cAAc,CAAC,UAAC,MAAyB;YAClD,IAAI,WAAW,GAAoB,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAEjF,SAAS,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,SAAS,CAAC;YACnB;gBACC,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,YAAY;gBACnB,cAAc,EAAE,OAAO;aACvB;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}

View File

@@ -0,0 +1,47 @@
exports.__esModule = true;
//TODO: Implement wrap checkbox property in editor
module.exports = function (actionAPI) {
//Handle the action when executed
actionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var wrap = properties.wrap != undefined ? properties.wrap : true;
if (connectionID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var mitti = connection.instance;
mitti
.previous(wrap)
.then(function () {
status("Previous clip has been selected", 'info');
})["catch"](function (error) {
status(error.message, 'error');
});
}
else
status('No connection specified', 'error');
});
//Handle the interactive editor
actionAPI.onOpenEditor(function (editorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
var wrap = properties.wrap != undefined ? properties.wrap : true;
editorAPI.onFieldChanges(function (fields) {
var fieldValues = editorAPI.tools.objectifyFieldsValues(fields);
editorAPI.saveProperties({ connectionID: fieldValues.connectionID, wrap: fieldValues.wrap });
});
editorAPI.setFields([
{
id: 'connectionID',
name: 'Connection',
type: 'connection',
value: connectionID,
connectionType: 'mitti'
},
{
id: 'wrap',
name: 'Wrap',
type: 'checkbox',
value: true
}
]);
});
};
//# sourceMappingURL=previous.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"previous.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CAAC,IAAI,CAAC;QAEjE,SAAS,CAAC,cAAc,CAAC,UAAC,MAAyB;YAClD,IAAI,WAAW,GAAoB,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAEjF,SAAS,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,SAAS,CAAC;YACnB;gBACC,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,YAAY;gBACnB,cAAc,EAAE,OAAO;aACvB;YACD;gBACC,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,IAAI;aACX;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}

View File

@@ -0,0 +1,38 @@
exports.__esModule = true;
module.exports = function (actionAPI) {
//Handle the action when executed
actionAPI.handle(function (properties, status) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
if (connectionID != 'none') {
var connection = actionAPI.getConnection('mitti', connectionID);
var mitti = connection.instance;
mitti
.stop()
.then(function () {
status("Current clip stopped", 'info');
})["catch"](function (error) {
status(error.message, 'error');
});
}
else
status('No connection specified', 'error');
});
//Handle the interactive editor
actionAPI.onOpenEditor(function (editorAPI, properties) {
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
editorAPI.onFieldChanges(function (fields) {
var fieldValues = editorAPI.tools.objectifyFieldsValues(fields);
editorAPI.saveProperties({ connectionID: fieldValues.connectionID });
});
editorAPI.setFields([
{
id: 'connectionID',
name: 'Connection',
type: 'connection',
value: connectionID,
connectionType: 'mitti'
}
]);
});
};
//# sourceMappingURL=stop.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"stop.js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,SAAS,CAAC;YACnB;gBACC,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,YAAY;gBACnB,cAAc,EAAE,OAAO;aACvB;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}

View File

@@ -0,0 +1,40 @@
exports.__esModule = true;
var Integration = {
name: 'Mitti',
description: 'Control Mitti through the Mitti Undecked Bridge.',
main: require('./mitti'),
actions: [
{
id: 'clip',
name: 'Set the Mitti clip'
},
{
id: 'play',
name: 'Play current clip'
},
{
id: 'stop',
name: 'Stop current clip'
},
{
id: 'next',
name: 'Go to next clip'
},
{
id: 'previous',
name: 'Go to previous clip'
}
],
connections: [
{
type: 'mitti',
name: 'Mitti Instance',
message: 'For this connection to work you need to enable Hyperdeck in the Mitti settings.',
fields: [
{ id: 'ip', name: 'IP Address', type: 'text', value: '0.0.0.0' }
]
}
]
};
module.exports = Integration;
//# sourceMappingURL=integration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../../src/Integrations/buildin/mitti/integration.ts"],"names":[],"mappings":";AAEA,IAAI,WAAW,GAAgB;IAC9B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC;IAExB,OAAO,EAAE;QACR;YACC,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,oBAAoB;SAC1B;QAED;YACC,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,mBAAmB;SACzB;QAED;YACC,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,mBAAmB;SACzB;QAED;YACC,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,iBAAiB;SACvB;QAED;YACC,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,qBAAqB;SAC3B;KACD;IAED,WAAW,EAAE;QACZ;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,iFAAiF;YAC1F,MAAM,EAAE;gBACP,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;aAChE;SACD;KACD;CACD,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC"}

View File

@@ -0,0 +1,42 @@
exports.__esModule = true;
var MittiClass_1 = require("./MittiClass");
var axios = require('axios')["default"];
module.exports = function (api) {
//Register a action
api.registerAction('clip', require('./actions/clip'));
api.registerAction('play', require('./actions/play'));
api.registerAction('stop', require('./actions/stop'));
api.registerAction('next', require('./actions/next'));
api.registerAction('previous', require('./actions/previous'));
api.registerConnectionValidator('mitti', function (ValidatorAPI) {
var properties = ValidatorAPI.properties;
if (properties.ip != undefined) {
if (ValidatorAPI.instance != undefined && ValidatorAPI.instance.connected == true)
return ValidatorAPI.callback(true);
var mitti = new MittiClass_1.Mitti(properties.ip);
var canRespond = true;
var timeout = setTimeout(function () {
canRespond = false;
ValidatorAPI.callback(false, 'Timeout while trying to connect to Mitti');
}, 3000);
mitti.on('connected', function () {
if (canRespond == true) {
canRespond = false;
ValidatorAPI.setInstance(mitti);
clearTimeout(timeout);
ValidatorAPI.callback(true);
}
});
mitti.on('connecterror', function (errorMessage) {
if (canRespond == true) {
canRespond = false;
clearTimeout(timeout);
ValidatorAPI.callback(false, errorMessage);
}
});
}
else
ValidatorAPI.callback(false, 'Incorrect ip address syntax');
});
};
//# sourceMappingURL=mitti.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mitti.js","sourceRoot":"","sources":["../../../../src/Integrations/buildin/mitti/mitti.ts"],"names":[],"mappings":";AACA,2CAAqC;AACrC,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,SAAO,CAAA,CAAC;AAEvC,MAAM,CAAC,OAAO,GAAG,UAAC,GAAmB;IACpC,mBAAmB;IACnB,GAAG,CAAC,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