I have built a table based on a tutorial by Ben Gatien on structured parameters
I'm using the playlist to drive sources to monitor arrays and split effects on our Carbonite Black.
This task adds a new item to the bottom of the playlist.
<task tasktype="ogscript">var newrecall = {
name: params.getValue("store_name",0),
Layout: params.getValue("Layout",0),
Abus: params.getValue("Abus",0),
Bbus: params.getValue("Bbus",0),
Key1: params.getValue("Key1",0),
Key2: params.getValue("Key2",0),
Key3: params.getValue("Key3",0),
Key4: params.getValue("Key4",0),
};
var count = params.getElementCount("recalls");
var p = params.getParam("recalls",0);
p.setValueAt(count, newrecall);</task>
For late changes, my directors are asking about adding a new item in a particular place.
I'm thinking that the "add new item" combined with elements of the "move up" function might get me close, but I am afraid it might also break every item below the insert point.
Move Up:
<task tasktype="ogscript">var newarray = new Array();
var index = params.getValue("selection",0);
if (index>0) {
// Recreate the array of values, with a new order.
var count = params.getElementCount("recalls");
for (var i=0; i < count; i++) {
if (i == index-1) {
newarray.push(params.getValue("recalls",index));
continue;
}
if (i == index) {
newarray.push(params.getValue("recalls",index-1));
continue;
}
newarray.push(params.getValue("recalls",i));
}
params.setAllValues("recalls", newarray);
params.setValue("selection",0,index-1);
}</task>
Does anybody have any ideas?
Can I do this without everything crumbling down around my ears?
Thanks,
James.
#DashBoard
#CarboniteBlack
------------------------------
James Hessler
WAAY (HEARTLAND MEDIA)
------------------------------