Uranium
Application Framework
|
Manages all available output devices and the plugin objects used to create them. More...
Public Member Functions | |
None | __init__ (self) |
def | getOutputDevices (self) |
Get a list of all registered output devices. More... | |
def | getOutputDeviceIds (self) |
Get a list of all IDs of registered output devices. More... | |
Optional["OutputDevice"] | getOutputDevice (self, str device_id) |
Get an output device by ID. More... | |
def | start (self) |
def | stop (self) |
None | startDiscovery (self) |
None | refreshConnections (self) |
None | addOutputDevice (self, "OutputDevice" device) |
Add and register an output device. More... | |
bool | removeOutputDevice (self, str device_id) |
Remove a registered device by ID. More... | |
def | getActiveDevice (self) |
Get the active device. More... | |
None | setActiveDevice (self, str device_id) |
Set the active device. More... | |
None | resetActiveDevice (self) |
Reset the active device to the default device. More... | |
None | addOutputDevicePlugin (self, "OutputDevicePlugin" plugin) |
Add an OutputDevicePlugin instance. More... | |
None | removeOutputDevicePlugin (self, str plugin_id) |
Remove an OutputDevicePlugin by ID. More... | |
Dict[str, "OutputDevicePlugin"] | getAllOutputDevicePlugins (self) |
Optional["OutputDevicePlugin"] | getOutputDevicePlugin (self, str plugin_id) |
Get an OutputDevicePlugin by plugin ID. More... | |
Static Public Attributes | |
writeStarted = Signal() | |
Emitted whenever a registered device emits writeStarted. More... | |
writeProgress = Signal() | |
Emitted whenever a registered device emits writeProgress. More... | |
writeFinished = Signal() | |
Emitted whenever a registered device emits writeFinished. More... | |
writeError = Signal() | |
Emitted whenever a registered device emits writeError. More... | |
writeSuccess = Signal() | |
Emitted whenever a registered device emits writeSuccess. More... | |
manualDeviceAdded = Signal() | |
Emitted whenever a device has been added manually. More... | |
manualDeviceRemoved = Signal() | |
Emitted whenever a device has been removed manually. More... | |
outputDevicesChanged = Signal() | |
Emitted whenever an output device is added or removed. More... | |
activeDeviceChanged = Signal() | |
Emitted whenever the active device changes. More... | |
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.
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.
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.
None UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.addOutputDevice | ( | self, | |
"OutputDevice" | device | ||
) |
Add and register an output device.
<em>OutputDevice</em> | The output device to add. |
None UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.addOutputDevicePlugin | ( | self, | |
"OutputDevicePlugin" | plugin | ||
) |
Add an OutputDevicePlugin instance.
<em>OutputDevicePlugin</em> | The plugin to add. |
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getActiveDevice | ( | self | ) |
Get the active device.
Optional["OutputDevice"] UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevice | ( | self, | |
str | device_id | ||
) |
Get an output device by ID.
device_id | The ID of the device to retrieve. |
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDeviceIds | ( | self | ) |
Get a list of all IDs of registered output devices.
Optional["OutputDevicePlugin"] UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevicePlugin | ( | self, | |
str | plugin_id | ||
) |
Get an OutputDevicePlugin by plugin ID.
plugin_id | The ID of the plugin to retrieve |
def UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.getOutputDevices | ( | self | ) |
Get a list of all registered output devices.
bool UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.removeOutputDevice | ( | self, | |
str | device_id | ||
) |
Remove a registered device by ID.
device_id | The ID of the device to remove. |
None UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.removeOutputDevicePlugin | ( | self, | |
str | plugin_id | ||
) |
Remove an OutputDevicePlugin by ID.
plugin_id | The ID of the plugin to remove. |
None UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.resetActiveDevice | ( | self | ) |
Reset the active device to the default device.
None UM.OutputDevice.OutputDeviceManager.OutputDeviceManager.setActiveDevice | ( | self, | |
str | device_id | ||
) |
Set the active device.
device_id | The ID of the device to set as active device. |
|
static |
Emitted whenever the active device changes.
|
static |
Emitted whenever a device has been added manually.
|
static |
Emitted whenever a device has been removed manually.
|
static |
Emitted whenever an output device is added or removed.
|
static |
Emitted whenever a registered device emits writeError.
|
static |
Emitted whenever a registered device emits writeFinished.
|
static |
Emitted whenever a registered device emits writeProgress.
|
static |
Emitted whenever a registered device emits writeStarted.
|
static |
Emitted whenever a registered device emits writeSuccess.