Tags: xantoz/mpv-tools
Tags
Moved repository to new location - Updated author name and all links.
Modules/SelectionMenu: Callbacks get action name - All callbacks now receive the name of the triggered action. This helps you easily register the same function for multiple callbacks. Callback action names are: `Menu-Show`, `Menu-Hide`, `Menu-Left`, `Menu-Right`, `Menu-Open`, `Menu-Undo`.
Modules/SelectionMenu: Allow specifying font alpha - You can now configure the font transparency (alpha) of the menu. The range is from `0.0` (invisible) to `1.0` (fully visible).
Modules/SelectionMenu: Add support for object-items
- Previously, you had to define every menu option as a simple string. To
attach special information which you wanted later, you either needed
to store the option offset yourself and compare it to some other array
where you kept your extra data, or you had to somehow embed the data
in the string and then extract it later.
This commit gives you a better solution. You can now use object-based
option items. In that case, you simply have to define an object which
MUST have the `menuText` key. All other object keys can be anything
you want. But you should never create any keys with `menu*` in the
name, since the menu will always use that prefix for any future
extensions/special object keys.
Example of an object-based option:
```
var menu = new SelectionMenu();
menu.setCallbackMenuOpen(function(){ dump(menu.getSelectedItem()); });
menu.setOptions([
'An old-school string-based option',
{
menuText: 'An object-based option',
somethingExtra: [ 1, 2, 3 ]
}
]);
menu.renderMenu();
```
The example dumps the selection to the terminal whenever you press
enter (the default "Open" key) on a menu selection. So be sure to run
mpv from your terminal, such as with `mpv --idle --force-window`.
It uses both string-based and object-based options for demonstration
purposes, but you are actually also allowed to do that in your real code
if you want to. The `getSelectedItem()` method will return the entire
selected value. In case of a string option, it returns the string. In
case of an object-based option it returns the whole object.
As you can see, this new feature makes it very easy to embed advanced
data within your options tree.
Backbox: Rename to Blackbox - The new name was suggested by a user who mistyped the name of this project. It seems like a very good idea to rename it to that similar and much more recognizable word _now_, to avoid any future confusion as the project grows. The name "Blackbox" makes a lot of sense and nicely fits the "swiss army knife playlist/file manager" idea behind this project. - You'll have to update your input.conf bindings to `Blackbox*`. And if you are using a custom script config, simply rename your existing config file to `script-settings/Blackbox.conf`.
Backbox: Add support for playlist item titles Closes VideoPlayerCode#3. - Certain imported playlists, such as M3U files, can sometimes contain extra title metadata about each playlist item. We now read that title if available. Regular playlists show the filename/URL of the item as usual. But if a title is available, we'll now show that instead.
PreviousNext