diff options
author | Peter Grassberger <petertheone@gmail.com> | 2015-10-02 18:29:20 (GMT) |
---|---|---|
committer | Peter Grassberger <petertheone@gmail.com> | 2015-10-02 18:29:20 (GMT) |
commit | 0138e75f8947d764a3542055448e0c2bcf7610a3 (patch) | |
tree | 441124a7b68d5d1d130e2b96ce9f425c85a7b02d | |
parent | 90020d956895a0a0e4c4e33ae713243753e16f56 (diff) |
add all functions from (probably incomplete) web_api.pdf documentation
many untested, some optional parameters missing.
-rw-r--r-- | www/js/rivendell.js | 175 |
1 files changed, 174 insertions, 1 deletions
diff --git a/www/js/rivendell.js b/www/js/rivendell.js index d303620..7d0365c 100644 --- a/www/js/rivendell.js +++ b/www/js/rivendell.js @@ -35,7 +35,49 @@ Rivendell.Rivendell.prototype.listLog = function(name, success) { COMMAND: 22, LOGIN_NAME: this.username, PASSWORD: this.token, - NAME: shows_current.log + NAME: name + }; + return $.post(this.rdxportEndpoint, command, success, "xml"); +}; + +Rivendell.Rivendell.prototype.listLogs = function(success) { + var command = { + COMMAND: 20, + LOGIN_NAME: this.username, + PASSWORD: this.token + //todo: fix optionals + /*SERVICE_NAME: serviceName, + TRACKABLE: trackable*/ + }; + return $.post(this.rdxportEndpoint, command, success, "xml"); +}; + +Rivendell.Rivendell.prototype.listServices = function(success) { + var command = { + COMMAND: 21, + LOGIN_NAME: this.username, + PASSWORD: this.token + //todo: fix optionals + /*TRACKABLE: trackable*/ + }; + return $.post(this.rdxportEndpoint, command, success, "xml"); +}; + +Rivendell.Rivendell.prototype.listGroup = function(groupName, success) { + var command = { + COMMAND: 5, + LOGIN_NAME: this.username, + PASSWORD: this.token, + GROUP_NAME: groupName + }; + return $.post(this.rdxportEndpoint, command, success, "xml"); +}; + +Rivendell.Rivendell.prototype.listGroups = function(success) { + var command = { + COMMAND: 4, + LOGIN_NAME: this.username, + PASSWORD: this.token }; return $.post(this.rdxportEndpoint, command, success, "xml"); }; @@ -74,6 +116,14 @@ Rivendell.Rivendell.prototype.addCart = function(groupName, type, cartNumber, su return $.post(this.rdxportEndpoint, command, success, "xml"); }; +Rivendell.Rivendell.prototype.editCart = function(cartNumber, options, success) { + options.COMMAND = 14; + options.LOGIN_NAME = this.username; + options.PASSWORD = this.token; + options.CART_NUMBER = cartNumber; + return $.post(this.rdxportEndpoint, options, success, "xml"); +}; + Rivendell.Rivendell.prototype.removeCart = function(cartNumber, success) { var command = { COMMAND: 13, @@ -84,6 +134,27 @@ Rivendell.Rivendell.prototype.removeCart = function(cartNumber, success) { return $.post(this.rdxportEndpoint, command, success, "xml"); }; +Rivendell.Rivendell.prototype.listCut = function(cartNumber, cutNumber, success) { + var command = { + COMMAND: 8, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.listCuts = function(cartNumber, success) { + var command = { + COMMAND: 9, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + Rivendell.Rivendell.prototype.addCut = function(cartNumber, success) { var command = { COMMAND: 10, @@ -94,6 +165,15 @@ Rivendell.Rivendell.prototype.addCut = function(cartNumber, success) { return $.post(this.rdxportEndpoint, command, success, 'xml'); }; +Rivendell.Rivendell.prototype.editCut = function(cartNumber, cutNumber, options, success) { + options.COMMAND = 15; + options.LOGIN_NAME = this.username; + options.PASSWORD = this.token; + options.CART_NUMBER = cartNumber; + options.CUT_NUMBER = cutNumber; + return $.post(this.rdxportEndpoint, options, success, "xml"); +}; + Rivendell.Rivendell.prototype.removeCut = function(destinationCartNumber, destinationCutNumber, success) { var command = { COMMAND: 11, @@ -159,3 +239,96 @@ Rivendell.Rivendell.prototype.copyAudio = function(sourceCartNumber, sourceCutNu }; return $.post(this.rdxportEndpoint, command, success, 'xml'); }; + +Rivendell.Rivendell.prototype.audioInfo = function(cartNumber, cutNumber, success) { + var command = { + COMMAND: 19, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.audioStore = function(success) { + var command = { + COMMAND: 23, + LOGIN_NAME: this.username, + PASSWORD: this.token + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.import = function(cartNumber, cutNumber, channels, normalizationLevel, autotrimLevel, + useMetadata, filename, success) { + var command = { + COMMAND: 2, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber, + CHANNELS: channels, + NORMALIZATION_LEVEL: normalizationLevel, + AUTOTRIM_LEVEL: autotrimLevel, + USE_METADATA: useMetadata, + FILENAME: filename + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.export = function(cartNumber, cutNumber, format, channels, sampleRate, bitRate, + quality, startPoint, endPoint, normalizationLevel, enableMetadata, + success) { + var command = { + COMMAND: 1, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber, + FORMAT: format, + CHANNELS: channels, + SAMPLE_RATE: sampleRate, + BIT_RATE: bitRate, + QUALITY: quality, + START_POINT: startPoint, + END_POINT: endPoint, + NORMALIZATION_LEVEL: normalizationLevel, + ENABLE_METADATA: enableMetadata + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.exportPeaks = function(cartNumber, cutNumber, success) { + var command = { + COMMAND: 16, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.trimAudio = function(cartNumber, cutNumber, trimLevel, success) { + var command = { + COMMAND: 17, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber, + TRIM_LEVEL: trimLevel + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; + +Rivendell.Rivendell.prototype.deleteAudio = function(cartNumber, cutNumber, success) { + var command = { + COMMAND: 3, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + CUT_NUMBER: cutNumber + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; |