Skip to content

Commit

Permalink
Full support for select.lua
Browse files Browse the repository at this point in the history
select.lua is a new simple command palette script
embedded into mpv/libmpv.

In the context menu select.lua features can be found under 'View > On Screen Menu'.

https://github.com/mpv-player/mpv/blob/master/player/lua/select.lua
  • Loading branch information
stax76 committed Jul 15, 2024
1 parent ae9c69e commit ae80076
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 551 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

- Korean, Russian and Turkish translation added, Japanese translation fixed. Thanks to the translation team!
- Auto build update.
- Full support for select.lua which is a new simple command palette script embedded into mpv/libmpv.
In the context menu select.lua features can be found under 'View > On Screen Menu'.
https://github.com/mpv-player/mpv/blob/master/player/lua/select.lua
- The helper script 'Tools\update-mpv-and-libmpv.ps1' no longer uses command line arguments,
it uses now the Path environment variable to find mpv and mpv.net.

# v7.1.1.0 (2024-02-03)

Expand Down
9 changes: 0 additions & 9 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,6 @@ Shows media info with raw property names.
### show-menu
Shows the context menu.

### show-playlist
Shows the playlist in a message box. For a playlist menu
the following user scripts exist:

- https://github.com/stax76/mpv-scripts#command_palette
- https://github.com/stax76/mpv-scripts#search_menu
- https://github.com/tomasklaen/uosc
- https://github.com/jonniek/mpv-playlistmanager

### show-profiles
Shows available profiles with a message box.

Expand Down
45 changes: 5 additions & 40 deletions src/MpvNet.Windows/GuiCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ public class GuiCommand
["show-media-info"] = ShowMediaInfo,
["show-menu"] = args => ShowMenu?.Invoke(),
["show-profiles"] = args => Msg.ShowInfo(Player.GetProfiles()),
["show-properties"] = args => ShowProperties(),
["show-properties"] = args => Player.Command("script-binding select/show-properties"),
["show-protocols"] = args => ShowProtocols(),
["window-scale"] = args => WindowScaleNet?.Invoke(float.Parse(args[0], CultureInfo.InvariantCulture)),


// deprecated
["show-recent"] = args => ShowRemoved(), // deprecated
["show-playlist"] = args => ShowPlaylist(), // deprecated
["quick-bookmark"] = args => QuickBookmark(), // deprecated
["show-history"] = args => ShowHistory(), // deprecated
["show-command-palette"] = args => ShowCommandPalette(), // deprecated
["show-audio-tracks"] = args => ShowTracks(), // deprecated
["show-subtitle-tracks"] = args => ShowTracks(), // deprecated
["show-playlist"] = args => Player.Command("script-binding select/select-playlist"), // deprecated
["show-command-palette"] = args => Player.Command("script-binding select/select-binding"), // deprecated
["show-audio-tracks"] = args => Player.Command("script-binding select/select-aid"), // deprecated
["show-subtitle-tracks"] = args => Player.Command("script-binding select/select-sid"), // deprecated
};

void ShowDialog(Type winType)
Expand Down Expand Up @@ -161,9 +161,6 @@ void ShowCommands()
ShowTextWithEditor("Input Commands", header + sb.ToString());
}

void ShowProperties() =>
ShowTextWithEditor("Properties", Core.GetPropertyString("property-list").Replace(",", BR));

void ShowKeys() =>
ShowTextWithEditor("Keys", Core.GetPropertyString("input-key-list").Replace(",", BR));

Expand Down Expand Up @@ -384,28 +381,6 @@ void RemoveFromPath()
Msg.ShowInfo(_("mpv.net was successfully removed from the Path environment variable."));
}

// deprecated
void ShowTracks() =>
Msg.ShowInfo(_("This feature was removed, but there are user scripts:") + BR2 +
"https://github.com/stax76/mpv-scripts#command_palette" + BR +
"https://github.com/stax76/mpv-scripts#search_menu" + BR +
"https://github.com/tomasklaen/uosc");

// deprecated
void ShowPlaylist() =>
Msg.ShowInfo(_("This feature was removed, but there are user scripts:") + BR2 +
"https://github.com/stax76/mpv-scripts#command_palette" + BR +
"https://github.com/stax76/mpv-scripts#search_menu" + BR +
"https://github.com/tomasklaen/uosc" + BR +
"https://github.com/jonniek/mpv-playlistmanager");

// deprecated
void ShowCommandPalette() =>
Msg.ShowInfo(_("This feature was removed, but there are user scripts:") + BR2 +
"https://github.com/stax76/mpv-scripts#command_palette" + BR +
"https://github.com/stax76/mpv-scripts#search_menu" + BR +
"https://github.com/tomasklaen/uosc");

// deprecated
void QuickBookmark() =>
Msg.ShowInfo(_("This feature was removed, but there are user scripts:") + BR2 +
Expand All @@ -419,13 +394,3 @@ void ShowHistory() =>
// deprecated
void ShowRemoved() => Msg.ShowInfo(_("This feature was removed."));
}


//public void ShowCommandPalette()
//{
// MainForm.Instance?.BeginInvoke(() => {
// CommandPalette.Instance.SetItems(CommandPalette.GetItems());
// MainForm.Instance.ShowCommandPalette();
// CommandPalette.Instance.SelectFirst();
// });
//}
22 changes: 0 additions & 22 deletions src/MpvNet.Windows/UI/CommandPalette.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/MpvNet.Windows/UI/CommandPaletteItem.cs

This file was deleted.

127 changes: 0 additions & 127 deletions src/MpvNet.Windows/WPF/Controls/CommandPaletteControl.xaml

This file was deleted.

Loading

0 comments on commit ae80076

Please sign in to comment.