| |
- Monitored.Monitored
-
- Instrument
class Instrument(Monitored.Monitored) |
|
This module is the non-gui class the represents Instruments. Instruments
represent a track of audio that can contain many different sources in sequence.
It also handles loading and saving Instruments from xml, the gstreamer
bits for playing and recording events, audio effects plugins, as well as any
Instrument specific functionality like; solo, mute, volume, etc. |
|
Methods defined here:
- AddAndLinkPlaybackbin(self)
- Creates a playback bin for this Instrument and adds it to the main
playback pipeline. *CHECK*
- AddEffect(self, effectName)
- Adds an effect to the pipeline for this Instrument.
Considerations:
The effect is always placed in the pipeline after any other
effects that were previously added.
Parameters:
effectName -- GStreamer element name of the effect to add.
Returns:
the added effect element.
- ChangeEffectOrder(self, effect, newPosition)
- TODO: this function has yet to be implemented.
Move a given GStreamer element inside the effects bin.
Parameters:
effect -- GStreamer effect to be moved.
newPosition -- value of the new position inside the effects bin
the effect will have.
- ChangeType = 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.
- DeleteEvent(self, eventid)
- Removes an Event from this Instrument.
Considerations:
This operation does not register with undo or append it to the
graveyard, because both are done by event.Delete()
Parameters:
eventid -- ID of the Event to be removed.
- JoinEvents(self)
- Joins together all the selected Events into a single Event.
- LoadFromXML(self, node)
- Restores an Instrument from its serialized XML representation.
Parameters:
node -- the XML node to retreive data from.
- MultipleEventsSelected(self)
- Confirms whether or not multiple events are selected.
Returns:
True = multiple Instruments have been selected.
False = none or just one Instrument has been seleced.
- OnMute(self)
- Updates the GStreamer volume element to reflect the mute status.
- PrepareController(self)
- Fills the gst.Controller for this Instrument with its list of fade times.
- RemoveAndUnlinkPlaybackbin(self)
- Removes this Instrumen's playback bin from the main playback pipeline. *CHECK*
- RemoveEffect(self, effect)
- Remove the given GStreamer element from the effects bin.
Parameters:
effect -- GStreamer effect to be removed from this Instrument.
- SetLevel(self, level)
- Sets the level of this Instrument.
Considerations:
This sets the current REPORTED level, NOT THE VOLUME!
Parameters:
level -- new level value in a [0,1] range.
- SetName = 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.
- SetSelected(self, sel)
- Sets the Instrument to be highlighted and receive keyboard actions.
Parameters:
sel -- True = the Instrument is currently selected.
False = the Instrument is not currently selected.
- SetVisible = 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.
- SetVolume(self, volume)
- Sets the volume of this Instrument.
Parameters:
volume -- new volume value in a [0,1] range.
- StoreToXML(self, doc, parent, graveyard=False)
- Converts this Instrument into an XML representation suitable for saving to a file.
Parameters:
doc -- the XML document object the Instrument will be saved to.
parent -- the parent node that the serialized Instrument should
be added to.
graveyard -- True if this Instrument is on the graveyard stack,
and should be serialized as a dead Instrument.
- ToggleArmed = 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.
- ToggleMuted = 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.
- ToggleSolo = 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.
- UpdateVolume(self)
- Updates the volume property of the gstreamer volume element
based on this instrument's volume and the project's master volume.
- __init__(self, project, name, type, pixbuf, id=None)
- Creates a new instance of Instrument.
Parameters:
project -- the currently active Project.
name -- name of the Instrument.
type -- type of the Instrument.
pixbuf -- image of the Instrument resource object.
id -- unique ID value for the Instrument.
- __repr__(self)
- Creates a representation string of the Instrument.
Returns:
a string representing the id and name for this Instrument.
- addEventFromEvent = 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.
- addEventFromFile = 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.
- addEventFromURL = 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.
- checkActuallyIsMuted(self)
- Determines if this Intrument should be muted, by taking into account
if any other Intruments are muted.
- finishRecordingEvent = 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.
- getRecordingEvent(self)
- Obtain an Event suitable for recording. *CHECK*
Returns:
an Event suitable for recording.
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.
| |