Ejemplo n.º 1
0
 public EncodeParameters GetEncodeParameters(InputFile file)
 {
     return(new EncodeParameters(
                inputPath: file.GetFilePath(),
                outputFolder: savePathLabel.Text,
                outputName: autoNamingBox.Checked? $"{file.GetFileName()}_V{selectedVCodec}_A{selectedACodec}_{selectedPreset}" : $"{prefixBox.Texts}{file.GetFileName()}{postfixBox.Texts}",
                videoCodec: selectedVCodec,
                audioCodec: selectedACodec,
                preset: selectedPreset,
                extention: selectedExtension,
                bitrateBox.Checked ? bitRate : file.GetFileBitrate() / 1024f,
                width: customWidthBox.Checked ? ((int)customWidthNumeric.Value) : file.GetFileWidth(),
                height: customHeightBox.Checked ? ((int)customHeightNumeric.Value) : file.GetFileHeight(),
                horizontalFlip: horFlipBox.Checked,
                verticalFlip: verFlipBox.Checked,
                saveAspect: saveAspectButton.Checked
                ));
 }
Ejemplo n.º 2
0
        private void toolStripMenuItemOpenPoFile_Click(object sender, EventArgs e)
        {
            try
            {
                // Пользователь выбирает файл, с помощью файлового диалога OS.
                var ofd      = new InputFile();
                var filePath = ofd.GetFilePath(".po");
                if (String.IsNullOrWhiteSpace(filePath))
                {
                    return;
                }

                // Парсим выбранный пользователем файл. После завершения слушаем событие - CompleteEvent.
                var poParser = new PoParser(filePath);
                poParser.ParseCompletedEvent += PoFileParseCompleted;
                poParser.Parse();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }