Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Device-Priority-SMP (Read 2871 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Device-Priority-SMP


Spider Monkey Panel Script for, built within a button. Automate foobar2000's output without having to select devices manually every time one is disconnected/connected. Wireless, headphone, and server devices auto-switch made easy.

Features
  • Export Device List: after connecting all devices desired to be used at some point, the list can be exported to be able to set them at a later point as prioritized devices (even if they are not connected).
  • 1-5 slots for prioritized devices: set the order in which the devices must be set as output. Device 1 would be used (if available) before Device 2 and so on...
  • Server friendly: some wireless devices pause playback when they are disconnected, thus requiring to manually start playback again even if the device has been changed (manually or automatically). The script checks if playback is paused after swapping devices and will continue it automatically in those cases for a seamless change between devices when you switch them off/on.
  • Toolbar: the button can be loaded within a toolbar or as an independent button. It's fully compatible with my other scripts which also use a toolbar (see at bottom), so the button can be simply merged with your already existing toolbar panel easily.



Compatible with (toolbar)

 1. Search-by-Distance-SMP: creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.
 2. Playlist-Tools-SMP: Offers different pre-defefined examples for intelligent playlist creation.


Installation
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts 
Any other path WILL NOT work without editing the scripts.
For ex: mine is c:\Users\xxx\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts\... 
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts\... 
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts\... 
Then load 'buttons_device_priority.js' (button) into a SMP panel within foobar.

If you already have the toolbar from any of my other scripts, just load the button using the config menu on the toolbar within foobar2000 (see previous gif). Also read file '_TIPS and INSTALLATION.txt for additional comments about foobar portable installations, not properly following the installation instructions will result in scripts not working as intended. Please don't report errors before checking this.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/Device-Priority-SMP

Re: Device-Priority-SMP

Reply #1
New update, idiot of me.. I missed a file on the release so it could not work. Now fixed. No more changes.
Check 1.0.1.
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.0.1

Re: Device-Priority-SMP

Reply #2
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.1.0
Made it easier populating the list of available devices by adding new connected ones instead of recreating the entire list.
Quote
   ### Added
   - New menu entry 'Add new devices to list' which adds any non present device to the list of available options. This can be used as workaround instead of connecting all devices which will be used to create the complete list, adding devices on demand in an incremental way... much easier than recreating the entire list whenever a change has to be made.
   ### Changed
   - Helpers: additional checks at json loading on all scripts. Warnings via popup when a corrupted file is found.
   ### Removed
   ### Fixed
   - Fixed crash when loading corrupt devices json file. Now warns about it with a popup.

Re: Device-Priority-SMP

Reply #3
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.1.1
Minor update for compatibility with latest Playlist Tools.

Re: Device-Priority-SMP

Reply #4
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.2.0

Quote
v1.2.0 - Compatibility with new Playlist Tools version Latest

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    New option to force device selection by priority on startup. Enabled by default.
    Update for compatibility with latest https://github.com/regorxxx/Playlist-Tools-SMP
    Fully reworked buttons framework: configurable scale, orientation, buttons position can be changed with drag n drop, reflow of columns/rows, etc.

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Re: Device-Priority-SMP

Reply #5
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.2.2

Quote
v1.2.2 - Compatibility with new Playlist Tools

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Icon is shown with a different color when Auto-device is enabled. Works like a on/off light indicator.
    New menu entry to enable/disable the auto-device functionality globally.
    Minor UI improvements.
    Some buttons framework fixes.
    Update for compatibility with latest Playlist Tools v3.0.0-beta.6

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Re: Device-Priority-SMP

Reply #6
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.2.3
Quote
v1.2.3 - Compatibility with new Playlist Tools version Latest

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Update for compatibility with latest Playlist Tools v3.0.0-beta.7

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Have also updated the wiki on github.

Re: Device-Priority-SMP

Reply #7
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.2.4
Quote
v1.2.4 - Improved wine compatibility
@regorxxx regorxxx released this in 1 minute
v1.2.4
c215460

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Themed buttons are replaced with manually drawn buttons when the first method fails (on Wine for ex.).
    Update for compatibility with latest Playlist Tools v3.0.0-beta.8
    Minor improvements on readmes, helpers, temp files, ...
    Fixed crash on wine due to buttons.

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Spoiler (click to show/hide)

Re: Device-Priority-SMP

Reply #8
https://github.com/regorxxx/Search-by-Distance-SMP/releases/tag/v2.2.3
Quote
v1.2.5 - Compatibility update
@regorxxx regorxxx released this 2 minutes ago
v1.2.5
9384b7c

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Updated helpers to match my other scripts.

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Re: Device-Priority-SMP

Reply #9
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.3.0
Quote
v1.3.0 - Compatibility update
@regorxxx regorxxx released this in 2 minutes
v1.3.0
4027a47

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Updated helpers to match my other scripts.
    Switched all callbacks to event listeners.
    Reduced console logging at startup.
    Workaround for some instances where the scripts would warn about some feature not being supported by the OS (due to an OS or SMP bug).

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md

Re: Device-Priority-SMP

Reply #10
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.3.1
Quote
v1.3.1 - Console fix
@regorxxx regorxxx released this in 12 hours
v1.3.1
f51edf6

There may be a SMP's bug on installation. See _TIPS and INSTALLATION.txt
REQUIRES SMP 1.6.1

    Updated helpers to match my other scripts.
    Fixed console logging to file (lines were not being split properly).

See changelog for a full list: https://github.com/regorxxx/Device-Priority-SMP/blob/main/CHANGELOG.md-


Re: Device-Priority-SMP

Reply #12
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.7.0
Quote
[1.7.0] - 2023-03-04
Added
Changed

    UI: tweaked and unified buttons weight and margins, adjusted to scale set and DPI.
    UI: minor improvements to readme sub-folders names.
    UI: cursor now changes when over a button.
    UI: cursor now changes while performing buttons drag n' drop. It now clearly indicates when a move is allowed or it's outside the allowed range.
    UI: drag n' drop now only works when the mouse is over a button position. i.e. both the functionality and position rectangle are disabled if the mouse is not on a valid position. Previously moving the button to a blank part of the bar would have simply sent it to the first/last position for ex. This is disallowed now, which makes drag n' drop a bit more intuitive and offers an overall more cohesive experience. It also respects orientation and reflow settings.
    Internal code cleanup of menus.

Removed
Fixed

    UI: minor improvements to drag n drop behavior when mouse remains static and R. Click is released. Panel is redrawn immediately instead of waiting to move the mouse, current button remains hovered.
    UI: minor improvements to drag n drop behavior when R. Click menu is called in rapid succession. Panel is redrawn on the background now.
    Console: logging of null value not working properly (totally irrelevant except for debug purposes).

Re: Device-Priority-SMP

Reply #13
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.9.2

Quote
## [1.9.2] - 2023-06-29
### Added
### Changed
### Removed
### Fixed
- Helpers: fixed incorrect warning about missing font.

## [1.9.1] - 2023-06-27
### Added
### Changed
- Helpers: updated helpers.
- Console: menu entries are no longer logged to console after clicking.
- Console: multiple improvements when logging to file for FbMetadbHandle, FbMetadbHandleList, Error and unknown instances (totally irrelevant except for debug purposes).
### Removed
### Fixed

## [1.9.0] - 2023-05-08
### Added
### Changed
- Helpers: updated helpers.
- Console: menu entries are no longer logged to console after clicking.
- Console: multiple improvements when logging to file for FbMetadbHandle, FbMetadbHandleList, Error and unknown instances (totally irrelevant except for debug purposes).
### Removed
### Fixed

## [1.8.1] - 2023-03-09
### Added
### Changed
### Removed
### Fixed
- Crash when using drag n' drop if a button file was loaded (instead of using the toolbar), although this installation method is no longer supported.

## [1.8.0] - 2023-03-08
### Added
### Changed
- Helpers: updated helpers.
### Removed
### Fixed

## [1.7.1] - 2023-03-04
### Added
### Changed
- UI: png icons now use a dark-mode version (if available) or get inverted according to the button text color configuration.
### Removed
### Fixed

Re: Device-Priority-SMP

Reply #14
v1.11.0 - Auto-update + toolbar customization Latest
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v1.11.0

Quote
## [1.11.0] - 2023-11-15
### Added
- Auto-update: added -optional- automatic checks for updates on script load; enabled by default. Compares version of current file against GitHub repository. Manual checking can also be found at the settings menu. For buttons within the toolbar every button will check for updates independently (although the toolbar menu has an entry for batch checking). Setting may also be globally switched at '[FOOBAR PROFILE FOLDER]\js_data\presets\global\globSettings.json', by changing 'bAutoUpdateCheck'. It will apply by default to any new installed script (previous scripts will still need to be manually configured to change them).
- Buttons bar: added some safe-checks to panel properties.
- Buttons bar: added custom button hover color and customization.
- Buttons bar: added custom offset for buttons along X/Y axis.
- Buttons bar: added full size mode for buttons, which will use full Width/Height according to Y/X orientation.
- Added setting to disable popups related to features not being supported by the OS (at startup). Found at '[FOOBAR PROFILE FOLDER]\js_data\presets\global\globSettings.json', by changing 'bPopupOnCheckSOFeatures'. By default popups are always shown. This setting will never be exposed within foobar, only at this file.
### Changed
- UI: toolbar's color menu entries now show the color name along the menu entry. 'none' equals to no color.
- Buttons bar: renamed background buttons to 'Use themed buttons', which depends on the windows theme.
- Helpers: updated helpers.
### Removed
### Fixed

Spoiler (click to show/hide)

 

Re: Device-Priority-SMP

Reply #15
https://github.com/regorxxx/Device-Priority-SMP/releases/tag/v2.0.0

Quote
2.0.0 - 2024-02-28
Added

    Configuration: added integrity checks to global user settings files, found at '[FOOBAR PROFILE FOLDER]\js_data\presets\global[...].json'. In particular queries are now check to ensure they are valid and will throw a popup at init otherwise. Other settings are check to ensure they contain valid values too.
    Configuration: expanded user configurable file at '[FOOBAR PROFILE FOLDER]\js_data\presets\global\globSettings.json' with a new setting to output to console profiling logs at script init. They work globally. Disabled by default.
    Toolbar: new settings for text (or icon) position: left, right (default), top and bottom. These settings mimic CUI options at the buttons bar.
    Toolbar: new settings for text scale (now independent of button and icon scale).
    Toolbar: new settings for icon scale (now independent of button and text scale).

Changed

    Buttons: changed filename for 'buttons_others_device_priority.js' to 'buttons_others_device_priority.js' Before updating, rename all instances of these names at '[foobar2000 profile]\js_data\buttons_XXX.json' with the new names. 'buttons_XXXXX.json' are all json button toolbar files.
    Helpers: updated helpers.
    Console: improved log file formatting on windows text editors which parse new lines only with CR+LF instead of LF.
    Code cleanup.

Removed
Fixed

    Toolbar: buttons' size not restored back to normal height after disabling 'Full size buttons' without reloading the panel.
    UI: wrong parsing of png masks on unix systems (currently, it only affected the ListenBrainz icon when changing the font color).
    Minor fixes.