Mercurial > hg > Members > e105711
changeset 17:1e8fa3c370ab draft
make select music scene
author | e105711 <yomitan.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 03 Jul 2012 23:39:21 +0900 |
parents | b322a8557f93 |
children | fafb468bd914 |
files | webGL/DrumSimulator.html webGL/ruby/directoryReader.rb webGL/src/keybord.js webGL/src/loadMusicFiles.js webGL/src/mainfunc.js |
diffstat | 5 files changed, 5 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/webGL/DrumSimulator.html Tue Jul 03 23:20:21 2012 +0900 +++ b/webGL/DrumSimulator.html Tue Jul 03 23:39:21 2012 +0900 @@ -19,10 +19,6 @@ <script src="src/jquery-1.7.2.min.js"></script> <script src="src/Cursor.js"></script> <script src="src/loadMusicFiles.js"></script> -<!-- - <script src="src/MusicInformation.js"></script> - <script src="src/readFile.js"></script> ---> </head> <script id="vshader" type="x-shader/x-vertex"> uniform mat4 u_modelViewProjMatrix;
--- a/webGL/ruby/directoryReader.rb Tue Jul 03 23:20:21 2012 +0900 +++ b/webGL/ruby/directoryReader.rb Tue Jul 03 23:39:21 2012 +0900 @@ -3,19 +3,12 @@ dir = Dir.open("../music/"); file = File.open("../src/loadMusicFiles.js","w"); file.print "function loadMusicFiles(){\n"; -file.print "\tvar jsonArray=[];\n"; dir.each{|list| if list.match(".json") && !(list.match("~")) then - file.print "\tjsonArray.push(\"music/" + list + "\");\n"; + file.print " musicsArray.push(\"music/" + list + "\");\n"; end } -file.print "\tcursor.setMAX(jsonArray.length);\n"; -file.print "\tfor(var i=0;i<jsonArray.length;i++){\n"; -file.print "\t\tvar httpObj = jQuery.get(jsonArray[i],null,function(){\n"; -file.print "\t\t\tvar JSONObj = JSON.parse(httpObj.responseText);\n"; -file.print "\t\t\tmusicsArray.push(new MusicInformation(JSONObj.title,JSONObj.path));\n"; -file.print "\t\t});"; -file.print "\t}\n"; +file.print " cursor.setMAX(musicsArray.length);\n"; file.print "}\n"; dir.close(); file.close();
--- a/webGL/src/keybord.js Tue Jul 03 23:20:21 2012 +0900 +++ b/webGL/src/keybord.js Tue Jul 03 23:39:21 2012 +0900 @@ -98,12 +98,14 @@ if(!FPressed){ FPressed = true; cursor.previous(); + loadMusicTitle(cursor.getIndex()); } break; case keyJ: // -> if(!JPressed){ JPressed = true; cursor.next(); + loadMusicTitle(cursor.getIndex()); } break;
--- a/webGL/src/loadMusicFiles.js Tue Jul 03 23:20:21 2012 +0900 +++ b/webGL/src/loadMusicFiles.js Tue Jul 03 23:39:21 2012 +0900 @@ -1,25 +1,6 @@ function loadMusicFiles(){ - var musicsArray=[]; musicsArray.push("music/Am.json"); musicsArray.push("music/test.json"); musicsArray.push("music/test2.json"); cursor.setMAX(musicsArray.length); } -/* -function loadMusicFiles(){ - var jsonArray=[]; - jsonArray.push("music/Am.json"); - jsonArray.push("music/test.json"); - jsonArray.push("music/test2.json"); - cursor.setMAX(jsonArray.length); - for(var i=0;i<jsonArray.length;i++){ - var httpObj = jQuery.get(jsonArray[i],null,function(){ - while(httpObj.readyState!=4){ - console.log(httpObj.readyState); - } - var JSONObj = JSON.parse(httpObj.responseText); - musicsArray.push(new MusicInformation(JSONObj.title,JSONObj.filepath)); - }); - } -} -*/
--- a/webGL/src/mainfunc.js Tue Jul 03 23:20:21 2012 +0900 +++ b/webGL/src/mainfunc.js Tue Jul 03 23:39:21 2012 +0900 @@ -23,8 +23,7 @@ MODE = MENU; objsArray.length = 0; objsArray.push(new Obj(100,7.8125,1,"select_music")); -// loadMusicTitle(cursor.getIndex()); -// drawText(ctx,"music_title",musicsArray(cursor.getIndex()).getTitle(),60,"white","center",432,86); + loadMusicTitle(cursor.getIndex()); objsArray.push(new Obj(100,40,1,"music_title")); }