ContextMenu

A plugin for SqueezeCenter

Releases for SqueezeCenter 7 are available here.

Installation:
SqueezeCenter 7.3: you can use the repository URL https://tuxreborn.netlify.com/slim/slim7/repodata.xml in the web Extension Downloader interface instead of manually unzipping the plugin.
SqueezeCenter 7.1 or newer: unpack the ContextMenu zip file in your Plugins directory and restart SqueezeCenter.
SqueezeCenter 7.0: unpack the ContextMenu zip file in your Plugins directory, copy its Default.map to your IR folder, and restart SqueezeCenter.

Context menu for users

Context menus give you an easy way to access functions and additional features that might otherwise be hidden in a layer of menus, or bound to some odd key combination (for instance, clearing a playlist by pressing the Now Playing button on a Squeezebox Classic remote and then holding the Add button). The ContextMenu plugin maps itself to "arrow_right.hold" and "knob_down.hold" -- that is, it will appear when you hold the right arrow button on a Classic or Transporter remote control, or when you press the knob on a Boom (or Transporter?) for one second. It will show you a number of options appropriate for your player's current state, or even the selection you're looking at on the player's screen -- much like a "right click" menu in a desktop operating system.

All by itself, ContextMenu provides some simple context options -- a list of standard buttons on a Slim Devices / Squeezebox IR remote. I use this mainly for my two players that I control with "universal" remotes -- ContextMenu keeps me from having to remember which button acts like the Size button, as I can simply hold the right arrow, then scroll up or down to Size Button, then tap the right arrow to have the same effect as pressing the normal Squeezebox Size button. Old-timers may remember how SoftSqueeze's virtual remote had a Mute button -- ContextMenu gives everyone a Mute button now.

Other Plugins that have ContextMenu support

AllQuiet
Easily silence/pause all players in your household.
Custom Browse by Erland Isaksson
Offers the "Browse by selected" menu as an option which makes it possible to browse your library in the context of the selected object. Offers a "Rating" menu as an option on albums and songs to make it possible to set ratings on a single song or on all songs on the selected album.
Custom Skip by Erland Isaksson
Offers an option to add a new skip filter based on the selected object.
Dynamic Playlist by Erland Isaksson
Offers an option to start a dynamic playlist with the selected object as parameter, makes it for example possible to play top rated tracks from the selected year or genre.
KitchenTimer
Quickly jump to screens for viewing, modifying, adding, and controlling countdown timers.
PlayLog
Log information about the currently playing track, no matter what screen you're looking at.
SaverSwitcher
Change the currently active screensaver without having to navigate the usual Settings menus.
TrackStat by Erland Isaksson
Offers a "Statistics by selected" menu as an option which makes it possible to browse the TrackStat statisitcs in the context of the selected object.

Settings

There are four settings available in the Web settings page for ContextMenu:

  1. Sort order
    You can specify whether the options shown in a context menu are sorted alhpabetically or by "smart" ordering. Smart ordering uses an algorithm to determine which context menu options you use most & display those first.
  2. Options to show (per option)
    Every option that ContextMenu knows about is listed in the Web UI, and you can click checkboxes to ensure that ContextMenu will never offer certain options -- use this to shorten your context menu lists if there are some functions you'll never use.
  3. "Autorun" (per option)
    Each option that ContextMenu knows about can be set to "autorun", meaning that ContextMenu will run that option without prompting if you request a context menu and only that option is valid. For instance, if you only ask ContextMenu to show the Mute Button option and you set Mute Button to autorun, you can mute or unmute the player simply by holding the right arrow button or knob.
  4. Show message if no options
    If you hold the right arrow or knob and no options are valid, ContextMenu will normally show a message like "No context options available". You can set ContextMenu to display nothing at all in such situations if you wish.

ContextMenu for developers

Plugin developers write a couple new functions (see ContextMenu/Public.pm for samples & info) to "register" one or more context menu possibilities. Essentially, the plugin provides a GUID for each option and a "pre-offer" coderef.

Each time the user calls up the context menu, ContextMenu executes *all* the registered pre-offer coderefs. This gives each plugin a chance to examine the current situation and determine if its contextual option makes sense. If so, the plugin tells ContextMenu how to label its option, and gives another coderef that should be executed if the user selects (Right Arrow, Play, or Add) the plugin's context option.

For instance, the new ContextMenu code in PlayLog will offer to "Log track info", but only if the Squeezebox has been playing a track for a few seconds and PlayLog hasn't already logged the track info. Otherwise ContextMenu doesn't show any PlayLog option.

See the Public.pm file for documentation on the exact API, and Buttons.pm for sample implementation.

Other plugins - Home

$Id: ContextMenu.html,v 1.5 2009/01/10 01:23:45 peterw Exp peterw $