Permalink
Browse files

MxUnit didLoad : calling this both when a unit is added or when the w…

…hole thing is reloaded from disk
  • Loading branch information...
1 parent 18e302d commit 88e428ba5904dee09b2f672a4da21e61c67fa5f6 @crucialfelix committed Apr 11, 2012
Showing with 10 additions and 6 deletions.
  1. +3 −5 Mx.sc
  2. +7 −1 MxUnit.sc
View
8 Mx.sc
@@ -51,7 +51,8 @@ Mx : AbstractPlayerProxy {
outlets = loader.outlets;
this.allUnits.do { arg unit;
- this.unitAddFrameRateDevices(unit)
+ unit.didLoad;
+ this.unitAddFrameRateDevices(unit);
};
});
source = master;
@@ -247,10 +248,7 @@ Mx : AbstractPlayerProxy {
unit = MxUnit.make(object);
if(unit.notNil,{ // nil object is nil unit which is legal
this.registerUnit(unit);
- unit.use {
- ~didLoad.value();
- unit.onLoad.value();
- }
+ unit.didLoad;
});
^unit
}
View
@@ -141,7 +141,13 @@ MxUnit {
status = newStatus;
NotificationCenter.notify(this,\didChangeStatus,newStatus)
}
-
+ didLoad {
+ this.use {
+ ~didLoad.value();
+ this.onLoad.value();
+ }
+ }
+
// methods delegated to the handlers
prepareToBundle { arg agroup, bundle, private, bus;
bundle.addFunction({this.prSetStatus('isPrepared')});

0 comments on commit 88e428b

Please sign in to comment.