Permalink
Browse files

Who wants a licence?! Fixed client bug from a while back, probably re…

…lating to adding new tracks
  • Loading branch information...
1 parent 17aac46 commit f938a2bb9752f5d9f8f139e60dd3b35fa4f14918 @mbarton committed Apr 15, 2012
Showing with 31 additions and 17 deletions.
  1. +10 −0 README
  2. +15 −15 client/js/muz.js
  3. +6 −2 client/js/shout.js
  4. BIN client/samples/big.mp3
View
10 README
@@ -1 +1,11 @@
SHOUT.JS
+
+We got BSD license yo:
+Copyright (c) 2012, Andrejs Jermakovics, Kiril Piskunov, Michael Barton
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
@@ -11,29 +11,29 @@ function decodeAudio(index, response)
function loadSample(index, path)
{
- var request = new XMLHttpRequest();
- request.onload = function(args)
+ if(matrix[index].buffer === undefined)
{
- console.log("Downloaded " + index);
- decodeAudio(index, args.target.response);
- }
- request.onerror = function(args)
- {
- logError("Unable to download sample " + matrix[index]["sample"]);
+ var request = new XMLHttpRequest();
+ request.onload = function(args)
+ {
+ console.log("Downloaded " + index);
+ decodeAudio(index, args.target.response);
+ }
+ request.onerror = function(args)
+ {
+ logError("Unable to download sample " + matrix[index]["sample"]);
+ }
+ request.open('GET', path, true);
+ request.responseType = 'arraybuffer';
+ request.send();
}
- request.open('GET', path, true);
- request.responseType = 'arraybuffer';
- request.send();
}
function loadAudio()
{
for(var i = 0; i < matrix.length; i++)
{
- if(matrix[i].buffer === undefined)
- {
- loadSample(i, matrix[i].path);
- }
+ loadSample(i, matrix[i].path);
}
}
View
@@ -266,8 +266,6 @@ $(function(){
{
triggers.push(false);
}
- matrix.push({"sample": sample, "triggers": triggers});
- renderFromMatrix();
// Update server
var path = -1;
@@ -280,6 +278,12 @@ $(function(){
break;
}
}
+
+ matrix.push({"sample": sample, "path": path, "triggers": triggers});
+ loadAudio();
+ renderFromMatrix();
+
+
if(path === -1)
{
logError("Couldn't find path for sample " + sample);
View
Binary file not shown.

0 comments on commit f938a2b

Please sign in to comment.