| |
- Monitored.Monitored
-
- Event
class Event(Monitored.Monitored) |
|
This class handles maintaing the information for a single audio
event, normally, a fragment of a recorded file. |
|
Methods defined here:
- AddAudioFadePoints = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- CreateFilesource(self)
- Creates a new GStreamer file source with an unique id.
It then calls SetProperties() to populate the new object's
properties.
- Delete = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- DeleteSelectedFadePoints(self)
- Removes all the fade points for this Event.
- GenerateWaveform(self)
- Renders the level information for the GUI.
- GetFadeLevelAtPoint(self, time)
- Obtain the level of audio at any point in time.
Parameters:
time -- point in time to extract the audio level from.
Returns:
the level of the audio in percentage format [0,1]
- GetFadeLevels(self)
- Obtain the fade levels list.
The only difference between this list and the levels list is
that the levels in this list are scaled according to the fade
curves applied to the current Event.
Returns:
a list of fade levels, the same length as the levels list.
- Join = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- LoadFromXML(self, node)
- Restores an Event from its serialized XML representation.
Parameters:
node -- the XML node to retreive data from.
- MayPlace(self, xpos)
- Checks if this event could be placed at xpos without
overlapping another Event on the same Instrument.
Parameters:
xpos -- the potential start position to check.
Returns:
True if it's OK to place the Event at xpos, False if not.
- Move = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- MoveButDoNotOverlap(self, xpos)
- This method will attempt to move this Event to the given position.
If the position requires overlapping, this Event will be put flush
against the closest side of the Event which is in the way.
Parameters:
xpos -- the potential position to move the Event to.
- RemoveAudioFadePoints = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- Resurrect = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- SetProperties(self)
- Sets basic Event properties like location, start, duration, etc.
- SetSelected(self, sel)
- Enables or disables the selection state for this Event.
Parameters:
sel -- the new selection state:
True = the Event has been selected.
False = the Event has been deselected.
- Split = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- StoreToXML(self, doc, parent, graveyard=False)
- Converts this Event into an XML representation suitable for saving to a file.
Parameters:
doc -- the XML document object the Event will be saved to.
parent -- the parent node that the serialized Event should
be added to.
graveyard -- True if this Event is on the graveyard stack,
and should be serialized as a dead Event.
- Trim = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- UndoTrim = UndoWrapper(funcSelf, *args, **kwargs)
- This function will wrap and take the place of the function
that is being decorated. All arguments to the original function
will be saved, and sent to the decorated function call.
The funcSelf value must be the first parameter, because
the first parameter will always be self, and it carries a
reference to the decorated function's class.
Considerations:
All decorated undo functions *must* be in a class or this will fail.
Parameters:
funcSelf -- reference to the decorated function's class.
*args -- parameters meant for the decorated function.
**kwargs -- dictionary of keyword:value parameters meant
for the decorated function.
Returns:
the wrapped function resulting value.
- __cmp__(self, object)
- Compares two Events for equality.
Returns:
True -- the Events are equal.
False -- the Events are different.
- __init__(self, instrument, file=None, id=None, filelabel=None)
- Creates a new instance of Event.
Parameters:
instrument -- Instrument associated with this Event.
file -- the file this Event should play.
id -- unique ID for this Event. If it's taken, a new one will be generated.
filelabel -- label to print in error messages.
It can be different from the file parameter.
- __repr__(self)
- Creates a representation string of the Event.
Returns:
a string representing the name, id, start and duration
for this Event.
- bus_eos(self, bus, message)
- Handler for the GStreamer End Of Stream message. Currently
used when the file is loading and is being rendered. This
function is called at the end of the file loading process and
finalises the rendering.
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
Returns:
False -- stops the signal propagation. *CHECK*
- bus_error(self, bus, message)
- Handler for when things go completely wrong with GStreamer.
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
- bus_message(self, bus, message)
- Handler for the GStreamer bus messages relevant to this Event.
At the moment, this is used to report on how the loading progress
is going.
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
Returns:
True -- the Event is loading.
False -- the Event isn't loading.
- bus_message_statechange(self, bus, message)
- Handler for the GStreamer statechange message.
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
- bus_message_tags(self, bus, message)
- Handler for catching audio file tags that Gstreamer throws.
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
- join_event(self, joinEvent, joinToRight=True)
- Helper function for Join() and Trim(). After joining the events on
either side, this method will not remove the Event from the instrument lane.
This must be done from the calling function.
Considerations:
All other methods and classes should not invoke this function
directly since there is no undo for it.
Parameters:
joinEvent -- Event to join with elf.
joinToRight -- if True, the joinEvent will be merged to the right
side of self.
if False, the joinEvent will be to the left of self.
- recording_bus_level(self, bus, message)
- Handler for the GStreamer bus messages relevant to this Event.
At the moment this is used to report on how the recording
progress is going. *CHECK*
Parameters:
bus -- GStreamer bus sending the message.
message -- GStreamer message.
Returns:
True -- the Event is recording.
False -- the Event isn't recording.
- split_event(self, split_point, cutRightSide=True)
- Helper function for Split() and Trim().
Considerations:
All other methods and classes should not invoke this function
directly since there is no undo for it.
Parameters:
split_point --
cutRightSide -- if True, a new event will be created to represent
the piece on the right which was split. This instance
will be the one on the left.
if False, this instance is the one on the right.
Returns:
the newly created Event.
Data and other attributes defined here:
- CORRUPT = 3
- LENGTH = 2
- LEVEL_INTERVAL = 0.10000000000000001
- MOVE = 1
- WAVEFORM = 0
Methods inherited from Monitored.Monitored:
- AddListener(self, obj)
- Adds an object to report changes to.
Parameters:
obj -- an object to inform when StateChanged is called.
- ClearListeners(self)
- Remove all listeners to allow them to be destroyed.
- RemoveListener(self, obj)
- Stop reporting changes to the specified object.
Parameters:
obj -- the object which should no longer receive change updates.
- StateChanged(self, change=None, *extra)
- This method should be called when we want a change to be reported
to all objects previously added by AddListener.
Parameters:
change -- the change which has occured.
extra -- any extra parameters that should be passed.
| |