public AudioOptions(Massive mass, MainWindow parent, AudioOptionsModes mode)
        {
            this.InitializeComponent();

            this.mode = mode;
            p         = parent;
            Owner     = p;

            DDHelper ddh = new DDHelper(this);

            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //загружаем фарш в форму
            Reload(mass);

            //прописываем события
            this.num_delay.ValueChanged += new RoutedPropertyChangedEventHandler <decimal>(num_delay_ValueChanged);

            if (mode == AudioOptionsModes.AllOptions)
            {
                Show();
            }
            else
            {
                ShowDialog();
            }
        }
Exemple #2
0
        public MediaInfo(string infilepath, InfoMode infomode, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner      = owner;
            this.infomode   = infomode;
            this.infilepath = infilepath;

            DDHelper ddh = new DDHelper(this);

            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            Title = "Info (" + infomode.ToString() + ")";
            button_open.Content  = Languages.Translate("Open");
            button_save.Content  = Languages.Translate("Save");
            button_close.Content = Languages.Translate("Close");
            tbxInfo.ToolTip      = Languages.Translate("Drag and Drop your files here");
            check_wrap.Content   = Languages.Translate("Wrap text");

            if (Settings.MI_WrapText)
            {
                check_wrap.IsChecked = true;
                tbxInfo.TextWrapping = TextWrapping.Wrap;
            }
            else
            {
                check_wrap.IsChecked = false;
                tbxInfo.TextWrapping = TextWrapping.NoWrap;
            }

            foreach (string info in Enum.GetNames(typeof(InfoMode)))
            {
                combo_info.Items.Add(info);
            }
            combo_info.SelectedItem = infomode.ToString();

            if (infilepath != null)
            {
                GetInfo();
            }

            Show();
        }
        public AudioOptions(Massive mass, MainWindow parent, AudioOptionsModes mode)
        {
            this.InitializeComponent();

            this.mode = mode;
            p = parent;
            Owner = p;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //загружаем фарш в форму
            Reload(mass);

            //прописываем события
            this.num_delay.ValueChanged += new RoutedPropertyChangedEventHandler<decimal>(num_delay_ValueChanged);

            if (mode == AudioOptionsModes.AllOptions)
                Show();
            else
                ShowDialog();
        }
Exemple #4
0
        public MediaInfo(string infilepath, InfoMode infomode, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner = owner;
            this.infomode = infomode;
            this.infilepath = infilepath;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            Title = "Info (" + infomode.ToString() + ")";
            button_open.Content = Languages.Translate("Open");
            button_save.Content = Languages.Translate("Save");
            button_close.Content = Languages.Translate("Close");
            tbxInfo.ToolTip = Languages.Translate("Drag and Drop your files here");
            check_wrap.Content = Languages.Translate("Wrap text");

            if (Settings.MI_WrapText)
            {
                check_wrap.IsChecked = true;
                tbxInfo.TextWrapping = TextWrapping.Wrap;
            }
            else
            {
                check_wrap.IsChecked = false;
                tbxInfo.TextWrapping = TextWrapping.NoWrap;
            }

            foreach (string info in Enum.GetNames(typeof(InfoMode)))
                combo_info.Items.Add(info);
            combo_info.SelectedItem = infomode.ToString();

            if (infilepath != null)
                GetInfo();

            Show();
        }
        public FFRebuilder(MainWindow owner)
        {
            this.InitializeComponent();
            this.Owner = owner;
            this.p = owner;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //переводим
            button_cancel.Content = Languages.Translate("Cancel");
            button_start.Content = Languages.Translate("Start");
            tab_main.Header = Languages.Translate("Main");
            tab_log.Header = Languages.Translate("Log");
            tab_help.Header = Languages.Translate("Help");
            label_infile.Content = Languages.Translate("Input file path:");
            label_outfile.Content = Languages.Translate("Output file path:");
            group_options.Header = Languages.Translate("Options");
            group_files.Header = Languages.Translate("Files");
            group_info.Header = Languages.Translate("Info");
            label_acodec.Content = Languages.Translate("Audio codec") + ":";
            label_vcodec.Content = Languages.Translate("Video codec") + ":";
            label_format.Content = Languages.Translate("Format") + ":";
            button_play.Content = Languages.Translate("Play");
            button_add_profile.ToolTip = Languages.Translate("Add profile");
            button_remove_profile.ToolTip = Languages.Translate("Remove profile");
            button_store_profile.ToolTip = Languages.Translate("Save changes");
            textbox_search.Text = (button_search.Content = Languages.Translate("Search")) + "...";
            button_open.ToolTip = Languages.Translate("Open");
            button_save.ToolTip = Languages.Translate("Save");
            progress.Maximum = 100;

            //Format
            //Enum formats используется только для заполнения комбобокса, т.к. пользователь
            //может добавить свои форматы, но Enum уже никак не изменить.
            //combo_format.ToolTip = Languages.Translate("Format");
            combo_format.Items.Add("");
            foreach (string _format in Enum.GetNames(typeof(formats)))
                combo_format.Items.Add(_format);

            //Vcodec
            foreach (vcodecs _vcodec in Enum.GetValues(typeof(vcodecs)))
                combo_vcodec.Items.Add(_vcodec);

            //Colorspace
            combo_colorspace.ToolTip = "Color space";
            foreach (colorspace _color in Enum.GetValues(typeof(colorspace)))
                combo_colorspace.Items.Add(_color);

            //AR
            combo_aspect.ToolTip = Languages.Translate("Aspect");
            combo_aspect.Items.Add("AUTO");
            combo_aspect.Items.Add("1:1");
            combo_aspect.Items.Add("4:3");
            combo_aspect.Items.Add("1.66");
            combo_aspect.Items.Add("16:9");
            combo_aspect.Items.Add("1.85");
            combo_aspect.Items.Add("2.00");
            combo_aspect.Items.Add("2.21");
            combo_aspect.Items.Add("2.35");

            //FPS
            combo_framerate.ToolTip = Languages.Translate("Framerate");
            combo_framerate.Items.Add("AUTO");
            combo_framerate.Items.Add("15.000");
            combo_framerate.Items.Add("18.000");
            combo_framerate.Items.Add("20.000");
            combo_framerate.Items.Add("23.976");
            combo_framerate.Items.Add("23.980");
            combo_framerate.Items.Add("24.000");
            combo_framerate.Items.Add("25.000");
            combo_framerate.Items.Add("29.970");
            combo_framerate.Items.Add("30.000");
            combo_framerate.Items.Add("50.000");
            combo_framerate.Items.Add("59.940");
            combo_framerate.Items.Add("60.000");

            //Acodec
            foreach (acodecs _acodec in Enum.GetValues(typeof(acodecs)))
                combo_acodec.Items.Add(_acodec);

            //PCM Bits
            combo_bits.Items.Add("S8");
            combo_bits.Items.Add("S16BE");
            combo_bits.Items.Add("S16LE");
            combo_bits.Items.Add("S24BE");
            combo_bits.Items.Add("S24LE");
            combo_bits.Items.Add("S32BE");
            combo_bits.Items.Add("S32LE");
            combo_bits.Items.Add("U8");
            combo_bits.Items.Add("U16BE");
            combo_bits.Items.Add("U16LE");
            combo_bits.Items.Add("U24BE");
            combo_bits.Items.Add("U24LE");
            combo_bits.Items.Add("U32BE");
            combo_bits.Items.Add("U32LE");

            //Аудио трек
            combo_atrack.Items.Add(new ComboBoxItem() { Content = "AUTO", ToolTip = Languages.Translate("Select audio track") });
            combo_atrack.SelectedIndex = 0;

            //Дискретизация
            combo_srate.ToolTip = Languages.Translate("Samplerate");
            combo_srate.Items.Add("AUTO");
            combo_srate.Items.Add("22050");
            combo_srate.Items.Add("32000");
            combo_srate.Items.Add("44100");
            combo_srate.Items.Add("48000");
            combo_srate.Items.Add("96000");

            //Кол-во каналов
            combo_channels.ToolTip = Languages.Translate("Channels");
            combo_channels.Items.Add("AUTO");
            combo_channels.Items.Add("1");
            combo_channels.Items.Add("2");
            combo_channels.Items.Add("3");
            combo_channels.Items.Add("4");
            combo_channels.Items.Add("5");
            combo_channels.Items.Add("6");
            combo_channels.Items.Add("7");
            combo_channels.Items.Add("8");

            //Help
            combo_help.Items.Add("-L");
            combo_help.Items.Add("-help");
            combo_help.Items.Add("-version");
            combo_help.Items.Add("-formats");
            combo_help.Items.Add("-codecs");
            combo_help.Items.Add("-filters");
            combo_help.SelectedIndex = 1;

            LoadAllProfiles(); //Список профилей
            LoadFromProfile(); //Настройки из профиля
            UpdateCombosIsEnabled();

            Show();
        }
Exemple #6
0
        public MainWindow()
        {
            //разрешаем запустить только один экземпляр
            try
            {
                Process process = Process.GetCurrentProcess();
                Process[] processes = Process.GetProcessesByName(process.ProcessName);
                foreach (Process _process in processes)
                {
                    if (_process.Id != process.Id && _process.MainModule.FileName == process.MainModule.FileName)
                    {
                        process.Kill();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.InitializeComponent();

            try
            {
                //Установка параметров окна из сохраненных настроек
                if (Settings.WindowResize)
                {
                    string[] value = (Settings.WindowLocation + "/" + Settings.TasksRows).Split('/');
                    if (value.Length == 6)
                    {
                        this.Width = Convert.ToDouble(value[0]);
                        this.Height = Convert.ToDouble(value[1]);
                        this.Left = Convert.ToDouble(value[2]);
                        this.Top = Convert.ToDouble(value[3]);
                        GridLengthConverter conv = new GridLengthConverter();
                        string sep = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
                        this.TasksRow.Height = (GridLength)conv.ConvertFromString(value[4].Replace(".", sep).Replace(",", sep));
                        this.TasksRow2.Height = (GridLength)conv.ConvertFromString(value[5].Replace(".", sep).Replace(",", sep));
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (WindowSize): " + ex.Message, ex.StackTrace);
            }

            try
            {
                //Определяем наличие Ависинта
                SysInfo.RetrieveAviSynthInfo();
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (AviSynth): " + ex.Message, ex.StackTrace);
            }

            try
            {
                //Трей
                System.Windows.Forms.ContextMenuStrip TrayMenu = new System.Windows.Forms.ContextMenuStrip();
                TrayIcon = new System.Windows.Forms.NotifyIcon();
                //Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/pictures/Top.ico")).Stream;
                Stream iconStream = Application.GetResourceStream(new Uri("main.ico", UriKind.RelativeOrAbsolute)).Stream;
                TrayIcon.Icon = new System.Drawing.Icon(iconStream);

                //Пункт меню "Close to tray"
                tmnTrayClose = new System.Windows.Forms.ToolStripMenuItem();
                tmnTrayClose.Text = "Close to tray";
                tmnTrayClose.CheckOnClick = true;
                tmnTrayClose.Checked = Settings.TrayClose;
                tmnTrayClose.Click += new EventHandler(tmnTrayClose_Click);
                TrayMenu.Items.Add(tmnTrayClose);

                //Пункт меню "Minimize to tray"
                tmnTrayMinimize = new System.Windows.Forms.ToolStripMenuItem();
                tmnTrayMinimize.Text = "Minimize to tray";
                tmnTrayMinimize.CheckOnClick = true;
                tmnTrayMinimize.Checked = Settings.TrayMinimize;
                tmnTrayMinimize.Click += new EventHandler(tmnTrayMinimize_Click);
                TrayMenu.Items.Add(tmnTrayMinimize);

                //Пункт меню "1-Click"
                tmnTrayClickOnce = new System.Windows.Forms.ToolStripMenuItem();
                tmnTrayClickOnce.Text = "Single click to open";
                tmnTrayClickOnce.CheckOnClick = true;
                tmnTrayClickOnce.Checked = Settings.TrayClickOnce;
                tmnTrayClickOnce.Click += new EventHandler(tmnTrayClickOnce_Click);
                TrayMenu.Items.Add(tmnTrayClickOnce);

                //Пункт меню "Disable balloons"
                tmnTrayNoBalloons = new System.Windows.Forms.ToolStripMenuItem();
                tmnTrayNoBalloons.Text = "Disable balloons";
                tmnTrayNoBalloons.CheckOnClick = true;
                tmnTrayNoBalloons.Checked = Settings.TrayNoBalloons;
                tmnTrayNoBalloons.Click += new EventHandler(tmnTrayNoBalloons_Click);
                TrayMenu.Items.Add(tmnTrayNoBalloons);
                TrayMenu.Items.Add(new System.Windows.Forms.ToolStripSeparator());

                //Пункт меню "Exit"
                tmnExit = new System.Windows.Forms.ToolStripMenuItem();
                tmnExit.Text = "Exit";
                tmnExit.Click += new EventHandler(mnExit_Click);
                TrayMenu.Items.Add(tmnExit);

                TrayIcon.ContextMenuStrip = TrayMenu;
                TrayIcon.Text = "XviD4PSP";
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (TrayIcon): " + ex.Message, ex.StackTrace);
            }

            try
            {
                UpdateRecentFiles();  //Список недавних файлов
                MenuHider(false);     //Делаем пункты меню неактивными
                SetHotKeys();         //Загружаем HotKeys
                SetLanguage();        //переводим лейблы

                textbox_name.Text = textbox_frame.Text = textbox_frame_goto.Text = "";
                textbox_time.Text = textbox_duration.Text = "00:00:00";

                //Определяем коэффициент dpi
                SysInfo.RetrieveDPI(this);
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (Misc): " + ex.Message, ex.StackTrace);
            }

            try
            {
                //Пользовательские утилиты
                LoadCustomTools();
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (CustomTools): " + ex.Message, ex.StackTrace);
            }

            try
            {
                //events
                this.PreviewKeyDown += new KeyEventHandler(MainWindow_KeyDown);
                this.StateChanged += new EventHandler(MainWindow_StateChanged);
                this.textbox_name.MouseEnter += new MouseEventHandler(textbox_name_MouseEnter); //Мышь вошла в зону с названием файла
                this.textbox_name.MouseLeave += new MouseEventHandler(textbox_name_MouseLeave); //Мышь вышла из зоны с названием файла
                if (Settings.TrayClickOnce) TrayIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(TrayIcon_Click);
                else TrayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(TrayIcon_Click);

                DDHelper ddh = new DDHelper(this);
                ddh.GotFiles += new DDEventHandler(DD_GotFiles);
            }
            catch (Exception ex)
            {
                ErrorException("Initializing (Events): " + ex.Message, ex.StackTrace);
            }
        }
Exemple #7
0
        public DVDImport(Massive mass, string dvdpath)
        {
            this.InitializeComponent();
            this.Owner = App.Current.MainWindow;
            this.m = mass.Clone();
            this.dpi = SysInfo.dpi;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            //tooltips
            label_title.Content = Languages.Translate("Select title:");
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            button_play.ToolTip = Languages.Translate("Play-Pause");
            button_stop.ToolTip = Languages.Translate("Stop");

            //events
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            this.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            this.KeyUp += new KeyEventHandler(MainWindow_KeyUp);

            //подготавливаем список титлов
            string[] maintitles = Directory.GetFiles(dvdpath, "VTS_*1.VOB", SearchOption.AllDirectories);
            int titlescount = maintitles.Length;

            //если нет ни одного титла
            if (titlescount == 0)
            {
                Message message = new Message(this.Owner);
                message.ShowMessage(Languages.Translate("Can`t find any VOB file in:") +
                    " \"" + dvdpath + "\"!", Languages.Translate("Error"));
                m = null;
                Close();
                return;
            }

            //сортируем и забиваем вобы в список
            dvd = new ArrayList();
            string[] vobs = new string[] { "" };
            for (int n = 0; n < titlescount; n++)
            {
                string title = Calculate.GetTitleNum(maintitles[n]);
                vobs = Directory.GetFiles(dvdpath, "VTS_" + title + "*.VOB", SearchOption.AllDirectories);
                ArrayList vobs_ar = Calculate.ConvertStringArrayToArrayList(vobs);
                if (vobs_ar[0].ToString().ToUpper().EndsWith("0.VOB"))
                    vobs_ar.RemoveAt(0);
                vobs = Calculate.ConvertArrayListToStringArray(vobs_ar);
                dvd.Add(vobs);
            }

            //забиваем и выделяем пустой титл
            combo_titles.Items.Add(Calculate.GetTimeline(0));
            combo_titles.SelectedIndex = 0;
            Title = "DVD: " + Calculate.GetDVDName(vobs[0]);

            this.ShowDialog();
        }