[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Querying TempoClock status



indeed hjh

On Friday, 13 December 2013, James Harkins wrote:
On Thu, Dec 12, 2013 at 8:02 PM, Batuhan Bozkurt
<batuhan@xxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
>
> Is it possible to ask a TempoClock if it is stopped or not somehow?
>
> I store { }.fork(TempoClock.new) Routines in a list to iterate and stop
> those specific ones when desired. But sometimes I want to kill every
> non-permanent clock with cmd period. At some point I want to remove the
> Routines with stopped clocks (from outside, with cmd period) from my list
> but I couldn't find a way to ask a clock its running status.

Indeed, it seems there isn't a nice, neat interface to ask the clock
if it's still running or not.

An alternate way is to add a dependent to the clock. It will broadcast
a \stop message when it's stopped. Your object can receive that
message and remove routines immediately when the clock stops, instead
of "at some point."

t = TempoClock.new;

~tDeathWatcher = SimpleController(t).put(\stop, { "t stopped".postln;
~tDeathWatcher.remove });

t.stop;


My ddwGUIEnhancements quark adds a method to TempoClock:

    isRunning { ^ptr.notNil }

I suppose I should put that in ddwCommon -- it's in ddwGUIEnhancements
to support TempoClockGui.

I can't think of a good reason not to add this method to the main class library.

hjh

_______________________________________________
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/