Skip to content

Commit

Permalink
Merge pull request #77 from mohayonao/issue-74
Browse files Browse the repository at this point in the history
build v0.3.1
  • Loading branch information
mohayonao committed May 7, 2014
2 parents 9897188 + 51686ed commit 1c0c8e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coffee-collider",
"version": "0.3.0",
"version": "0.3.1",
"authors": [
"Nao Yonamine <mohayonao@gmail.com>"
],
Expand Down
28 changes: 18 additions & 10 deletions build/coffee-collider-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -22725,15 +22725,15 @@ define('cc/server/world', function(require, exports, module) {

var cc = require("./cc");
var push = [].push;

var commands = {};

var World = (function() {
function World(userId) {
this.userId = userId|0;
this.bus = new Float32Array(cc.server.busClear);
this.busClear = cc.server.busClear;

this.busIndex = 0;
this.busAmp = 0.8;
this.timeline = [];
Expand All @@ -22747,6 +22747,7 @@ define('cc/server/world', function(require, exports, module) {
this.syncItems = new Uint8Array(20);
this.i16_syncItems = new Int16Array(this.syncItems.buffer);
this.f32_syncItems = new Float32Array(this.syncItems.buffer);
this._pendingBinaryCmdSetBuffer = {};
}
World.prototype.run = function(flag) {
this.rootNode.run(flag);
Expand Down Expand Up @@ -22784,21 +22785,21 @@ define('cc/server/world', function(require, exports, module) {
World.prototype.process = function(bufLength) {
var timeline = this.timeline;
var args, func;

while ((args = timeline.shift())) {
func = commands[args[0]];
if (func) {
func(this, args);
}
}

this.bus.set(this.busClear);
this.rootNode.process(bufLength, this);
};

return World;
})();

commands["/n_run"] = function(world, args) {
var nodeId = args[1]|0;
var flag = !!args[2];
Expand Down Expand Up @@ -22852,6 +22853,11 @@ define('cc/server/world', function(require, exports, module) {
var frames = args[2]|0;
var channels = args[3]|0;
world.buffers[bufnum] = cc.createServerBuffer(world, bufnum, frames, channels);
if (world._pendingBinaryCmdSetBuffer[bufnum]) {
var binary = world._pendingBinaryCmdSetBuffer[bufnum];
delete world._pendingBinaryCmdSetBuffer[bufnum];
commands[1](world, binary);
}
};
commands["/b_free"] = function(world, args) {
var bufnum = args[1]|0;
Expand Down Expand Up @@ -22909,7 +22915,7 @@ define('cc/server/world', function(require, exports, module) {
buffer.gen(cmd, flag, params);
}
};

commands[0] = function(world, binary) {
world.syncItems.set(binary);
var server = cc.server;
Expand All @@ -22927,13 +22933,15 @@ define('cc/server/world', function(require, exports, module) {
var buffer = world.buffers[bufnum];
if (buffer) {
buffer.bind(sampleRate, channels, frames, samples);
} else {
world._pendingBinaryCmdSetBuffer[bufnum] = binary;
}
};

cc.createWorld = function(userId) {
return new World(userId);
};

module.exports = {
World : World,
commands: commands
Expand Down
4 changes: 2 additions & 2 deletions build/coffee-collider.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coffee-collider",
"version": "0.3.0",
"version": "0.3.1",
"description": "Sound Processing Language for Web Audio",
"keywords": [
"language",
Expand Down

0 comments on commit 1c0c8e7

Please sign in to comment.