Skip to content

whistlechips/PlayControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 

Repository files navigation

PlayControl

Foobar2000 Spider Monkey (@TheQwertiest) single panel javascript with user configurable settings via the SMP Properties dialog.
Based on: "track info + seekbar + buttons.js" and "last.fm lover.js" by @marc2k3.
image

Features:

Two sets of buttons, one for transport control of FB2K's playback functionality which is located below the center Seekbar:
Left-to-right:

  • Love/Unlove, Right-click to set up LFM user and authorize.
  • Previous Track.
  • Rewind 10 seconds.
  • Play/Pause.
  • Fast Forward 30 seconds.
  • Next Track.
  • Cycle through playback order: Default, Repeat (Playlist), Repeat (Track), Random, Shuffle (tracks), Shuffle (albums), Shuffle (folders)

The second set, under the Volume Bar:
  • FB2K Preferences.
  • DSP Prefs.
  • Search via Facets.
  • Save all playlists.
  • Enable/disable Foo_Skip component.

Installation:

Unzip the latest release ZIP to your Foobar2000 user profile directory (i.e. "C:\Users\XXXXXXXXXX\AppData\Roaming\foobar2000") where "XXXXXXXXXX" is your Windows Username.
Then download and unzip "PlayControl.zip" into it. Add "PlayControl.js" to a Spider Monkey panel.
image

Requirements:


Full screen ColumnsUI shot with PlayControl SMP panel at the bottom of the Foobar2000 window, under control of the PS Splitter at the top of the screen:
image

Start with:

image
Suggested starting points for Height and Width of panel: 75px (can be adjusted with caution). The script will attempt to fit and position items automatically. Anything too small and things can get ugly.

User Changable Settings:

Right Click -> Configure... -> Properties (tab): (with default values)
Limit(s) are indicated, if any. If things get really messed up, on the Properties panel, click “Clear”, then”Apply”. All defaults will be restored.
image
If changes are made and you prefer your customizations, use the Export button to save them to a JSON file so that the Import button can be used to restore them should anything happen.

v1.5.3 Changes:

  • drawSummaryText() function now computes its own width to allow longer TF strings for Now Playing Line 2 and 3.
  • Combined duplicate parameters passed between functions btn() and make_button().
  • Updated make_rgb() function to use both Hyphen and Comma-separated formats --- 3/4/2026
  • Made second line of Now Playing Text bold.

v1.5.2 Changes:

  • Fixed lost summ.w assignment in drawSummaryText().
  • Fix the "Unexpected token >" error and correctly expand shorthand hex colors.
  • Modified code with try...catch blocks added around the two FillRoundRect calls in drawButtonsBgBorder().

v1.5.1 Changes:

  • Button Tool Tips modularized.
  • Changed inline button functions into a consolidated structure btnHandlers.

v1.5.0 Changes:

  • Folded drawVolumeBar() function into drawSeekbar().
  • Combined Shortcut and Transport button background and border settings into one.
  • Updated drawButtons() to accomodate above combination.
  • Changed colors.ButtonBackground to be a color overlay of wallpaper using alpha _RGBA(0, 0, 0, 96).
  • Seekbar: Paused and Playing Colors are no longer used. Value shared with buttonBackground.
  • Various other minor code clean-ups.
  • Optimized make_rgb() function that supports both:
    • RGB(A) comma-separated strings like "255,128,64" or "255,128,64,128"
    • Hex color strings like "#FF8040", "FF8040", or even short format "#F83"

v1.4.1 Changes:

  • New Property added: "Album Art Run". Left-clicking on the Album Art (if enabled) launches a FB2K Context Command via the foo_run component, which must be installed. See https://www.foobar2000.org/components/view/foo_run for more info and download link. The Property VALUE is a Named Service in this component (FB2K: Preferences > Tools > Run services). Default is the included 'Google Artist + Title' service. This can be changed to another or a new service can be added and this VALUE can be edited.
  • Old SAVE button is now "Button: Shortcut Run". It sends its VALUE to the same foo_run component. Again, this can be changed to another FB2K Context Command or a new service can be added and this VALUE can be edited.
  • To get these to display on the Properties screen/tab: click the CLEAR button, then APPLY.

v1.4.0 Changes:

  • Major AI optimization and modularization. Notes in source files.

v1.3.0 Changes:

  • Mod Wallpaper and Album art functionality.
  • General code cleanup and optimization.

v1.2.6 Changes:

Now using fb.GetFocusItem() in its own PlayControl helper function, instead of fb.GetNowPlaying() in a callback to utils.GetAlbumArtV2() to get the proper albumart, along with modification/addition of if() statements to select appropriate above function.

v1.2.5 Changes:

  • Disabled "utils.GetAlbumArtV2(fb.GetFocusItem(), 0)". This does not allow showing art when initially starting FB2000 but finally kills the error that rises when a playing song/playlist is deleted.

v1.2.4 Changes:

  • Changed icons for Playback Orders; Random and Default.
  • Updated 'tip' text for Playback Orders.
  • Fixed bug where deleting an active playlist when the panel used background wallpaper causes a crash.
  • Include 'props.json' with example customized Properties.

v1.2.3 Changes:

  • Checks the availability of foo_skip component, disables skip button if not true.

v1.2.2 Changes:

  • Adjust transparency of borders.

v1.2.1 Changes:

  • Code cleanup and Preferences reorganization.

v1.2.0 Changes:

Clipboard_12-09-2024_02 Clipboard_12-09-2024_03

  • Panel background can now have the playing album cover as a wallpaper.
    • Wallpaper can be blurred.
    • Amount of blur can be changed.
    • Wallpaper: Alpha Property controls transparancy.
  • Transport and/or Shortcut buttons can now have a rounded, retangular background behind them to make them stand out.
    • Transparency of rectangle(s) can be adjusted.
    • A border can be applied to the rectangle(s).
    • Wallpaper: Alpha Property controls transparancy.
    • Custom Color Seekbar Paused Property also controls color of rectangle(s).

About

Foobar2000 Spider Monkey (@TheQwertiest) single panel javascript with user configurable settings via the SMP Properties dialog. Including functionality from: "track info + seekbar + buttons" and "last.fm lover" by @marc2k3, also "JS Smooth Browser" by @br3tt aka Falstaff.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors