The Main Window
Inheritance: Form
Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="frmPreview"/> class.
        /// </summary>
        /// <param name="mw">
        /// The mw.
        /// </param>
        public frmPreview(frmMain mw)
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception)
            {
                this.noQt = true;

                int borderWidth = (this.Width - this.ClientSize.Width) / 2;
                int titlebarAndBorder = this.Height - this.ClientSize.Height;

                this.Height = toolBar.Height + titlebarAndBorder + 1;
                btn_playQT.Enabled = false;
                btn_playQT.Visible = false;
            }

            this.mainWindow = mw;

            cb_preview.SelectedIndex = 0;
            cb_duration.SelectedIndex = 1;

            cb_preview.Items.Clear();
            for (int i = 1; i <= Properties.Settings.Default.previewScanCount; i++)
            {
                cb_preview.Items.Add(i.ToString());
            }

            cb_preview.SelectedIndex = 0;

            encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;
            encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="frmAddPreset"/> class.
        /// </summary>
        /// <param name="mainWindow">
        /// The Main Window
        /// </param>
        /// <param name="presetHandler">
        /// The preset handler.
        /// </param>
        public frmAddPreset(frmMain mainWindow, PresetService presetHandler)
        {
            InitializeComponent();
            this.mainWindow = mainWindow;
            presetCode = presetHandler;

            cb_usePictureSettings.SelectedIndex = 0;
        }
Exemple #3
0
        public frmAddBatch(frmMain mw, Source discSource)
        {
            InitializeComponent();

            if (this.DesignMode)
                return;

            this.discSource = discSource;
            this.mainWindow = mw;

            minTimespan = TimeSpan.Parse(ServiceManager.UserSettingService.GetUserSetting<string>(UserSettingConstants.BatchMinDuration));
            maxTimespan = TimeSpan.Parse(ServiceManager.UserSettingService.GetUserSetting<string>(UserSettingConstants.BatchMaxDuration));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="frmQueue"/> class.
        /// </summary>
        /// <param name="q">
        /// An instance of the queue service.
        /// </param>
        /// <param name="mw">
        /// The main window.
        /// </param>
        public frmQueue(IQueueProcessor q, frmMain mw)
        {
            InitializeComponent();

            this.mainWindow = mw;

            this.queue = q;
            queue.EncodeService.EncodeStarted += this.QueueOnEncodeStart;
            queue.QueueCompleted += this.QueueOnQueueFinished;
            queue.QueuePaused += this.QueueOnPaused;
            queue.QueueManager.QueueChanged += this.queue_QueueListChanged;

            queue.EncodeService.EncodeStarted += this.queue_EncodeStarted;
            queue.EncodeService.EncodeCompleted += this.queue_EncodeEnded;

            drp_completeOption.Text = userSettingService.GetUserSettingString(UserSettingConstants.WhenCompleteAction);
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="frmQueue"/> class.
        /// </summary>
        /// <param name="q">
        /// An instance of the queue service.
        /// </param>
        /// <param name="mw">
        /// The main window.
        /// </param>
        public frmQueue(IQueueProcessor q, frmMain mw)
        {
            InitializeComponent();

            this.mainWindow = mw;

            this.queue = q;
            queue.EncodeService.EncodeStarted += this.QueueOnEncodeStart;
            queue.QueueCompleted += this.QueueOnQueueFinished;
            queue.QueuePaused += this.QueueOnPaused;
            queue.QueueManager.QueueChanged += new EventHandler(queue_QueueListChanged);

            queue.EncodeService.EncodeStarted += this.queue_EncodeStarted;
            queue.EncodeService.EncodeCompleted += this.queue_EncodeEnded;

            drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
        }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="frmPreview"/> class.
        /// </summary>
        /// <param name="mw">
        /// The mw.
        /// </param>
        public frmPreview(frmMain mw)
        {
            InitializeComponent();
            this.mainWindow = mw;

            startPoint.SelectedIndex = 0;
            endPoint.SelectedIndex = 1;

            startPoint.Items.Clear();
            for (int i = 1; i <= UserSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount); i++)
            {
                startPoint.Items.Add(i.ToString());
            }

            startPoint.SelectedIndex = 0;

            encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;
            encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;

            defaultPlayer.Checked = UserSettingService.GetUserSetting<bool>(UserSettingConstants.DefaultPlayer);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="frmPreview"/> class.
        /// </summary>
        /// <param name="mw">
        /// The mw.
        /// </param>
        public frmPreview(frmMain mw)
        {
            InitializeComponent();
            this.mainWindow = mw;

            startPoint.SelectedIndex = 0;
            endPoint.SelectedIndex = 1;

            startPoint.Items.Clear();
            for (int i = 1; i <= Properties.Settings.Default.previewScanCount; i++)
            {
                startPoint.Items.Add(i.ToString());
            }

            startPoint.SelectedIndex = 0;

            encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;
            encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;

            defaultPlayer.Checked = Properties.Settings.Default.defaultPlayer;
        }
        public frmOptions(frmMain mw)
        {
            InitializeComponent();
            mainWindow = mw;

            IDictionary<string, string> langList = LanguageUtilities.MapLanguages();

            foreach (string selectedItem in Properties.Settings.Default.SelectedLanguages)
            {
                // removing wrong keys when a new Language list comes out.
                if (langList.ContainsKey(selectedItem))
                    listBox_selectedLanguages.Items.Add(selectedItem);
            }

            foreach (string item in langList.Keys)
            {
                drop_preferredLang.Items.Add(item);

                // In the available languages should be no "Any" and no selected language.
                if ((item != "Any") && (!Properties.Settings.Default.SelectedLanguages.Contains(item)))
                {
                    listBox_availableLanguages.Items.Add(item);
                }
            }

            // #############################
            // General
            // #############################

            // Enable Tooltips.
            if (Properties.Settings.Default.tooltipEnable)
            {
                check_tooltip.CheckState = CheckState.Checked;
                ToolTip.Active = true;
            }

            // Update Check
            if (Properties.Settings.Default.updateStatus)
                check_updateCheck.CheckState = CheckState.Checked;

            // Days between update checks
            switch (Properties.Settings.Default.daysBetweenUpdateCheck)
            {
                case 1:
                    drop_updateCheckDays.SelectedIndex = 0;
                    break;
                case 7:
                    drop_updateCheckDays.SelectedIndex = 1;
                    break;
                case 30:
                    drop_updateCheckDays.SelectedIndex = 2;
                    break;
            }

            // On Encode Completeion Action
            drp_completeOption.Text = userSettingService.GetUserSettingString("WhenCompleteAction");

            // Growl.
            if (userSettingService.GetUserSettingBoolean(UserSettingConstants.GrowlEncode))
                check_growlEncode.CheckState = CheckState.Checked;

            if (userSettingService.GetUserSettingBoolean(UserSettingConstants.GrowlQueue))
                check_GrowlQueue.CheckState = CheckState.Checked;

            check_sendFileTo.Checked = this.userSettingService.GetUserSettingBoolean(UserSettingConstants.SendFile);
            lbl_sendFileTo.Text = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSettingString(UserSettingConstants.SendFileTo));
            txt_SendFileArgs.Text = this.userSettingService.GetUserSettingString(UserSettingConstants.SendFileToArgs);

            // #############################
            // Output Settings
            // #############################

            // Enable auto naming feature.)
            if (Properties.Settings.Default.autoNaming)
                check_autoNaming.CheckState = CheckState.Checked;

            // Store the auto name path
            text_an_path.Text = Properties.Settings.Default.autoNamePath;
            if (text_an_path.Text == string.Empty)
                text_an_path.Text = "Click 'Browse' to set the default location";

            // Store auto name format
            txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;

            // Use iPod/iTunes friendly .m4v extension for MP4 files.
            cb_mp4FileMode.SelectedIndex = Properties.Settings.Default.useM4v;

            // Remove Underscores
            check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore;

            // Title case
            check_TitleCase.Checked = Properties.Settings.Default.AutoNameTitleCase;

            // #############################
            // Picture Tab
            // #############################

            // VLC Path
            txt_vlcPath.Text = Properties.Settings.Default.VLC_Path;

            // #############################
            // Audio and Subtitles Tab
            // #############################

            drop_preferredLang.SelectedItem = Properties.Settings.Default.NativeLanguage;

            if (Settings.Default.DubMode != 255)
            {
                switch (Settings.Default.DubMode)
                {
                    case 0:
                        Settings.Default.DubModeAudio = 2;
                        Settings.Default.DubModeSubtitle = 0;
                        Settings.Default.DubMode = 255;
                        break;
                    case 1:
                        Settings.Default.DubModeAudio = 4;
                        Settings.Default.DubModeSubtitle = 0;
                        Settings.Default.DubMode = 255;
                        break;
                    case 2:
                        Settings.Default.DubModeAudio = 2;
                        Settings.Default.DubModeSubtitle = 4;
                        Settings.Default.DubMode = 255;
                        break;
                    case 3:
                        Settings.Default.DubModeAudio = 4;
                        Settings.Default.DubModeSubtitle = 4;
                        Settings.Default.DubMode = 255;
                        break;
                    default:
                        Settings.Default.DubMode = 255;
                        break;
                }
            }

            cb_audioMode.SelectedIndex = Settings.Default.DubModeAudio;
            cb_subtitleMode.SelectedIndex = Settings.Default.DubModeSubtitle;

            check_AddOnlyOneAudioPerLanguage.Checked = Properties.Settings.Default.addOnlyOneAudioPerLanguage;

            check_AddCCTracks.Checked = Properties.Settings.Default.useClosedCaption;

            // #############################
            // CLI
            // #############################

            // Priority level for encodes
            drp_Priority.Text = userSettingService.GetUserSettingString(UserSettingConstants.ProcessPriority);

            check_preventSleep.Checked = userSettingService.GetUserSettingBoolean(UserSettingConstants.PreventSleep);

            // Log Verbosity Level
            cb_logVerboseLvl.SelectedIndex = userSettingService.GetUserSettingInt(UserSettingConstants.Verbosity);

            // Save logs in the same directory as encoded files
            if (userSettingService.GetUserSettingBoolean(UserSettingConstants.SaveLogWithVideo))
                check_saveLogWithVideo.CheckState = CheckState.Checked;

            // Save Logs in a specified path
            if (userSettingService.GetUserSettingBoolean(UserSettingConstants.SaveLogToCopyDirectory))
                check_logsInSpecifiedLocation.CheckState = CheckState.Checked;

            // The saved log path
            text_logPath.Text = userSettingService.GetUserSettingString(UserSettingConstants.SaveLogCopyDirectory);

            check_clearOldLogs.Checked = Properties.Settings.Default.clearOldLogs;

            // #############################
            // Advanced
            // #############################

            // Minimise to Tray
            if (Properties.Settings.Default.trayIconAlerts)
                check_trayStatusAlerts.CheckState = CheckState.Checked;

            // Tray Balloon popups
            if (Properties.Settings.Default.MainWindowMinimize)
                check_mainMinimize.CheckState = CheckState.Checked;

            // Enable / Disable Query editor tab
            if (Properties.Settings.Default.QueryEditorTab)
                check_queryEditorTab.CheckState = CheckState.Checked;
            check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;

            // Prompt on inconsistant queries
            check_promptOnUnmatchingQueries.Checked = Properties.Settings.Default.PromptOnUnmatchingQueries;

            // Preset update notification
            if (Properties.Settings.Default.presetNotification)
                check_disablePresetNotification.CheckState = CheckState.Checked;

            // Show CLI Window
            check_showCliForInGUIEncode.Checked = userSettingService.GetUserSettingBoolean(UserSettingConstants.ShowCLI);

            // Set the preview count
            drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();

            // x264 step
            string step = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step).ToString(new CultureInfo("en-US"));
            switch (step)
            {
                case "1":
                    drop_x264step.SelectedIndex = 0;
                    break;
                case "0.5":
                    drop_x264step.SelectedIndex = 1;
                    break;
                case "0.25":
                    drop_x264step.SelectedIndex = 2;
                    break;
                case "0.2":
                    drop_x264step.SelectedIndex = 3;
                    break;
            }

            // Min Title Length
            ud_minTitleLength.Value = this.userSettingService.GetUserSettingInt(UserSettingConstants.MinScanDuration);

            // Use Experimental dvdnav
            if (userSettingService.GetUserSettingBoolean(UserSettingConstants.DisableLibDvdNav))
                check_dvdnav.CheckState = CheckState.Checked;

            optionsWindowLoading = false;
        }
        public frmOptions(frmMain mw)
        {
            InitializeComponent();
            mainWindow = mw;

            IDictionary<string, string> langList = Main.MapLanguages();
            foreach (string item in langList.Keys)
                drop_preferredLang.Items.Add(item);

            // #############################
            // General
            // #############################

            // Enable Tooltips.
            if (Properties.Settings.Default.tooltipEnable)
            {
                check_tooltip.CheckState = CheckState.Checked;
                ToolTip.Active = true;
            }

            // Update Check
            if (Properties.Settings.Default.updateStatus)
                check_updateCheck.CheckState = CheckState.Checked;

            // Days between update checks
            switch (Properties.Settings.Default.daysBetweenUpdateCheck)
            {
                case 1:
                    drop_updateCheckDays.SelectedIndex = 0;
                    break;
                case 7:
                    drop_updateCheckDays.SelectedIndex = 1;
                    break;
                case 30:
                    drop_updateCheckDays.SelectedIndex = 2;
                    break;
            }

            // On Encode Completeion Action
            drp_completeOption.Text = Properties.Settings.Default.CompletionOption;

            // Growl.
            if (Properties.Settings.Default.growlEncode)
                check_growlEncode.CheckState = CheckState.Checked;

            if (Properties.Settings.Default.growlQueue)
                check_GrowlQueue.CheckState = CheckState.Checked;

            // Enable auto naming feature.
            if (Properties.Settings.Default.autoNaming)
                check_autoNaming.CheckState = CheckState.Checked;

            // Store the auto name path
            text_an_path.Text = Properties.Settings.Default.autoNamePath;
            if (text_an_path.Text == string.Empty)
                text_an_path.Text = "Click 'Browse' to set the default location";

            // Store auto name format
            txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;

            // Use iPod/iTunes friendly .m4v extension for MP4 files.
            cb_mp4FileMode.SelectedIndex = Properties.Settings.Default.useM4v;

            // Remove Underscores
            check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore;

            // Title case
            check_TitleCase.Checked = Properties.Settings.Default.AutoNameTitleCase;

            // #############################
            // Picture Tab
            // #############################

            // VLC Path
            txt_vlcPath.Text = Properties.Settings.Default.VLC_Path;

            // #############################
            // Audio and Subtitles Tab
            // #############################

            drop_preferredLang.SelectedItem = Properties.Settings.Default.NativeLanguage;

            switch (Settings.Default.DubMode)
            {
                case 1:
                    radio_dub.Checked = true;
                    break;
                case 2:
                    radio_foreignAndSubs.Checked = true;
                    break;
                case 3:
                    radio_preferredAudioAndSubs.Checked = true;
                    break;
            }

            check_AddCCTracks.Checked = Properties.Settings.Default.useClosedCaption;

            // #############################
            // CLI
            // #############################

            // Priority level for encodes
            drp_Priority.Text = Properties.Settings.Default.processPriority;

            check_preventSleep.Checked = Properties.Settings.Default.preventSleep;

            // Log Verbosity Level
            cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;

            // Save logs in the same directory as encoded files
            if (Properties.Settings.Default.saveLogWithVideo)
                check_saveLogWithVideo.CheckState = CheckState.Checked;

            // Save Logs in a specified path
            if (Properties.Settings.Default.saveLogToSpecifiedPath)
                check_logsInSpecifiedLocation.CheckState = CheckState.Checked;

            // The saved log path
            text_logPath.Text = Properties.Settings.Default.saveLogPath;

            check_clearOldLogs.Checked = Properties.Settings.Default.clearOldLogs;

            // #############################
            // Advanced
            // #############################

            // Minimise to Tray
            if (Properties.Settings.Default.trayIconAlerts)
                check_trayStatusAlerts.CheckState = CheckState.Checked;

            // Tray Balloon popups
            if (Properties.Settings.Default.MainWindowMinimize)
                check_mainMinimize.CheckState = CheckState.Checked;

            // Enable / Disable Query editor tab
            if (Properties.Settings.Default.QueryEditorTab)
                check_queryEditorTab.CheckState = CheckState.Checked;
            check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;

            // Prompt on inconsistant queries
            check_promptOnUnmatchingQueries.Checked = Properties.Settings.Default.PromptOnUnmatchingQueries;

            // Preset update notification
            if (Properties.Settings.Default.presetNotification)
                check_disablePresetNotification.CheckState = CheckState.Checked;

            // Show CLI Window
            check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;

            // Set the preview count
            drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();

            // x264 step
            string step = Properties.Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
            switch (step)
            {
                case "1":
                    drop_x264step.SelectedIndex = 0;
                    break;
                case "0.5":
                    drop_x264step.SelectedIndex = 1;
                    break;
                case "0.25":
                    drop_x264step.SelectedIndex = 2;
                    break;
                case "0.2":
                    drop_x264step.SelectedIndex = 3;
                    break;
            }

            // Use Experimental dvdnav
            if (Properties.Settings.Default.noDvdNav)
                check_dvdnav.CheckState = CheckState.Checked;

            optionsWindowLoading = false;
        }