예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
#if DEBUG
#endif
            if (com.cfg.dat.check_update != "")
            {
                this.checkUpdate();
            }

            if (com.cfg.dat.processPriority < ConfigFile.priorityArr.Length)
            {
                FFmpeg.PriorityClass = ConfigFile.priorityArr[com.cfg.dat.processPriority];
            }
            processToolStripMenuItem.setSelectItem(com.cfg.dat.processPriority);
            processToolStripMenuItem.onSelectItem(index =>
            {
                com.cfg.dat.processPriority = index;
                if (com.cfg.dat.processPriority < ConfigFile.priorityArr.Length)
                {
                    FFmpeg.PriorityClass = ConfigFile.priorityArr[com.cfg.dat.processPriority];
                }
                com.cfg.save();
            });

            flowLayoutPanelProp.Enabled = false;

            comboBoxCon.Items.AddRange(new string[] { com.lang.dat.Dont_change, "mkv", "mp4" });
            comboBoxCon.SelectedIndex = 0;

            comboBoxSplit.Items.AddRange(new string[] { com.lang.dat.After_duration, com.lang.dat.Specific_time });
            comboBoxSplit.SelectedIndex = 0;

            comboBoxPack.Items.AddRange(ConvertMedia.extVideos);
            comboBoxPack.Items.AddRange(ConvertMedia.extAudios);

            comboBoxPack.SelectedIndex = 0;
            comboBoxIsDefault.Items.AddRange(new string[] { com.lang.dat.No, com.lang.dat.Yes });
            comboBoxIsDefault.SelectedIndex = 0;


            comboBoxAudioCode.Items.Add("");
            comboBoxAudioCode.Items.AddRange(ConvertMedia.codeAudios);
            comboBoxAudioCode.SelectedIndex = 0;

            comboBoxVideoCode.Items.AddRange(ConvertMedia.codecVideosStr);
            comboBoxVideoCode.SelectedIndex = 0;

            initPreset();

            comboBoxAudioBitRate.Items.Add("");
            comboBoxAudioBitRate.Items.AddRange(ConvertMedia.bitRates);

            comboBoxStreamLang.Items.Add("");
            comboBoxStreamLang.Items.AddRange(FFmpeg.streamLangs);

            comboBoxFPS.Items.Add("");
            comboBoxFPS.Items.AddRange(ConvertMedia.FPSlist);

            comboBoxCrf.Items.AddRange(ConvertMedia.getCRF());

            comboBoxSize.Items.Add("");
            comboBoxSize.Items.AddRange(ConvertMedia.codeSizes);

            comboBoxPixelFormat.Items.Add("");
            comboBoxPixelFormat.Items.AddRange(ConvertMedia.codePixelFormats);

            bindConvert(convert);

            ListViewExt lvExt = new ListViewExt(listViewStream);
            lvExt.onSortStart = () =>
            {
                listViewStream.ItemChecked -= listViewStream_ItemChecked;
            };
            lvExt.onSortEnd = (oldI, newI, realI) =>
            {
                if (streamsCurrent.Count > 0)
                {
                    var old = streamsCurrent[oldI];
                    streamsCurrent[oldI] = null;
                    streamsCurrent.Insert(newI, old);
                    streamsCurrent.Remove(null);


                    currentStreamIndex = realI;
                    listViewStream.Items[realI].Selected = true;
                }

                listViewStream.ItemChecked += listViewStream_ItemChecked;
            };


            lvExt.setDrag();


#if DEBUG
            var oldLang = com.lang.dat;
            var oldMenu = com.lang.fileMenu;
            com.lang.dat      = new LanguageFile();
            com.lang.fileMenu = AppLanguage.getLangFile(AppLanguage.engLang);
            com.lang.save();
            com.lang.dat      = oldLang;
            com.lang.fileMenu = oldMenu;
            com.lang.save();

            genCode();
#endif
        }