Foobar2000:Components/Quicksearch UI Element (foo quicksearch): Difference between revisions

From Hydrogenaudio Knowledgebase
Line 24: Line 24:
===Basic usage===
===Basic usage===
A search is triggered by the enter key, using the string typed in the toolbar as the basic criteria.
A search is triggered by the enter key, using the string typed in the toolbar as the basic criteria.
The target playlist (as set in the Preferences page) will be fed with the results of the search ... or a new playlist (or autoplaylist) will be created (according to the corresponding toolbar menu options).
The target playlist (as set in the Preferences page) will be fed with the results of the search ... or a new playlist (or autoplaylist) will be created (according to the corresponding toolbar menu options).



Revision as of 07:10, 15 April 2010

Foobar2000_Logo.png
Quick Search

General

foo_quicksearch is derived from foo_uie_quicksearch and ported to foobar2000 V1.0.x. It is now available as either a Column UI panel or an UI element for the default UI. The version has been rewritten (almost) from scratch to benefit from the new SDK and introduce new features such as autoplaylist generation, full customization of the context menu, ....

Configuration has also been simplified with separation of general and toolbar customization, and performances have been improved.

Download link

The component is available from here. Download an place in your foobar components directory.

Discussion

Please use this thread to provide feedback or report any bug.

Requirements

Foobar 1.x and Column UI 0.3.8.x (Optional). The component will not work with previous versions of Foobar.

Getting started

Although the toolbar is highly configurable, the recommended scenario is to just install the toolbar as an UI element (Default UI) or a column UI panel, then type a string and press the enter key to visualize the results. A popup instance of the toolbar can also be activated from the main Menu (Library->Quicksearch).

If you are using column UI, it is recommended that your remove 'foo_uie_quicksearch' from your components directory.

Features

Searching ...

Basic usage

A search is triggered by the enter key, using the string typed in the toolbar as the basic criteria.

The target playlist (as set in the Preferences page) will be fed with the results of the search ... or a new playlist (or autoplaylist) will be created (according to the corresponding toolbar menu options).

The toolbar is highlighted when the search is not successful.

Special Keys

Pressing "Crtl", "Alt" and "Shift" keys (together with the enter key) will trigger the following processings, regardless of the search parameters that are currently selected :

  • Ctrl: Force the creation of a new results playlist
  • Ctrl+Shift: Force the creation of a new (results) autoplaylist
  • Alt: Force search in the current playlist
  • Alt+Shift: Force search in all playlist(except the last search results)
  • Shift: Force inline playlist search
  • Ctrl+Alt: Force the creation of a new results playlist and use the current playlist as the search source
  • Ctrl+Alt+Shift: Force the creation of a new results playlist and use all playlists (except the last search results) as the search source

Context Menu (Search for same)

A context menu is available from the playlist view (Search for same) and will list some tags to be used in order to search in the media library for similar entries.

The content of the context menu is now fully customizable. Please refer to the "Tagz strings" area of the preferences page for details.

Context menu entries can be mapped to keyboard shortcuts using the standard foobar features.

Please note that the context menu is not available (and grayed) when several entries are selected in the playlist view.

Configuration

Toolbar Menu

A toolbar menu is available by (left) clicking on the toolbar icon and provides with the ability to customize search parameters or the look of the toolbar. Options are described below :

Toolbar Menu

Search configuration

Search in ...

Indicates where to search :

  • Database Will search in the media library
  • Playlist will search in the currently selected playlist
  • Playlist (inline) will search in the currently selected playlist but will highlight the results in the currently selected playlist. If "Set Focus to search results" is not selected in the preferences page, navigation in the selected results is available through the "Up" and "Down" arrow keys.
  • All Playlists will search in the contents of all playlist. Please note that the playlist containing the previous search results will be skipped when searching in all playlists.

Tagz strings ...

Provides with the ability to select in which tags the search will be performed. The contents of this option is customizable in the general preferences page (See "Tagz strings" section).

Match...

Determines what kind of processing will be performed to produce the results, in particular when several keywords are typed :

  • Match all will select tracks if all keywords are found in the tags determined by the "Search in ..." option
  • Match all will select tracks if one of the keywords is found in the tags determined by the "Search in ..." option
  • Exact will select tracks if the typed string exactly matches the contents of the tags determined by the "Search in ..." option
  • Prefix will select tracks if when the contents of the tags determined by the "Search in ..." option are starting with the typed string
  • Extended will use the foobar query syntax. Look here for further details.

Autosearch

Enables automatic searching. The toolbar will automatically (e.g. without the need to press the enter key) trigger a search when this option is selected. The launch of the search is control by a delay that can be tuned in the general Preferences page. Please note that the autosearch is not triggered when the searched string is shorter than three characters.

New Playlist

Will generate a new playlist instead of sending the results to the "Target Playlist" indicated in the preferences page. Please note this option is deactivated when "Playlist (inline)" is selected as the source.

New Autoplaylist

Will generate a new playlist instead of sending the results to the "Target Playlist" indicated in the preferences page, and set up this new playlist as an autopaylist, using the transformed search criteria. Please note this option is deactivated when "Playlist (inline)" is selected as the source and is mutually exclusive with the "New Playlist" option.

History

This menu entry provides with the list of recent queries. Selecting one of them will reexecute the corresponding search. Please note that parameters (Search in ..., Tagz string .., Match ...) are saved within the history and will be recalled together with the search criteria.

An option ("Clear") is provided to clear the history below the list.

Favorites

The search history can be used to flag some entries as favorites. The menu entry provides options :

  • to add history items to favorites
  • to delete favorites
  • to recall one of the favorites searches for reexecution

Options

This option enable to customize the look of the toolbar, including :

  • Loading a custom bitmap (Must be 2 x 16x20, e.g. hight=16, width=40 with the second part used as the mouseover image. The top left pixel of each part will be used as the transparent color). Selecting this option when a custombitmap is loaded will revert to the standard image.
  • Customizing the frame style (None Grey, Sunken).
  • Customizing the colors. Default toolbar colors are those set in DUI or CUI preferences, and a custom color can be set for each category (Text and Background ... for normal and errors state). When customized, these options will revert to the default colors if selected.

Options->Reset configuration

This option will revert to the default toolbar configuration, for all the toolbar menu options.

Preferences

Will give access to the general preferences.

Notes

  • "New playlist" and "New autoplaylist" options are not compatible with "Inline playlist search" and will be deactivated accordingly.
  • "New autoplaylist" cannot be used when searching from an other source than the media library and will be deactivated accordingly.
  • You are not allowed to rename or delete the results playlist. It is automatically managed by the plugin.

General Configuration

Quick Search Preferences Page

The general configuration is available from the Preferences menu (under Media Library/Quicksearch) or by selecting "Preferences" from the toolbar Menu.

Note that the general configuration is now consistent with the standard foobar behavior for preference pages (OK, Cancel and Apply buttons). Changes (including any change made in the Tagz list) are not taken into account until the OK or Apply buttons are hit. Options are divided into sections as follows :

Search ...

Reset searchstring when successfull

Will blank the string you have typed after a successfull search.

Reset "New Playlist" after execution

Will unselect "New Playlist" or "New Autoplaylist" after execution.

Remove parenthesis from search tags (context menu)

Will automatically remove parenthesis found in tags from the selected track before building the query. Can be usefull to search more globally (e.g. excluding "(Disc 1 ... n)" from the search criteria).

Automatic switch to extended search

Will automatically force the "Match ..." option in the toolbar to "Extended" when a "%" character is typed in the toolbar. Enables easier usage of extended queries. The "Match ..." option will revert to its previous value if only normal characters are present or if the typing area is cleared.

Autosearch delay

Enables to fine tune the delay which triggers the search when the "Autosearch" option is selected in the toolbar. It is recommended that you set this option to "Slow" if your system is Slow or if you have a large library.

Tagz strings

Enables the customization of strings to look for during a search. The list can be manipulated using the "Add", "Change", "Delete", "Reset", "Up" and "Down" buttons and the fields below the list :

  • Name is the human readable index of the list and will appear in the "Tagz strings ..." menu of the toolbar and in the context menu options
  • Value contains the Tagz language strings used for the search
  • Context Menu will enable the entry in the context menu and keyboard shortcuts mapping.

Please note :

  • The status of the "Add", "Change" and "Delete" buttons is managed to avoid duplicates in the list. Implementing the following rules :
    • You cannot have the same value with two different name
    • You cannot have several entries with the same name
  • For the strings to appear in Keyboards shortcuts preferences, the "OK" button needs to be hit in Quicksearch Preferences page before moving to the keyboard shortcuts preference pages.

Search Results

Target Playlist

Indicates the name of the playlist that will be fed with the search results.

Append searchstring to playlist name

When selected, the string used for the search will be appended (between brackets) to the playlist name.

Set focus to search results

Will set the focus to the main foobar window after a successful search. Please note that this option is irrelevant when Autosearch is activated.

History

History size

Indicates the desired length for the search history. Setting this parameter to zero will clear the search history.

Manage Favorites

Indicates whether the management of favorites is desired.

Change Log

  • V1.3
    • Results Playlist can be removed
    • Implemented max favorites size (32)
  • V1.2
    • Implemented a new keyboard shortcut to focus on the toolbar
    • Implemented a minmax size option for CUI
  • V1.1 Bugfix
    • CUI: Now available as a toolbar
    • Renamed menu entries to "Quicksearch ..."
    • Fixed (tbc) context menu option label glitch
    • Invalidated "Set focus to search results" when Autosearch is active
    • Updated help page address
  • V1.0
    • Initial version

To do:

  • Think about multi valued fields