Commit 325cabb7 authored by Jérémie Garcia's avatar Jérémie Garcia

Debug Multiplay modes and loop mode

parent 7575e5bc
......@@ -1050,7 +1050,6 @@ Mousetrap.bind('command+escape', function() { win.isFullscreen = !win.isFullscre
$(window).on('load', function() {
win.moveTo(0,30);
win.resizeTo(800, 650);
//win.blur();
win.show();
});
}
......@@ -10,7 +10,6 @@ Traj.Player = {
//This methods plays the curves from their indexes
playCurves : function (indexes){
this.stopPlayActions();
Traj.Player.isPlaying = true;
//Find longest curves for the time slider range
......@@ -43,13 +42,17 @@ Traj.Player = {
if(now > maxDuration){
//if loop mode then relaucnh the palying
if (Traj.Player.loopMode) {
cancelAnimationFrame(this.requestId);
this.requestId = undefined;
Traj.OSC.sendPlay("end");
Traj.Player.playCurves(indexes);
return;
}
Traj.Player.stopPlayActions();
return;
}else{
Traj.Player.stopPlayActions();
return;
}
} else {
//process each curve
for (var k=0; k<indexes.length;k++) {
......@@ -82,13 +85,13 @@ Traj.Player = {
}
}
}
Traj.Player.requestId = requestAnimationFrame(loopMulti);
}
}())
},
stopPlayActions : function() {
console.log("Stop action");
if (this.isPlaying) {
if (this.requestId) {
cancelAnimationFrame(this.requestId);
......@@ -137,24 +140,25 @@ Traj.Player = {
}
},
//resets the player (stop playing and refresh display)
reset : function (){
Traj.Player.stopPlayActions();
Traj.Events.setZSliderValue(0);
document.getElementById('playButton').innerHTML = 'Play';
Traj.View.repaintAll();
},
////////////////////////////////////
////////// CALLED FROM HTML ////////
////////////////////////////////////
updateLoopMode : function(){
Traj.Player.loopMode = document.getElementById("flip-loop").value === 'on';
Traj.Player.loopMode = document.getElementById("flip-loop").checked;
Traj.Player.reset();
},
updatePlayMode : function(){
Traj.Player.isMulti = document.getElementById("flip-PlayMode").value === 'on';
Traj.View.repaintAll();
},
}
Traj.Player.isMulti = document.getElementById("flip-PlayMode").checked;
Traj.Player.reset();
}
}
\ No newline at end of file
......@@ -410,7 +410,7 @@ OrientationRecording : function(){
button.style.color = "#000000";
Traj.Events.isOrientationMode = false;
Traj.View.setDefaultFeedbackDisplay();
Traj.View.updateDrawCurvesInBackground();
Traj.View.repaintAll();
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment