Uranium
Application Framework
 All Classes Namespaces Files Functions Variables Pages
UM.OutputDevice.OutputDeviceManager.OutputDeviceManager Class Reference

Manages all available output devices and the plugin objects used to create them. More...

Public Member Functions

def __init__
 
def getOutputDevices
 Get a list of all registered output devices. More...
 
def getOutputDeviceIds
 Get a list of all IDs of registered output devices. More...
 
def getOutputDevice
 Get an output device by ID. More...
 
def addOutputDevice
 Add and register an output device. More...
 
def removeOutputDevice
 Remove a registered device by ID. More...
 
def getActiveDevice
 Get the active device. More...
 
def setActiveDevice
 Set the active device. More...
 
def resetActiveDevice
 Reset the active device to the default device. More...
 
def addOutputDevicePlugin
 Add an OutputDevicePlugin instance. More...
 
def removeOutputDevicePlugin
 Remove an OutputDevicePlugin by ID. More...
 
def getOutputDevicePlugin
 Get an OutputDevicePlugin by plugin ID. More...
 

Static Public Attributes

tuple writeStarted = Signal()
 Emitted whenever a registered device emits writeStarted. More...
 
tuple writeProgress = Signal()
 Emitted whenever a registered device emits writeProgress. More...
 
tuple writeFinished = Signal()
 Emitted whenever a registered device emits writeFinished. More...
 
tuple writeError = Signal()
 Emitted whenever a registered device emits writeError. More...
 
tuple writeSuccess = Signal()
 Emitted whenever a registered device emits writeSuccess. More...
 
tuple outputDevicesChanged = Signal()
 Emitted whenever an output device is added or removed. More...
 
tuple activeDeviceChanged = Signal()
 Emitted whenever the active device changes. More...
 

Detailed Description

Manages all available output devices and the plugin objects used to create them.

This class is intended as the main entry point for anything relating to file saving. For the most basic usage, call getActiveDevice() to get an output device, then call OutputDevice::requestWrite() on the returned object.

Active Device

The active device by default is determined based on the priority of individual OutputDevice instances when there is more than one OutputDevice available. When adding a device, the active device will be updated with the highest priority device. Should there be two devices with the same priority the active device will be the first device encountered with that priority.

Calling setActiveDevice() will override this behaviour and instead force the active device to the specified device. This active device will not change when a new device is added or removed, but it will revert back to the default behaviour if the active device is removed. Call resetActiveDevice() to reset the active device to the default behaviour based on priority.

OutputDevicePlugin and OutputDevice creation/removal

Each instance of an OutputDevicePlugin is meant as an OutputDevice creation object. Subclasses of OutputDevicePlugin are meant to perform device lookup and listening for events like device hot-plugging. When a new device has been detected, the plugin class should create an instance of an OutputDevice subclass and add it to this manager class using addOutputDevice(). Similarly, if a device has been removed the OutputDevicePlugin is expected to call removeOutputDevice() to remove the proper device.

Member Function Documentation

def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.addOutputDevice (   self,
  device 
)

Add and register an output device.

Parameters
<em>OutputDevice</em>The output device to add.
Note
Does nothing if a device with the same ID as the passed device was already added.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.addOutputDevicePlugin (   self,
  plugin 
)

Add an OutputDevicePlugin instance.

Parameters
<em>OutputDevicePlugin</em>The plugin to add.
Note
This does nothing if the plugin was already added.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getActiveDevice (   self)

Get the active device.

def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevice (   self,
  device_id 
)

Get an output device by ID.

Parameters
device_idThe ID of the device to retrieve.
Returns
OutputDevice The output device corresponding to the ID or None if not found.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDeviceIds (   self)

Get a list of all IDs of registered output devices.

Returns
list A list of all registered output device ids.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevicePlugin (   self,
  plugin_id 
)

Get an OutputDevicePlugin by plugin ID.

Parameters
plugin_idThe ID of the plugin to retrieve
Returns
The plugin corresponding to the specified ID or None if it was not found.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevices (   self)

Get a list of all registered output devices.

Returns
list A list of all registered output devices.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.removeOutputDevice (   self,
  device_id,
  bool 
)

Remove a registered device by ID.

Parameters
device_idThe ID of the device to remove.
Note
This does nothing if the device_id does not correspond to a registered device.
Returns
Whether the device was successfully removed or not.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.removeOutputDevicePlugin (   self,
  plugin_id 
)

Remove an OutputDevicePlugin by ID.

Parameters
plugin_idThe ID of the plugin to remove.
Note
This does nothing if the specified plugin_id was not found.
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.resetActiveDevice (   self)

Reset the active device to the default device.

def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.setActiveDevice (   self,
  device_id 
)

Set the active device.

Parameters
device_idThe ID of the device to set as active device.
Note
This does nothing if the device_id does not correspond to a registered device.
This will override the default active device selection behaviour.

Member Data Documentation

tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.activeDeviceChanged = Signal()
static

Emitted whenever the active device changes.

tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.outputDevicesChanged = Signal()
static

Emitted whenever an output device is added or removed.

tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.writeError = Signal()
static

Emitted whenever a registered device emits writeError.

See also
OutputDevice::writeError
tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.writeFinished = Signal()
static

Emitted whenever a registered device emits writeFinished.

See also
OutputDevice::writeFinished
tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.writeProgress = Signal()
static

Emitted whenever a registered device emits writeProgress.

See also
OutputDevice::writeProgress
tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.writeStarted = Signal()
static

Emitted whenever a registered device emits writeStarted.

See also
OutputDevice::writeStarted
tuple UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.writeSuccess = Signal()
static

Emitted whenever a registered device emits writeSuccess.

See also
OutputDevice::writeSuccess

The documentation for this class was generated from the following file: