function add_one_region() {
+
const dur = ws.getDuration();
const pad = 0.2;
const currtime = ws.getCurrentTime();
-
//let randstart = (Math.random() * dur) - pad;
//let randend = randstart + 3;
+ num_regions++;
wsr.addRegion({
channelIdx: num_regions,
loop: false,
color: 'hsla(184, 32%, 72%, 0.1)'
});
- num_regions++;
+
}
+
function add_3_regions() {
const dur = ws.getDuration();
const pad = 0.2;
- for(let i=0; i<3; i++){
+ for(let i = 1; i < 4; i++){
+ //this should be clipped
let randstart = (Math.random() * dur) - pad;
let randend = randstart + 3;
wsr.addRegion({
channelIdx: i,
content: "region" + i + "text",
- //id: "cue " + i,
id: 'region',
start: randstart,
end: randend,
btn_tp_reset();
btn_r_reset();
btn_m_reset();
- marker_reset();
-}
-
-function marker_add() {
- num_regions++;
-
+ marker_view_reset();
}
-function marker_reset(){
+function marker_view_reset(){
curr_region = -1;
text_input.value = "no marker selected";
}
call_action: function () {
console.log("generate button clicked");
wsr.clearRegions();
+ num_regions = 0;
add_3_regions();
},
},
clicked: false,
call_action: function () {
wsr.clearRegions();
- num_regions = -1;
+ num_regions = 0;
},
}
];