Home | Trees | Indices | Help |
|
---|
|
object --+ | threading._Verbose --+ | threading.Thread --+ | TheTime
The class containing timer and timed queue methods.
Automation is executed via a queue of events to be executed in time, format for the queue is a list of events, with each event represented as a list with the following format: [type, time, data]. The type field is a string, to be parsed in eventCaller.parseEvents(). Time is in beats and may be fractional. The data field may contain several parameters (not as sublist).
|
|||
|
__init__(self,
eventCaller,
bpm=60) The class constructor. |
||
|
run(self) The main clock increment method, also polling the event queue. |
||
|
startStopClock(self,
state,
offset=1) Start or stop (pause) the clock. |
||
|
getCurrentBeat(self) Get the current beat count. |
||
|
getQueue(self) Get the contents of the timed queue. |
||
|
removeEvent(self,
event) Remove an event from the timed queue. |
||
|
removeEvent2(self,
event) Helper method for removeEvent, thread safe handling of the timed queue list. |
||
|
checkQueue(self,
beat) Check if any events in the queue are due for execution. |
||
|
insertQueue(self,
timeStamp,
event) Insert an event into the queue, keeping the timeStamps in sorted order. |
||
|
insertQueue2(self,
timeAndEvent) Helper method for insertQueue, threadsafe queue access. |
||
|
insertQueueWithOffset(self,
timeStamp,
event) Insert an event into the queue, keeping the timeStamps in sorted order. |
||
|
insertQueueWithOffset2(self,
timeAndEvent) Helper method for insertQueueWithOffset, threadsafe queue access. |
||
|
insertListFromNow(self,
list) Insert a list of timed events into the queue, transposing each event's timestamp relative to the "now" time. |
||
|
setBpm(self,
bpm) Set the clock tempo in beats per minute. |
||
|
stop(self) Stops the thread from running, by setting isRunning = False. |
||
Inherited from Inherited from Inherited from Inherited from |
|
|||
|
queueMutex The mutex for thread safe handling of the queue list. |
||
|
isRunning Flag to keep the clock thread running, set to False to exit thread. |
||
|
timeResolution Timer resolution in seconds, 0.001=millisecond resolution (not accurate). |
||
|
queue The list of events in the timed queue. |
||
|
beatCounter Counter for quarter notes at a given bpm. |
||
|
fractionalBeat Counter for fractions of a beat. |
||
|
bpm The tempo in beats per minute for the beat counter. |
||
|
runClock Flag to run or pause the clock. |
|
|||
Inherited from |
|
The class constructor. Under normal operation this timer instance is a standard seconds and minutes clock so the bpm should not be changed.
|
|
Start or stop (pause) the clock. An optional offset may increment the current beat count when starting the clock.
|
|
|
|
|
Check if any events in the queue are due for execution. Execute any events with timestamp <= timeNow. Times are in beats and so will be relative to the current tempo in bpm, timeNow is a beat counter, and the beat counter may be fractional.
|
|
|
|
|
|
|
|
|
queueMutexThe mutex for thread safe handling of the queue list. |
isRunningFlag to keep the clock thread running, set to False to exit thread. |
timeResolutionTimer resolution in seconds, 0.001=millisecond resolution (not accurate). |
queueThe list of events in the timed queue. |
beatCounterCounter for quarter notes at a given bpm. |
fractionalBeatCounter for fractions of a beat. |
bpmThe tempo in beats per minute for the beat counter. |
runClockFlag to run or pause the clock. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Mon Feb 23 14:31:59 2009 | http://epydoc.sourceforge.net |