diff --git a/ATRACTool-Reloaded.csproj b/ATRACTool-Reloaded.csproj index b8b96c1..b4dbcc0 100644 --- a/ATRACTool-Reloaded.csproj +++ b/ATRACTool-Reloaded.csproj @@ -2,17 +2,17 @@ WinExe - net6.0-windows + net7.0-windows ATRACTool_Reloaded enable true enable - 1.27.2220.1109 - 1.27.2220.1109 + 1.28.2320.818 + 1.28.2320.818 git XyLe Open source ATRAC conversion utility - Copyright © 2022 - XyLe. All Rights Reserved. + Copyright © 2023 - XyLe. All Rights Reserved. ATRAC, ATRAC3, ATRAC9, at3, at9, Converter, GUI Properties\ATRACTool.ico diff --git a/Localizable/Localization.ja.resx b/Localizable/Localization.ja.resx index d2405f7..80e24d0 100644 --- a/Localizable/Localization.ja.resx +++ b/Localizable/Localization.ja.resx @@ -149,6 +149,15 @@ 現在のバージョン: + + 独自のスプラッシュスクリーン画像はアプリケーションを再起動すると反映されます。 + + + 画像ファイルの解像度が不正です。 +縦:800 または 400px +横:480 または 240px +上記の要件を満たしたファイル以外は設定できません。 + ATRACのデコードに失敗しました。 @@ -294,6 +303,12 @@ アプリケーションのアップデートが可能です。 GitHubリポジトリのページを開きますか? + + 保存先のパスが指定されていません。 + + + サブフォルダ名が指定されていません。 + アプリケーションの設定情報を取得中… @@ -309,6 +324,9 @@ GitHubリポジトリのページを開きますか? アップデート中... + + スプラッシュスクリーン画像のパスが指定されていません。 + {0} / {1} ファイルを変換済み diff --git a/Localizable/Localization.resx b/Localizable/Localization.resx index 6775308..8bf7bff 100644 --- a/Localizable/Localization.resx +++ b/Localizable/Localization.resx @@ -150,6 +150,15 @@ Do you want to continue? Current version: + + Unique splash screen images are reflected when the application is restarted. + + + Image size is incorrect. +Width: 800 or 400px +Height: 480 or 240px +Only files that meet the above criteria can be specified. + Failed to decode the ATRAC file. @@ -292,6 +301,12 @@ Please make appropriate settings from the menu 'Conversion Settings'. The application can be updated. Do you want to open the GitHub? + + Path not specified. + + + suffix is not specified. + Getting application configuration information... @@ -307,6 +322,9 @@ Do you want to open the GitHub? Updating... + + The path to the splash screen image is not specified. + Converting {0} of {1} files diff --git a/Localizable/localization.Designer.cs b/Localizable/localization.Designer.cs index c805f47..6769cb8 100644 --- a/Localizable/localization.Designer.cs +++ b/Localizable/localization.Designer.cs @@ -153,6 +153,27 @@ internal static string CurrentCaption { } } + /// + /// Unique splash screen images are reflected when the application is restarted. に類似しているローカライズされた文字列を検索します。 + /// + internal static string CustomSplashCaption { + get { + return ResourceManager.GetString("CustomSplashCaption", resourceCulture); + } + } + + /// + /// Image size is incorrect. + ///Width: 800 or 400px + ///Height: 480 or 240px + ///Only files that meet the above criteria can be specified. に類似しているローカライズされた文字列を検索します。 + /// + internal static string CustomSplashSizeErrorCaption { + get { + return ResourceManager.GetString("CustomSplashSizeErrorCaption", resourceCulture); + } + } + /// /// Failed to decode the ATRAC file. に類似しているローカライズされた文字列を検索します。 /// @@ -559,6 +580,24 @@ internal static string SiteOpenCaption { } } + /// + /// Path not specified. に類似しているローカライズされた文字列を検索します。 + /// + internal static string SpecificPathErrorCaption { + get { + return ResourceManager.GetString("SpecificPathErrorCaption", resourceCulture); + } + } + + /// + /// suffix is not specified. に類似しているローカライズされた文字列を検索します。 + /// + internal static string SpecificSubfolderErrorCaption { + get { + return ResourceManager.GetString("SpecificSubfolderErrorCaption", resourceCulture); + } + } + /// /// Getting application configuration information... に類似しているローカライズされた文字列を検索します。 /// @@ -604,6 +643,15 @@ internal static string SplashFormUpdatingCaption { } } + /// + /// The path to the splash screen image is not specified. に類似しているローカライズされた文字列を検索します。 + /// + internal static string SplashPathErrorCaption { + get { + return ResourceManager.GetString("SplashPathErrorCaption", resourceCulture); + } + } + /// /// Converting {0} of {1} files に類似しているローカライズされた文字列を検索します。 /// diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 220a9b5..6be5ea6 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -79,5 +79,35 @@ internal static System.Drawing.Bitmap SIE { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap SIEv2 { + get { + object obj = ResourceManager.GetObject("SIEv2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap Splash { + get { + object obj = ResourceManager.GetObject("Splash", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap Splash_SIE_Default { + get { + object obj = ResourceManager.GetObject("Splash_SIE_Default", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index a812446..36939b8 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -112,16 +112,25 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + IMG_1540.JPG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a SIE.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + SIEv2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Splash_SIE_Default.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Properties/SIEv2.png b/Properties/SIEv2.png new file mode 100644 index 0000000..0e049bf Binary files /dev/null and b/Properties/SIEv2.png differ diff --git a/Properties/Splash.png b/Properties/Splash.png new file mode 100644 index 0000000..3c78a49 Binary files /dev/null and b/Properties/Splash.png differ diff --git a/Properties/Splash_SIE_Default.png b/Properties/Splash_SIE_Default.png new file mode 100644 index 0000000..354a003 Binary files /dev/null and b/Properties/Splash_SIE_Default.png differ diff --git a/VERSIONINFO b/VERSIONINFO index b90aa83..7ee27ca 100644 --- a/VERSIONINFO +++ b/VERSIONINFO @@ -1 +1 @@ -version:1.27.2220.1109 \ No newline at end of file +version:1.28.2320.818 \ No newline at end of file diff --git a/src/Common.cs b/src/Common.cs index a0359ea..a8df6d5 100644 --- a/src/Common.cs +++ b/src/Common.cs @@ -70,6 +70,7 @@ public class Generic public static string EncodeParamAT9 = ""; public static StreamReader Log = null!; + public static Exception GlobalException = null!; /// /// ダウンロード機能用変数 @@ -416,6 +417,42 @@ public static void InitConfig() { Config.Entry["ATRAC9_Params"].Value = "at9tool -e -br 168 -fs 48000 $InFile $OutFile"; } + + // 設定ダイアログ + + if (Config.Entry["Check_Update"].Value == null) // アップデートを確認 (bool) + { + Config.Entry["Check_Update"].Value = "true"; + } + if (Config.Entry["SplashImage"].Value == null) // スプラッシュスクリーン画像 (bool) + { + Config.Entry["SplashImage"].Value = "false"; + } + if (Config.Entry["SplashImage_Path"].Value == null) // スプラッシュスクリーン画像パス (string) + { + Config.Entry["SplashImage_Path"].Value = ""; + } + if (Config.Entry["Oldmode"].Value == null) // 従来のモード (bool) + { + Config.Entry["Oldmode"].Value = "false"; + } + if (Config.Entry["HideSplash"].Value == null) // スプラッシュスクリーンを無効化 (bool) + { + Config.Entry["HideSplash"].Value = "false"; + } + if (Config.Entry["FasterATRAC"].Value == null) // ATRAC即時変換 (bool) + { + Config.Entry["FasterATRAC"].Value = "false"; + } + if (Config.Entry["FixedConvert"].Value == null) // 形式固定 (bool) + { + Config.Entry["FixedConvert"].Value = "false"; + } + if (Config.Entry["ConvertType"].Value == null) // 形式固定有効化時の形式 (int) + { + Config.Entry["ConvertType"].Value = ""; + } + if (Config.Entry["Save_IsManual"].Value == null) // ファイル保存方法 (bool) { Config.Entry["Save_IsManual"].Value = "false"; diff --git a/src/Forms/FormLPC.Designer.cs b/src/Forms/FormLPC.Designer.cs index bcffe3f..902f3a1 100644 --- a/src/Forms/FormLPC.Designer.cs +++ b/src/Forms/FormLPC.Designer.cs @@ -28,262 +28,263 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormLPC)); - this.trackBar_trk = new System.Windows.Forms.TrackBar(); - this.button_Play = new System.Windows.Forms.Button(); - this.button_Stop = new System.Windows.Forms.Button(); - this.button_OK = new System.Windows.Forms.Button(); - this.button_Cancel = new System.Windows.Forms.Button(); - this.label_Samples = new System.Windows.Forms.Label(); - this.timer_Reload = new System.Windows.Forms.Timer(this.components); - this.label_Length = new System.Windows.Forms.Label(); - this.trackBar_Start = new System.Windows.Forms.TrackBar(); - this.trackBar_End = new System.Windows.Forms.TrackBar(); - this.label_LoopStartSamples = new System.Windows.Forms.Label(); - this.label_LoopEndSamples = new System.Windows.Forms.Label(); - this.button_SetStart = new System.Windows.Forms.Button(); - this.button_SetEnd = new System.Windows.Forms.Button(); - this.numericUpDown_LoopStart = new System.Windows.Forms.NumericUpDown(); - this.numericUpDown_LoopEnd = new System.Windows.Forms.NumericUpDown(); - this.checkBox_LoopEnable = new System.Windows.Forms.CheckBox(); - this.radioButton_at3 = new System.Windows.Forms.RadioButton(); - this.radioButton_at9 = new System.Windows.Forms.RadioButton(); - this.label_File = new System.Windows.Forms.Label(); - this.button_Prev = new System.Windows.Forms.Button(); - this.button_Next = new System.Windows.Forms.Button(); - this.label_Psamples = new System.Windows.Forms.Label(); - this.label_Plength = new System.Windows.Forms.Label(); - this.volumeSlider1 = new NAudio.Gui.VolumeSlider(); - this.label_Volume = new System.Windows.Forms.Label(); - this.button_LS_Current = new System.Windows.Forms.Button(); - this.button_LE_Current = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_trk)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_Start)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_End)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_LoopStart)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_LoopEnd)).BeginInit(); - this.SuspendLayout(); + trackBar_trk = new TrackBar(); + button_Play = new Button(); + button_Stop = new Button(); + button_OK = new Button(); + button_Cancel = new Button(); + label_Samples = new Label(); + timer_Reload = new System.Windows.Forms.Timer(components); + label_Length = new Label(); + trackBar_Start = new TrackBar(); + trackBar_End = new TrackBar(); + label_LoopStartSamples = new Label(); + label_LoopEndSamples = new Label(); + button_SetStart = new Button(); + button_SetEnd = new Button(); + numericUpDown_LoopStart = new NumericUpDown(); + numericUpDown_LoopEnd = new NumericUpDown(); + checkBox_LoopEnable = new CheckBox(); + radioButton_at3 = new RadioButton(); + radioButton_at9 = new RadioButton(); + label_File = new Label(); + button_Prev = new Button(); + button_Next = new Button(); + label_Psamples = new Label(); + label_Plength = new Label(); + volumeSlider1 = new NAudio.Gui.VolumeSlider(); + label_Volume = new Label(); + button_LS_Current = new Button(); + button_LE_Current = new Button(); + ((System.ComponentModel.ISupportInitialize)trackBar_trk).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackBar_Start).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackBar_End).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown_LoopStart).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown_LoopEnd).BeginInit(); + SuspendLayout(); // // trackBar_trk // - resources.ApplyResources(this.trackBar_trk, "trackBar_trk"); - this.trackBar_trk.Name = "trackBar_trk"; - this.trackBar_trk.TickStyle = System.Windows.Forms.TickStyle.Both; + resources.ApplyResources(trackBar_trk, "trackBar_trk"); + trackBar_trk.Name = "trackBar_trk"; + trackBar_trk.TickStyle = TickStyle.Both; // // button_Play // - resources.ApplyResources(this.button_Play, "button_Play"); - this.button_Play.Name = "button_Play"; - this.button_Play.UseVisualStyleBackColor = true; - this.button_Play.Click += new System.EventHandler(this.Button_Play_Click); + resources.ApplyResources(button_Play, "button_Play"); + button_Play.Name = "button_Play"; + button_Play.UseVisualStyleBackColor = true; + button_Play.Click += Button_Play_Click; // // button_Stop // - resources.ApplyResources(this.button_Stop, "button_Stop"); - this.button_Stop.Name = "button_Stop"; - this.button_Stop.UseVisualStyleBackColor = true; - this.button_Stop.Click += new System.EventHandler(this.Button_Stop_Click); + resources.ApplyResources(button_Stop, "button_Stop"); + button_Stop.Name = "button_Stop"; + button_Stop.UseVisualStyleBackColor = true; + button_Stop.Click += Button_Stop_Click; // // button_OK // - resources.ApplyResources(this.button_OK, "button_OK"); - this.button_OK.Name = "button_OK"; - this.button_OK.UseVisualStyleBackColor = true; - this.button_OK.Click += new System.EventHandler(this.Button_OK_Click); + resources.ApplyResources(button_OK, "button_OK"); + button_OK.Name = "button_OK"; + button_OK.UseVisualStyleBackColor = true; + button_OK.Click += Button_OK_Click; // // button_Cancel // - resources.ApplyResources(this.button_Cancel, "button_Cancel"); - this.button_Cancel.Name = "button_Cancel"; - this.button_Cancel.UseVisualStyleBackColor = true; - this.button_Cancel.Click += new System.EventHandler(this.Button_Cancel_Click); + resources.ApplyResources(button_Cancel, "button_Cancel"); + button_Cancel.Name = "button_Cancel"; + button_Cancel.UseVisualStyleBackColor = true; + button_Cancel.Click += Button_Cancel_Click; // // label_Samples // - resources.ApplyResources(this.label_Samples, "label_Samples"); - this.label_Samples.Name = "label_Samples"; + resources.ApplyResources(label_Samples, "label_Samples"); + label_Samples.Name = "label_Samples"; // // timer_Reload // - this.timer_Reload.Tick += new System.EventHandler(this.Timer_Reload_Tick); + timer_Reload.Tick += Timer_Reload_Tick; // // label_Length // - resources.ApplyResources(this.label_Length, "label_Length"); - this.label_Length.Name = "label_Length"; + resources.ApplyResources(label_Length, "label_Length"); + label_Length.Name = "label_Length"; // // trackBar_Start // - resources.ApplyResources(this.trackBar_Start, "trackBar_Start"); - this.trackBar_Start.Name = "trackBar_Start"; - this.trackBar_Start.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + resources.ApplyResources(trackBar_Start, "trackBar_Start"); + trackBar_Start.Name = "trackBar_Start"; + trackBar_Start.TickStyle = TickStyle.TopLeft; // // trackBar_End // - resources.ApplyResources(this.trackBar_End, "trackBar_End"); - this.trackBar_End.Name = "trackBar_End"; + resources.ApplyResources(trackBar_End, "trackBar_End"); + trackBar_End.Name = "trackBar_End"; // // label_LoopStartSamples // - resources.ApplyResources(this.label_LoopStartSamples, "label_LoopStartSamples"); - this.label_LoopStartSamples.Name = "label_LoopStartSamples"; + resources.ApplyResources(label_LoopStartSamples, "label_LoopStartSamples"); + label_LoopStartSamples.Name = "label_LoopStartSamples"; // // label_LoopEndSamples // - resources.ApplyResources(this.label_LoopEndSamples, "label_LoopEndSamples"); - this.label_LoopEndSamples.Name = "label_LoopEndSamples"; + resources.ApplyResources(label_LoopEndSamples, "label_LoopEndSamples"); + label_LoopEndSamples.Name = "label_LoopEndSamples"; // // button_SetStart // - resources.ApplyResources(this.button_SetStart, "button_SetStart"); - this.button_SetStart.Name = "button_SetStart"; - this.button_SetStart.UseVisualStyleBackColor = true; - this.button_SetStart.Click += new System.EventHandler(this.Button_SetStart_Click); + resources.ApplyResources(button_SetStart, "button_SetStart"); + button_SetStart.Name = "button_SetStart"; + button_SetStart.UseVisualStyleBackColor = true; + button_SetStart.Click += Button_SetStart_Click; // // button_SetEnd // - resources.ApplyResources(this.button_SetEnd, "button_SetEnd"); - this.button_SetEnd.Name = "button_SetEnd"; - this.button_SetEnd.UseVisualStyleBackColor = true; - this.button_SetEnd.Click += new System.EventHandler(this.Button_SetEnd_Click); + resources.ApplyResources(button_SetEnd, "button_SetEnd"); + button_SetEnd.Name = "button_SetEnd"; + button_SetEnd.UseVisualStyleBackColor = true; + button_SetEnd.Click += Button_SetEnd_Click; // // numericUpDown_LoopStart // - resources.ApplyResources(this.numericUpDown_LoopStart, "numericUpDown_LoopStart"); - this.numericUpDown_LoopStart.Name = "numericUpDown_LoopStart"; - this.numericUpDown_LoopStart.ValueChanged += new System.EventHandler(this.NumericUpDown_LoopStart_ValueChanged); + resources.ApplyResources(numericUpDown_LoopStart, "numericUpDown_LoopStart"); + numericUpDown_LoopStart.Name = "numericUpDown_LoopStart"; + numericUpDown_LoopStart.ValueChanged += NumericUpDown_LoopStart_ValueChanged; // // numericUpDown_LoopEnd // - resources.ApplyResources(this.numericUpDown_LoopEnd, "numericUpDown_LoopEnd"); - this.numericUpDown_LoopEnd.Name = "numericUpDown_LoopEnd"; - this.numericUpDown_LoopEnd.ValueChanged += new System.EventHandler(this.NumericUpDown_LoopEnd_ValueChanged); + resources.ApplyResources(numericUpDown_LoopEnd, "numericUpDown_LoopEnd"); + numericUpDown_LoopEnd.Name = "numericUpDown_LoopEnd"; + numericUpDown_LoopEnd.ValueChanged += NumericUpDown_LoopEnd_ValueChanged; // // checkBox_LoopEnable // - resources.ApplyResources(this.checkBox_LoopEnable, "checkBox_LoopEnable"); - this.checkBox_LoopEnable.Name = "checkBox_LoopEnable"; - this.checkBox_LoopEnable.UseVisualStyleBackColor = true; - this.checkBox_LoopEnable.CheckedChanged += new System.EventHandler(this.CheckBox_LoopEnable_CheckedChanged); + resources.ApplyResources(checkBox_LoopEnable, "checkBox_LoopEnable"); + checkBox_LoopEnable.Name = "checkBox_LoopEnable"; + checkBox_LoopEnable.UseVisualStyleBackColor = true; + checkBox_LoopEnable.CheckedChanged += CheckBox_LoopEnable_CheckedChanged; // // radioButton_at3 // - resources.ApplyResources(this.radioButton_at3, "radioButton_at3"); - this.radioButton_at3.Checked = true; - this.radioButton_at3.Name = "radioButton_at3"; - this.radioButton_at3.TabStop = true; - this.radioButton_at3.UseVisualStyleBackColor = true; + resources.ApplyResources(radioButton_at3, "radioButton_at3"); + radioButton_at3.Checked = true; + radioButton_at3.Name = "radioButton_at3"; + radioButton_at3.TabStop = true; + radioButton_at3.UseVisualStyleBackColor = true; + radioButton_at3.CheckedChanged += radioButton_at3_CheckedChanged; // // radioButton_at9 // - resources.ApplyResources(this.radioButton_at9, "radioButton_at9"); - this.radioButton_at9.Name = "radioButton_at9"; - this.radioButton_at9.TabStop = true; - this.radioButton_at9.UseVisualStyleBackColor = true; + resources.ApplyResources(radioButton_at9, "radioButton_at9"); + radioButton_at9.Name = "radioButton_at9"; + radioButton_at9.TabStop = true; + radioButton_at9.UseVisualStyleBackColor = true; + radioButton_at9.CheckedChanged += radioButton_at9_CheckedChanged; // // label_File // - this.label_File.AutoEllipsis = true; - resources.ApplyResources(this.label_File, "label_File"); - this.label_File.Name = "label_File"; + label_File.AutoEllipsis = true; + resources.ApplyResources(label_File, "label_File"); + label_File.Name = "label_File"; // // button_Prev // - resources.ApplyResources(this.button_Prev, "button_Prev"); - this.button_Prev.Name = "button_Prev"; - this.button_Prev.UseVisualStyleBackColor = true; - this.button_Prev.Click += new System.EventHandler(this.Button_Prev_Click); + resources.ApplyResources(button_Prev, "button_Prev"); + button_Prev.Name = "button_Prev"; + button_Prev.UseVisualStyleBackColor = true; + button_Prev.Click += Button_Prev_Click; // // button_Next // - resources.ApplyResources(this.button_Next, "button_Next"); - this.button_Next.Name = "button_Next"; - this.button_Next.UseVisualStyleBackColor = true; - this.button_Next.Click += new System.EventHandler(this.Button_Next_Click); + resources.ApplyResources(button_Next, "button_Next"); + button_Next.Name = "button_Next"; + button_Next.UseVisualStyleBackColor = true; + button_Next.Click += Button_Next_Click; // // label_Psamples // - resources.ApplyResources(this.label_Psamples, "label_Psamples"); - this.label_Psamples.Name = "label_Psamples"; + resources.ApplyResources(label_Psamples, "label_Psamples"); + label_Psamples.Name = "label_Psamples"; // // label_Plength // - resources.ApplyResources(this.label_Plength, "label_Plength"); - this.label_Plength.Name = "label_Plength"; + resources.ApplyResources(label_Plength, "label_Plength"); + label_Plength.Name = "label_Plength"; // // volumeSlider1 // - resources.ApplyResources(this.volumeSlider1, "volumeSlider1"); - this.volumeSlider1.Name = "volumeSlider1"; - this.volumeSlider1.VolumeChanged += new System.EventHandler(this.VolumeSlider1_VolumeChanged); + resources.ApplyResources(volumeSlider1, "volumeSlider1"); + volumeSlider1.Name = "volumeSlider1"; + volumeSlider1.VolumeChanged += VolumeSlider1_VolumeChanged; // // label_Volume // - resources.ApplyResources(this.label_Volume, "label_Volume"); - this.label_Volume.Name = "label_Volume"; + resources.ApplyResources(label_Volume, "label_Volume"); + label_Volume.Name = "label_Volume"; // // button_LS_Current // - resources.ApplyResources(this.button_LS_Current, "button_LS_Current"); - this.button_LS_Current.Name = "button_LS_Current"; - this.button_LS_Current.UseVisualStyleBackColor = true; - this.button_LS_Current.Click += new System.EventHandler(this.Button_LS_Current_Click); + resources.ApplyResources(button_LS_Current, "button_LS_Current"); + button_LS_Current.Name = "button_LS_Current"; + button_LS_Current.UseVisualStyleBackColor = true; + button_LS_Current.Click += Button_LS_Current_Click; // // button_LE_Current // - resources.ApplyResources(this.button_LE_Current, "button_LE_Current"); - this.button_LE_Current.Name = "button_LE_Current"; - this.button_LE_Current.UseVisualStyleBackColor = true; - this.button_LE_Current.Click += new System.EventHandler(this.Button_LE_Current_Click); + resources.ApplyResources(button_LE_Current, "button_LE_Current"); + button_LE_Current.Name = "button_LE_Current"; + button_LE_Current.UseVisualStyleBackColor = true; + button_LE_Current.Click += Button_LE_Current_Click; // // FormLPC // - this.AcceptButton = this.button_OK; + AcceptButton = button_OK; resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.button_Cancel; - this.ControlBox = false; - this.Controls.Add(this.button_LE_Current); - this.Controls.Add(this.button_LS_Current); - this.Controls.Add(this.label_Volume); - this.Controls.Add(this.volumeSlider1); - this.Controls.Add(this.label_Plength); - this.Controls.Add(this.label_Psamples); - this.Controls.Add(this.button_Next); - this.Controls.Add(this.button_Prev); - this.Controls.Add(this.label_File); - this.Controls.Add(this.radioButton_at9); - this.Controls.Add(this.radioButton_at3); - this.Controls.Add(this.checkBox_LoopEnable); - this.Controls.Add(this.numericUpDown_LoopEnd); - this.Controls.Add(this.numericUpDown_LoopStart); - this.Controls.Add(this.trackBar_End); - this.Controls.Add(this.button_SetEnd); - this.Controls.Add(this.button_SetStart); - this.Controls.Add(this.label_LoopEndSamples); - this.Controls.Add(this.label_LoopStartSamples); - this.Controls.Add(this.trackBar_trk); - this.Controls.Add(this.label_Length); - this.Controls.Add(this.label_Samples); - this.Controls.Add(this.button_Cancel); - this.Controls.Add(this.button_OK); - this.Controls.Add(this.button_Stop); - this.Controls.Add(this.button_Play); - this.Controls.Add(this.trackBar_Start); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Name = "FormLPC"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormLPC_FormClosed); - this.Load += new System.EventHandler(this.FormLPC_Load); - this.Paint += new System.Windows.Forms.PaintEventHandler(this.FormLPC_Paint); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_trk)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_Start)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar_End)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_LoopStart)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_LoopEnd)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleMode = AutoScaleMode.Font; + CancelButton = button_Cancel; + ControlBox = false; + Controls.Add(button_LE_Current); + Controls.Add(button_LS_Current); + Controls.Add(label_Volume); + Controls.Add(volumeSlider1); + Controls.Add(label_Plength); + Controls.Add(label_Psamples); + Controls.Add(button_Next); + Controls.Add(button_Prev); + Controls.Add(label_File); + Controls.Add(radioButton_at9); + Controls.Add(radioButton_at3); + Controls.Add(checkBox_LoopEnable); + Controls.Add(numericUpDown_LoopEnd); + Controls.Add(numericUpDown_LoopStart); + Controls.Add(trackBar_End); + Controls.Add(button_SetEnd); + Controls.Add(button_SetStart); + Controls.Add(label_LoopEndSamples); + Controls.Add(label_LoopStartSamples); + Controls.Add(trackBar_trk); + Controls.Add(label_Length); + Controls.Add(label_Samples); + Controls.Add(button_Cancel); + Controls.Add(button_OK); + Controls.Add(button_Stop); + Controls.Add(button_Play); + Controls.Add(trackBar_Start); + FormBorderStyle = FormBorderStyle.FixedSingle; + Name = "FormLPC"; + FormClosed += FormLPC_FormClosed; + Load += FormLPC_Load; + Paint += FormLPC_Paint; + ((System.ComponentModel.ISupportInitialize)trackBar_trk).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackBar_Start).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackBar_End).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown_LoopStart).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown_LoopEnd).EndInit(); + ResumeLayout(false); + PerformLayout(); } #endregion diff --git a/src/Forms/FormLPC.cs b/src/Forms/FormLPC.cs index 5e27c15..7e8d9cc 100644 --- a/src/Forms/FormLPC.cs +++ b/src/Forms/FormLPC.cs @@ -3,6 +3,7 @@ using System.Text; using static ATRACTool_Reloaded.Common; using NAudio.Wave.SampleProviders; +using System.Diagnostics; namespace ATRACTool_Reloaded { @@ -10,17 +11,27 @@ public partial class FormLPC : Form { private readonly WaveIn wi = new(); private readonly WaveOut wo = new(); - private NotifyingSampleProvider osp = null!; - private AudioFileReader reader = null!; + private ISampleProvider isp = null!; + WaveFileReader reader; + //private AudioFileReader reader = null!; long Sample, Start = 0, End = 0; + float[] SampleF_L, SampleF_R; int bytePerSec, position, length, btnpos; TimeSpan time; bool mouseDown = false; - public FormLPC() + public FormLPC(bool IsEnabledBtn) { InitializeComponent(); + if (!IsEnabledBtn) + { + FormBorderStyle = FormBorderStyle.None; + button_OK.Enabled = false; + button_OK.Visible = false; + button_Cancel.Enabled = false; + button_Cancel.Visible = false; + } trackBar_trk.Scroll += TrackBar_trk_Scroll; trackBar_Start.Scroll += TrackBar_Start_Scroll; trackBar_End.Scroll += TrackBar_End_Scroll; @@ -68,7 +79,7 @@ private void FormLPC_Load(object sender, EventArgs e) { reader = new(Common.Generic.OpenFilePaths[0]); FileInfo fi = new(Common.Generic.OpenFilePaths[0]); - label_File.Text = fi.Name + "[ " + reader.WaveFormat.BitsPerSample + "-bit, " + reader.WaveFormat.SampleRate + "Hz ]"; + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Prev.Enabled = false; button_Next.Enabled = false; } @@ -106,13 +117,13 @@ private void FormLPC_Load(object sender, EventArgs e) { reader = new(Common.Generic.OpenFilePaths[0]); FileInfo fi = new(Common.Generic.OpenFilePaths[0]); - label_File.Text = fi.Name; + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Prev.Enabled = false; button_Next.Enabled = true; btnpos = 1; } } - + wo.Init(reader); trackBar_trk.Minimum = 0; trackBar_trk.Maximum = (int)reader.TotalTime.TotalMilliseconds; @@ -194,18 +205,79 @@ private void Timer_Reload_Tick(object sender, EventArgs e) private void Playback() { + //long rp = 0; while (wo.PlaybackState != PlaybackState.Stopped) { - + /*long FasterPos = wo.GetPosition() / wo.OutputWaveFormat.BlockAlign; + long ReaderPos = reader.Position / reader.WaveFormat.BlockAlign; + int ct = (int)reader.CurrentTime.TotalMilliseconds; + if (wo.PlaybackState == PlaybackState.Paused) + { + if (mouseDown) + { + Sample = ReaderPos; + rp = ReaderPos; + } + } + if (wo.PlaybackState == PlaybackState.Playing) + { + if (mouseDown) + { + if (ct == 0) + { + wo.Stop(); + } + Sample = ReaderPos; + rp = ReaderPos; + } + else + { + if (rp < FasterPos) + { + Sample = FasterPos - rp; + } + else if (rp > FasterPos) + { + Sample = FasterPos + rp; + } + else + { + Sample = FasterPos + rp; + } + } + }*/ position = (int)reader.Position / reader.WaveFormat.AverageBytesPerSecond; time = new(0, 0, position); - Sample = reader.Position / reader.WaveFormat.BlockAlign; + if (wo.PlaybackState == PlaybackState.Paused) + { + Sample = reader.Position / reader.WaveFormat.BlockAlign; + } + else + { + //SampleF_L = new float[reader.Length / reader.WaveFormat.BlockAlign]; + //float[] smpl = reader.ReadNextSampleFrame(); + Sample = reader.Position / reader.WaveFormat.BlockAlign; + } + + } + } + + private void SampleCalc() + { + SampleF_L = new float[reader.Length / reader.WaveFormat.BlockAlign]; + SampleF_R = new float[reader.Length / reader.WaveFormat.BlockAlign]; + + for (int i = 0; i < SampleF_L.Length; i++) + { + float[] smpl = reader.ReadNextSampleFrame(); + SampleF_L[i] = smpl[0]; + SampleF_R[i] = smpl[1]; } } private void FormLPC_Paint(object sender, PaintEventArgs e) { - + } private void Button_SetStart_Click(object sender, EventArgs e) @@ -234,19 +306,19 @@ private void Button_Prev_Click(object sender, EventArgs e) { btnpos--; FileInfo fi = new(Common.Generic.OpenFilePaths[btnpos - 1]); - label_File.Text = fi.Name; wo.Stop(); button_Play.Text = Localization.PlayCaption; reader.Position = 0; reader.Close(); button_Stop.Enabled = false; - + if (btnpos == 1) { reader = new(Common.Generic.OpenFilePaths[btnpos - 1]); wo.Init(reader); ResetAFR(); + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Prev.Enabled = false; button_Next.Enabled = true; } @@ -255,6 +327,7 @@ private void Button_Prev_Click(object sender, EventArgs e) reader = new(Common.Generic.OpenFilePaths[btnpos - 1]); wo.Init(reader); ResetAFR(); + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Prev.Enabled = true; button_Next.Enabled = true; } @@ -264,7 +337,6 @@ private void Button_Next_Click(object sender, EventArgs e) { btnpos++; FileInfo fi = new(Common.Generic.OpenFilePaths[btnpos - 1]); - label_File.Text = fi.Name; wo.Stop(); button_Play.Text = Localization.PlayCaption; @@ -277,6 +349,7 @@ private void Button_Next_Click(object sender, EventArgs e) reader = new(Common.Generic.OpenFilePaths[btnpos - 1]); wo.Init(reader); ResetAFR(); + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Next.Enabled = false; button_Prev.Enabled = true; } @@ -285,6 +358,7 @@ private void Button_Next_Click(object sender, EventArgs e) reader = new(Common.Generic.OpenFilePaths[btnpos - 1]); wo.Init(reader); ResetAFR(); + label_File.Text = fi.Name + " [" + reader.WaveFormat.BitsPerSample + "-bit," + reader.WaveFormat.SampleRate + "Hz]"; button_Next.Enabled = true; button_Prev.Enabled = true; } @@ -316,6 +390,25 @@ private void CheckBox_LoopEnable_CheckedChanged(object sender, EventArgs e) { if (checkBox_LoopEnable.Checked != false) { + if (radioButton_at3.Checked) + { + if (CheckLoopSoundEnabled(false)) + { + MessageBox.Show(this, "If the item to loop from the beginning to the end of the sound source is enabled in the settings screen, the loop range setting will not be reflected.", Localization.MSGBoxWarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetLoopEnable(); + return; + } + } + else if (radioButton_at9.Checked) + { + if (CheckLoopSoundEnabled(true)) + { + MessageBox.Show(this, "If the item to loop from the beginning to the end of the sound source is enabled in the settings screen, the loop range setting will not be reflected.", Localization.MSGBoxWarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetLoopEnable(); + return; + } + } + trackBar_Start.Enabled = true; trackBar_End.Enabled = true; numericUpDown_LoopStart.Enabled = true; @@ -425,5 +518,65 @@ private void ResetAFR() numericUpDown_LoopStart.Value = 0; numericUpDown_LoopEnd.Value = tb; } + + private static bool CheckLoopSoundEnabled(bool IsAT9) + { + Config.Load(Common.xmlpath); + if (IsAT9) + { + if (bool.Parse(Config.Entry["ATRAC9_LoopSound"].Value)) + { + return true; + } + else { return false; } + } + else + { + if (bool.Parse(Config.Entry["ATRAC3_LoopSound"].Value)) + { + return true; + } + else { return false; } + } + } + + private void radioButton_at3_CheckedChanged(object sender, EventArgs e) + { + if (checkBox_LoopEnable.Checked && radioButton_at3.Checked) + { + if (CheckLoopSoundEnabled(false)) + { + MessageBox.Show(this, "If the item to loop from the beginning to the end of the sound source is enabled in the settings screen, the loop range setting will not be reflected.", Localization.MSGBoxWarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetLoopEnable(); + return; + } + } + } + + private void radioButton_at9_CheckedChanged(object sender, EventArgs e) + { + if (checkBox_LoopEnable.Checked && radioButton_at9.Checked) + { + if (CheckLoopSoundEnabled(true)) + { + MessageBox.Show(this, "If the item to loop from the beginning to the end of the sound source is enabled in the settings screen, the loop range setting will not be reflected.", Localization.MSGBoxWarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetLoopEnable(); + return; + } + } + } + + private void ResetLoopEnable() + { + checkBox_LoopEnable.Checked = false; + trackBar_Start.Enabled = false; + trackBar_End.Enabled = false; + numericUpDown_LoopStart.Enabled = false; + numericUpDown_LoopEnd.Enabled = false; + button_LS_Current.Enabled = false; + button_LE_Current.Enabled = false; + button_SetStart.Enabled = false; + button_SetEnd.Enabled = false; + } } } diff --git a/src/Forms/FormLPC.resx b/src/Forms/FormLPC.resx index a231dea..07900bc 100644 --- a/src/Forms/FormLPC.resx +++ b/src/Forms/FormLPC.resx @@ -1,4 +1,64 @@ - + + + diff --git a/src/Forms/FormMain.Designer.cs b/src/Forms/FormMain.Designer.cs index 653b50c..958b91d 100644 --- a/src/Forms/FormMain.Designer.cs +++ b/src/Forms/FormMain.Designer.cs @@ -29,295 +29,291 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.label_Sizetxt = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label_Formattxt = new System.Windows.Forms.Label(); - this.label_Filepath = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label_NotReaded = new System.Windows.Forms.Label(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openFileOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeFileCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitXToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.settingsSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.convertSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveMethodSettingsMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.convertAudioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.audioToWAVEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.wAVEToAudioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.loopPointCreationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpHToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutATRACToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.checkForUpdatesUToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.button_Decode = new System.Windows.Forms.Button(); - this.button_Encode = new System.Windows.Forms.Button(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel_Status = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripDropDownButton_EF = new System.Windows.Forms.ToolStripDropDownButton(); - this.aTRAC3ATRAC3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aTRAC9ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.groupBox1.SuspendLayout(); - this.menuStrip1.SuspendLayout(); - this.statusStrip1.SuspendLayout(); - this.SuspendLayout(); + groupBox1 = new GroupBox(); + label_Sizetxt = new Label(); + label4 = new Label(); + label_Formattxt = new Label(); + label_Filepath = new Label(); + label3 = new Label(); + label2 = new Label(); + label_NotReaded = new Label(); + menuStrip1 = new MenuStrip(); + fileFToolStripMenuItem = new ToolStripMenuItem(); + openFileOToolStripMenuItem = new ToolStripMenuItem(); + closeFileCToolStripMenuItem = new ToolStripMenuItem(); + toolStripMenuItem1 = new ToolStripSeparator(); + exitXToolStripMenuItem = new ToolStripMenuItem(); + settingsSToolStripMenuItem = new ToolStripMenuItem(); + convertSettingsToolStripMenuItem = new ToolStripMenuItem(); + saveMethodSettingsMToolStripMenuItem = new ToolStripMenuItem(); + toolsTToolStripMenuItem = new ToolStripMenuItem(); + convertAudioToolStripMenuItem = new ToolStripMenuItem(); + audioToWAVEToolStripMenuItem = new ToolStripMenuItem(); + wAVEToAudioToolStripMenuItem = new ToolStripMenuItem(); + loopPointCreationToolStripMenuItem = new ToolStripMenuItem(); + helpHToolStripMenuItem = new ToolStripMenuItem(); + aboutATRACToolToolStripMenuItem = new ToolStripMenuItem(); + toolStripMenuItem2 = new ToolStripSeparator(); + checkForUpdatesUToolStripMenuItem = new ToolStripMenuItem(); + button_Decode = new Button(); + button_Encode = new Button(); + statusStrip1 = new StatusStrip(); + toolStripStatusLabel_Status = new ToolStripStatusLabel(); + toolStripDropDownButton_EF = new ToolStripDropDownButton(); + aTRAC3ATRAC3ToolStripMenuItem = new ToolStripMenuItem(); + aTRAC9ToolStripMenuItem = new ToolStripMenuItem(); + panel_Control = new Panel(); + panel_Main = new Panel(); + groupBox1.SuspendLayout(); + menuStrip1.SuspendLayout(); + statusStrip1.SuspendLayout(); + panel_Control.SuspendLayout(); + panel_Main.SuspendLayout(); + SuspendLayout(); // // groupBox1 // - this.groupBox1.Controls.Add(this.label_Sizetxt); - this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Controls.Add(this.label_Formattxt); - this.groupBox1.Controls.Add(this.label_Filepath); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.label2); - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; + resources.ApplyResources(groupBox1, "groupBox1"); + groupBox1.Controls.Add(label_Sizetxt); + groupBox1.Controls.Add(label4); + groupBox1.Controls.Add(label_Formattxt); + groupBox1.Controls.Add(label_Filepath); + groupBox1.Controls.Add(label3); + groupBox1.Controls.Add(label2); + groupBox1.Name = "groupBox1"; + groupBox1.TabStop = false; // // label_Sizetxt // - resources.ApplyResources(this.label_Sizetxt, "label_Sizetxt"); - this.label_Sizetxt.Name = "label_Sizetxt"; + resources.ApplyResources(label_Sizetxt, "label_Sizetxt"); + label_Sizetxt.Name = "label_Sizetxt"; // // label4 // - resources.ApplyResources(this.label4, "label4"); - this.label4.Name = "label4"; + resources.ApplyResources(label4, "label4"); + label4.Name = "label4"; // // label_Formattxt // - resources.ApplyResources(this.label_Formattxt, "label_Formattxt"); - this.label_Formattxt.Name = "label_Formattxt"; + resources.ApplyResources(label_Formattxt, "label_Formattxt"); + label_Formattxt.Name = "label_Formattxt"; // // label_Filepath // - this.label_Filepath.AutoEllipsis = true; - resources.ApplyResources(this.label_Filepath, "label_Filepath"); - this.label_Filepath.Name = "label_Filepath"; + resources.ApplyResources(label_Filepath, "label_Filepath"); + label_Filepath.AutoEllipsis = true; + label_Filepath.Name = "label_Filepath"; // // label3 // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; + resources.ApplyResources(label3, "label3"); + label3.Name = "label3"; // // label2 // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; + resources.ApplyResources(label2, "label2"); + label2.Name = "label2"; // // label_NotReaded // - resources.ApplyResources(this.label_NotReaded, "label_NotReaded"); - this.label_NotReaded.Name = "label_NotReaded"; + resources.ApplyResources(label_NotReaded, "label_NotReaded"); + label_NotReaded.Name = "label_NotReaded"; // // menuStrip1 // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileFToolStripMenuItem, - this.settingsSToolStripMenuItem, - this.toolsTToolStripMenuItem, - this.helpHToolStripMenuItem}); - resources.ApplyResources(this.menuStrip1, "menuStrip1"); - this.menuStrip1.Name = "menuStrip1"; + resources.ApplyResources(menuStrip1, "menuStrip1"); + menuStrip1.Items.AddRange(new ToolStripItem[] { fileFToolStripMenuItem, settingsSToolStripMenuItem, toolsTToolStripMenuItem, helpHToolStripMenuItem }); + menuStrip1.Name = "menuStrip1"; // // fileFToolStripMenuItem // - this.fileFToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openFileOToolStripMenuItem, - this.closeFileCToolStripMenuItem, - this.toolStripMenuItem1, - this.exitXToolStripMenuItem}); - this.fileFToolStripMenuItem.Name = "fileFToolStripMenuItem"; - resources.ApplyResources(this.fileFToolStripMenuItem, "fileFToolStripMenuItem"); + resources.ApplyResources(fileFToolStripMenuItem, "fileFToolStripMenuItem"); + fileFToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { openFileOToolStripMenuItem, closeFileCToolStripMenuItem, toolStripMenuItem1, exitXToolStripMenuItem }); + fileFToolStripMenuItem.Name = "fileFToolStripMenuItem"; // // openFileOToolStripMenuItem // - this.openFileOToolStripMenuItem.Name = "openFileOToolStripMenuItem"; - resources.ApplyResources(this.openFileOToolStripMenuItem, "openFileOToolStripMenuItem"); - this.openFileOToolStripMenuItem.Click += new System.EventHandler(this.OpenFileOToolStripMenuItem_Click); + resources.ApplyResources(openFileOToolStripMenuItem, "openFileOToolStripMenuItem"); + openFileOToolStripMenuItem.Name = "openFileOToolStripMenuItem"; + openFileOToolStripMenuItem.Click += OpenFileOToolStripMenuItem_Click; // // closeFileCToolStripMenuItem // - this.closeFileCToolStripMenuItem.Name = "closeFileCToolStripMenuItem"; - resources.ApplyResources(this.closeFileCToolStripMenuItem, "closeFileCToolStripMenuItem"); - this.closeFileCToolStripMenuItem.Click += new System.EventHandler(this.CloseFileCToolStripMenuItem_Click); + resources.ApplyResources(closeFileCToolStripMenuItem, "closeFileCToolStripMenuItem"); + closeFileCToolStripMenuItem.Name = "closeFileCToolStripMenuItem"; + closeFileCToolStripMenuItem.Click += CloseFileCToolStripMenuItem_Click; // // toolStripMenuItem1 // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); + resources.ApplyResources(toolStripMenuItem1, "toolStripMenuItem1"); + toolStripMenuItem1.Name = "toolStripMenuItem1"; // // exitXToolStripMenuItem // - this.exitXToolStripMenuItem.Name = "exitXToolStripMenuItem"; - resources.ApplyResources(this.exitXToolStripMenuItem, "exitXToolStripMenuItem"); - this.exitXToolStripMenuItem.Click += new System.EventHandler(this.ExitXToolStripMenuItem_Click); + resources.ApplyResources(exitXToolStripMenuItem, "exitXToolStripMenuItem"); + exitXToolStripMenuItem.Name = "exitXToolStripMenuItem"; + exitXToolStripMenuItem.Click += ExitXToolStripMenuItem_Click; // // settingsSToolStripMenuItem // - this.settingsSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.convertSettingsToolStripMenuItem, - this.saveMethodSettingsMToolStripMenuItem}); - this.settingsSToolStripMenuItem.Name = "settingsSToolStripMenuItem"; - resources.ApplyResources(this.settingsSToolStripMenuItem, "settingsSToolStripMenuItem"); + resources.ApplyResources(settingsSToolStripMenuItem, "settingsSToolStripMenuItem"); + settingsSToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { convertSettingsToolStripMenuItem, saveMethodSettingsMToolStripMenuItem }); + settingsSToolStripMenuItem.Name = "settingsSToolStripMenuItem"; // // convertSettingsToolStripMenuItem // - this.convertSettingsToolStripMenuItem.Name = "convertSettingsToolStripMenuItem"; - resources.ApplyResources(this.convertSettingsToolStripMenuItem, "convertSettingsToolStripMenuItem"); - this.convertSettingsToolStripMenuItem.Click += new System.EventHandler(this.ConvertSettingsToolStripMenuItem_Click); + resources.ApplyResources(convertSettingsToolStripMenuItem, "convertSettingsToolStripMenuItem"); + convertSettingsToolStripMenuItem.Name = "convertSettingsToolStripMenuItem"; + convertSettingsToolStripMenuItem.Click += ConvertSettingsToolStripMenuItem_Click; // // saveMethodSettingsMToolStripMenuItem // - this.saveMethodSettingsMToolStripMenuItem.Name = "saveMethodSettingsMToolStripMenuItem"; - resources.ApplyResources(this.saveMethodSettingsMToolStripMenuItem, "saveMethodSettingsMToolStripMenuItem"); - this.saveMethodSettingsMToolStripMenuItem.Click += new System.EventHandler(this.PreferencesMToolStripMenuItem_Click); + resources.ApplyResources(saveMethodSettingsMToolStripMenuItem, "saveMethodSettingsMToolStripMenuItem"); + saveMethodSettingsMToolStripMenuItem.Name = "saveMethodSettingsMToolStripMenuItem"; + saveMethodSettingsMToolStripMenuItem.Click += PreferencesMToolStripMenuItem_Click; // // toolsTToolStripMenuItem // - this.toolsTToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.convertAudioToolStripMenuItem, - this.loopPointCreationToolStripMenuItem}); - this.toolsTToolStripMenuItem.Name = "toolsTToolStripMenuItem"; - resources.ApplyResources(this.toolsTToolStripMenuItem, "toolsTToolStripMenuItem"); + resources.ApplyResources(toolsTToolStripMenuItem, "toolsTToolStripMenuItem"); + toolsTToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { convertAudioToolStripMenuItem, loopPointCreationToolStripMenuItem }); + toolsTToolStripMenuItem.Name = "toolsTToolStripMenuItem"; // // convertAudioToolStripMenuItem // - this.convertAudioToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.audioToWAVEToolStripMenuItem, - this.wAVEToAudioToolStripMenuItem}); - this.convertAudioToolStripMenuItem.Name = "convertAudioToolStripMenuItem"; - resources.ApplyResources(this.convertAudioToolStripMenuItem, "convertAudioToolStripMenuItem"); - this.convertAudioToolStripMenuItem.Click += new System.EventHandler(this.ConvertAudioToolStripMenuItem_Click); + resources.ApplyResources(convertAudioToolStripMenuItem, "convertAudioToolStripMenuItem"); + convertAudioToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { audioToWAVEToolStripMenuItem, wAVEToAudioToolStripMenuItem }); + convertAudioToolStripMenuItem.Name = "convertAudioToolStripMenuItem"; + convertAudioToolStripMenuItem.Click += ConvertAudioToolStripMenuItem_Click; // // audioToWAVEToolStripMenuItem // - this.audioToWAVEToolStripMenuItem.Name = "audioToWAVEToolStripMenuItem"; - resources.ApplyResources(this.audioToWAVEToolStripMenuItem, "audioToWAVEToolStripMenuItem"); - this.audioToWAVEToolStripMenuItem.Click += new System.EventHandler(this.AudioToWAVEToolStripMenuItem_Click); + resources.ApplyResources(audioToWAVEToolStripMenuItem, "audioToWAVEToolStripMenuItem"); + audioToWAVEToolStripMenuItem.Name = "audioToWAVEToolStripMenuItem"; + audioToWAVEToolStripMenuItem.Click += AudioToWAVEToolStripMenuItem_Click; // // wAVEToAudioToolStripMenuItem // - this.wAVEToAudioToolStripMenuItem.Name = "wAVEToAudioToolStripMenuItem"; - resources.ApplyResources(this.wAVEToAudioToolStripMenuItem, "wAVEToAudioToolStripMenuItem"); - this.wAVEToAudioToolStripMenuItem.Click += new System.EventHandler(this.WAVEToAudioToolStripMenuItem_Click); + resources.ApplyResources(wAVEToAudioToolStripMenuItem, "wAVEToAudioToolStripMenuItem"); + wAVEToAudioToolStripMenuItem.Name = "wAVEToAudioToolStripMenuItem"; + wAVEToAudioToolStripMenuItem.Click += WAVEToAudioToolStripMenuItem_Click; // // loopPointCreationToolStripMenuItem // - this.loopPointCreationToolStripMenuItem.Name = "loopPointCreationToolStripMenuItem"; - resources.ApplyResources(this.loopPointCreationToolStripMenuItem, "loopPointCreationToolStripMenuItem"); - this.loopPointCreationToolStripMenuItem.Click += new System.EventHandler(this.LoopPointCreationToolStripMenuItem_Click); + resources.ApplyResources(loopPointCreationToolStripMenuItem, "loopPointCreationToolStripMenuItem"); + loopPointCreationToolStripMenuItem.Name = "loopPointCreationToolStripMenuItem"; + loopPointCreationToolStripMenuItem.Click += LoopPointCreationToolStripMenuItem_Click; // // helpHToolStripMenuItem // - this.helpHToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.helpHToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aboutATRACToolToolStripMenuItem, - this.toolStripMenuItem2, - this.checkForUpdatesUToolStripMenuItem}); - this.helpHToolStripMenuItem.Name = "helpHToolStripMenuItem"; - resources.ApplyResources(this.helpHToolStripMenuItem, "helpHToolStripMenuItem"); + resources.ApplyResources(helpHToolStripMenuItem, "helpHToolStripMenuItem"); + helpHToolStripMenuItem.Alignment = ToolStripItemAlignment.Right; + helpHToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { aboutATRACToolToolStripMenuItem, toolStripMenuItem2, checkForUpdatesUToolStripMenuItem }); + helpHToolStripMenuItem.Name = "helpHToolStripMenuItem"; // // aboutATRACToolToolStripMenuItem // - this.aboutATRACToolToolStripMenuItem.Name = "aboutATRACToolToolStripMenuItem"; - resources.ApplyResources(this.aboutATRACToolToolStripMenuItem, "aboutATRACToolToolStripMenuItem"); - this.aboutATRACToolToolStripMenuItem.Click += new System.EventHandler(this.AboutATRACToolToolStripMenuItem_Click); + resources.ApplyResources(aboutATRACToolToolStripMenuItem, "aboutATRACToolToolStripMenuItem"); + aboutATRACToolToolStripMenuItem.Name = "aboutATRACToolToolStripMenuItem"; + aboutATRACToolToolStripMenuItem.Click += AboutATRACToolToolStripMenuItem_Click; // // toolStripMenuItem2 // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - resources.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2"); + resources.ApplyResources(toolStripMenuItem2, "toolStripMenuItem2"); + toolStripMenuItem2.Name = "toolStripMenuItem2"; // // checkForUpdatesUToolStripMenuItem // - this.checkForUpdatesUToolStripMenuItem.Name = "checkForUpdatesUToolStripMenuItem"; - resources.ApplyResources(this.checkForUpdatesUToolStripMenuItem, "checkForUpdatesUToolStripMenuItem"); - this.checkForUpdatesUToolStripMenuItem.Click += new System.EventHandler(this.CheckForUpdatesUToolStripMenuItem_Click); + resources.ApplyResources(checkForUpdatesUToolStripMenuItem, "checkForUpdatesUToolStripMenuItem"); + checkForUpdatesUToolStripMenuItem.Name = "checkForUpdatesUToolStripMenuItem"; + checkForUpdatesUToolStripMenuItem.Click += CheckForUpdatesUToolStripMenuItem_Click; // // button_Decode // - resources.ApplyResources(this.button_Decode, "button_Decode"); - this.button_Decode.Name = "button_Decode"; - this.button_Decode.UseVisualStyleBackColor = true; - this.button_Decode.Click += new System.EventHandler(this.Button_Decode_Click); + resources.ApplyResources(button_Decode, "button_Decode"); + button_Decode.Name = "button_Decode"; + button_Decode.UseVisualStyleBackColor = true; + button_Decode.Click += Button_Decode_Click; // // button_Encode // - resources.ApplyResources(this.button_Encode, "button_Encode"); - this.button_Encode.Name = "button_Encode"; - this.button_Encode.UseVisualStyleBackColor = true; - this.button_Encode.Click += new System.EventHandler(this.Button_Encode_Click); + resources.ApplyResources(button_Encode, "button_Encode"); + button_Encode.Name = "button_Encode"; + button_Encode.UseVisualStyleBackColor = true; + button_Encode.Click += Button_Encode_Click; // // statusStrip1 // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel_Status, - this.toolStripDropDownButton_EF}); - this.statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; - resources.ApplyResources(this.statusStrip1, "statusStrip1"); - this.statusStrip1.Name = "statusStrip1"; + resources.ApplyResources(statusStrip1, "statusStrip1"); + statusStrip1.Items.AddRange(new ToolStripItem[] { toolStripStatusLabel_Status, toolStripDropDownButton_EF }); + statusStrip1.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow; + statusStrip1.Name = "statusStrip1"; // // toolStripStatusLabel_Status // - this.toolStripStatusLabel_Status.Name = "toolStripStatusLabel_Status"; - resources.ApplyResources(this.toolStripStatusLabel_Status, "toolStripStatusLabel_Status"); + resources.ApplyResources(toolStripStatusLabel_Status, "toolStripStatusLabel_Status"); + toolStripStatusLabel_Status.Name = "toolStripStatusLabel_Status"; // // toolStripDropDownButton_EF // - this.toolStripDropDownButton_EF.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripDropDownButton_EF.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton_EF.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aTRAC3ATRAC3ToolStripMenuItem, - this.aTRAC9ToolStripMenuItem}); - resources.ApplyResources(this.toolStripDropDownButton_EF, "toolStripDropDownButton_EF"); - this.toolStripDropDownButton_EF.Name = "toolStripDropDownButton_EF"; + resources.ApplyResources(toolStripDropDownButton_EF, "toolStripDropDownButton_EF"); + toolStripDropDownButton_EF.Alignment = ToolStripItemAlignment.Right; + toolStripDropDownButton_EF.DisplayStyle = ToolStripItemDisplayStyle.Text; + toolStripDropDownButton_EF.DropDownItems.AddRange(new ToolStripItem[] { aTRAC3ATRAC3ToolStripMenuItem, aTRAC9ToolStripMenuItem }); + toolStripDropDownButton_EF.Name = "toolStripDropDownButton_EF"; // // aTRAC3ATRAC3ToolStripMenuItem // - this.aTRAC3ATRAC3ToolStripMenuItem.Name = "aTRAC3ATRAC3ToolStripMenuItem"; - resources.ApplyResources(this.aTRAC3ATRAC3ToolStripMenuItem, "aTRAC3ATRAC3ToolStripMenuItem"); - this.aTRAC3ATRAC3ToolStripMenuItem.Click += new System.EventHandler(this.ATRAC3ATRAC3ToolStripMenuItem_Click); + resources.ApplyResources(aTRAC3ATRAC3ToolStripMenuItem, "aTRAC3ATRAC3ToolStripMenuItem"); + aTRAC3ATRAC3ToolStripMenuItem.Name = "aTRAC3ATRAC3ToolStripMenuItem"; + aTRAC3ATRAC3ToolStripMenuItem.Click += ATRAC3ATRAC3ToolStripMenuItem_Click; // // aTRAC9ToolStripMenuItem // - this.aTRAC9ToolStripMenuItem.Name = "aTRAC9ToolStripMenuItem"; - resources.ApplyResources(this.aTRAC9ToolStripMenuItem, "aTRAC9ToolStripMenuItem"); - this.aTRAC9ToolStripMenuItem.Click += new System.EventHandler(this.ATRAC9ToolStripMenuItem_Click); + resources.ApplyResources(aTRAC9ToolStripMenuItem, "aTRAC9ToolStripMenuItem"); + aTRAC9ToolStripMenuItem.Name = "aTRAC9ToolStripMenuItem"; + aTRAC9ToolStripMenuItem.Click += ATRAC9ToolStripMenuItem_Click; + // + // panel_Control + // + resources.ApplyResources(panel_Control, "panel_Control"); + panel_Control.Controls.Add(button_Encode); + panel_Control.Controls.Add(button_Decode); + panel_Control.Name = "panel_Control"; + // + // panel_Main + // + resources.ApplyResources(panel_Main, "panel_Main"); + panel_Main.Controls.Add(label_NotReaded); + panel_Main.Name = "panel_Main"; // // FormMain // - this.AllowDrop = true; resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.label_NotReaded); - this.Controls.Add(this.button_Encode); - this.Controls.Add(this.button_Decode); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.menuStrip1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MainMenuStrip = this.menuStrip1; - this.MaximizeBox = false; - this.Name = "FormMain"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed); - this.Load += new System.EventHandler(this.FormMain_Load); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.FormMain_DragDrop); - this.DragEnter += new System.Windows.Forms.DragEventHandler(this.FormMain_DragEnter); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AllowDrop = true; + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(groupBox1); + Controls.Add(panel_Main); + Controls.Add(panel_Control); + Controls.Add(statusStrip1); + Controls.Add(menuStrip1); + FormBorderStyle = FormBorderStyle.FixedSingle; + MainMenuStrip = menuStrip1; + MaximizeBox = false; + Name = "FormMain"; + FormClosed += FormMain_FormClosed; + Load += FormMain_Load; + DragDrop += FormMain_DragDrop; + DragEnter += FormMain_DragEnter; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + statusStrip1.ResumeLayout(false); + statusStrip1.PerformLayout(); + panel_Control.ResumeLayout(false); + panel_Main.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -355,5 +351,7 @@ private void InitializeComponent() private ToolStripMenuItem wAVEToAudioToolStripMenuItem; private ToolStripMenuItem loopPointCreationToolStripMenuItem; private ToolStripMenuItem saveMethodSettingsMToolStripMenuItem; + private Panel panel_Control; + private Panel panel_Main; } } \ No newline at end of file diff --git a/src/Forms/FormMain.cs b/src/Forms/FormMain.cs index e554dd7..3c2cbc6 100644 --- a/src/Forms/FormMain.cs +++ b/src/Forms/FormMain.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Net.NetworkInformation; using ATRACTool_Reloaded.Localizable; +using ATRACTool_Reloaded.Properties; using static ATRACTool_Reloaded.Common; namespace ATRACTool_Reloaded @@ -15,6 +16,7 @@ public partial class FormMain : Form }; private static readonly HttpClient appUpdatechecker = new(handler); #endregion + FormLPC FLPC; static FormSplash fs; static object lockobj; @@ -33,50 +35,134 @@ private void FormMain_Load(object sender, EventArgs e) Text = "ATRACTool Rel ( build: " + ver.FileVersion.ToString() + "-Beta )"; } - lockobj = new object(); + if (!File.Exists(Common.xmlpath)) + { + Common.Utils.InitConfig(); + } + + Common.Config.Load(Common.xmlpath); - lock (lockobj) + if (!bool.Parse(Config.Entry["HideSplash"].Value)) // Splash { - ThreadStart tds = new(StartThread); - Thread thread = new(tds) - { - Name = "Splash", - IsBackground = true - }; - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); + lockobj = new object(); - dmes d = new(ShowMessage); - if (fs != null) - { - fs.Invoke(d, "Initializing..."); - } - Thread.Sleep(500); - foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) + lock (lockobj) { - FileInfo fi = new(files); - if (fs != null) + ThreadStart tds = new(StartThread); + Thread thread = new(tds) + { + Name = "Splash", + IsBackground = true + }; + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + + dmes d = new(ShowMessage); + fs?.Invoke(d, "Initializing..."); + Thread.Sleep(1000); + foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) { - fs.Invoke(d, string.Format(Localization.SplashFormFileCaption, fi.Name)); - Thread.Sleep(10); + FileInfo fi = new(files); + if (fs != null) + { + fs.Invoke(d, string.Format(Localization.SplashFormFileCaption, fi.Name)); + Thread.Sleep(50); + } } - } - Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp"); - ResetStatus(); + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp"); + ResetStatus(); - if (fs != null) - { - fs.Invoke(d, Localization.SplashFormConfigCaption); - - } + fs?.Invoke(d, Localization.SplashFormConfigCaption); - if (!File.Exists(Common.xmlpath)) - { - Common.Utils.InitConfig(); + int ts = int.Parse(Config.Entry["ToolStrip"].Value); + string prm1 = Config.Entry["ATRAC3_Params"].Value, prm2 = Config.Entry["ATRAC9_Params"].Value; + if (ts != 65535) + { + switch (ts) + { + case 0: + Common.Generic.ATRACFlag = 0; + aTRAC3ATRAC3ToolStripMenuItem.Checked = true; + aTRAC9ToolStripMenuItem.Checked = false; + toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; + break; + case 1: + Common.Generic.ATRACFlag = 1; + aTRAC3ATRAC3ToolStripMenuItem.Checked = false; + aTRAC9ToolStripMenuItem.Checked = true; + toolStripDropDownButton_EF.Text = "ATRAC9"; + break; + } + } + if (prm1 != "" || prm1 != null) + { + Common.Generic.EncodeParamAT3 = prm1; + } + else + { + Common.Generic.EncodeParamAT3 = ""; + } + if (prm2 != "" || prm2 != null) + { + Common.Generic.EncodeParamAT9 = prm2; + } + else + { + Common.Generic.EncodeParamAT9 = ""; + } + loopPointCreationToolStripMenuItem.Enabled = false; + Thread.Sleep(1000); + + if (bool.Parse(Config.Entry["Oldmode"].Value)) + { + fs?.Invoke(d, "Old mode is activated"); + Thread.Sleep(500); + loopPointCreationToolStripMenuItem.Enabled = true; + } + else + { + loopPointCreationToolStripMenuItem.Enabled = false; + } + + if (bool.Parse(Config.Entry["Check_Update"].Value)) + { + fs?.Invoke(d, Localization.SplashFormUpdateCaption); + Thread.Sleep(500); + if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) + { + fs?.Invoke(d, Localization.SplashFormUpdatingCaption); + File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); + string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; + File.Delete(updpath + @"\updater.exe"); + File.Delete(updpath + @"\atractool-rel.zip"); + Common.Utils.DeleteDirectory(updpath + @"\updater-temp"); + + fs?.Invoke(d, Localization.SplashFormUpdatedCaption); + MessageBox.Show(fs, Localization.UpdateCompletedCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + var update = Task.Run(() => CheckForUpdatesForInit()); + update.Wait(); + } + } + else + { + fs?.Invoke(d, "Skip Update"); + Thread.Sleep(500); + } + + fs?.Invoke(d, "Starting..."); + Thread.Sleep(1000); } - Common.Config.Load(Common.xmlpath); + CloseSplash(); + } + else // No Splash + { + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp"); + ResetStatus(); int ts = int.Parse(Config.Entry["ToolStrip"].Value); string prm1 = Config.Entry["ATRAC3_Params"].Value, prm2 = Config.Entry["ATRAC9_Params"].Value; @@ -115,40 +201,33 @@ private void FormMain_Load(object sender, EventArgs e) Common.Generic.EncodeParamAT9 = ""; } loopPointCreationToolStripMenuItem.Enabled = false; - Thread.Sleep(500); - if (fs != null) + if (bool.Parse(Config.Entry["Check_Update"].Value)) { - fs.Invoke(d, Localization.SplashFormUpdateCaption); - } - Thread.Sleep(500); - if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) - { - if (fs != null) + if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) { - fs.Invoke(d, Localization.SplashFormUpdatingCaption); - } - File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); - string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; - File.Delete(updpath + @"\updater.exe"); - File.Delete(updpath + @"\atractool-rel.zip"); - Common.Utils.DeleteDirectory(updpath + @"\updater-temp"); + File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); + string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; + File.Delete(updpath + @"\updater.exe"); + File.Delete(updpath + @"\atractool-rel.zip"); + Common.Utils.DeleteDirectory(updpath + @"\updater-temp"); - if (fs != null) + MessageBox.Show(this, Localization.UpdateCompletedCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else { - fs.Invoke(d, Localization.SplashFormUpdatedCaption); + var update = Task.Run(() => CheckForUpdatesForInit()); + update.Wait(); } - MessageBox.Show(fs, Localization.UpdateCompletedCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - var update = Task.Run(() => CheckForUpdatesForInit()); - update.Wait(); } } - CloseSplash(); Activate(); + + if (Generic.GlobalException is not null) + { + MessageBox.Show(this, string.Format(Localization.UnExpectedCaption, Generic.GlobalException), Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } } // j[ @@ -247,7 +326,7 @@ private void OpenFileOToolStripMenuItem_Click(object sender, EventArgs e) foreach (var file in Common.Generic.OpenFilePaths) { FileInfo fi = new(file); - + if (count != 0) { if (Ft != fi.Extension) @@ -329,6 +408,7 @@ private void OpenFileOToolStripMenuItem_Click(object sender, EventArgs e) private void CloseFileCToolStripMenuItem_Click(object sender, EventArgs e) { + ActivateOrDeactivateLPC(false); ResetStatus(); } @@ -371,9 +451,9 @@ private void ConvertSettingsToolStripMenuItem_Click(object sender, EventArgs e) private void ConvertAudioToolStripMenuItem_Click(object sender, EventArgs e) { - - + + } private void AboutATRACToolToolStripMenuItem_Click(object sender, EventArgs e) @@ -487,7 +567,7 @@ private async void CheckForUpdatesUToolStripMenuItem_Click(object sender, EventA { MessageBox.Show(this, Localization.NetworkNotConnectedCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); return; - } + } } // Xe[^Xo[ @@ -500,7 +580,7 @@ private void ATRAC3ATRAC3ToolStripMenuItem_Click(object sender, EventArgs e) aTRAC3ATRAC3ToolStripMenuItem.Checked = true; aTRAC9ToolStripMenuItem.Checked = false; toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; - + } private void ATRAC9ToolStripMenuItem_Click(object sender, EventArgs e) @@ -523,6 +603,7 @@ private void ATRAC9ToolStripMenuItem_Click(object sender, EventArgs e) private void Button_Decode_Click(object sender, EventArgs e) { Config.Load(xmlpath); + bool manual = bool.Parse(Config.Entry["Save_IsManual"].Value); Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); @@ -594,7 +675,7 @@ private void Button_Decode_Click(object sender, EventArgs e) } } - + } else // t@C { @@ -689,7 +770,7 @@ private void Button_Decode_Click(object sender, EventArgs e) break; } } - + } Common.Generic.ProcessFlag = 0; @@ -811,6 +892,8 @@ private void Button_Encode_Click(object sender, EventArgs e) true => true, }; + ActivateOrDeactivateLPC(false); + if (Common.Generic.ATRACFlag == 0 || Common.Generic.ATRACFlag == 1) { if (Common.Generic.EncodeParamAT3 == "" || Common.Generic.EncodeParamAT3 == null || Common.Generic.EncodeParamAT9 == "" || Common.Generic.EncodeParamAT9 == null) @@ -1025,9 +1108,9 @@ private void Button_Encode_Click(object sender, EventArgs e) break; } } - + } - + } Common.Generic.ProcessFlag = 1; @@ -1177,8 +1260,9 @@ private void Button_Encode_Click(object sender, EventArgs e) private void ReadStatus() { + AllowDrop = false; toolStripStatusLabel_Status.Text = Localization.ReadyCaption; - toolStripStatusLabel_Status.ForeColor = Color.FromArgb(0, 0, 225, 0); + toolStripStatusLabel_Status.ForeColor = Color.Green; label_NotReaded.Visible = false; label2.Visible = true; label3.Visible = true; @@ -1190,14 +1274,20 @@ private void ReadStatus() private void ResetStatus() { + AllowDrop = true; Utils.ATWCheck(Generic.IsATW); Common.Generic.OpenFilePaths = null!; Common.Generic.ProcessFlag = -1; Common.Generic.ProgressMax = -1; + if (panel_Main.BackgroundImage is not null) + { + panel_Main.BackgroundImage.Dispose(); + } + panel_Main.BackgroundImage = null!; button_Decode.Enabled = false; button_Encode.Enabled = false; toolStripStatusLabel_Status.Text = Localization.NotReadyCaption; - toolStripStatusLabel_Status.ForeColor = Color.FromArgb(0, 255, 0, 0); + toolStripStatusLabel_Status.ForeColor = Color.Red; label_NotReaded.Text = Localization.OpenFileCaption; label_NotReaded.Visible = true; label2.Visible = false; @@ -1235,10 +1325,9 @@ private void AudioToWAVEToolStripMenuItem_Click(object sender, EventArgs e) if (Common.Generic.OpenFilePaths.Length == 1) // Single { - using Form formAtWST = new FormAtWSelectTarget(); - DialogResult dr = formAtWST.ShowDialog(); - if (dr != DialogResult.Cancel && dr != DialogResult.None) + if (bool.Parse(Config.Entry["FixedConvert"].Value)) // Fix { + Common.Generic.WTAmethod = int.Parse(Config.Entry["ConvertType"].Value); SaveFileDialog sfd = new() { FileName = Common.Utils.SFDRandomNumber(), @@ -1290,17 +1379,71 @@ private void AudioToWAVEToolStripMenuItem_Click(object sender, EventArgs e) return; } } - else + else // normal { - return; + using Form formAtWST = new FormAtWSelectTarget(); + DialogResult dr = formAtWST.ShowDialog(); + if (dr != DialogResult.Cancel && dr != DialogResult.None) + { + SaveFileDialog sfd = new() + { + FileName = Common.Utils.SFDRandomNumber(), + InitialDirectory = "", + Filter = Localization.WAVEFilter, + FilterIndex = 1, + Title = Localization.SaveDialogTitle, + OverwritePrompt = true, + RestoreDirectory = true + }; + if (sfd.ShowDialog() == DialogResult.OK) + { + Common.Generic.SavePath = sfd.FileName; + Common.Generic.ProgressMax = 1; + + Common.Generic.ProcessFlag = 2; + + Form formProgress = new FormProgress(); + formProgress.ShowDialog(); + formProgress.Dispose(); + + if (Common.Generic.Result == false) + { + Common.Generic.cts.Dispose(); + MessageBox.Show(this, Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + FileInfo fi = new(Common.Generic.SavePath); + if (File.Exists(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name)) + { + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name, Common.Generic.SavePath); + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(this, Localization.ConvertSuccessCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); + ResetStatus(); + Utils.ShowFolder(Common.Generic.SavePath, bool.Parse(Config.Entry["ShowFolder"].Value)); + return; + } + else // Error + { + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(this, Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + ResetStatus(); + return; + } + } + else // Cancelled + { + return; + } + } + else { return; } } } else // Multiple { - using Form formAtWST = new FormAtWSelectTarget(); - DialogResult dr = formAtWST.ShowDialog(); - if (dr != DialogResult.Cancel && dr != DialogResult.None) + if (bool.Parse(Config.Entry["FixedConvert"].Value)) // Fix { + Common.Generic.WTAmethod = int.Parse(Config.Entry["ConvertType"].Value); FolderBrowserDialog fbd = new() { Description = Localization.FolderSaveDialogTitle, @@ -1363,9 +1506,75 @@ private void AudioToWAVEToolStripMenuItem_Click(object sender, EventArgs e) return; } } - else + else // normal { - return; + using Form formAtWST = new FormAtWSelectTarget(); + DialogResult dr = formAtWST.ShowDialog(); + if (dr != DialogResult.Cancel && dr != DialogResult.None) + { + FolderBrowserDialog fbd = new() + { + Description = Localization.FolderSaveDialogTitle, + RootFolder = Environment.SpecialFolder.MyDocuments, + SelectedPath = @"", + }; + if (fbd.ShowDialog() == DialogResult.OK) + { + Common.Generic.FolderSavePath = fbd.SelectedPath; + if (Directory.GetFiles(Common.Generic.FolderSavePath, "*", SearchOption.AllDirectories).Length != 0) + { + DialogResult dr2 = MessageBox.Show(this, Localization.AlreadyExistsCaption, Localization.MSGBoxWarningCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dr2 == DialogResult.Yes) + { + Common.Utils.DeleteDirectoryFiles(Common.Generic.FolderSavePath); + } + else + { + return; + } + } + Common.Generic.ProgressMax = Common.Generic.OpenFilePaths.Length; + + Common.Generic.ProcessFlag = 2; + + Form formProgress = new FormProgress(); + formProgress.ShowDialog(); + formProgress.Dispose(); + + if (Common.Generic.Result == false) + { + Common.Generic.cts.Dispose(); + MessageBox.Show(this, Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + foreach (var file in Common.Generic.OpenFilePaths) + { + FileInfo fi = new(file); + if (File.Exists(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav")) + { + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav", Common.Generic.FolderSavePath + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"); + } + else // Error + { + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(this, Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + ResetStatus(); + return; + } + } + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(this, Localization.ConvertSuccessCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); + ResetStatus(); + Utils.ShowFolder(Common.Generic.FolderSavePath, bool.Parse(Config.Entry["ShowFolder"].Value)); + return; + } + else // Cancelled + { + return; + } + } + else { return; } } } } @@ -1485,7 +1694,7 @@ private void WAVEToAudioToolStripMenuItem_Click(object sender, EventArgs e) { return; } - + Common.Generic.ProgressMax = Common.Generic.OpenFilePaths.Length; Common.Generic.ProcessFlag = 3; @@ -1738,7 +1947,7 @@ private void FormMain_DragDrop(object sender, DragEventArgs e) FormatSorter(false); break; } - + return; } } @@ -1757,7 +1966,7 @@ private void FormMain_FormClosed(object sender, FormClosedEventArgs e) private void LoopPointCreationToolStripMenuItem_Click(object sender, EventArgs e) { - using FormLPC form = new(); + using FormLPC form = new(true); form.ShowDialog(); } @@ -1868,17 +2077,17 @@ private async Task CheckForUpdatesForInit() /// /// Waveł͂Ȃt@CWaveɕϊ /// - private void AudioToWaveConvert() + private bool AudioToWaveConvert() { if (Common.Generic.IsWave != true && Common.Generic.IsATRAC != true) { if (Common.Generic.OpenFilePaths.Length == 1) // Pt@C { - FileInfo file = new(Common.Generic.OpenFilePaths[0]); - using Form formAtWST = new FormAtWSelectTarget(); - DialogResult dr = formAtWST.ShowDialog(); - if (dr != DialogResult.Cancel && dr != DialogResult.None) + if (bool.Parse(Config.Entry["FixedConvert"].Value)) // Fix { + FileInfo file = new(Common.Generic.OpenFilePaths[0]); + Common.Generic.WTAmethod = int.Parse(Config.Entry["ConvertType"].Value); + Common.Generic.SavePath = file.Directory + @"\" + file.Name + @".wav"; Common.Generic.ProgressMax = 1; @@ -1893,7 +2102,7 @@ private void AudioToWaveConvert() Common.Generic.cts.Dispose(); MessageBox.Show(Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); ResetStatus(); - return; + return false; } FileInfo fi = new(Common.Generic.SavePath); @@ -1920,6 +2129,7 @@ private void AudioToWaveConvert() { ResetStatus(); MessageBox.Show(Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; } switch (Common.Generic.WTAmethod) @@ -1961,30 +2171,131 @@ private void AudioToWaveConvert() toolStripDropDownButton_EF.Text = "ATRAC9"; break; } - return; + return true; } else // Error { ResetStatus(); Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); MessageBox.Show(Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; + return false; } } - else + else // normal { - Generic.IsATW = false; - ResetStatus(); - return; + FileInfo file = new(Common.Generic.OpenFilePaths[0]); + using Form formAtWST = new FormAtWSelectTarget(); + DialogResult dr = formAtWST.ShowDialog(); + if (dr != DialogResult.Cancel && dr != DialogResult.None) + { + Common.Generic.SavePath = file.Directory + @"\" + file.Name + @".wav"; + Common.Generic.ProgressMax = 1; + + Common.Generic.ProcessFlag = 2; + + Form formProgress = new FormProgress(); + formProgress.ShowDialog(); + formProgress.Dispose(); + + if (Common.Generic.Result == false) + { + Common.Generic.cts.Dispose(); + MessageBox.Show(Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetStatus(); + return false; + } + + FileInfo fi = new(Common.Generic.SavePath); + if (File.Exists(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name)) + { + if (File.Exists(Common.Generic.SavePath)) // t@Cɑ݂ꍇ͍폜ĂMove + { + File.Delete(Common.Generic.SavePath); + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name, Common.Generic.SavePath); + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + } + else + { + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name, Common.Generic.SavePath); + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + } + + if (File.Exists(Common.Generic.SavePath)) // t@CĂ邩ǂ + { + Common.Generic.OpenFilePaths[0] = Common.Generic.SavePath; + label_Filepath.Text = Common.Generic.OpenFilePaths[0]; + } + else // G[ + { + ResetStatus(); + MessageBox.Show(Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + switch (Common.Generic.WTAmethod) + { + case 0: + Config.Entry["ATRAC3_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "0"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 0; + aTRAC3ATRAC3ToolStripMenuItem.Checked = true; + aTRAC9ToolStripMenuItem.Checked = false; + toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; + break; + case 1: + Config.Entry["ATRAC3_Console"].Value = "1"; + Config.Entry["ToolStrip"].Value = "0"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 0; + aTRAC3ATRAC3ToolStripMenuItem.Checked = true; + aTRAC9ToolStripMenuItem.Checked = false; + toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; + break; + case 2: + Config.Entry["ATRAC9_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "1"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 1; + aTRAC3ATRAC3ToolStripMenuItem.Checked = false; + aTRAC9ToolStripMenuItem.Checked = true; + toolStripDropDownButton_EF.Text = "ATRAC9"; + break; + case 3: + Config.Entry["ATRAC9_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "1"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 1; + aTRAC3ATRAC3ToolStripMenuItem.Checked = false; + aTRAC9ToolStripMenuItem.Checked = true; + toolStripDropDownButton_EF.Text = "ATRAC9"; + break; + } + return true; + } + else // Error + { + ResetStatus(); + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + } + else + { + Generic.IsATW = false; + ResetStatus(); + return false; + } } } else // t@C { - FileInfo fp = new(Common.Generic.OpenFilePaths[0]); - using Form formAtWST = new FormAtWSelectTarget(); - DialogResult dr = formAtWST.ShowDialog(); - if (dr != DialogResult.Cancel && dr != DialogResult.None) + if (bool.Parse(Config.Entry["FixedConvert"].Value)) // Fix { + FileInfo fp = new(Common.Generic.OpenFilePaths[0]); + Common.Generic.WTAmethod = int.Parse(Config.Entry["ConvertType"].Value); + Common.Generic.ProgressMax = Common.Generic.OpenFilePaths.Length; Common.Generic.ProcessFlag = 2; @@ -1998,7 +2309,7 @@ private void AudioToWaveConvert() Common.Generic.cts.Dispose(); MessageBox.Show(this, Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); ResetStatus(); - return; + return false; } int count = 0; @@ -2016,14 +2327,14 @@ private void AudioToWaveConvert() { File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav", fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"); } - + } else // Error { Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); MessageBox.Show(this, Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); ResetStatus(); - return; + return false; } if (File.Exists(fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav")) // t@C݊mF @@ -2033,7 +2344,8 @@ private void AudioToWaveConvert() } else // G[ { - return; + ResetStatus(); + return false; } } Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); @@ -2078,19 +2390,124 @@ private void AudioToWaveConvert() break; } - return; + return true; } - else + else // normal { - Generic.IsATW = false; - ResetStatus(); - return; + FileInfo fp = new(Common.Generic.OpenFilePaths[0]); + using Form formAtWST = new FormAtWSelectTarget(); + DialogResult dr = formAtWST.ShowDialog(); + if (dr != DialogResult.Cancel && dr != DialogResult.None) + { + Common.Generic.ProgressMax = Common.Generic.OpenFilePaths.Length; + + Common.Generic.ProcessFlag = 2; + + Form formProgress = new FormProgress(); + formProgress.ShowDialog(); + formProgress.Dispose(); + + if (Common.Generic.Result == false) + { + Common.Generic.cts.Dispose(); + MessageBox.Show(this, Localization.CancelledCaption, Localization.MSGBoxAbortedCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + ResetStatus(); + return false; + } + + int count = 0; + foreach (var file in Common.Generic.OpenFilePaths) + { + FileInfo fi = new(file); + if (File.Exists(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav")) + { + if (File.Exists(fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav")) // t@Cɑ݂ꍇ͍폜ĂMove + { + File.Delete(fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"); + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav", fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"); + } + else + { + File.Move(Directory.GetCurrentDirectory() + @"\_temp\" + fi.Name.Replace(fi.Extension, "") + ".wav", fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"); + } + + } + else // Error + { + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + MessageBox.Show(this, Localization.ConvertErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + ResetStatus(); + return false; + } + + if (File.Exists(fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav")) // t@C݊mF + { + Common.Generic.OpenFilePaths[count] = fp.Directory + @"\" + fi.Name.Replace(fi.Extension, "") + ".wav"; + count++; + } + else // G[ + { + ResetStatus(); + return false; + } + } + Common.Utils.DeleteDirectoryFiles(Directory.GetCurrentDirectory() + @"\_temp"); + + switch (Common.Generic.WTAmethod) + { + case 0: + Config.Entry["ATRAC3_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "0"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 0; + aTRAC3ATRAC3ToolStripMenuItem.Checked = true; + aTRAC9ToolStripMenuItem.Checked = false; + toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; + break; + case 1: + Config.Entry["ATRAC3_Console"].Value = "1"; + Config.Entry["ToolStrip"].Value = "0"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 0; + aTRAC3ATRAC3ToolStripMenuItem.Checked = true; + aTRAC9ToolStripMenuItem.Checked = false; + toolStripDropDownButton_EF.Text = "ATRAC3 / ATRAC3+"; + break; + case 2: + Config.Entry["ATRAC9_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "1"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 1; + aTRAC3ATRAC3ToolStripMenuItem.Checked = false; + aTRAC9ToolStripMenuItem.Checked = true; + toolStripDropDownButton_EF.Text = "ATRAC9"; + break; + case 3: + Config.Entry["ATRAC9_Console"].Value = "0"; + Config.Entry["ToolStrip"].Value = "1"; + Config.Save(xmlpath); + Common.Generic.ATRACFlag = 1; + aTRAC3ATRAC3ToolStripMenuItem.Checked = false; + aTRAC9ToolStripMenuItem.Checked = true; + toolStripDropDownButton_EF.Text = "ATRAC9"; + break; + } + + return true; + } + else + { + Generic.IsATW = false; + ResetStatus(); + return false; + } } + } } else { - return; + return false; } } @@ -2113,32 +2530,62 @@ private void FormatSorter(bool IsEncode, bool IsNotWave = false) toolStripDropDownButton_EF.Visible = true; button_Decode.Enabled = false; button_Encode.Enabled = true; - loopPointCreationToolStripMenuItem.Enabled = true; + //loopPointCreationToolStripMenuItem.Enabled = true; + ActivateOrDeactivateLPC(true); } else // NotWave { + toolStripStatusLabel_Status.ForeColor = Color.Orange; + toolStripStatusLabel_Status.Text = Localization.InitializationCaption; + label_Formattxt.Text = Localization.InitializationCaption; Common.Generic.IsWave = false; Common.Generic.IsATRAC = false; Generic.IsATW = true; - label_Formattxt.Text = Localization.WAVEConvertedFormatCaption; - toolStripDropDownButton_EF.Enabled = true; - toolStripDropDownButton_EF.Visible = true; - button_Decode.Enabled = false; - button_Encode.Enabled = true; - loopPointCreationToolStripMenuItem.Enabled = true; - AudioToWaveConvert(); + if (AudioToWaveConvert()) + { + toolStripStatusLabel_Status.ForeColor = Color.Green; + toolStripStatusLabel_Status.Text = Localization.ReadyCaption; + ActivateOrDeactivateLPC(true); + label_Formattxt.Text = Localization.WAVEConvertedFormatCaption; + toolStripDropDownButton_EF.Enabled = true; + toolStripDropDownButton_EF.Visible = true; + button_Decode.Enabled = false; + button_Encode.Enabled = true; + //loopPointCreationToolStripMenuItem.Enabled = true; + } + else + { + return; + } } } else // ATRAC { - Common.Generic.IsWave = false; - Common.Generic.IsATRAC = true; - Generic.IsATW = false; - toolStripDropDownButton_EF.Enabled = false; - toolStripDropDownButton_EF.Visible = false; - button_Decode.Enabled = true; - button_Encode.Enabled = false; - loopPointCreationToolStripMenuItem.Enabled = false; + if (bool.Parse(Config.Entry["FasterATRAC"].Value)) + { + panel_Main.BackgroundImage = Resources.SIEv2; + Common.Generic.IsWave = false; + Common.Generic.IsATRAC = true; + Generic.IsATW = false; + toolStripDropDownButton_EF.Enabled = false; + toolStripDropDownButton_EF.Visible = false; + button_Decode.Enabled = true; + button_Encode.Enabled = false; + loopPointCreationToolStripMenuItem.Enabled = false; + button_Decode.PerformClick(); + } + else + { + panel_Main.BackgroundImage = Resources.SIEv2; + Common.Generic.IsWave = false; + Common.Generic.IsATRAC = true; + Generic.IsATW = false; + toolStripDropDownButton_EF.Enabled = false; + toolStripDropDownButton_EF.Visible = false; + button_Decode.Enabled = true; + button_Encode.Enabled = false; + loopPointCreationToolStripMenuItem.Enabled = false; + } } } @@ -2177,5 +2624,27 @@ private void PreferencesMToolStripMenuItem_Click(object sender, EventArgs e) using Form FSS = new FormPreferencesSettings(); FSS.ShowDialog(); } + + private void ActivateOrDeactivateLPC(bool flag) + { + if (Generic.OpenFilePaths is null) { return; } + if (flag) + { + FLPC = new(false) + { + TopLevel = false + }; + panel_Main.Controls.Add(FLPC); + FLPC.Show(); + } + else + { + if (FLPC is not null && FLPC.Visible) + { + FLPC.Close(); + } + } + + } } } \ No newline at end of file diff --git a/src/Forms/FormMain.en.resx b/src/Forms/FormMain.en.resx index b823aaf..dd26675 100644 --- a/src/Forms/FormMain.en.resx +++ b/src/Forms/FormMain.en.resx @@ -1,4 +1,64 @@ - + + + diff --git a/src/Forms/FormMain.ja.resx b/src/Forms/FormMain.ja.resx index 0009168..e7efe83 100644 --- a/src/Forms/FormMain.ja.resx +++ b/src/Forms/FormMain.ja.resx @@ -1,4 +1,64 @@ - + + + @@ -59,7 +119,7 @@ - 365, 45 + 365, 35 47, 15 @@ -68,10 +128,13 @@ サイズ: - 46, 45 + 46, 35 - 57, 25 + 57, 17 + + + 752, 15 43, 15 @@ -92,10 +155,10 @@ Yu Gothic UI, 14.25pt - 18, 44 + 3, 5 - 548, 51 + 818, 297 ここにファイルをドラッグアンドドロップするか @@ -135,11 +198,17 @@ 設定 (&C) - 139, 22 + 180, 22 変換設定 (&S) + + 180, 22 + + + 詳細設定 (&P) + 63, 20 @@ -147,7 +216,7 @@ ツール (&T) - 180, 22 + 174, 22 音声形式の変換 (&C) @@ -165,7 +234,7 @@ WAVEから別形式に変換 - 180, 22 + 174, 22 ループポイント作成 diff --git a/src/Forms/FormMain.resx b/src/Forms/FormMain.resx index ad80003..71445c0 100644 --- a/src/Forms/FormMain.resx +++ b/src/Forms/FormMain.resx @@ -1,4 +1,64 @@ - + + + @@ -57,475 +117,327 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 350, 45 + + $this - - 58, 15 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 5 + + toolStripMenuItem2 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 188, 6 + + + System.Windows.Forms.Panel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 Unknown - - label_Sizetxt + + Size: - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + convertAudioToolStripMenuItem - - groupBox1 + + 144, 22 - - 0 + + 874, 50 - - True + + 874, 308 - - 325, 45 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 30, 15 + + MiddleCenter - - 4 + + + 7 - - Size: + + Encode (WAVE to ATRAC) - - label4 + + 177, 22 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + button_Encode - + groupBox1 - - 1 + + 2 - - True + + 0, 0 - - 55, 45 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 58, 15 + + Select Encoding method - + 3 - - Unknown + + checkForUpdatesUToolStripMenuItem - - label_Formattxt + + aTRAC3ATRAC3ToolStripMenuItem - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + aTRAC9ToolStripMenuItem - - groupBox1 + + 191, 22 - - 2 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 35, 25 + + 874, 24 - - 518, 15 + + 5 - - 2 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Unknown + + 870, 54 - - label_Filepath + + statusStrip1 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 5 - - groupBox1 + + Decode (ATRAC to WAVE) - - 3 + + 144, 22 - - True + + 0 - - 11, 45 + + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FormMain 47, 15 - - 1 + + About ATRACTool (&A) - - Format: + + fileFToolStripMenuItem - - label3 + + 155, 22 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Information + + + toolStripDropDownButton_EF groupBox1 - - 4 + + 0, 0 - - True + + 0, 396 - - 11, 25 + + closeFileCToolStripMenuItem - - 28, 15 + + 0 - + + 3 + + 0 - - File: + + 28, 15 - - label2 + + 180, 22 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 155, 22 - - groupBox1 + + Unknown - - 5 + + 30, 15 - - 12, 25 + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 560, 76 + + True - - 0 + + convertSettingsToolStripMenuItem - - Information + + Close File (&C) - - groupBox1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + groupBox1 - - 4 + + menuStrip1 - - Yu Gothic UI, 20.25pt + + label_NotReaded - - 18, 48 + + 444, 0 - - 548, 41 + + toolStripMenuItem1 - - 4 + + Magenta - - Drag and drop a file here or Open the file... + + groupBox1 - - MiddleCenter + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label_NotReaded + + label3 System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this - - - 1 - - - 17, 17 - - - 144, 22 - - - Open File (&O) - - - 144, 22 - - - Close File (&C) - - - 141, 6 - - - 144, 22 - - - Exit (&X) - - - 54, 20 - - - File (&F) - - - 194, 22 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wgAADsIBFShKgAAAAJFJREFUOE9j+Pbt239KMNgAJycnsjCKAR/efyQJk2zA81sn/5/oNgXTID7JBpzo + Nvl/qFYKbAiIT6YLTAi7YNLZV/8XXHoN5+PCWA3I2vfiv/TCR2BMyBAMA5A1E2MIigE6DSsxNMMwsiEg + duuJl5gGYNOIjEEaQRjGB7mWJAOwYZCrKTIAhKlnACWYgTLAwAAABzX8nC+3qw0AAAAASUVORK5CYII= + - - Conversion settings (&S) + + 325, 35 194, 22 - - Preferences (&P) - - - 71, 20 - - - Config (&C) - - - 155, 22 - - - Audio to WAVE - - - 155, 22 - - - WAVE to Audio - - - 178, 22 - - - AudioConverter (&C) + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 178, 22 + + 0, 27 - - Loop point creation + + Unknown 58, 20 - - Tool (&T) - - - 191, 22 - - - About ATRACTool (&A) - - - 188, 6 - - - 191, 22 - - - Check For Updates (&U) - - - 64, 20 - - - Help (&H) - - - 0, 0 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 584, 24 + + loopPointCreationToolStripMenuItem - - 1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - menuStrip1 + + panel_Control menuStrip1 - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - False - - - Yu Gothic UI, 14.25pt - - - 12, 107 - - - 275, 45 + + 55, 35 2 - - Decode (ATRAC to WAVE) - - - button_Decode - - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - False + + 2, 336 - - Yu Gothic UI, 14.25pt + + panel_Main - - 297, 107 + + 1 - 275, 45 - - - 3 - - - Encode (WAVE to ATRAC) - - - button_Encode - - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 132, 17 - - - 41, 17 - - - Ready. - - - 177, 22 - - - ATRAC3 / ATRAC3+ - - - 177, 22 - - - ATRAC9 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACRSURBVDhPY/j27dt/SjDYACcnJ7IwigEf3n8kCZNswPNb - J/+f6DYF0yA+yQac6Db5f6hWCmwIiE+mC0wIu2DS2Vf/F1x6DefjwlgNyNr34r/0wkdgTMgQDAOQNRNj - CIoBOg0rMTTDMLIhIHbriZeYBmDTiIxBGkEYxge5liQDsGGQqykyAISpZwAlmIEywMAAAAc1/Jwvt6sN - AAAAAElFTkSuQmCC - + 430, 50 - - Magenta + + 35, 17 - - 148, 20 + + 180, 22 - - Select Encoding method + + audioToWAVEToolStripMenuItem - - 0, 164 + + Open File (&O) - - 584, 22 + + 71, 20 - - 5 + + $this - - statusStrip1 + + $this - - statusStrip1 + + label4 System.Windows.Forms.StatusStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this - - - 0 - - - True - - - 7, 15 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 584, 186 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -6744,139 +6656,343 @@ CenterScreen - - ATRACTool Reloaded + + ATRAC3 / ATRAC3+ - - fileFToolStripMenuItem + + groupBox1 - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - openFileOToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3, 9 - - closeFileCToolStripMenuItem + + True - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + button_Decode - - toolStripMenuItem1 + + False - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + 874, 22 + + + 2 + + + toolsTToolStripMenuItem + + + panel_Control + + + 3 + + + 2 + + + ATRAC9 + + + System.Windows.Forms.Panel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + helpHToolStripMenuItem + + + False + + + 144, 22 + + + 11, 35 + + + wAVEToAudioToolStripMenuItem + + + $this + + + label2 + + + Drag and drop a file here or Open the file... + + + ATRACTool Reloaded + + + Format: + + + 58, 15 + + + $this + + + Check For Updates (&U) + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 exitXToolStripMenuItem - + + Audio to WAVE + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - settingsSToolStripMenuItem + + panel_Main - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - convertSettingsToolStripMenuItem + + 0, 449 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - - saveMethodSettingsMToolStripMenuItem + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 191, 22 - - toolsTToolStripMenuItem + + 874, 471 - + + File (&F) + + + Loop point creation + + + groupBox1 + + + Ready. + + + label_Formattxt + + + Zoom + + + 828, 15 + + + statusStrip1 + + + 3 + + + aboutATRACToolToolStripMenuItem + + + Top, Bottom, Left, Right + + + Exit (&X) + + + 148, 20 + + + 41, 17 + + + AudioConverter (&C) + + + openFileOToolStripMenuItem + + + Help (&H) + + + 0 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - convertAudioToolStripMenuItem + + 1 + + + groupBox1 + + + Conversion settings (&S) + + + Left + + + System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 430, 50 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + settingsSToolStripMenuItem System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - audioToWAVEToolStripMenuItem + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - wAVEToAudioToolStripMenuItem + + 5 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 7, 15 - - loopPointCreationToolStripMenuItem + + Config (&C) - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label_Filepath - - helpHToolStripMenuItem + + 1 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - - aboutATRACToolToolStripMenuItem + + True - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 177, 22 - - toolStripMenuItem2 + + 1 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 54, 20 - - checkForUpdatesUToolStripMenuItem + + panel_Control - + + 141, 6 + + + 4 + + + Yu Gothic UI, 14.25pt + + + label_Sizetxt + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 toolStripStatusLabel_Status - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + saveMethodSettingsMToolStripMenuItem - - toolStripDropDownButton_EF + + 871, 293 - - System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - aTRAC3ATRAC3ToolStripMenuItem + + 0 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + WAVE to Audio - - aTRAC9ToolStripMenuItem + + File: - + + Right + + + 350, 35 + + + 58, 15 + + + 6 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - FormMain + + Yu Gothic UI, 20.25pt - - System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Tool (&T) + + 4 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 194, 22 + + + Yu Gothic UI, 14.25pt + + + 11, 17 + + + 64, 20 + + + Preferences (&P) + + + True + + + 17, 17 + + + 132, 17 + \ No newline at end of file diff --git a/src/Forms/FormPreferencesSettings.Designer.cs b/src/Forms/FormPreferencesSettings.Designer.cs index 035c9f4..faa6c8c 100644 --- a/src/Forms/FormPreferencesSettings.Designer.cs +++ b/src/Forms/FormPreferencesSettings.Designer.cs @@ -28,242 +28,260 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.radioButton_nml = new System.Windows.Forms.RadioButton(); - this.radioButton_spc = new System.Windows.Forms.RadioButton(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.textBox_Path = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button_OK = new System.Windows.Forms.Button(); - this.button_Cancel = new System.Windows.Forms.Button(); - this.button_Browse = new System.Windows.Forms.Button(); - this.button_Clear = new System.Windows.Forms.Button(); - this.checkBox_Subfolder = new System.Windows.Forms.CheckBox(); - this.label2 = new System.Windows.Forms.Label(); - this.textBox_suffix = new System.Windows.Forms.TextBox(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.label3 = new System.Windows.Forms.Label(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.checkBox_ShowFolder = new System.Windows.Forms.CheckBox(); - this.groupBox1.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.SuspendLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormPreferencesSettings)); + radioButton_nml = new RadioButton(); + radioButton_spc = new RadioButton(); + groupBox1 = new GroupBox(); + textBox_Path = new TextBox(); + label1 = new Label(); + button_OK = new Button(); + button_Cancel = new Button(); + button_Browse = new Button(); + button_Clear = new Button(); + checkBox_Subfolder = new CheckBox(); + label2 = new Label(); + textBox_suffix = new TextBox(); + tabControl1 = new TabControl(); + tabPage1 = new TabPage(); + button_Splashimg = new Button(); + textBox_Splashimg = new TextBox(); + checkBox_Splashimg = new CheckBox(); + checkBox_Checkupdate = new CheckBox(); + tabPage2 = new TabPage(); + checkBox_ShowFolder = new CheckBox(); + tabPage3 = new TabPage(); + comboBox_Fixconvert = new ComboBox(); + checkBox_Fixconvert = new CheckBox(); + checkBox_FasterATRAC = new CheckBox(); + checkBox_Hidesplash = new CheckBox(); + checkBox_Oldmode = new CheckBox(); + groupBox1.SuspendLayout(); + tabControl1.SuspendLayout(); + tabPage1.SuspendLayout(); + tabPage2.SuspendLayout(); + tabPage3.SuspendLayout(); + SuspendLayout(); // // radioButton_nml // - this.radioButton_nml.AutoSize = true; - this.radioButton_nml.Location = new System.Drawing.Point(6, 22); - this.radioButton_nml.Name = "radioButton_nml"; - this.radioButton_nml.Size = new System.Drawing.Size(181, 19); - this.radioButton_nml.TabIndex = 0; - this.radioButton_nml.TabStop = true; - this.radioButton_nml.Text = "Always ask for a save location"; - this.radioButton_nml.UseVisualStyleBackColor = true; - this.radioButton_nml.CheckedChanged += new System.EventHandler(this.RadioButton_nml_CheckedChanged); + resources.ApplyResources(radioButton_nml, "radioButton_nml"); + radioButton_nml.Name = "radioButton_nml"; + radioButton_nml.TabStop = true; + radioButton_nml.UseVisualStyleBackColor = true; + radioButton_nml.CheckedChanged += RadioButton_nml_CheckedChanged; // // radioButton_spc // - this.radioButton_spc.AutoSize = true; - this.radioButton_spc.Location = new System.Drawing.Point(198, 22); - this.radioButton_spc.Name = "radioButton_spc"; - this.radioButton_spc.Size = new System.Drawing.Size(160, 19); - this.radioButton_spc.TabIndex = 1; - this.radioButton_spc.TabStop = true; - this.radioButton_spc.Text = "Output to specified folder"; - this.radioButton_spc.UseVisualStyleBackColor = true; - this.radioButton_spc.CheckedChanged += new System.EventHandler(this.RadioButton_spc_CheckedChanged); + resources.ApplyResources(radioButton_spc, "radioButton_spc"); + radioButton_spc.Name = "radioButton_spc"; + radioButton_spc.TabStop = true; + radioButton_spc.UseVisualStyleBackColor = true; + radioButton_spc.CheckedChanged += RadioButton_spc_CheckedChanged; // // groupBox1 // - this.groupBox1.Controls.Add(this.radioButton_spc); - this.groupBox1.Controls.Add(this.radioButton_nml); - this.groupBox1.Location = new System.Drawing.Point(7, 8); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(365, 55); - this.groupBox1.TabIndex = 2; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Behavior when saving a file"; + resources.ApplyResources(groupBox1, "groupBox1"); + groupBox1.Controls.Add(radioButton_spc); + groupBox1.Controls.Add(radioButton_nml); + groupBox1.Name = "groupBox1"; + groupBox1.TabStop = false; // // textBox_Path // - this.textBox_Path.Enabled = false; - this.textBox_Path.Location = new System.Drawing.Point(47, 69); - this.textBox_Path.Name = "textBox_Path"; - this.textBox_Path.ReadOnly = true; - this.textBox_Path.Size = new System.Drawing.Size(230, 23); - this.textBox_Path.TabIndex = 3; + resources.ApplyResources(textBox_Path, "textBox_Path"); + textBox_Path.Name = "textBox_Path"; + textBox_Path.ReadOnly = true; // // label1 // - this.label1.AutoSize = true; - this.label1.Enabled = false; - this.label1.Location = new System.Drawing.Point(7, 72); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(34, 15); - this.label1.TabIndex = 4; - this.label1.Text = "Path:"; + resources.ApplyResources(label1, "label1"); + label1.Name = "label1"; // // button_OK // - this.button_OK.Location = new System.Drawing.Point(232, 217); - this.button_OK.Name = "button_OK"; - this.button_OK.Size = new System.Drawing.Size(75, 23); - this.button_OK.TabIndex = 5; - this.button_OK.Text = "OK"; - this.button_OK.UseVisualStyleBackColor = true; - this.button_OK.Click += new System.EventHandler(this.Button_OK_Click); + resources.ApplyResources(button_OK, "button_OK"); + button_OK.Name = "button_OK"; + button_OK.UseVisualStyleBackColor = true; + button_OK.Click += Button_OK_Click; // // button_Cancel // - this.button_Cancel.Location = new System.Drawing.Point(313, 217); - this.button_Cancel.Name = "button_Cancel"; - this.button_Cancel.Size = new System.Drawing.Size(75, 23); - this.button_Cancel.TabIndex = 6; - this.button_Cancel.Text = "Cancel"; - this.button_Cancel.UseVisualStyleBackColor = true; - this.button_Cancel.Click += new System.EventHandler(this.Button_Cancel_Click); + resources.ApplyResources(button_Cancel, "button_Cancel"); + button_Cancel.Name = "button_Cancel"; + button_Cancel.UseVisualStyleBackColor = true; + button_Cancel.Click += Button_Cancel_Click; // // button_Browse // - this.button_Browse.Enabled = false; - this.button_Browse.Location = new System.Drawing.Point(283, 69); - this.button_Browse.Name = "button_Browse"; - this.button_Browse.Size = new System.Drawing.Size(26, 23); - this.button_Browse.TabIndex = 7; - this.button_Browse.Text = "..."; - this.button_Browse.UseVisualStyleBackColor = true; - this.button_Browse.Click += new System.EventHandler(this.Button_Browse_Click); + resources.ApplyResources(button_Browse, "button_Browse"); + button_Browse.Name = "button_Browse"; + button_Browse.UseVisualStyleBackColor = true; + button_Browse.Click += Button_Browse_Click; // // button_Clear // - this.button_Clear.Enabled = false; - this.button_Clear.Location = new System.Drawing.Point(315, 69); - this.button_Clear.Name = "button_Clear"; - this.button_Clear.Size = new System.Drawing.Size(57, 23); - this.button_Clear.TabIndex = 8; - this.button_Clear.Text = "Clear"; - this.button_Clear.UseVisualStyleBackColor = true; - this.button_Clear.Click += new System.EventHandler(this.Button_Clear_Click); + resources.ApplyResources(button_Clear, "button_Clear"); + button_Clear.Name = "button_Clear"; + button_Clear.UseVisualStyleBackColor = true; + button_Clear.Click += Button_Clear_Click; // // checkBox_Subfolder // - this.checkBox_Subfolder.AutoSize = true; - this.checkBox_Subfolder.Enabled = false; - this.checkBox_Subfolder.Location = new System.Drawing.Point(13, 98); - this.checkBox_Subfolder.Name = "checkBox_Subfolder"; - this.checkBox_Subfolder.Size = new System.Drawing.Size(117, 19); - this.checkBox_Subfolder.TabIndex = 9; - this.checkBox_Subfolder.Text = "Create subfolders"; - this.checkBox_Subfolder.UseVisualStyleBackColor = true; - this.checkBox_Subfolder.CheckedChanged += new System.EventHandler(this.CheckBox_Subfolder_CheckedChanged); + resources.ApplyResources(checkBox_Subfolder, "checkBox_Subfolder"); + checkBox_Subfolder.Name = "checkBox_Subfolder"; + checkBox_Subfolder.UseVisualStyleBackColor = true; + checkBox_Subfolder.CheckedChanged += CheckBox_Subfolder_CheckedChanged; // // label2 // - this.label2.AutoSize = true; - this.label2.Enabled = false; - this.label2.Location = new System.Drawing.Point(7, 124); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(92, 15); - this.label2.TabIndex = 10; - this.label2.Text = "Subfolder suffix:"; + resources.ApplyResources(label2, "label2"); + label2.Name = "label2"; // // textBox_suffix // - this.textBox_suffix.Enabled = false; - this.textBox_suffix.Location = new System.Drawing.Point(101, 121); - this.textBox_suffix.Name = "textBox_suffix"; - this.textBox_suffix.Size = new System.Drawing.Size(271, 23); - this.textBox_suffix.TabIndex = 11; + resources.ApplyResources(textBox_suffix, "textBox_suffix"); + textBox_suffix.Name = "textBox_suffix"; // // tabControl1 // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Location = new System.Drawing.Point(2, 1); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(390, 210); - this.tabControl1.TabIndex = 12; + resources.ApplyResources(tabControl1, "tabControl1"); + tabControl1.Controls.Add(tabPage1); + tabControl1.Controls.Add(tabPage2); + tabControl1.Controls.Add(tabPage3); + tabControl1.Name = "tabControl1"; + tabControl1.SelectedIndex = 0; // // tabPage1 // - this.tabPage1.Controls.Add(this.label3); - this.tabPage1.Location = new System.Drawing.Point(4, 24); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(382, 182); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "General"; - this.tabPage1.UseVisualStyleBackColor = true; + resources.ApplyResources(tabPage1, "tabPage1"); + tabPage1.Controls.Add(button_Splashimg); + tabPage1.Controls.Add(textBox_Splashimg); + tabPage1.Controls.Add(checkBox_Splashimg); + tabPage1.Controls.Add(checkBox_Checkupdate); + tabPage1.Name = "tabPage1"; + tabPage1.UseVisualStyleBackColor = true; // - // label3 + // button_Splashimg // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(155, 81); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(69, 15); - this.label3.TabIndex = 0; - this.label3.Text = "No options."; + resources.ApplyResources(button_Splashimg, "button_Splashimg"); + button_Splashimg.Name = "button_Splashimg"; + button_Splashimg.UseVisualStyleBackColor = true; + button_Splashimg.Click += Button_Splashimg_Click; + // + // textBox_Splashimg + // + resources.ApplyResources(textBox_Splashimg, "textBox_Splashimg"); + textBox_Splashimg.Name = "textBox_Splashimg"; + textBox_Splashimg.ReadOnly = true; + // + // checkBox_Splashimg + // + resources.ApplyResources(checkBox_Splashimg, "checkBox_Splashimg"); + checkBox_Splashimg.Name = "checkBox_Splashimg"; + checkBox_Splashimg.UseVisualStyleBackColor = true; + checkBox_Splashimg.CheckedChanged += CheckBox_Splashimg_CheckedChanged; + // + // checkBox_Checkupdate + // + resources.ApplyResources(checkBox_Checkupdate, "checkBox_Checkupdate"); + checkBox_Checkupdate.Checked = true; + checkBox_Checkupdate.CheckState = CheckState.Checked; + checkBox_Checkupdate.Name = "checkBox_Checkupdate"; + checkBox_Checkupdate.UseVisualStyleBackColor = true; + checkBox_Checkupdate.CheckedChanged += CheckBox_Checkupdate_CheckedChanged; // // tabPage2 // - this.tabPage2.Controls.Add(this.checkBox_ShowFolder); - this.tabPage2.Controls.Add(this.textBox_Path); - this.tabPage2.Controls.Add(this.textBox_suffix); - this.tabPage2.Controls.Add(this.groupBox1); - this.tabPage2.Controls.Add(this.label2); - this.tabPage2.Controls.Add(this.label1); - this.tabPage2.Controls.Add(this.checkBox_Subfolder); - this.tabPage2.Controls.Add(this.button_Browse); - this.tabPage2.Controls.Add(this.button_Clear); - this.tabPage2.Location = new System.Drawing.Point(4, 24); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(382, 182); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "IO"; - this.tabPage2.UseVisualStyleBackColor = true; + resources.ApplyResources(tabPage2, "tabPage2"); + tabPage2.Controls.Add(checkBox_ShowFolder); + tabPage2.Controls.Add(textBox_Path); + tabPage2.Controls.Add(textBox_suffix); + tabPage2.Controls.Add(groupBox1); + tabPage2.Controls.Add(label2); + tabPage2.Controls.Add(label1); + tabPage2.Controls.Add(checkBox_Subfolder); + tabPage2.Controls.Add(button_Browse); + tabPage2.Controls.Add(button_Clear); + tabPage2.Name = "tabPage2"; + tabPage2.UseVisualStyleBackColor = true; // // checkBox_ShowFolder // - this.checkBox_ShowFolder.AutoSize = true; - this.checkBox_ShowFolder.Checked = true; - this.checkBox_ShowFolder.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox_ShowFolder.Location = new System.Drawing.Point(13, 151); - this.checkBox_ShowFolder.Name = "checkBox_ShowFolder"; - this.checkBox_ShowFolder.Size = new System.Drawing.Size(241, 19); - this.checkBox_ShowFolder.TabIndex = 12; - this.checkBox_ShowFolder.Text = "Open destination folder after completion"; - this.checkBox_ShowFolder.UseVisualStyleBackColor = true; + resources.ApplyResources(checkBox_ShowFolder, "checkBox_ShowFolder"); + checkBox_ShowFolder.Checked = true; + checkBox_ShowFolder.CheckState = CheckState.Checked; + checkBox_ShowFolder.Name = "checkBox_ShowFolder"; + checkBox_ShowFolder.UseVisualStyleBackColor = true; + // + // tabPage3 + // + resources.ApplyResources(tabPage3, "tabPage3"); + tabPage3.Controls.Add(comboBox_Fixconvert); + tabPage3.Controls.Add(checkBox_Fixconvert); + tabPage3.Controls.Add(checkBox_FasterATRAC); + tabPage3.Controls.Add(checkBox_Hidesplash); + tabPage3.Controls.Add(checkBox_Oldmode); + tabPage3.Name = "tabPage3"; + tabPage3.UseVisualStyleBackColor = true; + // + // comboBox_Fixconvert + // + resources.ApplyResources(comboBox_Fixconvert, "comboBox_Fixconvert"); + comboBox_Fixconvert.DropDownStyle = ComboBoxStyle.DropDownList; + comboBox_Fixconvert.FormattingEnabled = true; + comboBox_Fixconvert.Items.AddRange(new object[] { resources.GetString("comboBox_Fixconvert.Items"), resources.GetString("comboBox_Fixconvert.Items1"), resources.GetString("comboBox_Fixconvert.Items2"), resources.GetString("comboBox_Fixconvert.Items3") }); + comboBox_Fixconvert.Name = "comboBox_Fixconvert"; + comboBox_Fixconvert.SelectedIndexChanged += ComboBox_Fixconvert_SelectedIndexChanged; + // + // checkBox_Fixconvert + // + resources.ApplyResources(checkBox_Fixconvert, "checkBox_Fixconvert"); + checkBox_Fixconvert.Name = "checkBox_Fixconvert"; + checkBox_Fixconvert.UseVisualStyleBackColor = true; + checkBox_Fixconvert.CheckedChanged += CheckBox_Fixconvert_CheckedChanged; + // + // checkBox_FasterATRAC + // + resources.ApplyResources(checkBox_FasterATRAC, "checkBox_FasterATRAC"); + checkBox_FasterATRAC.Name = "checkBox_FasterATRAC"; + checkBox_FasterATRAC.UseVisualStyleBackColor = true; + // + // checkBox_Hidesplash + // + resources.ApplyResources(checkBox_Hidesplash, "checkBox_Hidesplash"); + checkBox_Hidesplash.Name = "checkBox_Hidesplash"; + checkBox_Hidesplash.UseVisualStyleBackColor = true; + // + // checkBox_Oldmode + // + resources.ApplyResources(checkBox_Oldmode, "checkBox_Oldmode"); + checkBox_Oldmode.Name = "checkBox_Oldmode"; + checkBox_Oldmode.UseVisualStyleBackColor = true; // // FormPreferencesSettings // - this.AcceptButton = this.button_OK; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.button_Cancel; - this.ClientSize = new System.Drawing.Size(394, 251); - this.ControlBox = false; - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.button_Cancel); - this.Controls.Add(this.button_OK); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.Name = "FormPreferencesSettings"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Preferences"; - this.Load += new System.EventHandler(this.FormPreferencesSettings_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.tabPage2.PerformLayout(); - this.ResumeLayout(false); - + AcceptButton = button_OK; + resources.ApplyResources(this, "$this"); + AutoScaleMode = AutoScaleMode.Font; + CancelButton = button_Cancel; + ControlBox = false; + Controls.Add(tabControl1); + Controls.Add(button_Cancel); + Controls.Add(button_OK); + FormBorderStyle = FormBorderStyle.FixedDialog; + MaximizeBox = false; + Name = "FormPreferencesSettings"; + Load += FormPreferencesSettings_Load; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + tabControl1.ResumeLayout(false); + tabPage1.ResumeLayout(false); + tabPage1.PerformLayout(); + tabPage2.ResumeLayout(false); + tabPage2.PerformLayout(); + tabPage3.ResumeLayout(false); + tabPage3.PerformLayout(); + ResumeLayout(false); } #endregion @@ -284,6 +302,15 @@ private void InitializeComponent() private TabPage tabPage1; private TabPage tabPage2; private CheckBox checkBox_ShowFolder; - private Label label3; + private CheckBox checkBox_Checkupdate; + private TabPage tabPage3; + private CheckBox checkBox_Hidesplash; + private CheckBox checkBox_Oldmode; + private Button button_Splashimg; + private TextBox textBox_Splashimg; + private CheckBox checkBox_Splashimg; + private CheckBox checkBox_FasterATRAC; + private ComboBox comboBox_Fixconvert; + private CheckBox checkBox_Fixconvert; } } \ No newline at end of file diff --git a/src/Forms/FormPreferencesSettings.cs b/src/Forms/FormPreferencesSettings.cs index 20aa517..39d7d57 100644 --- a/src/Forms/FormPreferencesSettings.cs +++ b/src/Forms/FormPreferencesSettings.cs @@ -1,4 +1,5 @@ using ATRACTool_Reloaded.Localizable; +using Microsoft.VisualBasic; using static ATRACTool_Reloaded.Common; namespace ATRACTool_Reloaded @@ -14,88 +15,181 @@ public FormPreferencesSettings() private void FormPreferencesSettings_Load(object sender, EventArgs e) { + comboBox_Fixconvert.SelectedIndex = 0; + Config.Load(xmlpath); - switch (bool.Parse(Config.Entry["Save_IsManual"].Value)) - { - case true: - { - radioButton_spc.Checked = true; - radioButton_nml.Checked = false; - label1.Enabled = true; - button_Clear.Enabled = true; - button_Browse.Enabled = true; - textBox_Path.Enabled = true; - checkBox_Subfolder.Enabled = true; - - if (Config.Entry["Save_Isfolder"].Value != "") + + try + { + switch (bool.Parse(Config.Entry["Check_Update"].Value)) + { + case true: + checkBox_Checkupdate.Checked = true; + break; + case false: + checkBox_Checkupdate.Checked = false; + break; + } + + switch (bool.Parse(Config.Entry["SplashImage"].Value)) + { + case true: + checkBox_Splashimg.Checked = true; + textBox_Splashimg.Enabled = true; + button_Splashimg.Enabled = true; + if (!string.IsNullOrEmpty(Config.Entry["SplashImage_Path"].Value)) { - textBox_Path.Text = Config.Entry["Save_Isfolder"].Value; + textBox_Splashimg.Text = Config.Entry["SplashImage_Path"].Value; } else { - textBox_Path.Text = null; + textBox_Splashimg.Text = string.Empty; } + break; + case false: + checkBox_Splashimg.Checked = false; + textBox_Splashimg.Enabled = false; + button_Splashimg.Enabled = false; + break; + } + + switch (bool.Parse(Config.Entry["Oldmode"].Value)) + { + case true: + checkBox_Oldmode.Checked = true; + break; + case false: + checkBox_Oldmode.Checked = false; + break; + } - switch (bool.Parse(Config.Entry["Save_IsSubfolder"].Value)) + switch (bool.Parse(Config.Entry["HideSplash"].Value)) + { + case true: + checkBox_Hidesplash.Checked = true; + break; + case false: + checkBox_Hidesplash.Checked = false; + break; + } + + switch (bool.Parse(Config.Entry["FasterATRAC"].Value)) + { + case true: + checkBox_FasterATRAC.Checked = true; + break; + case false: + checkBox_FasterATRAC.Checked = false; + break; + } + + switch (bool.Parse(Config.Entry["FixedConvert"].Value)) + { + case true: + checkBox_Fixconvert.Checked = true; + comboBox_Fixconvert.Enabled = true; + comboBox_Fixconvert.SelectedIndex = int.Parse(Config.Entry["ConvertType"].Value) switch + { + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + _ => 0, + }; + break; + case false: + checkBox_Fixconvert.Checked = false; + comboBox_Fixconvert.Enabled = false; + break; + } + + switch (bool.Parse(Config.Entry["Save_IsManual"].Value)) + { + case true: { - case true: - { - label2.Enabled = true; - textBox_suffix.Enabled = true; - checkBox_Subfolder.Checked = true; + radioButton_spc.Checked = true; + radioButton_nml.Checked = false; + label1.Enabled = true; + button_Clear.Enabled = true; + button_Browse.Enabled = true; + textBox_Path.Enabled = true; + checkBox_Subfolder.Enabled = true; - if (Config.Entry["Save_Subfolder_Suffix"].Value != "") + if (Config.Entry["Save_Isfolder"].Value != "") + { + textBox_Path.Text = Config.Entry["Save_Isfolder"].Value; + } + else + { + textBox_Path.Text = null; + } + + switch (bool.Parse(Config.Entry["Save_IsSubfolder"].Value)) + { + case true: { - textBox_suffix.Text = Config.Entry["Save_Subfolder_Suffix"].Value; + label2.Enabled = true; + textBox_suffix.Enabled = true; + checkBox_Subfolder.Checked = true; + + if (Config.Entry["Save_Subfolder_Suffix"].Value != "") + { + textBox_suffix.Text = Config.Entry["Save_Subfolder_Suffix"].Value; + } + else + { + textBox_suffix.Text = null; + } + break; } - else + case false: { + label2.Enabled = false; textBox_suffix.Text = null; + textBox_suffix.Enabled = false; + checkBox_Subfolder.Checked = false; + break; } - break; - } - case false: - { - label2.Enabled = false; - textBox_suffix.Text = null; - textBox_suffix.Enabled = false; - checkBox_Subfolder.Checked = false; - break; - } + } + + break; + } + case false: + { + radioButton_spc.Checked = false; + radioButton_nml.Checked = true; + label1.Enabled = false; + label2.Enabled = false; + button_Clear.Enabled = false; + button_Browse.Enabled = false; + textBox_Path.Text = null; + textBox_Path.Enabled = false; + textBox_suffix.Text = null; + textBox_suffix.Enabled = false; + checkBox_Subfolder.Checked = false; + checkBox_Subfolder.Enabled = false; + break; } + } - break; - } - case false: - { - radioButton_spc.Checked = false; - radioButton_nml.Checked = true; - label1.Enabled = false; - label2.Enabled = false; - button_Clear.Enabled = false; - button_Browse.Enabled = false; - textBox_Path.Text = null; - textBox_Path.Enabled = false; - textBox_suffix.Text = null; - textBox_suffix.Enabled = false; - checkBox_Subfolder.Checked = false; - checkBox_Subfolder.Enabled = false; - break; - } + switch (bool.Parse(Config.Entry["ShowFolder"].Value)) + { + case true: + { + checkBox_ShowFolder.Checked = true; + break; + } + case false: + { + checkBox_ShowFolder.Checked = false; + break; + } + } } - - switch (bool.Parse(Config.Entry["ShowFolder"].Value)) + catch (Exception ex) { - case true: - { - checkBox_ShowFolder.Checked = true; - break; - } - case false: - { - checkBox_ShowFolder.Checked = false; - break; - } + MessageBox.Show(this, string.Format("An error has occurred.\n{0}\nThe configuration file is incorrect.", ex), Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); } } @@ -161,17 +255,83 @@ private void CheckBox_Subfolder_CheckedChanged(object sender, EventArgs e) private void Button_OK_Click(object sender, EventArgs e) { + if (checkBox_Splashimg.Checked == true && string.IsNullOrEmpty(textBox_Splashimg.Text)) + { + MessageBox.Show(this, Localization.SplashPathErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } if (radioButton_spc.Checked == true && textBox_Path.Text == "") { - MessageBox.Show(this, "Path not specified.", Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, Localization.SpecificPathErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (radioButton_spc.Checked == true && checkBox_Subfolder.Checked == true && textBox_suffix.Text == "") { - MessageBox.Show(this, "suffix is not specified.", Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, Localization.SpecificSubfolderErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } + string oldsplashimgpath = Config.Entry["SplashImage_Path"].Value; + + + if (checkBox_Checkupdate.Checked != true) + { + Config.Entry["Check_Update"].Value = "false"; + } + else + { + Config.Entry["Check_Update"].Value = "true"; + } + + if (checkBox_Splashimg.Checked != true) + { + Config.Entry["SplashImage"].Value = "false"; + Config.Entry["SplashImage_Path"].Value = ""; + } + else + { + Config.Entry["SplashImage"].Value = "true"; + Config.Entry["SplashImage_Path"].Value = textBox_Splashimg.Text; + } + + if (checkBox_Oldmode.Checked != true) + { + Config.Entry["Oldmode"].Value = "false"; + } + else + { + Config.Entry["Oldmode"].Value = "true"; + } + + if (checkBox_Hidesplash.Checked != true) + { + Config.Entry["HideSplash"].Value = "false"; + } + else + { + Config.Entry["HideSplash"].Value = "true"; + } + + if (checkBox_FasterATRAC.Checked != true) + { + Config.Entry["FasterATRAC"].Value = "false"; + } + else + { + Config.Entry["FasterATRAC"].Value = "true"; + } + + if (checkBox_Fixconvert.Checked != true) + { + Config.Entry["FixedConvert"].Value = "false"; + Config.Entry["ConvertType"].Value = ""; + } + else + { + Config.Entry["FixedConvert"].Value = "true"; + Config.Entry["ConvertType"].Value = comboBox_Fixconvert.SelectedIndex.ToString(); + } + if (radioButton_nml.Checked != true) { Config.Entry["Save_IsManual"].Value = "true"; @@ -219,6 +379,11 @@ private void Button_OK_Click(object sender, EventArgs e) Config.Save(xmlpath); + if (checkBox_Splashimg.Checked == true && !string.IsNullOrEmpty(textBox_Splashimg.Text) && oldsplashimgpath != textBox_Splashimg.Text) + { + MessageBox.Show(this, Localization.CustomSplashCaption, Localization.MSGBoxSuccessCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + Close(); } @@ -226,5 +391,97 @@ private void Button_Cancel_Click(object sender, EventArgs e) { Close(); } + + private void CheckBox_Checkupdate_CheckedChanged(object sender, EventArgs e) + { + if (!checkBox_Checkupdate.Checked) + { + checkBox_Checkupdate.Checked = false; + } + else + { + checkBox_Checkupdate.Checked = true; + } + } + + private void CheckBox_Splashimg_CheckedChanged(object sender, EventArgs e) + { + if (!checkBox_Splashimg.Checked) + { + checkBox_Splashimg.Checked = false; + textBox_Splashimg.Text = string.Empty; + textBox_Splashimg.Enabled = false; + button_Splashimg.Enabled = false; + } + else + { + checkBox_Splashimg.Checked = true; + textBox_Splashimg.Text = string.Empty; + textBox_Splashimg.Enabled = true; + button_Splashimg.Enabled = true; + } + } + + private void Button_Splashimg_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new() + { + Filter = "All Supported Files (*.jpg, *.png, *.bmp)|*.jpg;*.png;*.bmp", + }; + if (ofd.ShowDialog() == DialogResult.OK) + { + using var img = Image.FromFile(ofd.FileName); + if (img.Width == 800 && img.Height == 480) + { + textBox_Splashimg.Text = ofd.FileName; + } + else if (img.Width == 400 && img.Height == 240) + { + textBox_Splashimg.Text = ofd.FileName; + } + else + { + MessageBox.Show(Localization.CustomSplashSizeErrorCaption, Localization.MSGBoxErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); + textBox_Splashimg.Text = string.Empty; + } + return; + } + else + { + return; + } + } + + private void CheckBox_Fixconvert_CheckedChanged(object sender, EventArgs e) + { + if (!checkBox_Fixconvert.Checked) + { + checkBox_Fixconvert.Checked = false; + comboBox_Fixconvert.Enabled = false; + } + else + { + checkBox_Fixconvert.Checked = true; + comboBox_Fixconvert.Enabled = true; + comboBox_Fixconvert.SelectedIndex = 0; + } + } + + private void ComboBox_Fixconvert_SelectedIndexChanged(object sender, EventArgs e) + { + switch (comboBox_Fixconvert.SelectedIndex) + { + case 0: + break; + case 1: + break; + case 2: + break; + case 3: + break; + default: + break; + } + } } } diff --git a/src/Forms/FormPreferencesSettings.ja.resx b/src/Forms/FormPreferencesSettings.ja.resx new file mode 100644 index 0000000..0ce44ef --- /dev/null +++ b/src/Forms/FormPreferencesSettings.ja.resx @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 149, 19 + + + 毎回保存場所を確認する + + + 134, 19 + + + 指定したフォルダに保存 + + + ファイルの保存方法 + + + 38, 15 + + + パス: + + + キャンセル + + + 削除 + + + 140, 19 + + + サブフォルダーを作成する + + + 85, 15 + + + サブフォルダ名: + + + 一般 + + + 231, 19 + + + 独自のスプラッシュスクリーン画像を設定する + + + 242, 19 + + + アプリケーション起動時にアップデートを確認する + + + 243, 19 + + + 処理が完了したら保存先のフォルダを表示する + + + 高度 + + + [ATRAC3+/ATRAC9] 44.1kHz (ATRAC3+の場合PSPに適合) + + + [ATRAC3+/ATRAC9] 48kHz (ATRAC3+の場合PS3に適合) + + + [ATRAC9] 12kHz + + + [ATRAC9] 24kHz + + + 249, 19 + + + Waveファイルに変換した際の形式を固定する: + + + 246, 19 + + + ATRACを読み込んだ際に即時変換を実行する + + + 182, 19 + + + スプラッシュスクリーンを表示しない + + + 146, 19 + + + 従来のモードを有効にする + + + 詳細設定 + + \ No newline at end of file diff --git a/src/Forms/FormPreferencesSettings.resx b/src/Forms/FormPreferencesSettings.resx index f298a7b..a336af4 100644 --- a/src/Forms/FormPreferencesSettings.resx +++ b/src/Forms/FormPreferencesSettings.resx @@ -1,4 +1,64 @@ - + + + @@ -57,4 +117,722 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + False + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 4, 24 + + + 0 + + + tabPage1 + + + Fixed output format for Wave conversion: + + + label1 + + + tabPage2 + + + 2 + + + 13, 151 + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Set your own splash screen image + + + Enable old mode + + + 2 + + + tabControl1 + + + False + + + 4, 24 + + + True + + + checkBox_FasterATRAC + + + groupBox1 + + + Path: + + + Always ask for a save location + + + 2 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 47, 69 + + + radioButton_spc + + + 0 + + + tabPage2 + + + 7, 8 + + + Don't show splash screen + + + System.Windows.Forms.TabPage, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + 9 + + + False + + + $this + + + 230, 23 + + + 241, 19 + + + 0, 0 + + + 221, 216 + + + 181, 19 + + + 382, 182 + + + 365, 55 + + + 6 + + + 10 + + + 26, 23 + + + 6 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + Check for updates when launching applications + + + 2 + + + 0 + + + Behavior when saving a file + + + True + + + 338, 152 + + + 4, 24 + + + tabPage2 + + + 0 + + + False + + + True + + + [For ATRAC3+/ATRAC9] 44.1kHz (ATRAC3+ is best for PSP) + + + 92, 15 + + + tabPage1 + + + tabPage3 + + + False + + + checkBox_Oldmode + + + 114, 19 + + + 3 + + + 7, 15 + + + 8, 28 + + + tabPage3 + + + 1 + + + + 3, 3, 3, 3 + + + 1 + + + 7 + + + 4 + + + 8, 78 + + + groupBox1 + + + 0 + + + Output to specified folder + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 283, 69 + + + $this + + + 276, 19 + + + checkBox_Fixconvert + + + button_OK + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 382, 182 + + + tabPage3 + + + 3 + + + Clear + + + True + + + 5 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage3 + + + 3, 3, 3, 3 + + + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + 12 + + + 2 + + + True + + + Create subfolders + + + 271, 23 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6, 6 + + + tabPage2 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + True + + + 3 + + + button_Cancel + + + 75, 23 + + + 365, 23 + + + + CenterScreen + + + 6, 22 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + OK + + + True + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + [For ATRAC9] 12kHz + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + 34, 15 + + + Advanced + + + False + + + 57, 23 + + + 160, 19 + + + IO + + + ... + + + 11 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + [For ATRAC3+/ATRAC9] 48kHz (ATRAC3+ is best for PS3) + + + ... + + + System.Windows.Forms.TabPage, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + tabPage1 + + + 35, 23 + + + 7, 72 + + + label2 + + + General + + + 1 + + + Preferences + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + textBox_suffix + + + comboBox_Fixconvert + + + 8 + + + textBox_Splashimg + + + 6, 128 + + + tabPage1 + + + 389, 251 + + + 12 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage3 + + + 295, 19 + + + 6, 153 + + + groupBox1 + + + button_Splashimg + + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage2 + + + 4 + + + 245, 19 + + + True + + + 302, 216 + + + 101, 121 + + + tabControl1 + + + 5 + + + tabPage2 + + + tabPage2 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 8, 3 + + + 13, 98 + + + 0 + + + checkBox_Subfolder + + + 1 + + + 8, 103 + + + tabPage2 + + + 1 + + + Cancel + + + Open destination folder after completion + + + 117, 19 + + + 75, 23 + + + 3 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FormPreferencesSettings + + + 390, 210 + + + 0 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + 0 + + + button_Clear + + + 8 + + + 2 + + + tabControl1 + + + 203, 19 + + + tabPage2 + + + tabControl1 + + + checkBox_ShowFolder + + + 1 + + + 1 + + + 198, 22 + + + tabPage2 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 326, 23 + + + True + + + checkBox_Hidesplash + + + 315, 69 + + + 7, 124 + + + 2 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + radioButton_nml + + + Subfolder suffix: + + + True + + + $this + + + 3 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + 382, 182 + + + 2 + + + textBox_Path + + + 0 + + + Perform immediate conversion when ATRAC is read + + + 8, 53 + + + 159, 19 + + + checkBox_Splashimg + + + [For ATRAC9] 24kHz + + + tabPage3 + + + 7 + + + checkBox_Checkupdate + + + tabPage1 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + button_Browse + + + 3 + + + False + + + True + \ No newline at end of file diff --git a/src/Forms/FormProgress.cs b/src/Forms/FormProgress.cs index c6faad1..e1ffe66 100644 --- a/src/Forms/FormProgress.cs +++ b/src/Forms/FormProgress.cs @@ -624,7 +624,7 @@ private static bool Encode_DoWork(IProgress p, CancellationToken cToken) { Generic.lpcreatev2 = true; Generic.files = fs; - using FormLPC form = new(); + using FormLPC form = new(true); form.ShowDialog(); Generic.EncodeParamAT3 = Config.Entry["ATRAC3_Params"].Value; @@ -678,7 +678,7 @@ private static bool Encode_DoWork(IProgress p, CancellationToken cToken) { Generic.lpcreatev2 = true; Generic.files = fs; - using FormLPC form = new(); + using FormLPC form = new(true); form.ShowDialog(); Generic.EncodeParamAT3 = Config.Entry["ATRAC3_Params"].Value; @@ -742,7 +742,7 @@ private static bool Encode_DoWork(IProgress p, CancellationToken cToken) { Generic.lpcreatev2 = true; Generic.files = fs; - using FormLPC form = new(); + using FormLPC form = new(true); form.ShowDialog(); Generic.EncodeParamAT9 = Config.Entry["ATRAC9_Params"].Value; @@ -796,7 +796,7 @@ private static bool Encode_DoWork(IProgress p, CancellationToken cToken) { Generic.lpcreatev2 = true; Generic.files = fs; - using FormLPC form = new(); + using FormLPC form = new(true); form.ShowDialog(); Generic.EncodeParamAT9 = Config.Entry["ATRAC9_Params"].Value; diff --git a/src/Forms/FormSplash.Designer.cs b/src/Forms/FormSplash.Designer.cs index e9c9eb6..e71e50e 100644 --- a/src/Forms/FormSplash.Designer.cs +++ b/src/Forms/FormSplash.Designer.cs @@ -28,45 +28,47 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.label_log = new System.Windows.Forms.Label(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.SuspendLayout(); + label_log = new Label(); + progressBar1 = new ProgressBar(); + SuspendLayout(); // // label_log // - this.label_log.AutoEllipsis = true; - this.label_log.Location = new System.Drawing.Point(12, 144); - this.label_log.Name = "label_log"; - this.label_log.Size = new System.Drawing.Size(273, 15); - this.label_log.TabIndex = 0; - this.label_log.Text = "Loading..."; - this.label_log.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + label_log.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + label_log.AutoEllipsis = true; + label_log.Font = new Font("Yu Gothic UI", 11.25F, FontStyle.Bold, GraphicsUnit.Point); + label_log.Location = new Point(12, 130); + label_log.Name = "label_log"; + label_log.Size = new Size(273, 21); + label_log.TabIndex = 0; + label_log.Text = "Loading..."; + label_log.TextAlign = ContentAlignment.MiddleCenter; // // progressBar1 // - this.progressBar1.Location = new System.Drawing.Point(12, 132); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(276, 10); - this.progressBar1.TabIndex = 1; + progressBar1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + progressBar1.Location = new Point(12, 153); + progressBar1.Name = "progressBar1"; + progressBar1.Size = new Size(276, 5); + progressBar1.TabIndex = 1; // // FormSplash // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackgroundImage = global::ATRACTool_Reloaded.Properties.Resources.SIE; - this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.ClientSize = new System.Drawing.Size(300, 164); - this.ControlBox = false; - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.label_log); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Name = "FormSplash"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Loading..."; - this.Load += new System.EventHandler(this.FormSplash_Load); - this.ResumeLayout(false); - + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackgroundImage = Properties.Resources.SIE; + BackgroundImageLayout = ImageLayout.Center; + ClientSize = new Size(300, 164); + ControlBox = false; + Controls.Add(progressBar1); + Controls.Add(label_log); + FormBorderStyle = FormBorderStyle.None; + Name = "FormSplash"; + ShowInTaskbar = false; + StartPosition = FormStartPosition.CenterScreen; + Text = "Loading..."; + Load += FormSplash_Load; + ResumeLayout(false); } #endregion diff --git a/src/Forms/FormSplash.cs b/src/Forms/FormSplash.cs index e5b2700..0729624 100644 --- a/src/Forms/FormSplash.cs +++ b/src/Forms/FormSplash.cs @@ -1,4 +1,7 @@ -namespace ATRACTool_Reloaded +using ATRACTool_Reloaded.Localizable; +using static ATRACTool_Reloaded.Common; + +namespace ATRACTool_Reloaded { public partial class FormSplash : Form { @@ -9,9 +12,53 @@ public FormSplash() private void FormSplash_Load(object sender, EventArgs e) { - BackgroundImage = Properties.Resources.SIE; + Common.Config.Load(Common.xmlpath); + + try + { + label_log.BackColor = Color.Transparent; + if (bool.Parse(Config.Entry["SplashImage"].Value)) + { + Bitmap bimg = new(Properties.Resources.Splash); + Bitmap cimg = new(Config.Entry["SplashImage_Path"].Value); + using Graphics g = Graphics.FromImage(cimg); + g.DrawImage(bimg, 0, 0, cimg.Width, cimg.Height); + Width = cimg.Width; + Height = cimg.Height; + Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2; + Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2; + BackgroundImage = cimg; + } + else + { + Bitmap bimg = new(Properties.Resources.Splash); + Bitmap cimg = new(Properties.Resources.Splash_SIE_Default); + using Graphics g = Graphics.FromImage(cimg); + g.DrawImage(bimg, 0, 0, cimg.Width, cimg.Height); + Width = cimg.Width; + Height = cimg.Height; + Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2; + Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2; + BackgroundImage = cimg; + } + } + catch (Exception ex) + { + Generic.GlobalException = ex; + Bitmap bimg = new(Properties.Resources.Splash); + Bitmap cimg = new(Properties.Resources.Splash_SIE_Default); + using Graphics g = Graphics.FromImage(cimg); + g.DrawImage(bimg, 0, 0, cimg.Width, cimg.Height); + Width = cimg.Width; + Height = cimg.Height; + Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2; + Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2; + BackgroundImage = cimg; + } + + progressBar1.Style = ProgressBarStyle.Marquee; - progressBar1.MarqueeAnimationSpeed = 50; + progressBar1.MarqueeAnimationSpeed = 25; } public string ProgressMsg diff --git a/src/Forms/FormSplash.resx b/src/Forms/FormSplash.resx index f298a7b..a395bff 100644 --- a/src/Forms/FormSplash.resx +++ b/src/Forms/FormSplash.resx @@ -1,4 +1,64 @@ - + + +