Skip to content

Commit

Permalink
link fix, timer, cleanup
Browse files Browse the repository at this point in the history
removed excess jquery file
set pause on change speed
updated demo links
reset link goes to fretboard.html
  • Loading branch information
deltadada committed Aug 14, 2014
1 parent 579a5d3 commit 7f7bf7b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 175 deletions.
10 changes: 8 additions & 2 deletions PlayerModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ var PlayerModel = {
"setPlaySpeed" : function(speed){
this["playSpeed"] = Number(speed);
if(this["playState"] == PS_PLAYING){
this.setPlaystate(PS_PAUSED);
clearInterval(this["looper"]);
this["looper"] = setInterval(function(){animateNotegroups();},Number(speed));
this.setLooper(setInterval(function(){animateNotegroups(true);},Number(speed)));
//this["looper"] = setInterval(function(){animateNotegroups();},Number(speed));
this.setPlaystate(PS_PLAYING);
}
}
,
Expand Down Expand Up @@ -96,7 +99,10 @@ var PlayerModel = {

}


var ctl_changeSpeed = function(){
var timerSpeed = Math.round(1000 * 60 / $('#dashSpeed').val() );
mPlayer.setPlaySpeed(timerSpeed);
}

var ctl_stopPlayer = function(){
mPlayer.setPlaystate(PS_STOPPED);
Expand Down
12 changes: 8 additions & 4 deletions boxfrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,13 @@ var ctrl_addDashNotegroups = function(idStr){

$("#ngDashboard").append($abDiv); // add dragged notegroup to Dashboard
$("#ngDashboard").sortable({
stop: function( event, ui ) {mPlayer.reloadNotegroups($("#ngDashboard"))},
start: function( event, ui ) {ctl_stopPlayer();}
stop: function( event, ui ) {
mPlayer.reloadNotegroups($("#ngDashboard"));
update_link();
},
start: function( event, ui ) {
ctl_stopPlayer();
}
});
mPlayer.reloadNotegroups($("#ngDashboard"));
update_link();
Expand Down Expand Up @@ -976,8 +981,7 @@ jQuery(document).ready(function() {


$('#dashSpeed').change(function(){
var timerSpeed = Math.round(1000 * 60 / $('#dashSpeed').val() );
mPlayer.setPlaySpeed(timerSpeed);
ctl_changeSpeed();
});

// removed from view
Expand Down
15 changes: 13 additions & 2 deletions fretboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,24 @@

<!-- input type="button" id="clean" value="Try again!" / -->
<a id="linkthis" href="javascript:void(0)">Link</a> |
<a id="linkquiz" href="javascript:void(0)">Quiz link</a> | <a href="#">Refresh</a><br />
<a id="linkquiz" href="javascript:void(0)">Quiz link</a> |
<a href="fretboard.html">Reset</a>
<br />
<div id="examples"><strong>Examples:</strong>
<!-- (hiE){[fret,color], [fret,color]};(B){...};(G){...};(D){...};(A){...};(lowE){...}&diagram_title=title -->
<ul>
<li><a href="#strings=6:16,18:16;11:16;3:16,15:16;8:16;1:16,13:16;6:16,18:16&key=Cnatural&intColor=false&intNames=false&diagram_title=Bb%20octaves">Bb octaves</a></li>
<li><a href="#strings=0:17,3:17,8:17,12:17,15:17;1:17,5:17,8:17,13:17;0:17,5:17,9:17,12:17;2:17,5:17,10:17,14:17;3:17,7:17,10:17,15:17;0:17,3:17,8:17,12:17,15:17&key=Cnatural&intColor=false&intNames=false&diagram_title=C%20major%20along%20the%20fretboard">C major all along the fretboard</a></li>
<li><a href="#strings=3:0,4:20,5:20,6:20,7:4;3:7,4:20,5:20,6:20,7:11;3:20,4:4,5:20,6:20,7:7;3:20,4:11,5:0,6:20,7:20;3:20,4:20,5:7,6:20,7:20;3:0,4:20,5:20,6:20,7:4&key=Gnatural&intColor=true&intNames=false&diagram_title=G%20Major%202-5-1&dash=Fnatural_ARP_MIN7b5,Cnatural_ARP_DOM7,Gnatural_ARP_MAJ7">2-5-1 in G Major</a></li>
<li><a href="#strings=3:0,4:20,5:20,6:20,7:4,8:20;3:7,4:20,5:20,6:11,7:20,8:0;3:20,4:4,5:20,6:20,7:7,8:20;3:11,4:20,5:0,6:20,7:20,8:20;3:20,4:20,5:7,6:20,7:20,8:11;3:0,4:20,5:20,6:20,7:4,8:20&key=Gnatural&intColor=true&intNames=false&diagram_title=C%20Major%20ii-V-I&dash=Dnatural_ARP_DIM,Gnatural_ARP_DOM7,Cnatural_ARP_MAJ7,Cnatural_ARP_MAJ7">
2-5-1 in C Major</a>
</li>
<li><a href="l#strings=;;;;;&key=Cnatural&intColor=false&intNames=false&diagram_title=F%20minor%202-5-1&dash=Gnatural_ARP_MIN7b5,Cnatural_ARP_DOM7,Fnatural_ARP_MIN7,Fnatural_ARP_MIN7">
2-5-1 in F Minor</a>
</li>
<li>
<a href="#strings=;;;;;&key=Cnatural&intColor=false&intNames=false&diagram_title=3-6-2-5-1%20for%20Ab%20Major&dash=Cnatural_ARP_MIN7,Fnatural_ARP_MIN7,Bflat_ARP_MIN,Eflat_ARP_DOM7,Aflat_ARP_MAJ">
3-6-2-5-1 in Ab Major</a>
</li>


<li><a href="#strings=3:13;2:15;3:15;2:15;;3:15&key=Gnatural&intColor=false&intNames=false&diagram_title=Gdim%20fingering">Gdim fingering</a></li>
Expand Down
Loading

0 comments on commit 7f7bf7b

Please sign in to comment.