From a709d000095bfd6d0bb906cc721be94445337c07 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 14 Apr 2009 21:48:34 +0000 Subject: [PATCH] WinGui: - Move some files around. Removes frmMain folder. Removes old x264panel file which is no longer used. Fixes namespace errors. git-svn-id: svn://localhost/HandBrake/trunk@2327 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/{frmMain => Functions}/PresetLoader.cs | 2 +- win/C#/{frmMain => Functions}/QueryGenerator.cs | 2 +- win/C#/HandBrakeCS.csproj | 14 +- win/C#/frmMain.cs | 1 - win/C#/frmMain/x264Panel.cs | 949 --------------------- win/C#/frmPreview.cs | 1 + ...ester.Designer.cs => frmTestWindow.Designer.cs} | 0 .../QueryParserTester.cs => frmTestWindow.cs} | 0 .../QueryParserTester.resx => frmTestWindow.resx} | 0 9 files changed, 10 insertions(+), 959 deletions(-) rename win/C#/{frmMain => Functions}/PresetLoader.cs (97%) rename win/C#/{frmMain => Functions}/QueryGenerator.cs (97%) delete mode 100644 win/C#/frmMain/x264Panel.cs rename win/C#/{Functions/QueryParserTester.Designer.cs => frmTestWindow.Designer.cs} (100%) rename win/C#/{Functions/QueryParserTester.cs => frmTestWindow.cs} (100%) rename win/C#/{Functions/QueryParserTester.resx => frmTestWindow.resx} (100%) diff --git a/win/C#/frmMain/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs similarity index 97% rename from win/C#/frmMain/PresetLoader.cs rename to win/C#/Functions/PresetLoader.cs index 7d4f6397..21bd5f97 100644 --- a/win/C#/frmMain/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -2,7 +2,7 @@ using System.Windows.Forms; using System.Drawing; -namespace Handbrake +namespace Handbrake.Functions { class PresetLoader { diff --git a/win/C#/frmMain/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs similarity index 97% rename from win/C#/frmMain/QueryGenerator.cs rename to win/C#/Functions/QueryGenerator.cs index 96f2cda3..c3f66fc2 100644 --- a/win/C#/frmMain/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -11,7 +11,7 @@ using System.Globalization; using System.IO; using System.Collections.Generic; -namespace Handbrake +namespace Handbrake.Functions { class QueryGenerator { diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index f892112b..9d50b94e 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -184,14 +184,14 @@ frmUpdater.cs - - + + - + Form - - QueryParserTester.cs + + frmTestWindow.cs @@ -263,8 +263,8 @@ frmUpdater.cs Designer - - QueryParserTester.cs + + frmTestWindow.cs Designer diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 887effb8..ded23908 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -29,7 +29,6 @@ namespace Handbrake Parsing.DVD thisDVD; // Objects belonging to this window only - PresetLoader presetLoader = new PresetLoader(); QueryGenerator queryGen = new QueryGenerator(); // Globals: Mainly used for tracking. diff --git a/win/C#/frmMain/x264Panel.cs b/win/C#/frmMain/x264Panel.cs deleted file mode 100644 index be470418..00000000 --- a/win/C#/frmMain/x264Panel.cs +++ /dev/null @@ -1,949 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace Handbrake -{ - class x264Panel - { - /// - /// Reset all components to defaults and clears the x264 rtf box - /// - public void reset2Defaults(frmMain mainWindow) - { - mainWindow.check_8x8DCT.CheckState = CheckState.Unchecked; - mainWindow.check_Cabac.CheckState = CheckState.Checked; - mainWindow.check_mixedReferences.CheckState = CheckState.Unchecked; - mainWindow.check_noDCTDecimate.CheckState = CheckState.Unchecked; - mainWindow.check_noFastPSkip.CheckState = CheckState.Unchecked; - mainWindow.check_pyrmidalBFrames.CheckState = CheckState.Unchecked; - mainWindow.check_weightedBFrames.CheckState = CheckState.Unchecked; - mainWindow.drop_analysis.SelectedIndex = 0; - mainWindow.drop_bFrames.SelectedIndex = 0; - mainWindow.drop_deblockAlpha.SelectedIndex = 0; - mainWindow.drop_deblockBeta.SelectedIndex = 0; - mainWindow.drop_directPrediction.SelectedIndex = 0; - mainWindow.drop_MotionEstimationMethod.SelectedIndex = 0; - mainWindow.drop_MotionEstimationRange.SelectedIndex = 0; - mainWindow.drop_refFrames.SelectedIndex = 0; - mainWindow.drop_subpixelMotionEstimation.SelectedIndex = 0; - mainWindow.drop_trellis.SelectedIndex = 0; - mainWindow.slider_psyrd.Value = 0; - mainWindow.slider_psytrellis.Value = 0; - mainWindow.drop_adaptBFrames.SelectedIndex = 0; - - mainWindow.rtf_x264Query.Text = ""; - } - - /// - /// Update GUI componets from the current x264 rtf string - /// - public void X264_SetCurrentSettingsInPanel(frmMain mainWindow) - { - /* Set widgets depending on the opt string in field */ - String thisOpt; // The separated option such as "bframes=3" - String optName; // The option name such as "bframes" - String optValue;// The option value such as "3" - String[] currentOptsArray; - - //Set currentOptString to the contents of the text box. - String currentOptString = mainWindow.rtf_x264Query.Text.Replace("\n", ""); - - /*verify there is an opt string to process */ - if (currentOptString.Contains("=")) - { - /*Put individual options into an array based on the ":" separator for processing, result is "="*/ - currentOptsArray = currentOptString.Split(':'); - - /*iterate through the array and get and and - /// Iterate over every x264 option, standardize it, write the full string to the x264 rtf box - /// - public void X264_StandardizeOptString(frmMain mainWindow) - { - /* Set widgets depending on the opt string in field */ - String thisOpt; // The separated option such as "bframes=3" - String optName; // The option name such as "bframes" - String optValue;// The option value such as "3" - String changedOptString = ""; - String[] currentOptsArray; - - /*First, we get an opt string to process */ - String currentOptString = mainWindow.rtf_x264Query.Text; - - /*verify there is an opt string to process */ - if (currentOptString.Contains("=")) - { - /*Put individual options into an array based on the ":" separator for processing, result is "="*/ - currentOptsArray = currentOptString.Split(':'); - - /*iterate through the array and get and - /// This function will update the X264 Query when one of the GUI widgets changes. - /// - public void on_x264_WidgetChange(string sender, frmMain mainWindow) - { - animate(mainWindow, sender); - String optNameToChange = sender; - String currentOptString = mainWindow.rtf_x264Query.Text; - - /*First, we create a pattern to check for ":"optNameToChange"=" to modify the option if the name falls after - the first character of the opt string (hence the ":") */ - String checkOptNameToChange = ":" + optNameToChange + "="; - String checkOptNameToChangeBegin = optNameToChange + "="; - - // IF the current H264 Option String Contains Multiple Items or Just 1 Item - if ((currentOptString.Contains(checkOptNameToChange)) || (currentOptString.StartsWith(checkOptNameToChangeBegin))) - hasOptions(currentOptString, optNameToChange, mainWindow); - else // IF there is no options in the rich text box! - hasNoOptions(optNameToChange, mainWindow); - } - /* - * Used by on_x264_WidgetChange() - ** hasOptions - Called when the current x264 option string contains multiple (or a single) item(s) in it seperated by : - * it updates the current option that the widget corrosponds to, if it is already in thes string. - ** hasNoOptions - Add's an option to the x264 query string. - * Handles 2 cases. 1 Where rtf_x264Query.Text is empty, and one where there is an option with no value, - * e.g no-fast-pskip - */ - private void hasOptions(string currentOptString, string optNameToChange, frmMain mainWindow) - { - String thisOpt; // The separated option such as "bframes=3" - String optName; // The option name such as "bframes" - String[] currentOptsArray; - - /* Create new empty opt string*/ - String changedOptString = ""; - - /*Put individual options into an array based on the ":" separator for processing, result is "="*/ - currentOptsArray = currentOptString.Split(':'); - - /*iterate through the array and get and = 2 && mainWindow.check_Cabac.Checked && mainWindow.slider_psytrellis.Visible == false) - { - mainWindow.slider_psytrellis.Visible = true; - mainWindow.lbl_psytrellis.Visible = true; - } - } - - if (mainWindow.drop_trellis.SelectedIndex < 2) - { - mainWindow.slider_psytrellis.Visible = false; - mainWindow.slider_psytrellis.Value = 0; - mainWindow.lbl_psytrellis.Visible = false; - } - else - { - if ((mainWindow.drop_subpixelMotionEstimation.SelectedIndex == 0 || mainWindow.drop_subpixelMotionEstimation.SelectedIndex >= 7) && mainWindow.check_Cabac.Checked && mainWindow.slider_psytrellis.Visible == false) - { - mainWindow.slider_psytrellis.Visible = true; - mainWindow.lbl_psytrellis.Visible = true; - } - } - - } - - } -} \ No newline at end of file diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs index 37407c8a..748d6387 100644 --- a/win/C#/frmPreview.cs +++ b/win/C#/frmPreview.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; using System.IO; using AxQTOControlLib; +using Handbrake.Functions; using QTOControlLib; using QTOLibrary; diff --git a/win/C#/Functions/QueryParserTester.Designer.cs b/win/C#/frmTestWindow.Designer.cs similarity index 100% rename from win/C#/Functions/QueryParserTester.Designer.cs rename to win/C#/frmTestWindow.Designer.cs diff --git a/win/C#/Functions/QueryParserTester.cs b/win/C#/frmTestWindow.cs similarity index 100% rename from win/C#/Functions/QueryParserTester.cs rename to win/C#/frmTestWindow.cs diff --git a/win/C#/Functions/QueryParserTester.resx b/win/C#/frmTestWindow.resx similarity index 100% rename from win/C#/Functions/QueryParserTester.resx rename to win/C#/frmTestWindow.resx -- 2.11.0