On December 16, 2014 9:31:35 AM Bruno Ruviaro <bruviaro@xxxxxxx> wrote:
Perhaps a "while" statement can help? Sorry I don't have an example at
hand, but look at the Control Structures help file.
As Julian already pointed out, this is what Condition is for.
t = Task {
var c = Condition.new;
paths.do { |path|
path.someMethod(action: {
c.unhang;
});
c.hang;
};
}.play;
path.someMethod is where you would invoke the FreeSound class. The action function says to resume the task after the method finished its work. So you kick off the asynchronous method, put the unhang hook in place, and then "hang" (pause) the task.
It's a general solution for any sequence of asynchronous operations.
hjh
Sent with AquaMail for Android
http://www.aqua-mail.com
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/