Example #1
0
        public static void Execute(string id, string[] args = null)
        {
            switch (id)
            {
            case "add-files-to-playlist": OpenFiles("append"); break;     // deprecated 2019

            case "cycle-audio": CycleAudio(); break;

            case "execute-mpv-command": ExecuteMpvCommand(); break;

            case "load-audio": LoadAudio(); break;

            case "load-sub": LoadSubtitle(); break;

            case "manage-file-associations":     // deprecated 2019
            case "open-conf-folder": ProcessHelp.ShellExecute(core.ConfigFolder); break;

            case "open-files": OpenFiles(args); break;

            case "open-optical-media": Open_DVD_Or_BD_Folder(); break;

            case "open-url": OpenURL(); break;

            case "playlist-first": PlaylistFirst(); break;

            case "playlist-last": PlaylistLast(); break;

            case "scale-window": ScaleWindow(float.Parse(args[0], CultureInfo.InvariantCulture)); break;

            case "window-scale": WindowScale(float.Parse(args[0], CultureInfo.InvariantCulture)); break;

            case "shell-execute": ProcessHelp.ShellExecute(args[0]); break;

            case "show-about": ShowDialog(typeof(AboutWindow)); break;

            case "show-audio-devices": ShowTextWithEditor("audio-device-list", core.get_property_osd_string("audio-device-list")); break;

            case "show-command-palette": ShowDialog(typeof(CommandPaletteWindow)); break;

            case "show-commands": ShowCommands(); break;

            case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break;

            case "show-decoders": ShowTextWithEditor("decoder-list", mpvHelp.GetDecoders()); break;

            case "show-demuxers": ShowTextWithEditor("demuxer-lavf-list", mpvHelp.GetDemuxers()); break;

            case "show-history": ShowHistory(); break;

            case "show-info": ShowInfo(); break;

            case "show-input-editor": ShowDialog(typeof(InputWindow)); break;

            case "show-keys": ShowTextWithEditor("input-key-list", core.get_property_string("input-key-list").Replace(",", BR)); break;

            case "show-media-search": ShowDialog(typeof(EverythingWindow)); break;

            case "show-profiles": ShowTextWithEditor("profile-list", mpvHelp.GetProfiles()); break;

            case "show-playlist": ShowPlaylist(); break;

            case "show-properties": ShowProperties(); break;

            case "show-protocols": ShowTextWithEditor("protocol-list", mpvHelp.GetProtocols()); break;

            case "show-setup-dialog": ShowDialog(typeof(SetupWindow)); break;

            case "show-text": ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); break;

            case "update-check": UpdateCheck.CheckOnline(true); break;

            default: Msg.ShowError($"No command '{id}' found."); break;
            }
        }
Example #2
0
        public static void Execute(string id, string[] args)
        {
            switch (id)
            {
            case "open-files": OpenFiles(args); break;

            case "update-check": UpdateCheck.CheckOnline(true); break;

            case "open-url": OpenURL(); break;

            case "open-optical-media": Open_DVD_Or_BD_Folder(); break;

            case "manage-file-associations":     // deprecated 2019
            case "show-setup-dialog": ShowDialog(typeof(SetupWindow)); break;

            case "cycle-audio": CycleAudio(); break;

            case "load-audio": LoadAudio(); break;

            case "load-sub": LoadSubtitle(); break;

            case "execute-mpv-command": ExecuteMpvCommand(); break;

            case "show-history": ShowHistory(); break;

            case "show-media-search": ShowDialog(typeof(EverythingWindow)); break;

            case "show-command-palette": ShowDialog(typeof(CommandPaletteWindow)); break;

            case "show-about": ShowDialog(typeof(AboutWindow)); break;

            case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break;

            case "show-input-editor": ShowDialog(typeof(InputWindow)); break;

            case "open-conf-folder": Process.Start(mp.ConfigFolder); break;

            case "shell-execute": Process.Start(args[0]); break;

            case "show-info": ShowInfo(); break;

            case "playlist-first": PlaylistFirst(); break;

            case "playlist-last": PlaylistLast(); break;

            case "show-profiles": ShowProfiles(); break;

            case "show-properties": ShowProperties(); break;

            case "show-commands": ShowCommands(); break;

            case "add-files-to-playlist": OpenFiles("append"); break;     // deprecated 2019

            default: Msg.ShowError($"No command '{id}' found."); break;
            }

            MainForm.Instance.BeginInvoke(new Action(() => {
                Message m = new Message()
                {
                    Msg = 0x0202
                };                                          // WM_LBUTTONUP
                WinAPI.SendMessage(MainForm.Instance.Handle, m.Msg, m.WParam, m.LParam);
            }));
        }