Skip to content

Commit

Permalink
safety measures for buffermanager
Browse files Browse the repository at this point in the history
when dealing with strings & symbols
  • Loading branch information
colinsullivan committed Dec 7, 2015
1 parent f327604 commit 4491043
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions classes/BufferManager.sc
Expand Up @@ -28,7 +28,11 @@ BufferManager : Object {
init {
arg params;

//"BufferManager.init()".postln();

this.rootDir = params[\rootDir];
//"this.rootDir:".postln;
//this.rootDir.postln;
this.doneLoadingCallback = params[\doneLoadingCallback];

this.bufs = ();
Expand All @@ -51,7 +55,7 @@ BufferManager : Object {
arg bufData;

var bufFileName = bufData[0],
bufKey = bufData[1];
bufKey = bufData[1].asSymbol();

this.bufs[bufKey] = 0;

Expand All @@ -62,7 +66,7 @@ BufferManager : Object {
arg bufData;

var bufFileName = bufData[0],
bufKey = bufData[1];
bufKey = bufData[1].asSymbol();

Buffer.read(
Server.default,
Expand All @@ -81,7 +85,7 @@ BufferManager : Object {

this.bufs[bufKey] = buf;

/*("loaded buf: " ++ bufKey).postln();*/
("loaded buf: " ++ bufKey).postln();

// if all bufs are not zero
if (this.bufs.any({ arg item; item == 0; }) == false, {
Expand All @@ -98,7 +102,7 @@ BufferManager : Object {
});
});

/*msg.postln();*/
msg.postln();
});
}

Expand Down

0 comments on commit 4491043

Please sign in to comment.