From 6d077da61d9392471c2fb5fc8c2b4f78c94f0ea7 Mon Sep 17 00:00:00 2001 From: yyagi Date: Wed, 24 Jan 2018 00:08:38 +0900 Subject: [PATCH] =?utf8?q?#28263=20DTX2WAV=20002=E3=80=82=20=20*=20?= =?utf8?q?=E5=90=84=E3=83=91=E3=83=BC=E3=83=88=E3=81=AE=E9=9F=B3=E9=87=8F?= =?utf8?q?=E3=83=90=E3=83=A9=E3=83=B3=E3=82=B9=E5=A4=89=E6=9B=B4=E6=A9=9F?= =?utf8?q?=E8=83=BD=E3=82=92=E6=90=AD=E8=BC=89=E3=80=82Drums=E3=82=84BGM?= =?utf8?q?=E3=81=AA=E3=81=A9=E3=81=AE=E9=9F=B3=E9=87=8F=E6=AF=94=E7=8E=87?= =?utf8?q?=E3=82=92=E5=80=8B=E5=88=A5=E3=81=AB=E5=A4=89=E6=9B=B4=E5=8F=AF?= =?utf8?q?=E8=83=BD=E3=80=82=20=20*=20=E3=83=9C=E3=83=AA=E3=83=A5=E3=83=BC?= =?utf8?q?=E3=83=A0=E8=A8=AD=E5=AE=9A=E3=81=AE=E4=BF=9D=E6=8C=81=E6=A9=9F?= =?utf8?q?=E8=83=BD=E3=80=82=E3=82=A2=E3=83=97=E3=83=AA=E3=82=92=E5=86=8D?= =?utf8?q?=E8=B5=B7=E5=8B=95=E3=81=97=E3=81=A6=E3=82=82=E8=A8=AD=E5=AE=9A?= =?utf8?q?=E3=81=8C=E4=BF=9D=E6=8C=81=E3=81=95=E3=82=8C=E3=80=81=E6=AC=A1?= =?utf8?q?=E5=9B=9E=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AB=E5=BE=A9=E5=85=83?= =?utf8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=80=82=E3=82=A2=E3=83=97=E3=83=AA?= =?utf8?q?=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=A2?= =?utf8?q?=E3=83=83=E3=83=97=E6=99=82=E3=82=82=E3=80=81=E5=8F=A4=E3=81=84?= =?utf8?q?=E8=A8=AD=E5=AE=9A=E5=80=A4=E3=82=92=E3=81=9D=E3=81=AE=E3=81=BE?= =?utf8?q?=E3=81=BE=E5=BC=95=E3=81=8D=E7=B6=99=E3=81=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- DTX2WAV/App.config | 36 ++++ DTX2WAV/Form1.Designer.cs | 107 +++++----- DTX2WAV/Form1.cs | 60 +++++- DTX2WAV/Form1.resx | 218 ++++++++------------- DTX2WAV/Properties/AssemblyInfo.cs | 4 +- DTX2WAV/Properties/Settings.Designer.cs | 150 +++++++++++--- DTX2WAV/Properties/Settings.settings | 38 +++- DTXMania/コード/全体/CDTX2WAVmode.cs | 1 + DTXMania/コード/全体/CDTXMania.cs | 7 + DTXMania/コード/全体/cmdparse.cs | 25 ++- FDK/コード/03.サウンド/CSound.cs | 6 + .../03.サウンド/CSoundDeviceWASAPI.cs | 6 +- 12 files changed, 423 insertions(+), 235 deletions(-) diff --git a/DTX2WAV/App.config b/DTX2WAV/App.config index 016d28fc..13e2572b 100644 --- a/DTX2WAV/App.config +++ b/DTX2WAV/App.config @@ -1,6 +1,42 @@  + + +
+ + + + + + 100 + + + 100 + + + 100 + + + 100 + + + 100 + + + 100 + + + 0 + + + True + + + False + + + \ No newline at end of file diff --git a/DTX2WAV/Form1.Designer.cs b/DTX2WAV/Form1.Designer.cs index 3ba71355..30a3efe0 100644 --- a/DTX2WAV/Form1.Designer.cs +++ b/DTX2WAV/Form1.Designer.cs @@ -51,58 +51,57 @@ this.button_Cancel = new System.Windows.Forms.Button(); this.button_Convert = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label10 = new System.Windows.Forms.Label(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox_MonitorSound = new System.Windows.Forms.CheckBox(); this.numericUpDown_Master = new System.Windows.Forms.NumericUpDown(); + this.bindingSource_Master = new System.Windows.Forms.BindingSource(this.components); this.label9 = new System.Windows.Forms.Label(); this.trackBar_Master = new System.Windows.Forms.TrackBar(); this.numericUpDown_Bass = new System.Windows.Forms.NumericUpDown(); + this.bindingSource_Bass = new System.Windows.Forms.BindingSource(this.components); this.label8 = new System.Windows.Forms.Label(); this.trackBar_Bass = new System.Windows.Forms.TrackBar(); this.numericUpDown_Guitar = new System.Windows.Forms.NumericUpDown(); + this.bindingSource_Guitar = new System.Windows.Forms.BindingSource(this.components); this.label7 = new System.Windows.Forms.Label(); this.trackBar_Guitar = new System.Windows.Forms.TrackBar(); this.numericUpDown_Drums = new System.Windows.Forms.NumericUpDown(); + this.bindingSource_Drums = new System.Windows.Forms.BindingSource(this.components); this.label6 = new System.Windows.Forms.Label(); this.trackBar_Drums = new System.Windows.Forms.TrackBar(); this.numericUpDown_SE = new System.Windows.Forms.NumericUpDown(); - this.bindingSource_BGM = new System.Windows.Forms.BindingSource(this.components); + this.bindingSource_SE = new System.Windows.Forms.BindingSource(this.components); this.label5 = new System.Windows.Forms.Label(); this.trackBar_SE = new System.Windows.Forms.TrackBar(); this.numericUpDown_BGM = new System.Windows.Forms.NumericUpDown(); + this.bindingSource_BGM = new System.Windows.Forms.BindingSource(this.components); this.label4 = new System.Windows.Forms.Label(); this.trackBar_BGM = new System.Windows.Forms.TrackBar(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.bindingSource_SE = new System.Windows.Forms.BindingSource(this.components); - this.bindingSource_Drums = new System.Windows.Forms.BindingSource(this.components); - this.bindingSource_Guitar = new System.Windows.Forms.BindingSource(this.components); - this.bindingSource_Bass = new System.Windows.Forms.BindingSource(this.components); - this.bindingSource_Master = new System.Windows.Forms.BindingSource(this.components); this.menuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Master)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Master)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Master)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Bass)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Bass)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Bass)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Guitar)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Guitar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Guitar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Drums)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Drums)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Drums)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SE)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_BGM)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_SE)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_SE)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_BGM)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_BGM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_BGM)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_SE)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Drums)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Guitar)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Bass)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Master)).BeginInit(); this.SuspendLayout(); // // menuStrip1 @@ -243,8 +242,7 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.label10); - this.groupBox2.Controls.Add(this.checkBox1); + this.groupBox2.Controls.Add(this.checkBox_MonitorSound); this.groupBox2.Controls.Add(this.numericUpDown_Master); this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.trackBar_Master); @@ -267,18 +265,13 @@ this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // - // label10 - // - resources.ApplyResources(this.label10, "label10"); - this.label10.Name = "label10"; - // - // checkBox1 + // checkBox_MonitorSound // - resources.ApplyResources(this.checkBox1, "checkBox1"); - this.checkBox1.Checked = true; - this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Name = "checkBox1"; - this.checkBox1.UseVisualStyleBackColor = true; + resources.ApplyResources(this.checkBox_MonitorSound, "checkBox_MonitorSound"); + this.checkBox_MonitorSound.Checked = true; + this.checkBox_MonitorSound.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox_MonitorSound.Name = "checkBox_MonitorSound"; + this.checkBox_MonitorSound.UseVisualStyleBackColor = true; // // numericUpDown_Master // @@ -291,6 +284,10 @@ 0, 0}); // + // bindingSource_Master + // + this.bindingSource_Master.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + // // label9 // resources.ApplyResources(this.label9, "label9"); @@ -322,6 +319,10 @@ 0, 0}); // + // bindingSource_Bass + // + this.bindingSource_Bass.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + // // label8 // resources.ApplyResources(this.label8, "label8"); @@ -353,6 +354,10 @@ 0, 0}); // + // bindingSource_Guitar + // + this.bindingSource_Guitar.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + // // label7 // resources.ApplyResources(this.label7, "label7"); @@ -384,6 +389,10 @@ 0, 0}); // + // bindingSource_Drums + // + this.bindingSource_Drums.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + // // label6 // resources.ApplyResources(this.label6, "label6"); @@ -415,9 +424,9 @@ 0, 0}); // - // bindingSource_BGM + // bindingSource_SE // - this.bindingSource_BGM.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + this.bindingSource_SE.DataSource = typeof(DTX2WAV.Main.VolumeSlider); // // label5 // @@ -450,6 +459,10 @@ 0, 0}); // + // bindingSource_BGM + // + this.bindingSource_BGM.DataSource = typeof(DTX2WAV.Main.VolumeSlider); + // // label4 // resources.ApplyResources(this.label4, "label4"); @@ -471,26 +484,6 @@ this.tabPage2.Name = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // - // bindingSource_SE - // - this.bindingSource_SE.DataSource = typeof(DTX2WAV.Main.VolumeSlider); - // - // bindingSource_Drums - // - this.bindingSource_Drums.DataSource = typeof(DTX2WAV.Main.VolumeSlider); - // - // bindingSource_Guitar - // - this.bindingSource_Guitar.DataSource = typeof(DTX2WAV.Main.VolumeSlider); - // - // bindingSource_Bass - // - this.bindingSource_Bass.DataSource = typeof(DTX2WAV.Main.VolumeSlider); - // - // bindingSource_Master - // - this.bindingSource_Master.DataSource = typeof(DTX2WAV.Main.VolumeSlider); - // // Main // resources.ApplyResources(this, "$this"); @@ -500,6 +493,7 @@ this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "Main"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); this.Shown += new System.EventHandler(this.Main_Shown); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); @@ -510,23 +504,23 @@ this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Master)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Master)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Master)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Bass)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Bass)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Bass)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Guitar)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Guitar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Guitar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_Drums)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Drums)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_Drums)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SE)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_BGM)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_SE)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_SE)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_BGM)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource_BGM)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar_BGM)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_SE)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Drums)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Guitar)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Bass)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource_Master)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -554,7 +548,7 @@ private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox_MonitorSound; private System.Windows.Forms.NumericUpDown numericUpDown_Master; private System.Windows.Forms.Label label9; private System.Windows.Forms.TrackBar trackBar_Master; @@ -578,7 +572,6 @@ private System.Windows.Forms.BindingSource bindingSource_BGM; private System.Windows.Forms.Button button_Cancel; private System.Windows.Forms.Button button_Convert; - private System.Windows.Forms.Label label10; private System.Windows.Forms.BindingSource bindingSource_SE; private System.Windows.Forms.BindingSource bindingSource_Drums; private System.Windows.Forms.BindingSource bindingSource_Guitar; diff --git a/DTX2WAV/Form1.cs b/DTX2WAV/Form1.cs index f0af21eb..b3cd7ee2 100644 --- a/DTX2WAV/Form1.cs +++ b/DTX2WAV/Form1.cs @@ -30,15 +30,48 @@ namespace DTX2WAV /// /// メインウインドウの表示時に実行 /// タイトルバーに、アプリ名とリリース番号を表示する + /// 設定値の復元 /// /// /// private void Main_Shown(object sender, EventArgs e) { + #region [ タイトルバーの設定 ] System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly(); int ver_asm_major = asm.GetName().Version.Major; - this.Text = "DTX2WAV Rel" + ver_asm_major.ToString("D3"); + #endregion + + #region [ 設定値の復元 ] + // アプリのverup時は旧バージョンの設定を引き継ぐ。 + // さもなくば、前回終了時の設定値を引き継ぐ。 + if (Properties.Settings.Default.IsUpgrade == false) + { + // Upgradeを実行する + Properties.Settings.Default.Upgrade(); + + // 「Upgradeを実行した」という情報を設定する + Properties.Settings.Default.IsUpgrade = true; + + // 現行バージョンの設定を保存する + Properties.Settings.Default.Save(); + } + else + { + // 設定値の復元 + Properties.Settings.Default.Reload(); + } + #endregion + + #region [ 復元した設定値を、Formに反映する ] + numericUpDown_BGM.Value = Properties.Settings.Default.nVol_BGM; + numericUpDown_SE.Value = Properties.Settings.Default.nVol_SE; + numericUpDown_Drums.Value = Properties.Settings.Default.nVol_Drums; + numericUpDown_Guitar.Value = Properties.Settings.Default.nVol_Guitar; + numericUpDown_Bass.Value = Properties.Settings.Default.nVol_Bass; + numericUpDown_Master.Value = Properties.Settings.Default.nVol_Master; + checkBox_MonitorSound.Checked = Properties.Settings.Default.bMonitorSound; + #endregion } private void button_browseDTX_Click(object sender, EventArgs e) @@ -142,7 +175,9 @@ namespace DTX2WAV //アプリ名と引数の情報を設定 p.StartInfo.FileName = "DTXManiaGR.exe"; - p.StartInfo.Arguments = $"-E{comboBox_AudioFormat.Text.ToUpper()},48000,192,\"{textBox_BrowseAudio.Text}\",\"{textBox_BrowseDTX.Text}\""; + p.StartInfo.Arguments = $"-E{comboBox_AudioFormat.Text.ToUpper()},48000,192,"; + p.StartInfo.Arguments += $"{numericUpDown_BGM.Value},{numericUpDown_SE.Value},{numericUpDown_Drums.Value},{numericUpDown_Guitar.Value},{numericUpDown_Bass.Value},{numericUpDown_Master.Value},"; + p.StartInfo.Arguments += $"\"{textBox_BrowseAudio.Text}\",\"{textBox_BrowseDTX.Text}\""; //起動する p.Start(); @@ -246,6 +281,27 @@ namespace DTX2WAV } } + + /// + /// アプリ終了時に、設定値を保存 + /// + /// + /// + private void Main_FormClosing(object sender, FormClosingEventArgs e) + { + + #region [ Formの設定値を、Propertiesに退避する ] + Properties.Settings.Default.nVol_BGM = (int)numericUpDown_BGM.Value; + Properties.Settings.Default.nVol_SE = (int)numericUpDown_SE.Value; + Properties.Settings.Default.nVol_Drums = (int)numericUpDown_Drums.Value; + Properties.Settings.Default.nVol_Guitar = (int)numericUpDown_Guitar.Value; + Properties.Settings.Default.nVol_Bass = (int)numericUpDown_Bass.Value; + Properties.Settings.Default.nVol_Master = (int)numericUpDown_Master.Value; + Properties.Settings.Default.bMonitorSound = checkBox_MonitorSound.Checked; + #endregion + + Properties.Settings.Default.Save(); + } } } diff --git a/DTX2WAV/Form1.resx b/DTX2WAV/Form1.resx index 653d41af..9b733516 100644 --- a/DTX2WAV/Form1.resx +++ b/DTX2WAV/Form1.resx @@ -582,69 +582,35 @@ 1 - + True - - MS UI Gothic, 48pt - - - NoControl - - - 114, 34 - - - 405, 128 - - - 19 - - - 使えませんねん -亀は万年 - - - label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 0 - - - True - - + NoControl - + 22, 227 - + 522, 16 - + 18 - + 録音中の音をスピーカーに出力する(しかし実現方法不明。WASAPI排他じゃなければやりようがあるのだが) - - checkBox1 + + checkBox_MonitorSound - + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + groupBox2 - - 1 + + 0 177, 56 @@ -668,7 +634,7 @@ groupBox2 - 2 + 1 True @@ -680,13 +646,13 @@ 20, 188 - 86, 12 + 100, 12 16 - マスターボリューム + マスターボリューム(%) label9 @@ -698,11 +664,8 @@ groupBox2 - 3 + 2 - - 177, 56 - False @@ -728,7 +691,7 @@ groupBox2 - 4 + 3 17, 56 @@ -752,7 +715,7 @@ groupBox2 - 5 + 4 True @@ -764,13 +727,13 @@ 20, 135 - 65, 12 + 79, 12 13 - Bassの音量 + Bassの音量(%) label8 @@ -782,11 +745,8 @@ groupBox2 - 6 + 5 - - 17, 56 - False @@ -812,7 +772,7 @@ groupBox2 - 7 + 6 1069, 17 @@ -836,7 +796,7 @@ groupBox2 - 8 + 7 True @@ -848,13 +808,13 @@ 20, 107 - 70, 12 + 84, 12 10 - Guitarの音量 + Guitarの音量(%) label7 @@ -866,11 +826,8 @@ groupBox2 - 9 + 8 - - 1069, 17 - False @@ -896,7 +853,7 @@ groupBox2 - 10 + 9 932, 17 @@ -920,7 +877,7 @@ groupBox2 - 11 + 10 True @@ -932,13 +889,13 @@ 20, 79 - 72, 12 + 86, 12 7 - Drumsの音量 + Drumsの音量(%) label6 @@ -950,11 +907,8 @@ groupBox2 - 12 + 11 - - 932, 17 - False @@ -980,7 +934,7 @@ groupBox2 - 13 + 12 783, 17 @@ -1004,7 +958,7 @@ groupBox2 - 14 + 13 True @@ -1016,13 +970,13 @@ 20, 51 - 53, 12 + 67, 12 4 - SEの音量 + SEの音量(%) label5 @@ -1034,11 +988,8 @@ groupBox2 - 15 + 14 - - 783, 17 - False @@ -1064,7 +1015,7 @@ groupBox2 - 16 + 15 621, 17 @@ -1088,7 +1039,7 @@ groupBox2 - 17 + 16 True @@ -1100,13 +1051,13 @@ 20, 23 - 64, 12 + 78, 12 1 - BGMの音量 + BGMの音量(%) label4 @@ -1118,7 +1069,7 @@ groupBox2 - 18 + 17 False @@ -1145,7 +1096,7 @@ groupBox2 - 19 + 18 6, 150 @@ -1246,29 +1197,29 @@ 0 - - 621, 17 - - - 388, 17 + + 177, 56 - - 524, 17 + + 17, 56 - - 783, 17 + + 1069, 17 932, 17 - - 1069, 17 + + 783, 17 - - 17, 56 + + 621, 17 - - 177, 56 + + 388, 17 + + + 524, 17 True @@ -1279,9 +1230,6 @@ 681, 535 - - NoControl - DTX2WAV @@ -1315,28 +1263,22 @@ System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - bindingSource_BGM + + bindingSource_Master - + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - saveFileDialog1 - - - System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolTip1 + + bindingSource_Bass - - System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - bindingSource_SE + + bindingSource_Guitar - + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -1345,23 +1287,29 @@ System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - bindingSource_Guitar + + bindingSource_SE - + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - bindingSource_Bass + + bindingSource_BGM - + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - bindingSource_Master + + saveFileDialog1 - - System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolTip1 + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Main diff --git a/DTX2WAV/Properties/AssemblyInfo.cs b/DTX2WAV/Properties/AssemblyInfo.cs index 46410d2d..c2e98386 100644 --- a/DTX2WAV/Properties/AssemblyInfo.cs +++ b/DTX2WAV/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] diff --git a/DTX2WAV/Properties/Settings.Designer.cs b/DTX2WAV/Properties/Settings.Designer.cs index 91e6aa25..128365af 100644 --- a/DTX2WAV/Properties/Settings.Designer.cs +++ b/DTX2WAV/Properties/Settings.Designer.cs @@ -1,30 +1,134 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 // //------------------------------------------------------------------------------ -namespace DTX2WAV.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } +namespace DTX2WAV.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_BGM { + get { + return ((int)(this["nVol_BGM"])); + } + set { + this["nVol_BGM"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_SE { + get { + return ((int)(this["nVol_SE"])); + } + set { + this["nVol_SE"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_Drums { + get { + return ((int)(this["nVol_Drums"])); + } + set { + this["nVol_Drums"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_Guitar { + get { + return ((int)(this["nVol_Guitar"])); + } + set { + this["nVol_Guitar"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_Bass { + get { + return ((int)(this["nVol_Bass"])); + } + set { + this["nVol_Bass"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int nVol_Unknown { + get { + return ((int)(this["nVol_Unknown"])); + } + set { + this["nVol_Unknown"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int nVol_Master { + get { + return ((int)(this["nVol_Master"])); + } + set { + this["nVol_Master"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool bMonitorSound { + get { + return ((bool)(this["bMonitorSound"])); + } + set { + this["bMonitorSound"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool IsUpgrade { + get { + return ((bool)(this["IsUpgrade"])); + } + set { + this["IsUpgrade"] = value; + } + } + } } diff --git a/DTX2WAV/Properties/Settings.settings b/DTX2WAV/Properties/Settings.settings index 39645652..e5f7c87d 100644 --- a/DTX2WAV/Properties/Settings.settings +++ b/DTX2WAV/Properties/Settings.settings @@ -1,7 +1,33 @@  - - - - - - + + + + + 100 + + + 100 + + + 100 + + + 100 + + + 100 + + + 100 + + + 0 + + + True + + + False + + + \ No newline at end of file diff --git a/DTXMania/コード/全体/CDTX2WAVmode.cs b/DTXMania/コード/全体/CDTX2WAVmode.cs index e6a75fce..67351585 100644 --- a/DTXMania/コード/全体/CDTX2WAVmode.cs +++ b/DTXMania/コード/全体/CDTX2WAVmode.cs @@ -49,6 +49,7 @@ namespace DTXMania set; } + public int[] nMixerVolume = { 100, 100, 100, 100, 100, 100 }; /// /// コンストラクタ diff --git a/DTXMania/コード/全体/CDTXMania.cs b/DTXMania/コード/全体/CDTXMania.cs index 51ae75dc..1d6eed78 100644 --- a/DTXMania/コード/全体/CDTXMania.cs +++ b/DTXMania/コード/全体/CDTXMania.cs @@ -358,9 +358,16 @@ namespace DTXMania else if (DTX2WAVmode.Enabled) { strコンパクトモードファイル = DTX2WAVmode.dtxfilename; + #region [ FDKへの録音設定 ] FDK.CSound管理.strRecordInputDTXfilename = DTX2WAVmode.dtxfilename; FDK.CSound管理.strRecordOutFilename = DTX2WAVmode.outfilename; FDK.CSound管理.strRecordFileType = DTX2WAVmode.Format.ToString(); + for (int i = 0; i < (int)FDK.CSound.EInstType.Unknown; i++) + { + FDK.CSound管理.nMixerVolume[ i ] = DTX2WAVmode.nMixerVolume[ i ]; + } + ConfigIni.nMasterVolume.Value = DTX2WAVmode.nMixerVolume[(int)FDK.CSound.EInstType.Unknown]; // [5](Unknown)のところにMasterVolumeが入ってくるので注意 + #endregion #region [ 録音用の本体設定 ] CDTXMania.Instance.ConfigIni.nSoundDeviceType.Value = ESoundDeviceTypeForConfig.WASAPI_Exclusive; CDTXMania.Instance.ConfigIni.bEventDrivenWASAPI.Value = false; diff --git a/DTXMania/コード/全体/cmdparse.cs b/DTXMania/コード/全体/cmdparse.cs index 67b0ebf9..34e016a0 100644 --- a/DTXMania/コード/全体/cmdparse.cs +++ b/DTXMania/コード/全体/cmdparse.cs @@ -36,13 +36,14 @@ namespace DTXMania /// DTXモードとして使う場合、内部でEnabled, nStartBar, Command, NeedReload, filename, last_path, last_timestampを設定する public ECommandType ParseArguments(string arg, ref CDTXVmode cdtxv, ref CDTX2WAVmode cdtx2wav) { - // -Vvvv,ppp,"soundfilename" サウンドファイルの再生 vvv=volume, ppp=pan - // -S DTXV再生停止 - // -D(サウンドモード)(YかNが3文字続く) Viewerの設定 - // (サウンドモード) WE=WASAPI Exclusive, WS=WASAPI Shared, A1=ASIO(数値はデバイス番号), D=DSound - // YYY, YNYなど 1文字目=GRmode, 2文字目=TmeStretch, 3文字目=VSyncWait - // -Nxxx 再生開始小節番号 - // -Etype,freq,bitrate,"outfilename","dtxfilename" DTX2WAVとして使用 type="WAV"or"MP3"or"OGG", freq=48000など, bitrate=192 (kHzなど) + // -Vvvv,ppp,"soundfilename" サウンドファイルの再生 vvv=volume, ppp=pan + // -S DTXV再生停止 + // -D(サウンドモード)(YかNが3文字続く) Viewerの設定 + // (サウンドモード) WE=WASAPI Exclusive, WS=WASAPI Shared, A1=ASIO(数値はデバイス番号), D=DSound + // YYY, YNYなど 1文字目=GRmode, 2文字目=TmeStretch, 3文字目=VSyncWait + // -Nxxx 再生開始小節番号 + // -Etype,freq,bitrate,volBGM,volSE,volDrums,volGuitar,volBassmvolMaster,"outfilename","dtxfilename" + // DTX2WAVとして使用 type="WAV"or"MP3"or"OGG", freq=48000など, bitrate=192 (kHzなど) ECommandType ret = ECommandType.DTXMania; bool analyzing = true; @@ -226,7 +227,9 @@ namespace DTXMania arg = arg.Substring(2); Regex re = new Regex( - "(?.+?),(?.+?),(?.+?),(?\"?.+\"??),(?\"?.+\"??)", + "(?.+?),(?.+?),(?.+?)," + + "(?.+?),(?.+?),(?.+?),(?.+?),(?.+?),(?.+?)," + + "(?\"?.+\"??),(?\"?.+\"??)", RegexOptions.IgnoreCase ); Match m = re.Match(arg); @@ -248,6 +251,12 @@ namespace DTXMania break; } Trace.TraceInformation("cdtx2wav.Format=" + cdtx2wav.Format.ToString()); + cdtx2wav.nMixerVolume[ 0 ] = Convert.ToInt32(m.Groups["volBGM"].Value); + cdtx2wav.nMixerVolume[ 1 ] = Convert.ToInt32(m.Groups["volSE"].Value); + cdtx2wav.nMixerVolume[ 2 ] = Convert.ToInt32(m.Groups["volDrums"].Value); + cdtx2wav.nMixerVolume[ 3 ] = Convert.ToInt32(m.Groups["volGuitar"].Value); + cdtx2wav.nMixerVolume[ 4 ] = Convert.ToInt32(m.Groups["volBass"].Value); + cdtx2wav.nMixerVolume[ 5 ] = Convert.ToInt32(m.Groups["volMaster"].Value); cdtx2wav.freq = Convert.ToInt32(m.Groups["freq"].Value); cdtx2wav.bitrate = Convert.ToInt32(m.Groups["bitrate"].Value); diff --git a/FDK/コード/03.サウンド/CSound.cs b/FDK/コード/03.サウンド/CSound.cs index 56a09723..d80ea076 100644 --- a/FDK/コード/03.サウンド/CSound.cs +++ b/FDK/コード/03.サウンド/CSound.cs @@ -204,6 +204,12 @@ namespace FDK /// 録音機能で使うファイルタイプ /// public static string strRecordFileType; + + + /// + /// 録音機能で使うミキサーボリューム + /// + public static int[] nMixerVolume = { 100, 100, 100, 100, 100, 100 }; // BGM,SE,Drums,Guitar,Bass,Unknown #endregion diff --git a/FDK/コード/03.サウンド/CSoundDeviceWASAPI.cs b/FDK/コード/03.サウンド/CSoundDeviceWASAPI.cs index b61aab4d..b605023b 100644 --- a/FDK/コード/03.サウンド/CSoundDeviceWASAPI.cs +++ b/FDK/コード/03.サウンド/CSoundDeviceWASAPI.cs @@ -459,6 +459,10 @@ namespace FDK throw new Exception(string.Format("BASSミキサ(楽器[{1}]ごとのmixing)の作成に失敗しました。[{0}]", errcode, i)); } + // Mixerのボリューム設定 + Bass.BASS_ChannelSetAttribute(this.hMixer_Chips[ i ], BASSAttribute.BASS_ATTRIB_VOL, CSound管理.nMixerVolume[ i ] / 100.0f ); +Trace.TraceInformation("Vol{0}: {1}", i, CSound管理.nMixerVolume[i]); + bool b1 = BassMix.BASS_Mixer_StreamAddChannel(this.hMixer, this.hMixer_Chips[i], BASSFlag.BASS_DEFAULT); if (!b1) { @@ -508,8 +512,6 @@ namespace FDK }; } - //Bass.BASS_ChannelSetAttribute(this.hMixer_Chips[(int)CSound.EInstType.Guitar], BASSAttribute.BASS_ATTRIB_VOL, 1.50f); - // 録音設定(DTX2WAV) encoder = new EncoderWAV(this.hMixer_DeviceOut); -- 2.11.0