Esempio n. 1
0
        void InitColumn(ListView lst)
        {
            List <Dictionary <String, string> > items = ColumnData;
            List <ColumnHeader> heads  = new List <ColumnHeader>();
            ColumnHeader        action = new ColumnHeader();

            action.Name = "Add";
            action.Text = "选择";
            heads.Add(action);
            if (items != null)
            {
                foreach (Dictionary <string, string> item in items)
                {
                    if (item["hidden"] != "true")
                    {
                        ColumnHeader head = new ColumnHeader()
                        {
                            Width = 200
                        };
                        head.Name = item["key"];
                        head.Text = item["value"];
                        if (string.IsNullOrEmpty(head.Text))
                        {
                            head.Text = head.Name;
                        }
                        heads.Add(head);
                    }
                }
            }
            lst.View           = View.Details;
            lst.SmallImageList = imageList;

            //lst.View = View.Details;
            lst.Columns.AddRange(heads.ToArray());
            ListViewExt lstE = new ListViewExt();

            lst.Columns[0].ImageIndex = 0;
        }
Esempio n. 2
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
        }