Module Duplex.Browser
The Browser class shows and instantiates registered device configurations and shows the virtual UI for them.
More than one configuration can be active and running for multiple devices.
Changes
0.99.4
- Decorate open device dialogs when hardware is hot-swapped
- Prevent notifier feedback
0.99.1
- Button to show/hide virtual control surface (access with TAB key)
0.98.28
- Expanded set of key/MIDI mappings
- [Next] / [Previous] configuration for the selected device
- [Set] the active configuration for the selected device
- [Show] / [Hide] the Duplex browser dialog
0.98.14
- Tool menu: devices organized into sub-menu’s
- Tool menu: display on startup (only when active config)
- Tool menu: release all devices (useful shortcut)
- Tool menu: enable NRPN support
0.96
- Interactively change options while applications are running
- Application:_apply_options() and optional on_activate() has been removed
- Fixed: hot-plugging devices caused an error (bug was introduced in 0.95)
- More MIDI-mapping options: set,select previous/next configuration
0.95
- Refactoring: moved the "settings" dialog into the Browser class, as the
dialog will eventually contain application settings etc. The device now
only contains the device-specific UI code, and not the dialog itself
0.93
- Switch between device presets/configurations using function keys
- Forward keypresses to Renoise (except those we use for switching)
Functions
__init (initial_configuration, start_configuration) | Initialize the Browser class |
show () | Activate and shows the dialog, or bring the existing one to front |
hide () | Hide the dialog |
on_idle () | Forward idle notifications to all active processes |
on_new_document () | Forward new document notifications to all active processes |
on_release_document () | Forward released document notifications to all active processes |
on_window_became_active () | Forward notifications to all active processes |
on_window_resigned_active () | Forward notifications to all active processes |
available_devices () | Return a list of valid devices (plus a "None" option) existing devices (ones that we found MIDI ports for) are listed first, all others are listed as (N/A) to indicate that they are not present in the users device setup |
set_device (device_display_name, configuration_hint) | Change the active input device: instantiates a new device, using the first avilable configuration for it, or reusing an already running configuration |
available_configurations (device_name) | Return list of valid configurations for the given device |
configuration_running (configuration) | Determine if the given config is instantiated and running |
set_previous_configuration () | Activate the previous configuration (if active, has previous) |
has_previous_configuration () | Check if previous configuration exist |
set_next_configuration () | Activate the next configuration (if active, has next) |
has_next_configuration () | Check if next configuration exist |
goto_configuration (idx) | Activate a configuration based on the provided index (silently fails if no configuration exist at that index, or already active) |
get_configuration_index (cfg_name) | Retrieve the index for the configuration matching the provided name |
set_configuration (configuration, start_running) | Activate a new configuration for the currently active device |
start_current_configuration (start_running, from_ui) | Start current configuration (and all apps within it) |
stop_current_configuration (from_ui) | Stop current configuration (and all apps within it) |
dump_midi () | Check if we should write debug data to the std out (console) |
dump_osc () | Check if we should write debug data to the std out (console) |
set_dump_midi (dump) | Set the MIDI dump status |
set_dump_osc (dump) | Set the OSC dump status |
_strip_postfixes (name) | Remove NOTAVAILABLEPOSTFIX and RUNNING_POSTFIX from the passed name |
_process_running () | Check if any processes are running |
_current_process () | Retrieve the current process |
_device_index_by_name (device_display_name) | Retrieve index of the given device display name |
_configuration_index_by_name (config_name) | Retrieve index of the given configuration name |
_available_configurations_for_device (device_display_name) | Retrieve list of configurations present for the provided device |
_available_configuration_names_for_device (device_display_name) | Retrieve list of configuration-names present for the provided device |
_decorate_device_list () | Add/remove the "running" postfix for relevant devices. |
_decorate_configuration_list () | Add/remove the "running" postfix for relevant configurations. |
toggle_browser_size () | Show/hide the virtual control surface |
_update_resize_button () | Update dialog after virtual control surface is shown/hidden |
_update_device_description () | Show info about the current device, as specified in the control-map |
_configuration_autostart_enabled () | Check whether the current configuration should be autostarted return (bool) |
_enable_configuration_autostart () | Add the current configuration to the autostart prefs |
_disable_configuration_autostart () | Remove the current configuration from the autostart prefs |
_available_device_ports_changed () | Notifier, fired when device input or output port setting changed |
_device_ports_changed () | Notifier, fired when device input or output port setting changed |
_create_content_view () | Build and assign the application dialog |
Fields
self._available_configurations | (table) list of duplex device configuration definitions |
self._processes | (table) a table containing BrowserProcess processes |
self._device_name | (string) selected device display-name |
self._configuration_name | (string) selected configuration for the current device |
self._dump_midi | (bool) dump midi information to console (debug option) |
self._dump_osc | (bool) dump osc information to console (debug option) |
self._suppress_notifiers | (bool) true while updating the GUI from within the internal browser functions, to avoid doubling updates when the changes are not fired from the GUI |
self._requested_device | (string) set when we temporarily have selected "None" as device, and want to revert the list choice |
self._osc_client | (Duplex.OscClient) takes care of sending internally routed notes to Renoise (not created if host/port is not defined) |
self._voice_mgr | (Duplex.OscVoiceMgr) the voice manager is handling triggered note messages (needs the osc_client) |
self._vb | (renoise.ViewBuilder) viewbuilder for all our views |
self._dialog | (renoise.Dialog) referenc to the main dialog |
Functions
- __init (initial_configuration, start_configuration)
-
Initialize the Browser class
Parameters:
- initial_configuration (Table) set to this configuration
- start_configuration (bool) true to start the application
- show ()
- Activate and shows the dialog, or bring the existing one to front
- hide ()
- Hide the dialog
- on_idle ()
- Forward idle notifications to all active processes
- on_new_document ()
- Forward new document notifications to all active processes
- on_release_document ()
- Forward released document notifications to all active processes
- on_window_became_active ()
- Forward notifications to all active processes
- on_window_resigned_active ()
- Forward notifications to all active processes
- available_devices ()
-
Return a list of valid devices (plus a "None" option)
existing devices (ones that we found MIDI ports for) are listed first,
all others are listed as (N/A) to indicate that they are not present
in the users device setup
Returns:
-
(Table) list of device names
- set_device (device_display_name, configuration_hint)
-
Change the active input device:
instantiates a new device, using the first avilable configuration for it,
or reusing an already running configuration
Parameters:
- device_display_name (string) device display-name, without postfix
- configuration_hint (optional table) configuration that should be used to instantiate the device. when nil, a default one is selected from the available device configs
- available_configurations (device_name)
-
Return list of valid configurations for the given device
Parameters:
- device_name (String) the device name
- configuration_running (configuration)
-
Determine if the given config is instantiated and running
Parameters:
- configuration (Table) the configuration to check
Returns:
-
(bool) true if config is running
- set_previous_configuration ()
- Activate the previous configuration (if active, has previous)
- has_previous_configuration ()
-
Check if previous configuration exist
Returns:
-
(bool)
- set_next_configuration ()
- Activate the next configuration (if active, has next)
- has_next_configuration ()
-
Check if next configuration exist
Returns:
-
(bool)
- goto_configuration (idx)
-
Activate a configuration based on the provided index
(silently fails if no configuration exist at that index, or already active)Parameters:
- idx (int)
- get_configuration_index (cfg_name)
-
Retrieve the index for the configuration matching the provided name
Parameters:
- cfg_name
Returns:
-
int or nil
- set_configuration (configuration, start_running)
-
Activate a new configuration for the currently active device
Parameters:
- configuration (Table)
- start_running (bool)
- start_current_configuration (start_running, from_ui)
-
Start current configuration (and all apps within it)
Parameters:
- start_running
- from_ui
- stop_current_configuration (from_ui)
-
Stop current configuration (and all apps within it)
Parameters:
- from_ui
- dump_midi ()
-
Check if we should write debug data to the std out (console)
Returns:
-
(bool)
- dump_osc ()
-
Check if we should write debug data to the std out (console)
Returns:
-
(bool)
- set_dump_midi (dump)
-
Set the MIDI dump status
Parameters:
- dump (bool)
- set_dump_osc (dump)
-
Set the OSC dump status
Parameters:
- dump (bool)
- _strip_postfixes (name)
-
Remove NOTAVAILABLEPOSTFIX and RUNNING_POSTFIX from the passed name
Parameters:
- name (String)
Returns:
-
(String) the name without decoration
- _process_running ()
-
Check if any processes are running
Returns:
-
(bool) true when at least one process is instantiated and running
- _current_process ()
-
Retrieve the current process
Returns:
-
(BrowserProcess object or nil)
- _device_index_by_name (device_display_name)
-
Retrieve index of the given device display name
Parameters:
- device_display_name (string)
Returns:
-
(int or nil)
- _configuration_index_by_name (config_name)
-
Retrieve index of the given configuration name
Parameters:
- config_name (string)
Returns:
-
(int or nil)
- _available_configurations_for_device (device_display_name)
-
Retrieve list of configurations present for the provided device
Parameters:
- device_display_name (String) device display-name
Returns:
-
(Table) list of configurations
- _available_configuration_names_for_device (device_display_name)
-
Retrieve list of configuration-names present for the provided device
Parameters:
- device_display_name (String) device display-name
Returns:
-
(Table) list of configuration names
- _decorate_device_list ()
- Add/remove the "running" postfix for relevant devices. called when we start/stop apps, and choose a device/config
- _decorate_configuration_list ()
- Add/remove the "running" postfix for relevant configurations. called when we start/stop apps, and choose a device/config
- toggle_browser_size ()
- Show/hide the virtual control surface
- _update_resize_button ()
- Update dialog after virtual control surface is shown/hidden
- _update_device_description ()
- Show info about the current device, as specified in the control-map
- _configuration_autostart_enabled ()
- Check whether the current configuration should be autostarted return (bool)
- _enable_configuration_autostart ()
- Add the current configuration to the autostart prefs
- _disable_configuration_autostart ()
- Remove the current configuration from the autostart prefs
- _available_device_ports_changed ()
- Notifier, fired when device input or output port setting changed
- _device_ports_changed ()
- Notifier, fired when device input or output port setting changed
- _create_content_view ()
- Build and assign the application dialog
Fields
- self._available_configurations
-
(table) list of duplex device configuration definitions
See also:
- self._processes
- (table) a table containing BrowserProcess processes
- self._device_name
- (string) selected device display-name
- self._configuration_name
- (string) selected configuration for the current device
- self._dump_midi
- (bool) dump midi information to console (debug option)
- self._dump_osc
- (bool) dump osc information to console (debug option)
- self._suppress_notifiers
- (bool) true while updating the GUI from within the internal browser functions, to avoid doubling updates when the changes are not fired from the GUI
- self._requested_device
- (string) set when we temporarily have selected "None" as device, and want to revert the list choice
- self._osc_client
- (Duplex.OscClient) takes care of sending internally routed notes to Renoise (not created if host/port is not defined)
- self._voice_mgr
- (Duplex.OscVoiceMgr) the voice manager is handling triggered note messages (needs the osc_client)
- self._vb
- (renoise.ViewBuilder) viewbuilder for all our views
- self._dialog
- (renoise.Dialog) referenc to the main dialog