diff options
Diffstat (limited to 'www/js/rivendell.js')
-rw-r--r-- | www/js/rivendell.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/www/js/rivendell.js b/www/js/rivendell.js index ffa138a..70546dc 100644 --- a/www/js/rivendell.js +++ b/www/js/rivendell.js @@ -348,3 +348,51 @@ Rivendell.Rivendell.prototype.deleteAudio = function(cartNumber, cutNumber, succ }; return $.post(this.rdxportEndpoint, command, success, 'xml'); }; + +Rivendell.GroupList = function(rivendell) { + this.rivendell = rivendell; + + this.groups = []; +}; + +Rivendell.GroupList.prototype.destroy = function() { + $(this.groups).each(function(index, group) { + group.destroy(); + }); +}; + +Rivendell.Group = function(groupName, description, lowcart, highcart, normlevel, trimlevel) { + this.groupXml = null; + + if (arguments.length === 1) { + this.groupXml = groupName; + this.groupName = $('group', this.groupXml).text(); + this.description = $('group-description', this.groupXml).text(); + this.lowcart = $('group-low-cart', this.groupXml).text(); + this.highcart = $('group-high-cart', this.groupXml).text(); + this.normlevel = $('normalization-level', this.groupXml).text(); + this.trimlevel = $('autotrim-level', this.groupXml).text(); + } else { + this.groupName = groupName; + this.description = description; + this.lowcart = lowcart; + this.highcart = highcart; + this.normlevel = normlevel; + this.trimlevel = trimlevel; + } +}; + +Rivendell.Cart = function(number, title, groupName, group) { + this.number = number; + this.title = title; + this.groupName = groupName; + this.group = group; +}; + +Rivendell.Cut = function(cart, cartNumber, name, description) { + this.cart = cart; + this.cartNumber = cartNumber; + this.number = name.substr(-3); + this.name = name; + this.description = description; +}; |