From 7658e60240840f847439ebbfe74bf14fb96b580f Mon Sep 17 00:00:00 2001 From: yyagi Date: Tue, 13 Feb 2018 00:59:58 +0900 Subject: [PATCH] =?utf8?q?#28263=20DTX2WAV006:=20=20*=20=E9=8C=B2=E9=9F=B3?= =?utf8?q?=E7=B5=82=E4=BA=86=E3=81=A8=E9=8C=B2=E9=9F=B3=E3=82=AD=E3=83=A3?= =?utf8?q?=E3=83=B3=E3=82=BB=E3=83=AB=E3=81=AE=E3=83=80=E3=82=A4=E3=82=A2?= =?utf8?q?=E3=83=AD=E3=82=B0=E3=81=AB=E3=80=81OS=E6=A8=99=E6=BA=96?= =?utf8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= =?utf8?q?=E3=80=82=20=20*=20=20=E6=9B=B2=E3=83=87=E3=83=BC=E3=82=BF?= =?utf8?q?=E3=81=AE=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E5=89=8D=E3=81=AB?= =?utf8?q?=E9=8C=B2=E9=9F=B3=E3=82=AD=E3=83=A3=E3=83=B3=E3=82=BB=E3=83=AB?= =?utf8?q?=E3=82=92=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AB=E4=BE=8B?= =?utf8?q?=E5=A4=96=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=97=E3=81=9F=E5=95=8F?= =?utf8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- DTX2WAV/Form_FInished_OK.Designer.cs | 17 ++++- DTX2WAV/Form_FInished_OK.cs | 10 +++ DTX2WAV/Form_FInished_OK.resx | 36 ++++++++-- DTX2WAV/Form_Finished_Fail.Designer.cs | 92 +++++++++++++++++++++++++ DTX2WAV/Form_Finished_Fail.cs | 35 ++++++++++ DTX2WAV/Form_Finished_Fail.resx | 120 +++++++++++++++++++++++++++++++++ DTX2WAV/Form_Recording.cs | 2 - DTXMania/コード/全体/CDTXMania.cs | 7 +- 8 files changed, 307 insertions(+), 12 deletions(-) create mode 100644 DTX2WAV/Form_Finished_Fail.Designer.cs create mode 100644 DTX2WAV/Form_Finished_Fail.cs create mode 100644 DTX2WAV/Form_Finished_Fail.resx diff --git a/DTX2WAV/Form_FInished_OK.Designer.cs b/DTX2WAV/Form_FInished_OK.Designer.cs index 79382852..543754ea 100644 --- a/DTX2WAV/Form_FInished_OK.Designer.cs +++ b/DTX2WAV/Form_FInished_OK.Designer.cs @@ -31,6 +31,8 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Finished_OK)); this.button_OK = new System.Windows.Forms.Button(); this.label_finished = new System.Windows.Forms.Label(); + this.pictureBox_OKIcon = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox_OKIcon)).BeginInit(); this.SuspendLayout(); // // button_OK @@ -45,14 +47,24 @@ resources.ApplyResources(this.label_finished, "label_finished"); this.label_finished.Name = "label_finished"; // - // Form_FInished + // pictureBox_OKIcon + // + resources.ApplyResources(this.pictureBox_OKIcon, "pictureBox_OKIcon"); + this.pictureBox_OKIcon.Name = "pictureBox_OKIcon"; + this.pictureBox_OKIcon.TabStop = false; + // + // Form_Finished_OK // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ControlBox = false; + this.Controls.Add(this.pictureBox_OKIcon); this.Controls.Add(this.label_finished); this.Controls.Add(this.button_OK); - this.Name = "Form_FInished"; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "Form_Finished_OK"; + this.Shown += new System.EventHandler(this.Form_Finished_OK_Shown); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox_OKIcon)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -62,5 +74,6 @@ private System.Windows.Forms.Button button_OK; private System.Windows.Forms.Label label_finished; + private System.Windows.Forms.PictureBox pictureBox_OKIcon; } } \ No newline at end of file diff --git a/DTX2WAV/Form_FInished_OK.cs b/DTX2WAV/Form_FInished_OK.cs index 12fed89e..f5447c84 100644 --- a/DTX2WAV/Form_FInished_OK.cs +++ b/DTX2WAV/Form_FInished_OK.cs @@ -21,5 +21,15 @@ namespace DTX2WAV { this.Close(); } + + private void Form_Finished_OK_Shown(object sender, EventArgs e) + { + Bitmap canvas = new Bitmap(pictureBox_OKIcon.Width, pictureBox_OKIcon.Height); + Graphics g = Graphics.FromImage(canvas); + + g.DrawIcon(SystemIcons.Information, 0, 0); + g.Dispose(); + pictureBox_OKIcon.Image = canvas; + } } } diff --git a/DTX2WAV/Form_FInished_OK.resx b/DTX2WAV/Form_FInished_OK.resx index 98c544b0..e6a946f3 100644 --- a/DTX2WAV/Form_FInished_OK.resx +++ b/DTX2WAV/Form_FInished_OK.resx @@ -117,9 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Bottom + - 42, 85 + 57, 56 75, 23 @@ -141,13 +145,13 @@ $this - 1 + 2 True - 30, 35 + 57, 23 107, 12 @@ -168,6 +172,27 @@ $this + 1 + + + 11, 12 + + + 40, 46 + + + 2 + + + pictureBox_OKIcon + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -177,9 +202,8 @@ 6, 12 - 167, 120 + 186, 92 - CenterParent @@ -187,7 +211,7 @@ 録音終了 - Form_FInished + Form_Finished_OK System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/DTX2WAV/Form_Finished_Fail.Designer.cs b/DTX2WAV/Form_Finished_Fail.Designer.cs new file mode 100644 index 00000000..394792d9 --- /dev/null +++ b/DTX2WAV/Form_Finished_Fail.Designer.cs @@ -0,0 +1,92 @@ +namespace DTX2WAV +{ + partial class Form_Finished_Fail + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label_Canceled = new System.Windows.Forms.Label(); + this.button_OK = new System.Windows.Forms.Button(); + this.pictureBox_FailIcon = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox_FailIcon)).BeginInit(); + this.SuspendLayout(); + // + // label_Canceled + // + this.label_Canceled.AutoSize = true; + this.label_Canceled.Location = new System.Drawing.Point(57, 23); + this.label_Canceled.Name = "label_Canceled"; + this.label_Canceled.Size = new System.Drawing.Size(117, 12); + this.label_Canceled.TabIndex = 0; + this.label_Canceled.Text = "録音が中止されました。"; + // + // button_OK + // + this.button_OK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.button_OK.Location = new System.Drawing.Point(59, 56); + this.button_OK.Name = "button_OK"; + this.button_OK.Size = new System.Drawing.Size(75, 23); + this.button_OK.TabIndex = 1; + this.button_OK.Text = "OK"; + this.button_OK.UseVisualStyleBackColor = true; + this.button_OK.Click += new System.EventHandler(this.button_OK_Click); + // + // pictureBox_FailIcon + // + this.pictureBox_FailIcon.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.pictureBox_FailIcon.Location = new System.Drawing.Point(12, 12); + this.pictureBox_FailIcon.Name = "pictureBox_FailIcon"; + this.pictureBox_FailIcon.Size = new System.Drawing.Size(40, 46); + this.pictureBox_FailIcon.TabIndex = 3; + this.pictureBox_FailIcon.TabStop = false; + // + // Form_Finished_Fail + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(192, 91); + this.ControlBox = false; + this.Controls.Add(this.pictureBox_FailIcon); + this.Controls.Add(this.button_OK); + this.Controls.Add(this.label_Canceled); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "Form_Finished_Fail"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "録音中断"; + this.Shown += new System.EventHandler(this.Form_Finished_Fail_Shown); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox_FailIcon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label_Canceled; + private System.Windows.Forms.Button button_OK; + private System.Windows.Forms.PictureBox pictureBox_FailIcon; + } +} \ No newline at end of file diff --git a/DTX2WAV/Form_Finished_Fail.cs b/DTX2WAV/Form_Finished_Fail.cs new file mode 100644 index 00000000..b68ad185 --- /dev/null +++ b/DTX2WAV/Form_Finished_Fail.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DTX2WAV +{ + public partial class Form_Finished_Fail : Form + { + public Form_Finished_Fail() + { + InitializeComponent(); + } + + private void button_OK_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void Form_Finished_Fail_Shown(object sender, EventArgs e) + { + Bitmap canvas = new Bitmap(pictureBox_FailIcon.Width, pictureBox_FailIcon.Height); + Graphics g = Graphics.FromImage(canvas); + + g.DrawIcon(SystemIcons.Warning, 0, 0); + g.Dispose(); + pictureBox_FailIcon.Image = canvas; + } + } +} diff --git a/DTX2WAV/Form_Finished_Fail.resx b/DTX2WAV/Form_Finished_Fail.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/DTX2WAV/Form_Finished_Fail.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/DTX2WAV/Form_Recording.cs b/DTX2WAV/Form_Recording.cs index b44846cd..6907c88e 100644 --- a/DTX2WAV/Form_Recording.cs +++ b/DTX2WAV/Form_Recording.cs @@ -80,7 +80,6 @@ namespace DTX2WAV string[] s = label_state.Text.Split(new char[] { ',' }); int nEstimateTimeMs = Convert.ToInt32(s[2]); int nCurrentTimeMs = Convert.ToInt32(s[1]); -//Debug.WriteLine(label_state.Text + ": " + nCurrentTimeMs + " : " + nEstimateTimeMs); if (nCurrentTimeMs > nEstimateTimeMs) { @@ -88,7 +87,6 @@ namespace DTX2WAV } progressBar_Recording.Value = (int)(((double)nCurrentTimeMs / (double)nEstimateTimeMs) * 10000); - //int nEstimateTimeMs = (CDTXMania.Instance.DTX.listChip.Count > 0) ? CDTXMania.Instance.DTX.listChip[CDTXMania.Instance.DTX.listChip.Count - 1].n発声時刻ms : 0; string strEstimateTime = (((double)nEstimateTimeMs) / 1000.0).ToString("####0.00"); string strCurrentTime = (((double)nCurrentTimeMs) / 1000.0).ToString("####0.00"); diff --git a/DTXMania/コード/全体/CDTXMania.cs b/DTXMania/コード/全体/CDTXMania.cs index ba491137..7690602c 100644 --- a/DTXMania/コード/全体/CDTXMania.cs +++ b/DTXMania/コード/全体/CDTXMania.cs @@ -1262,8 +1262,11 @@ namespace DTXMania //SendKeys.Send("{ESC}"); //SendKeys.SendWait("%{F4}"); //Application.Exit(); - DTX.t全チップの再生停止(); - DTX.On非活性化(); + if (DTX != null) // 曲読み込みの前に録音Cancelされると、DTXがnullのままここにきてでGPFとなる→nullチェック追加 + { + DTX.t全チップの再生停止(); + DTX.On非活性化(); + } r現在のステージ.On非活性化(); //Environment.ExitCode = 10010; // この組み合わせではダメ、返り値が反映されない -- 2.11.0