vidhubcontrol.backends
¶
vidhubcontrol.backends.base
¶
- class vidhubcontrol.backends.base.BackendBase(*args, **kwargs)[source]¶
Bases:
pydispatch.dispatch.Dispatcher
Base class for communicating with devices
- Events
- on_preset_added(backend: BackendBase = self, preset: Preset = preset)¶
- on_preset_stored(backend: BackendBase = self, preset: Preset = preset)¶
This
Event
is emitted when an existingPreset
has been recorded (updated).
- connection_manager: vidhubcontrol.common.ConnectionManager¶
Manager for the device’s
ConnectionState
- property connection_state: vidhubcontrol.common.ConnectionState¶
The current
state
of theconnection_manager
- class vidhubcontrol.backends.base.Preset(*args, **kwargs)[source]¶
Bases:
pydispatch.dispatch.Dispatcher
Stores and recalls routing information
- crosspoints¶
The crosspoints that this preset has stored. This is a
DictProperty
- active¶
A flag indicating whether all of the crosspoints stored in this preset are currently active on the switcher. This is a
pydispatch.Property
- Type
- class vidhubcontrol.backends.base.SmartScopeMonitor(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.base.SmartViewMonitor
A single instance of a monitor within a SmartScope device
- class vidhubcontrol.backends.base.SmartViewBackendBase(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.base.BackendBase
Base class for SmartView devices
- inverted¶
True
if the device has been mounted in an inverted configuration (to optimize viewing angle).- Type
- monitors¶
A
list
containing instances ofSmartViewMonitor
orSmartScopeMonitor
, depending on device type.- Type
- Events
- on_monitor_property_change(self: SmartViewBackendBase, name: str, value: Any, monitor: SmartViewMonitor = monitor)¶
Dispatched when any
Property
value changes. The event signature for callbacks is(smartview_device, property_name, value, **kwargs)
containing a keyword argument “monitor” containing theSmartViewMonitor
instance.
- async set_monitor_property(monitor, name, value)[source]¶
Set a property value for the given
SmartViewMonitor
instance- Parameters
monitor – The
SmartViewMonitor
instance to setname (str) – Property name
value – The new value to set
This method is a coroutine.
- class vidhubcontrol.backends.base.SmartViewMonitor(*args, **kwargs)[source]¶
Bases:
pydispatch.dispatch.Dispatcher
A single instance of a monitor within a SmartView device
- widescreen_sd¶
Aspect ratio setting for SD format. Choices can be:
True
(stretching enabled),False
(pillar-box), orNone
(auto-detect).- Type
Optional[bool]
- identify¶
If set to
True
, the monitor’s border will be white for a brief duration to physically locate the device.- Type
- class vidhubcontrol.backends.base.VidhubBackendBase(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.base.BackendBase
Base class for Videohub devices
- crosspoints¶
This represents the currently active routing of the switcher. Each element in the
list
represents an output (the zero-based index of thelist
) with its selected index as the value (also zero-based). This is apydispatch.properties.ListProperty
and can be observed using thebind()
method.- Type
List[int]
- output_labels¶
A
list
containing the names of each output as reported by the switcher This is apydispatch.properties.ListProperty
and can be observed using thebind()
method.- Type
List[str]
- input_labels¶
A
list
containing the names of each input as reported by the switcher This is apydispatch.properties.ListProperty
and can be observed using thebind()
method.- Type
List[str]
- crosspoint_control¶
This is similar to
crosspoints
but if modified from outside code, the crosspoint changes will be set on the device (no method calls required).pydispatch.properties.ListProperty
- Type
List[int]
- output_label_control¶
This is similar to
output_labels
but if modified from outside code, the label changes will be written to the device (no method calls required).pydispatch.properties.ListProperty
- Type
List[str]
- input_label_control¶
This is similar to
input_labels
but if modified from outside code, the label changes will be written to the device (no method calls required).pydispatch.properties.ListProperty
- Type
List[str]
- presets¶
The currently available (stored)
list
ofPreset
instancespydispatch.properties.ListProperty
- Type
- async add_preset(name=None)[source]¶
Adds a new
Preset
instanceThis method is used internally and should not normally be called outside of this module. Instead, see
store_preset()
- async set_crosspoints(*args)[source]¶
Set multiple crosspoints in one method call
This is useful for setting many routing changes as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of output/input pairs to set. These should be given as
tuples
of(out_idx, in_idx)
as defined inset_crosspoint()
. They can be discontinuous and unordered.
- async set_input_labels(*args)[source]¶
Set multiple input labels in one method call
This is useful for setting many labels as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of input/label pairs to set. These should be given as
tuples
of(in_idx, label)
as defined inset_input_label()
. They can be discontinuous and unordered.
- async set_output_labels(*args)[source]¶
Set multiple output labels in one method call
This is useful for setting many labels as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of output/label pairs to set. These should be given as
tuples
of(out_idx, label)
as defined inset_output_label()
. They can be discontinuous and unordered.
- async store_preset(outputs_to_store=None, name=None, index=None, clear_current=True)[source]¶
Store the current switcher state to a
Preset
- Parameters
outputs_to_store (optional) – An iterable of the output numbers (zero-based) that should be saved in the preset. If given, only these outputs will be recorded and when recalled, any output not in this argument will be unchanged. If not given or
None
, all outputs will be recorded.name (optional) – The name to be given to the preset. If not provided or
None
the preset will be given a name based off of its index.index (optional) – The index for the preset. If given and the preset exists in the
presets
list, that preset will be updated. If there is no preset found with the index, a new one will be created. If not given orNone
, the next available index will be used and a new preset will be created.clear_current (bool) – If
True
, any previously existing data will be removed from the preset (if it exists). IfFalse
, the data (if existing) will be merged with the current switcher state. Default isTrue
- Returns
The
Preset
instance that was created or updated
This method is a
coroutine
vidhubcontrol.backends.telnet
¶
- class vidhubcontrol.backends.telnet.SmartScopeTelnetBackend(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.telnet.SmartViewTelnetBackendBase
,vidhubcontrol.backends.base.SmartScopeBackendBase
- class vidhubcontrol.backends.telnet.SmartViewTelnetBackend(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.telnet.SmartViewTelnetBackendBase
,vidhubcontrol.backends.base.SmartViewBackendBase
- class vidhubcontrol.backends.telnet.TelnetBackend(*args, **kwargs)[source]¶
Bases:
vidhubcontrol.backends.telnet.TelnetBackendBase
,vidhubcontrol.backends.base.VidhubBackendBase
Base class for backends implementing telnet
- async set_crosspoints(*args)[source]¶
Set multiple crosspoints in one method call
This is useful for setting many routing changes as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of output/input pairs to set. These should be given as
tuples
of(out_idx, in_idx)
as defined inset_crosspoint()
. They can be discontinuous and unordered.
- async set_input_labels(*args)[source]¶
Set multiple input labels in one method call
This is useful for setting many labels as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of input/label pairs to set. These should be given as
tuples
of(in_idx, label)
as defined inset_input_label()
. They can be discontinuous and unordered.
- async set_output_labels(*args)[source]¶
Set multiple output labels in one method call
This is useful for setting many labels as it reduces the number of commands sent to the switcher.
- Parameters
*args – Any number of output/label pairs to set. These should be given as
tuples
of(out_idx, label)
as defined inset_output_label()
. They can be discontinuous and unordered.