misc
This commit is contained in:
@@ -24,7 +24,6 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
|
||||||
case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019
|
case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019
|
||||||
case "cycle-audio": CycleAudio(); break;
|
case "cycle-audio": CycleAudio(); break;
|
||||||
case "execute-mpv-command": Msg.ShowError("Command was removed, reset input.conf."); break; // deprecated 2020
|
case "execute-mpv-command": Msg.ShowError("Command was removed, reset input.conf."); break; // deprecated 2020
|
||||||
@@ -55,6 +54,7 @@ namespace mpvnet
|
|||||||
case "show-media-info": ShowMediaInfo(args); break;
|
case "show-media-info": ShowMediaInfo(args); break;
|
||||||
case "show-playlist": ShowPlaylist(); break;
|
case "show-playlist": ShowPlaylist(); break;
|
||||||
case "show-profiles": Msg.ShowInfo(mpvHelp.GetProfiles()); break;
|
case "show-profiles": Msg.ShowInfo(mpvHelp.GetProfiles()); break;
|
||||||
|
case "show-progress": ShowProgress(); break;
|
||||||
case "show-properties": ShowProperties(); break;
|
case "show-properties": ShowProperties(); break;
|
||||||
case "show-protocols": ShowStrings(mpvHelp.GetProtocols().Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); break;
|
case "show-protocols": ShowStrings(mpvHelp.GetProtocols().Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); break;
|
||||||
case "show-recent": ShowRecent(); break;
|
case "show-recent": ShowRecent(); break;
|
||||||
@@ -185,11 +185,12 @@ namespace mpvnet
|
|||||||
duration = mediaInfo.GetInfo(MediaInfoStreamKind.Audio, "Duration/String");
|
duration = mediaInfo.GetInfo(MediaInfoStreamKind.Audio, "Duration/String");
|
||||||
|
|
||||||
if (performer != "") text += "Artist: " + performer + "\n";
|
if (performer != "") text += "Artist: " + performer + "\n";
|
||||||
if (title != "") text += "Title: " + title + "\n";
|
if (title != "") text += "Title: " + title + "\n";
|
||||||
if (album != "") text += "Album: " + album + "\n";
|
if (album != "") text += "Album: " + album + "\n";
|
||||||
if (genre != "") text += "Genre: " + genre + "\n";
|
if (genre != "") text += "Genre: " + genre + "\n";
|
||||||
if (date != "") text += "Year: " + date + "\n";
|
if (date != "") text += "Year: " + date + "\n";
|
||||||
if (duration != "") text += "Length: " + duration + "\n";
|
if (duration != "") text += "Length: " + duration + "\n";
|
||||||
|
|
||||||
text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n";
|
text += "Size: " + mediaInfo.GetInfo(MediaInfoStreamKind.General, "FileSize/String") + "\n";
|
||||||
text += "Type: " + path.Ext().ToUpper();
|
text += "Type: " + path.Ext().ToUpper();
|
||||||
|
|
||||||
@@ -213,17 +214,10 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeSpan position = TimeSpan.FromSeconds(Core.GetPropertyDouble("time-pos"));
|
|
||||||
TimeSpan duration2 = TimeSpan.FromSeconds(Core.GetPropertyDouble("duration"));
|
|
||||||
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
|
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
|
||||||
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
|
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
|
||||||
|
|
||||||
text = path.FileName() + "\n" +
|
text = path.FileName() + $"\n{width} x {height}\n";
|
||||||
FormatTime(position.TotalMinutes) + ":" +
|
|
||||||
FormatTime(position.Seconds) + " / " +
|
|
||||||
FormatTime(duration2.TotalMinutes) + ":" +
|
|
||||||
FormatTime(duration2.Seconds) + "\n" +
|
|
||||||
$"{width} x {height}\n";
|
|
||||||
|
|
||||||
if (fileSize > 0)
|
if (fileSize > 0)
|
||||||
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||||
@@ -231,7 +225,6 @@ namespace mpvnet
|
|||||||
text += $"{videoFormat}\n{audioCodec}";
|
text += $"{videoFormat}\n{audioCodec}";
|
||||||
|
|
||||||
Core.CommandV("show-text", text, "5000");
|
Core.CommandV("show-text", text, "5000");
|
||||||
string FormatTime(double value) => ((int)value).ToString("00");
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -239,6 +232,21 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ShowProgress()
|
||||||
|
{
|
||||||
|
TimeSpan position = TimeSpan.FromSeconds(Core.GetPropertyDouble("time-pos"));
|
||||||
|
TimeSpan duration = TimeSpan.FromSeconds(Core.GetPropertyDouble("duration"));
|
||||||
|
|
||||||
|
string text = FormatTime(position.TotalMinutes) + ":" +
|
||||||
|
FormatTime(position.Seconds) + " / " +
|
||||||
|
FormatTime(duration.TotalMinutes) + ":" +
|
||||||
|
FormatTime(duration.Seconds);
|
||||||
|
|
||||||
|
Core.CommandV("show-text", text, "5000");
|
||||||
|
|
||||||
|
string FormatTime(double value) => ((int)value).ToString("00");
|
||||||
|
}
|
||||||
|
|
||||||
public static void OpenURL()
|
public static void OpenURL()
|
||||||
{
|
{
|
||||||
App.InvokeOnMainThread(new Action(() => {
|
App.InvokeOnMainThread(new Action(() => {
|
||||||
|
|||||||
@@ -241,15 +241,7 @@ namespace mpvnet
|
|||||||
_ConfigFolder = _ConfigFolder.AddSep();
|
_ConfigFolder = _ConfigFolder.AddSep();
|
||||||
|
|
||||||
if (!File.Exists(_ConfigFolder + "input.conf"))
|
if (!File.Exists(_ConfigFolder + "input.conf"))
|
||||||
{
|
File.WriteAllText(_ConfigFolder + "input.conf", PatchInput(Properties.Resources.input_conf));
|
||||||
string content = Properties.Resources.input_conf;
|
|
||||||
|
|
||||||
if (Environment.GetEnvironmentVariable("username") == "frank")
|
|
||||||
content = content.Replace("volume 2 ", "volume 10")
|
|
||||||
.Replace("volume -2 ", "volume -10");
|
|
||||||
|
|
||||||
File.WriteAllText(_ConfigFolder + "input.conf", content);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ConfigFolder;
|
return _ConfigFolder;
|
||||||
@@ -279,6 +271,28 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string PatchInput(string value)
|
||||||
|
{
|
||||||
|
if (Environment.GetEnvironmentVariable("username") == "frank" && Directory.Exists(@"D:\Projects\CS\mpv.net"))
|
||||||
|
value = value.Replace("volume 2 ", "volume 10")
|
||||||
|
.Replace("volume -2 ", "volume -10");
|
||||||
|
value += @"
|
||||||
|
KP2 script-message rate-file 2
|
||||||
|
2 script-message rate-file 2
|
||||||
|
KP3 script-message rate-file 3
|
||||||
|
3 script-message rate-file 3
|
||||||
|
KP4 script-message rate-file 4
|
||||||
|
4 script-message rate-file 4
|
||||||
|
KP5 script-message rate-file 5
|
||||||
|
5 script-message rate-file 5
|
||||||
|
|
||||||
|
KP0 script-binding delete_current_file/delete
|
||||||
|
0 script-binding delete_current_file/delete
|
||||||
|
KP1 script-binding delete_current_file/confirm
|
||||||
|
1 script-binding delete_current_file/confirm";
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadScripts()
|
public void LoadScripts()
|
||||||
{
|
{
|
||||||
if (Directory.Exists(ConfigFolder + "scripts-ps"))
|
if (Directory.Exists(ConfigFolder + "scripts-ps"))
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ Space script-message mpv.net play-pause #menu: Play/Pause
|
|||||||
Ctrl+s stop #menu: Stop
|
Ctrl+s stop #menu: Stop
|
||||||
_ ignore #menu: -
|
_ ignore #menu: -
|
||||||
Enter cycle fullscreen #menu: Toggle Fullscreen
|
Enter cycle fullscreen #menu: Toggle Fullscreen
|
||||||
f cycle fullscreen
|
|
||||||
|
|
||||||
F11 playlist-prev; set pause no #menu: Navigate > Previous File
|
F11 playlist-prev; set pause no #menu: Navigate > Previous File
|
||||||
F12 playlist-next; set pause no #menu: Navigate > Next File
|
F12 playlist-next; set pause no #menu: Navigate > Next File
|
||||||
@@ -75,8 +74,8 @@ a cycle-values video-aspect 16:9 4:3 2.35:1 -1 #menu: Video > Cycle As
|
|||||||
|
|
||||||
KP7 script-message mpv.net cycle-audio #menu: Audio > Cycle/Next
|
KP7 script-message mpv.net cycle-audio #menu: Audio > Cycle/Next
|
||||||
_ ignore #menu: Audio > -
|
_ ignore #menu: Audio > -
|
||||||
KP6 add audio-delay 0.1 #menu: Audio > Delay +0.1
|
Ctrl+d add audio-delay 0.1 #menu: Audio > Delay +0.1
|
||||||
KP9 add audio-delay -0.1 #menu: Audio > Delay -0.1
|
Ctrl+D add audio-delay -0.1 #menu: Audio > Delay -0.1
|
||||||
|
|
||||||
KP8 cycle sub #menu: Subtitle > Cycle/Next
|
KP8 cycle sub #menu: Subtitle > Cycle/Next
|
||||||
v cycle sub-visibility #menu: Subtitle > Toggle Visibility
|
v cycle sub-visibility #menu: Subtitle > Toggle Visibility
|
||||||
@@ -153,6 +152,7 @@ l ab-loop #menu: Tools > Set/clear A-B
|
|||||||
L cycle-values loop-file inf no #menu: Tools > Toggle infinite file looping
|
L cycle-values loop-file inf no #menu: Tools > Toggle infinite file looping
|
||||||
_ playlist-shuffle #menu: Tools > Shuffle Playlist
|
_ playlist-shuffle #menu: Tools > Shuffle Playlist
|
||||||
Ctrl+h cycle-values hwdec auto no #menu: Tools > Toggle Hardware Decoding
|
Ctrl+h cycle-values hwdec auto no #menu: Tools > Toggle Hardware Decoding
|
||||||
|
Q quit-watch-later #menu: Tools > Exit Watch Later
|
||||||
|
|
||||||
_ script-message mpv.net shell-execute https://mpv.io #menu: Help > Website mpv
|
_ script-message mpv.net shell-execute https://mpv.io #menu: Help > Website mpv
|
||||||
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net #menu: Help > Website mpv.net
|
_ script-message mpv.net shell-execute https://github.com/stax76/mpv.net #menu: Help > Website mpv.net
|
||||||
@@ -163,31 +163,47 @@ _ ignore #menu:
|
|||||||
_ script-message mpv.net show-about #menu: Help > About mpv.net
|
_ script-message mpv.net show-about #menu: Help > About mpv.net
|
||||||
|
|
||||||
F1 script-message mpv.net show-command-palette #menu: Command Palette
|
F1 script-message mpv.net show-command-palette #menu: Command Palette
|
||||||
|
_ ignore #menu: -
|
||||||
|
Esc quit #menu: Exit
|
||||||
|
|
||||||
_ ignore #menu: -
|
6 script-message mpv.net show-progress
|
||||||
Esc quit #menu: Exit
|
KP6 script-message mpv.net show-progress
|
||||||
Q quit-watch-later #menu: Exit Watch Later
|
7 script-message mpv.net cycle-audio
|
||||||
|
SHARP script-message mpv.net cycle-audio
|
||||||
Power quit
|
8 cycle sub
|
||||||
Play cycle pause
|
j cycle sub
|
||||||
Pause cycle pause
|
q quit
|
||||||
PlayPause cycle pause
|
Power quit
|
||||||
MBTN_Mid cycle pause
|
Play cycle pause
|
||||||
Stop stop
|
Pause cycle pause
|
||||||
Forward seek 60
|
PlayPause cycle pause
|
||||||
Rewind seek -60
|
MBTN_Mid cycle pause
|
||||||
Wheel_Up add volume 2
|
Stop stop
|
||||||
Wheel_Down add volume -2
|
Forward seek 60
|
||||||
Wheel_Left add volume -2
|
Rewind seek -60
|
||||||
Wheel_Right add volume 2
|
Wheel_Up add volume 2
|
||||||
Prev playlist-prev
|
Wheel_Down add volume -2
|
||||||
Next playlist-next
|
Wheel_Left add volume -2
|
||||||
MBTN_Forward playlist-next
|
Wheel_Right add volume 2
|
||||||
MBTN_Back playlist-prev
|
Prev playlist-prev
|
||||||
> playlist-next
|
Next playlist-next
|
||||||
< playlist-prev
|
MBTN_Forward playlist-next
|
||||||
Ctrl+Wheel_Up no-osd seek 7
|
MBTN_Back playlist-prev
|
||||||
Ctrl+Wheel_Down no-osd seek -7
|
> playlist-next
|
||||||
MBTN_Left ignore
|
< playlist-prev
|
||||||
MBTN_Left_DBL cycle fullscreen
|
MBTN_Left ignore
|
||||||
KP_Enter cycle fullscreen
|
f cycle fullscreen
|
||||||
|
MBTN_Left_DBL cycle fullscreen
|
||||||
|
KP_Enter cycle fullscreen
|
||||||
|
Shift+RIGHT no-osd seek 1 exact
|
||||||
|
Shift+LEFT no-osd seek -1 exact
|
||||||
|
Shift+UP no-osd seek 5 exact
|
||||||
|
Shift+DOWN no-osd seek -5 exact
|
||||||
|
Shift+BS revert-seek # undo the previous (or marked) seek
|
||||||
|
Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek
|
||||||
|
Shift+g add sub-scale +0.1 # increase the subtitle font size
|
||||||
|
Shift+f add sub-scale -0.1 # decrease the subtitle font size
|
||||||
|
Ctrl+Shift+LEFT no-osd sub-seek -1 # seek to the previous subtitle
|
||||||
|
Ctrl+Shift+RIGHT no-osd sub-seek 1 # seek to the next subtitle
|
||||||
|
Ctrl+Wheel_Up no-osd seek 7
|
||||||
|
Ctrl+Wheel_Down no-osd seek -7
|
||||||
|
|||||||
Reference in New Issue
Block a user