| |
- CalculateAudioLevelFromStructure(structure)
- Calculates an average for all channel levels.
Parameters:
channelLevels -- list of levels from each channel.
Returns:
an average level, also taking into account negative infinity numbers,
which will be discarded in the average.
- DbToFloat(f)
- Converts f from the decibel scale to a float.
Parameters:
f -- number in decibel format.
Returns:
a float in the [0,1] range.
- GetIconThatMayBeMissing(iconName, iconSize, returnGtkImage=True)
- First tries to get the icon with the given name from the icon theme.
If that fails, it will try and load it from the Jokosher image directory.
Parameters:
iconName -- the string of the icon's name
iconSize -- an icon size from the gtk.
returnGtkImage -- If True, this method will return a gtk.Image.
If False it will return a gtk.gdk.Pixbuf.
Returns:
an instance of gtk.gdk.Pixbuf that contains the requested image.
- HandleGstPbutilsMissingMessage(message, callback, x_window_id=0)
- LoadDictionaryFromXML(parentElement)
- For those times when you don't want to fill module variables with
parameters from the XML but just want to fill a dictionary instead.
Parameters:
parentElement -- XML element from which the dictionary is loaded.
Returns:
a dictionary with the loaded values in (type, value) format.
- LoadListFromXML(parentElement)
- Loads a list from an XML file.
Parameters:
parentElement -- block of XML with the list nodes.
Returns:
a list with the loaded values.
- LoadParametersFromXML(self, parentElement)
- Loads parameters from an XML and fills variables of the same name
in that module.
Parameters:
parentElement -- block of XML with the parameters.
- LoadVariableFromNode(node, typeAttr='type', valueAttr='value')
- Loads a variable from an specific XML node.
Example:
Please refer to the StoreVariableToNode example
for the explanation of the typeAttr and valueAttr
parameters.
Parameters:
node -- node from which the variable is loaded.
typeAttr -- string of the attribute name that the
variable's type will be saved under.
valueAttr -- string of the attribute name that the
variable's value will be saved under.
Returns:
the loaded variable.
- OpenExternalURL(url, message, parent, timestamp=0)
- Opens a given url in the user's default web browser.
Parameters:
url -- the url the user's default web browser will open.
message -- the error message in the dialog window. the error message dialog will show if a link cannot be opened.
parent -- parent window of the error message dialog.
- StoreDictionaryToXML(doc, parent, dict, tagName=None)
- Saves a dictionary of settings in an XML document.
Parameters:
doc -- name of the XML document to save the settings into.
parent -- XML parent tag to use in doc.
dict -- dictionary to be saved in doc.
tagName -- name used for all tag names.
Considerations:
If tagName is not given, the dictionary keys will be used for the tag names.
This means that the keys must all be strings and can't have any invalid XML
characters in them.
If tagName is given, it is used for all the tag names, and the key is stored
in the keyvalue attribute and its type in the keytype attribute.
- StoreListToXML(doc, parent, itemList, tagName)
- Saves a list of items in an XML document.
Parameters:
doc -- name of the XML document to save the items into.
parent -- XML parent tag to use in doc.
itemList -- list of items to be saved in doc.
tagName -- name used for all tag names.
- StoreParametersToXML(self, doc, parent, parameters)
- Saves the variables indicated by the parameters in an XML document.
Parameters:
doc -- name of the XML document to save the settings into.
parent -- XML parent tag to use in doc.
parameters -- list of variable names whose value, save in doc.
- StoreVariableToNode(value, node, typeAttr='type', valueAttr='value')
- Saves a variable to an specific XML node.
Example:
typeAttr = "foo"
valueAttr = "bar"
value = "mystring"
would result in the following XML code:
<foo="str" bar="mystring" />
Parameters:
value -- the value of the variable.
node -- node to save the variable value to.
typeAttr -- type of the variable to be saved.
valueAttr -- value of the variable to be loaded.
- StringUnRepr(s)
- floatRange(start, end=None, inc=None)
- A range function capable of performing float increments.
Parameters:
start -- minimum value of the range list.
end -- maximum value of the range list.
inc -- delta between values in the range list.
Considerations:
If start is the only parameter given, the range goes from [0.0, start].
Returns:
A list with the range [start, end] in inc increments.
|