summaryrefslogtreecommitdiff
path: root/www/js/rivendell.js
diff options
context:
space:
mode:
authorPeterTheOne <petertheone@gmail.com>2016-01-28 20:29:46 (GMT)
committerPeterTheOne <petertheone@gmail.com>2016-01-28 20:29:46 (GMT)
commita3d085734454a66955bcc2c642b0a4f7bf5d2b92 (patch)
treed290b36b2eb96d6350ec31e02e2a9e2f0c93b14c /www/js/rivendell.js
parent7aa6781c617b91e3ed28d528428087f11131daac (diff)
fix musicgrid bugs, create Rivendell.Group class, refactor
Diffstat (limited to 'www/js/rivendell.js')
-rw-r--r--www/js/rivendell.js48
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;
+};