Пример #1
0
        /// <summary>
        /// Opens a dialog to allow the user to select the FFMpeg executable.  Saves the path
        /// to the executable to the TextBox and to an application-scope variable.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Select_FFMpeg(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("\"Select FFMpeg executable\" button clicked.");

            var findFFMpegDialog = new OpenFileDialog();

            findFFMpegDialog.Title      = "Select ffmpeg.exe";
            findFFMpegDialog.DefaultExt = ".exe";
            findFFMpegDialog.Filter     = "Executables (.exe) | *.exe";

            if (findFFMpegDialog.ShowDialog() == true)
            {
                var pathToFFMpeg = findFFMpegDialog.FileName;
                FFMpeg_Location.Text = pathToFFMpeg;

                string pathToFFProbe = Modify_Path(pathToFFMpeg, "ffprobe.exe");
                string pathToFFPlay  = Modify_Path(pathToFFMpeg, "ffplay.exe");
                PreferencesHelper.setFFMpegLocations(pathToFFMpeg, pathToFFProbe, pathToFFPlay);
            }
        }