|
@@ -13,6 +13,7 @@ private enum Message {
|
|
FadeEnd( id : Int, uid : Int );
|
|
FadeEnd( id : Int, uid : Int );
|
|
Active( b : Bool );
|
|
Active( b : Bool );
|
|
StopAll;
|
|
StopAll;
|
|
|
|
+ Sync( dst : Int, src : Int );
|
|
}
|
|
}
|
|
|
|
|
|
private class WorkerChannel extends NativeChannel {
|
|
private class WorkerChannel extends NativeChannel {
|
|
@@ -182,9 +183,23 @@ class Worker extends hxd.Worker<Message> {
|
|
volume = v;
|
|
volume = v;
|
|
case StopAll:
|
|
case StopAll:
|
|
stopAll();
|
|
stopAll();
|
|
|
|
+ case Sync(dst, src):
|
|
|
|
+ var cdst = cmap.get(dst);
|
|
|
|
+ var csrc = cmap.get(src);
|
|
|
|
+ if( cdst == null || csrc == null ) return;
|
|
|
|
+ moveChannel(cdst, csrc.channel);
|
|
|
|
+ cdst.syncWith(csrc);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function moveChannel( c : Channel, to : NativeChannelData ) {
|
|
|
|
+ if( c.channel == null || to == null || c.channel == to )
|
|
|
|
+ return;
|
|
|
|
+ c.channel.channels.remove(c);
|
|
|
|
+ to.channels.push(c);
|
|
|
|
+ c.channel = to;
|
|
|
|
+ }
|
|
|
|
+
|
|
override function setupMain() {
|
|
override function setupMain() {
|
|
#if flash
|
|
#if flash
|
|
// make sure that the sounds system is initialized
|
|
// make sure that the sounds system is initialized
|