OpenGLContext.events.timer
index
/home/mcfletch/pylive/OpenGLContext/events/timer.py

EventManager providing vcr-like control of an InternalTime object

 
Modules
       
pydispatch.dispatcher
OpenGLContext.events.eventmanager
OpenGLContext.events.internaltime
OpenGLContext.events.systemtime

 
Classes
       
EventManager(object)
Timer

 
class Timer(EventManager)
    Event manager providing VCR-like control of an InternalTime
 
Timer objects are currently the only end-user friendly
timing mechanism available within OpenGLContext.  They
provide simple VCR-like control of an InternalTime.
 
This allows the Timer to run forward, backward, fast,
slow, pause, or resume.  The class allows you to register
for events (fractional, cyclic or one-shot) as normal
for eventmanager classes.
 
Attributes:
    timerClass -- the class of InternalTime object used
    active -- Boolean flag indicating whether we are
        "active", that is, whether we are currently
        advancing through the internal time.
    internal -- the instantiated InternalTime object we
        are using to implement ourselves
 
 
Method resolution order:
Timer
EventManager
object

Methods defined here:
ProcessEvent(self, event)
Dispatch an incoming event
 
This sub-class sets the Timer as the sender of the
messages.
__init__(self, *arguments, **namedarguments)
Initialize the Timer
 
arguments, namedarguments -- passed directly to
    our timerClass to instantiate the InternalTime.
    See documentation on InternalTime  for details.
__repr__(self)
Get an useful representation of the Timer
addEventHandler(self, timetype='fraction', function=None)
Add/remove handler for the given timetype from this Timer object
 
timetype -- string value describing the event type, currently
    valid types are:
        "start"
        "stop"
        "resume"
        "pause"
        "cycle"
        "fraction"
    see the timeevents module for description of the individual
    types.
function -- callback function taking single argument, a
    Context time event
deregister(self, context)
De-register this timer with a given context's time event manager
 
See:
    timeeventgeneratormanager.TimeEventGeneratorManager
pause(self, realTime=None)
Pause the internal timer
poll(self, realTime=None)
Poll the internal timer for pending events
 
Returns the number of events dispatched
register(self, context)
Register this timer with a given context's time event manager
 
See:
    timeeventgeneratormanager.TimeEventGeneratorManager
resume(self, realTime=None)
Resume the internal timer
start(self, realTime=None)
Start the internal timer
stop(self, realTime=None)
Stop the internal timer

Data descriptors defined here:
active
Delegate to internal

Data and other attributes defined here:
timerClass = <class 'OpenGLContext.events.internaltime.InternalTime'>
Track an internal time.
 
Internal times allow for fractional and absolute reporting
of a current time with a given duration. The internal time
potentially has a transformation applied to the incoming time
values, which allows for time reversal, slowdown and speed up.

Class methods inherited from EventManager:
registerCallback(cls, key, function=None, node=None, capture=0) from type
Register callback function for the given key (possibly node-specific)
 
key -- as returned by event.getKey()
function -- callable function taking at least an
    event object as it's first parameter, or None
node -- the node to be watched, None to register a
    context-level callback ( default )
capture -- if true, capture events before passing to
    children, rather than processing during the
    bubbling phase.  (default false)
 
Note: this method would normally be called by a sub-
    class with the calculated key for the sub-class.
 
return previous callback function or None

Data descriptors inherited from EventManager:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from EventManager:
type = ''

 
Data
        DEBUG = 10
__file__ = '/home/mcfletch/pylive/OpenGLContext/events/timer.pyc'
__name__ = 'OpenGLContext.events.timer'
__package__ = 'OpenGLContext.events'
event_log = <logging.Logger instance at 0x360b050>