--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using System.Text;
+using System.Threading;
+
+namespace DTX2WAV
+{
+ public static class CSendMessage
+ {
+ #region #28821 2014.1.23 yyagi add: 外部からの文字列メッセージ送受信 定数定義
+ [StructLayout(LayoutKind.Sequential)]
+ public struct COPYDATASTRUCT
+ {
+ public IntPtr dwData;
+ public UInt32 cbData;
+ public IntPtr lpData;
+ }
+ #endregion
+ public const int WM_COPYDATA = 0x004A;
+
+ [DllImport("USER32.dll")]
+ static extern uint SendMessage(IntPtr window, int msg, IntPtr wParam, ref COPYDATASTRUCT lParam);
+
+ /// <summary>
+ /// 別のウインドウにメッセージを送信する
+ /// DTXCreatorで使っているコードをほぼそのまま流用(FDK依存をなくしただけ)
+ /// </summary>
+ /// <param name="MainWindowHandle"></param>
+ /// <param name="FromWindowHandle"></param>
+ /// <param name="arg"></param>
+ /// <returns></returns>
+ public static uint sendmessage(IntPtr MainWindowHandle, IntPtr FromWindowHandle, string arg)
+ {
+ uint len = (uint)arg.Length;
+
+ COPYDATASTRUCT cds;
+ cds.dwData = IntPtr.Zero; // 使用しない
+ cds.lpData = Marshal.StringToHGlobalUni(arg); // テキストのポインターをセット
+ cds.cbData = (len + 1) * 2; // 長さをセット
+
+ //文字列を送る
+ uint result = SendMessage(MainWindowHandle, WM_COPYDATA, FromWindowHandle, ref cds);
+
+ Marshal.FreeHGlobal(cds.lpData);
+
+ return result;
+ }
+ }
+
+
+ /// <summary>
+ /// 起動中のDTXMania本体にメッセージを送信する
+ /// DTXManiaのProgram.cs内のロジックを一部修正して流用
+ /// </summary>
+ public static class CSendMessageToDTXMania
+ {
+ public static void SendMessage(string strSend)
+ {
+ for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする
+ {
+ #region [ 既に起動中のDTXManiaプロセスを検索する。]
+ Process current = Process.GetCurrentProcess();
+ Process target = null;
+
+ Process[] running = Process.GetProcesses();
+ foreach (Process p in running)
+ {
+ if (p.MainWindowHandle != IntPtr.Zero && p.MainWindowTitle.Contains("DTX2WAV ("))
+ {
+ target = p;
+ break;
+ }
+ }
+ #endregion
+
+ #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ]
+ if (target != null && strSend != null)
+ {
+ CSendMessage.sendmessage(target.MainWindowHandle, current.MainWindowHandle, strSend);
+ }
+ #endregion
+ else
+ {
+ Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。");
+ Thread.Sleep(200);
+ }
+ }
+ }
+ }
+}
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="CSendMessage.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
- <Compile Include="Form_Converting.cs">
+ <Compile Include="Form_FInished.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Form_Converting.Designer.cs">
- <DependentUpon>Form_Converting.cs</DependentUpon>
+ <Compile Include="Form_FInished.Designer.cs">
+ <DependentUpon>Form_FInished.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Form_Recording.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Form_Recording.Designer.cs">
+ <DependentUpon>Form_Recording.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Form_Converting.resx">
- <DependentUpon>Form_Converting.cs</DependentUpon>
+ <EmbeddedResource Include="Form_FInished.resx">
+ <DependentUpon>Form_FInished.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Form_Recording.resx">
+ <DependentUpon>Form_Recording.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
resources.ApplyResources(this.button_BrowseAudio, "button_BrowseAudio");
this.button_BrowseAudio.Name = "button_BrowseAudio";
this.button_BrowseAudio.UseVisualStyleBackColor = true;
- this.button_BrowseAudio.Click += new System.EventHandler(this.button2_Click);
+ this.button_BrowseAudio.Click += new System.EventHandler(this.button_browseWAV_Click);
//
// textBox_BrowseAudio
//
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
+using System.Runtime.InteropServices;
namespace DTX2WAV
{
public partial class Main : Form
{
- Form_Converting f;
+ Form_Recording formRecording;
public Main()
{
}
- private void button2_Click(object sender, EventArgs e)
+ private void button_browseWAV_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
p.Start();
//モーダルで変換中ダイアログを表示して、処理をいったん止める(キャンセル or 正常終了イベント待ち)
- f = new Form_Converting();
- f.ShowDialog(this);
+ formRecording = new Form_Recording();
+ //formRecording.StartPosition = FormStartPosition.CenterParent;
+ formRecording.ShowDialog(this);
- if (f != null)
+ if (formRecording != null)
{
//フォームでCancelボタンが押されると、ここに来る
//変換終了時のイベントで正常終了する場合は、p_Exited()で終了して、fがnullになって、ここはスキップされる
- f.Dispose();
- f = null;
+ formRecording.Dispose();
+ formRecording = null;
}
}
private void p_Exited(object sender, EventArgs e)
{
- if (f != null)
+ if (formRecording != null)
{
- f.Dispose();
- f = null;
+ formRecording.Dispose();
+ formRecording = null;
}
- MessageBox.Show(
- "変換が正常に終了しました。",
- "変換終了",
- MessageBoxButtons.OK,
- MessageBoxIcon.Information
- );
+ //MessageBox.Show(
+ // "録音が正常に終了しました。",
+ // "録音終了",
+ // MessageBoxButtons.OK,
+ // MessageBoxIcon.Information
+ //);
+
+ using (Form_Finished f = new Form_Finished())
+ {
+ f.ShowDialog();
+ }
}
/// <summary>
Properties.Settings.Default.Save();
}
+
+
+ #region #28821 2014.1.23 yyagi add: 外部からの文字列メッセージ送受信 定数定義
+ [StructLayout(LayoutKind.Sequential)]
+ public struct COPYDATASTRUCT
+ {
+ public IntPtr dwData;
+ public UInt32 cbData;
+ public IntPtr lpData;
+ }
+ #endregion
+ /// <summary>
+ /// メッセージを受信する
+ /// </summary>
+ /// <param name="m"></param>
+ protected override void WndProc(ref Message m)
+ {
+ if (m.Msg == 0x004A) //WM_COPYDATA
+ {
+ COPYDATASTRUCT cds = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT));
+ string strMessage = Marshal.PtrToStringUni(cds.lpData);
+//Debug.WriteLine("Msg received: " + strMessage);
+ formRecording.label_state.Text = strMessage; // Form_Recordingにメッセージの内容を伝える
+ }
+ base.WndProc(ref m);
+ }
}
}
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>93, 22</value>
+ </data>
+ <data name="exitToolStripMenuItem.Text" xml:space="preserve">
+ <value>E&xit</value>
+ </data>
+ <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>37, 20</value>
+ </data>
+ <data name="toolStripMenuItem1.Text" xml:space="preserve">
+ <value>&File</value>
+ </data>
+ <data name="editToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>39, 20</value>
+ </data>
+ <data name="editToolStripMenuItem.Text" xml:space="preserve">
+ <value>&Edit</value>
+ </data>
+ <data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>44, 20</value>
+ </data>
+ <data name="helpToolStripMenuItem.Text" xml:space="preserve">
+ <value>&Help</value>
+ </data>
<data name="menuStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name=">>menuStrip1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
- <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
- <value>37, 20</value>
- </data>
- <data name="toolStripMenuItem1.Text" xml:space="preserve">
- <value>&File</value>
- </data>
- <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>93, 22</value>
- </data>
- <data name="exitToolStripMenuItem.Text" xml:space="preserve">
- <value>E&xit</value>
- </data>
- <data name="editToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>39, 20</value>
- </data>
- <data name="editToolStripMenuItem.Text" xml:space="preserve">
- <value>&Edit</value>
- </data>
- <data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>44, 20</value>
- </data>
- <data name="helpToolStripMenuItem.Text" xml:space="preserve">
- <value>&Help</value>
- </data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<data name=">>label1.ZOrder" xml:space="preserve">
<value>7</value>
</data>
- <data name=">>comboBox_AudioFormat.Name" xml:space="preserve">
- <value>comboBox_AudioFormat</value>
- </data>
- <data name=">>comboBox_AudioFormat.Type" xml:space="preserve">
- <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>comboBox_AudioFormat.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>comboBox_AudioFormat.ZOrder" xml:space="preserve">
- <value>0</value>
- </data>
- <data name=">>label3.Name" xml:space="preserve">
- <value>label3</value>
- </data>
- <data name=">>label3.Type" xml:space="preserve">
- <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>label3.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>label3.ZOrder" xml:space="preserve">
- <value>1</value>
- </data>
- <data name=">>button_BrowseAudio.Name" xml:space="preserve">
- <value>button_BrowseAudio</value>
- </data>
- <data name=">>button_BrowseAudio.Type" xml:space="preserve">
- <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>button_BrowseAudio.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>button_BrowseAudio.ZOrder" xml:space="preserve">
- <value>2</value>
- </data>
- <data name=">>textBox_BrowseAudio.Name" xml:space="preserve">
- <value>textBox_BrowseAudio</value>
- </data>
- <data name=">>textBox_BrowseAudio.Type" xml:space="preserve">
- <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>textBox_BrowseAudio.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>textBox_BrowseAudio.ZOrder" xml:space="preserve">
- <value>3</value>
- </data>
- <data name=">>label2.Name" xml:space="preserve">
- <value>label2</value>
- </data>
- <data name=">>label2.Type" xml:space="preserve">
- <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>label2.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>label2.ZOrder" xml:space="preserve">
- <value>4</value>
- </data>
- <data name=">>button_browseDTX.Name" xml:space="preserve">
- <value>button_browseDTX</value>
- </data>
- <data name=">>button_browseDTX.Type" xml:space="preserve">
- <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>button_browseDTX.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>button_browseDTX.ZOrder" xml:space="preserve">
- <value>5</value>
- </data>
- <data name=">>textBox_BrowseDTX.Name" xml:space="preserve">
- <value>textBox_BrowseDTX</value>
- </data>
- <data name=">>textBox_BrowseDTX.Type" xml:space="preserve">
- <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>textBox_BrowseDTX.Parent" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>textBox_BrowseDTX.ZOrder" xml:space="preserve">
- <value>6</value>
- </data>
- <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
- <value>6, 6</value>
- </data>
- <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
- <value>633, 138</value>
- </data>
- <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
- <value>3</value>
- </data>
- <data name="groupBox1.Text" xml:space="preserve">
- <value>変換ファイルの指定</value>
- </data>
- <data name=">>groupBox1.Name" xml:space="preserve">
- <value>groupBox1</value>
- </data>
- <data name=">>groupBox1.Type" xml:space="preserve">
- <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>groupBox1.Parent" xml:space="preserve">
- <value>tabPage1</value>
- </data>
- <data name=">>groupBox1.ZOrder" xml:space="preserve">
- <value>3</value>
- </data>
<data name="comboBox_AudioFormat.Items" xml:space="preserve">
<value>WAV</value>
</data>
<data name=">>textBox_BrowseDTX.ZOrder" xml:space="preserve">
<value>6</value>
</data>
+ <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>6, 6</value>
+ </data>
+ <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>633, 138</value>
+ </data>
+ <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
+ <value>3</value>
+ </data>
+ <data name="groupBox1.Text" xml:space="preserve">
+ <value>変換ファイルの指定</value>
+ </data>
+ <data name=">>groupBox1.Name" xml:space="preserve">
+ <value>groupBox1</value>
+ </data>
+ <data name=">>groupBox1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>groupBox1.Parent" xml:space="preserve">
+ <value>tabPage1</value>
+ </data>
+ <data name=">>groupBox1.ZOrder" xml:space="preserve">
+ <value>3</value>
+ </data>
<data name="button_Cancel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<value>5</value>
</data>
<data name="button_Convert.Text" xml:space="preserve">
- <value>変換</value>
+ <value>録音</value>
</data>
<data name=">>button_Convert.Name" xml:space="preserve">
<value>button_Convert</value>
<data name=">>tabControl1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
- <metadata name="bindingSource_Master.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>177, 56</value>
- </metadata>
- <metadata name="bindingSource_Bass.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 56</value>
- </metadata>
- <metadata name="bindingSource_Guitar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>1069, 17</value>
- </metadata>
- <metadata name="bindingSource_Drums.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>932, 17</value>
- </metadata>
- <metadata name="bindingSource_SE.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>783, 17</value>
- </metadata>
- <metadata name="bindingSource_BGM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>621, 17</value>
- </metadata>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>388, 17</value>
</metadata>
+++ /dev/null
-namespace DTX2WAV
-{
- partial class Form_Converting
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.button_CancelConverting = new System.Windows.Forms.Button();
- this.label_Converting = new System.Windows.Forms.Label();
- this.progressBar_Converting = new System.Windows.Forms.ProgressBar();
- this.SuspendLayout();
- //
- // button_CancelConverting
- //
- this.button_CancelConverting.Location = new System.Drawing.Point(66, 183);
- this.button_CancelConverting.Name = "button_CancelConverting";
- this.button_CancelConverting.Size = new System.Drawing.Size(144, 23);
- this.button_CancelConverting.TabIndex = 0;
- this.button_CancelConverting.Text = "Cancel(まだ使えません)";
- this.button_CancelConverting.UseVisualStyleBackColor = true;
- //
- // label_Converting
- //
- this.label_Converting.AutoSize = true;
- this.label_Converting.Location = new System.Drawing.Point(12, 86);
- this.label_Converting.Name = "label_Converting";
- this.label_Converting.Size = new System.Drawing.Size(270, 12);
- this.label_Converting.TabIndex = 1;
- this.label_Converting.Text = "変換中です。演奏が終わるまで、そのままお待ちください。";
- //
- // progressBar_Converting
- //
- this.progressBar_Converting.Location = new System.Drawing.Point(36, 142);
- this.progressBar_Converting.Name = "progressBar_Converting";
- this.progressBar_Converting.Size = new System.Drawing.Size(209, 23);
- this.progressBar_Converting.TabIndex = 2;
- //
- // Form_Converting
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(284, 261);
- this.ControlBox = false;
- this.Controls.Add(this.progressBar_Converting);
- this.Controls.Add(this.label_Converting);
- this.Controls.Add(this.button_CancelConverting);
- this.Name = "Form_Converting";
- this.Text = "Converting...";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Button button_CancelConverting;
- private System.Windows.Forms.Label label_Converting;
- private System.Windows.Forms.ProgressBar progressBar_Converting;
- }
-}
\ No newline at end of file
--- /dev/null
+namespace DTX2WAV
+{
+ partial class Form_Finished
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Finished));
+ this.button_OK = new System.Windows.Forms.Button();
+ this.label_finished = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // 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);
+ //
+ // label_finished
+ //
+ resources.ApplyResources(this.label_finished, "label_finished");
+ this.label_finished.Name = "label_finished";
+ //
+ // Form_FInished
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ControlBox = false;
+ this.Controls.Add(this.label_finished);
+ this.Controls.Add(this.button_OK);
+ this.Name = "Form_FInished";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button button_OK;
+ private System.Windows.Forms.Label label_finished;
+ }
+}
\ No newline at end of file
namespace DTX2WAV
{
- public partial class Form_Converting : Form
+ public partial class Form_Finished : Form
{
- public Form_Converting()
+ public Form_Finished()
{
InitializeComponent();
}
+
+ private void button_OK_Click(object sender, EventArgs e)
+ {
+ this.Close(); }
}
}
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="button_OK.Location" type="System.Drawing.Point, System.Drawing">
+ <value>42, 85</value>
+ </data>
+ <data name="button_OK.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="button_OK.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="button_OK.Text" xml:space="preserve">
+ <value>OK</value>
+ </data>
+ <data name=">>button_OK.Name" xml:space="preserve">
+ <value>button_OK</value>
+ </data>
+ <data name=">>button_OK.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>button_OK.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>button_OK.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="label_finished.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_finished.Location" type="System.Drawing.Point, System.Drawing">
+ <value>30, 35</value>
+ </data>
+ <data name="label_finished.Size" type="System.Drawing.Size, System.Drawing">
+ <value>107, 12</value>
+ </data>
+ <data name="label_finished.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="label_finished.Text" xml:space="preserve">
+ <value>録音が終了しました。</value>
+ </data>
+ <data name=">>label_finished.Name" xml:space="preserve">
+ <value>label_finished</value>
+ </data>
+ <data name=">>label_finished.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_finished.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_finished.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
+ <value>6, 12</value>
+ </data>
+ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>167, 120</value>
+ </data>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
+ <value>CenterParent</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>録音終了</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>Form_FInished</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
</root>
\ No newline at end of file
--- /dev/null
+namespace DTX2WAV
+{
+ partial class Form_Recording
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Recording));
+ this.button_CancelConverting = new System.Windows.Forms.Button();
+ this.label_Recording = new System.Windows.Forms.Label();
+ this.progressBar_Recording = new System.Windows.Forms.ProgressBar();
+ this.label_boot = new System.Windows.Forms.Label();
+ this.label_loading = new System.Windows.Forms.Label();
+ this.label_playing = new System.Windows.Forms.Label();
+ this.label_exit = new System.Windows.Forms.Label();
+ this.label_state = new System.Windows.Forms.Label();
+ this.label_boot_check = new System.Windows.Forms.Label();
+ this.label_loading_check = new System.Windows.Forms.Label();
+ this.label_playing_check = new System.Windows.Forms.Label();
+ this.label_exit_check = new System.Windows.Forms.Label();
+ this.label_estimateTime = new System.Windows.Forms.Label();
+ this.label_currentTime = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // button_CancelConverting
+ //
+ resources.ApplyResources(this.button_CancelConverting, "button_CancelConverting");
+ this.button_CancelConverting.Name = "button_CancelConverting";
+ this.button_CancelConverting.UseVisualStyleBackColor = true;
+ this.button_CancelConverting.Click += new System.EventHandler(this.button_CancelConverting_Click);
+ //
+ // label_Recording
+ //
+ resources.ApplyResources(this.label_Recording, "label_Recording");
+ this.label_Recording.Name = "label_Recording";
+ //
+ // progressBar_Recording
+ //
+ resources.ApplyResources(this.progressBar_Recording, "progressBar_Recording");
+ this.progressBar_Recording.Maximum = 10000;
+ this.progressBar_Recording.Name = "progressBar_Recording";
+ //
+ // label_boot
+ //
+ resources.ApplyResources(this.label_boot, "label_boot");
+ this.label_boot.Name = "label_boot";
+ //
+ // label_loading
+ //
+ resources.ApplyResources(this.label_loading, "label_loading");
+ this.label_loading.Name = "label_loading";
+ //
+ // label_playing
+ //
+ resources.ApplyResources(this.label_playing, "label_playing");
+ this.label_playing.Name = "label_playing";
+ //
+ // label_exit
+ //
+ resources.ApplyResources(this.label_exit, "label_exit");
+ this.label_exit.Name = "label_exit";
+ //
+ // label_state
+ //
+ resources.ApplyResources(this.label_state, "label_state");
+ this.label_state.Name = "label_state";
+ this.label_state.TextChanged += new System.EventHandler(this.label_state_TextChanged);
+ //
+ // label_boot_check
+ //
+ resources.ApplyResources(this.label_boot_check, "label_boot_check");
+ this.label_boot_check.Name = "label_boot_check";
+ //
+ // label_loading_check
+ //
+ resources.ApplyResources(this.label_loading_check, "label_loading_check");
+ this.label_loading_check.Name = "label_loading_check";
+ //
+ // label_playing_check
+ //
+ resources.ApplyResources(this.label_playing_check, "label_playing_check");
+ this.label_playing_check.Name = "label_playing_check";
+ //
+ // label_exit_check
+ //
+ resources.ApplyResources(this.label_exit_check, "label_exit_check");
+ this.label_exit_check.Name = "label_exit_check";
+ //
+ // label_estimateTime
+ //
+ resources.ApplyResources(this.label_estimateTime, "label_estimateTime");
+ this.label_estimateTime.Name = "label_estimateTime";
+ this.label_estimateTime.UseMnemonic = false;
+ //
+ // label_currentTime
+ //
+ resources.ApplyResources(this.label_currentTime, "label_currentTime");
+ this.label_currentTime.Name = "label_currentTime";
+ //
+ // Form_Recording
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ControlBox = false;
+ this.Controls.Add(this.label_currentTime);
+ this.Controls.Add(this.label_estimateTime);
+ this.Controls.Add(this.label_exit_check);
+ this.Controls.Add(this.label_playing_check);
+ this.Controls.Add(this.label_loading_check);
+ this.Controls.Add(this.label_boot_check);
+ this.Controls.Add(this.label_state);
+ this.Controls.Add(this.label_exit);
+ this.Controls.Add(this.label_playing);
+ this.Controls.Add(this.label_loading);
+ this.Controls.Add(this.label_boot);
+ this.Controls.Add(this.progressBar_Recording);
+ this.Controls.Add(this.label_Recording);
+ this.Controls.Add(this.button_CancelConverting);
+ this.Name = "Form_Recording";
+ this.Load += new System.EventHandler(this.Form_Recording_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button button_CancelConverting;
+ private System.Windows.Forms.Label label_Recording;
+ private System.Windows.Forms.ProgressBar progressBar_Recording;
+ private System.Windows.Forms.Label label_boot;
+ private System.Windows.Forms.Label label_loading;
+ private System.Windows.Forms.Label label_playing;
+ private System.Windows.Forms.Label label_exit;
+ public System.Windows.Forms.Label label_state;
+ private System.Windows.Forms.Label label_boot_check;
+ private System.Windows.Forms.Label label_loading_check;
+ private System.Windows.Forms.Label label_playing_check;
+ private System.Windows.Forms.Label label_exit_check;
+ private System.Windows.Forms.Label label_estimateTime;
+ private System.Windows.Forms.Label label_currentTime;
+ }
+}
\ No newline at end of file
--- /dev/null
+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;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+
+namespace DTX2WAV
+{
+ public partial class Form_Recording : Form
+ {
+ public Form_Recording()
+ {
+ InitializeComponent();
+ }
+
+ /// <summary>
+ /// DTXMania本体に、録音中止のメッセージを送信
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void button_CancelConverting_Click(object sender, EventArgs e)
+ {
+ CSendMessageToDTXMania.SendMessage("-C");
+ }
+
+ private void Form_Recording_Load(object sender, EventArgs e)
+ {
+ progressBar_Recording.Value = 0;
+ }
+
+
+ /// <summary>
+ /// DTXMania本体からDTX2WAVのメインForm経由でメッセージを受信する
+ /// (メインFormのWndProcでメッセージを受信し、Form_Recordingのlabel_state経由でForm_Recordingが受け取る)
+ /// そして、進捗表示をする
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void label_state_TextChanged(object sender, EventArgs e)
+ {
+ switch (label_state.Text.Substring(0,4).ToUpper())
+ {
+ case "BOOT":
+ label_boot_check.Text = "→";
+ label_loading_check.Text = "";
+ label_playing_check.Text = "";
+ label_exit_check.Text = "";
+ break;
+ case "LOAD":
+ label_boot_check.Text = "✔";
+ label_loading_check.Text = "→";
+ label_playing_check.Text = "";
+ label_exit_check.Text = "";
+ break;
+ case "PLAY":
+ label_boot_check.Text = "✔";
+ label_loading_check.Text = "✔";
+ label_playing_check.Text = "→";
+ label_exit_check.Text = "";
+ break;
+ case "TERM":
+ label_boot_check.Text = "✔";
+ label_loading_check.Text = "✔";
+ label_playing_check.Text = "✔";
+ label_exit_check.Text = "→";
+ break;
+ case "TIME":
+ 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)
+ {
+ nCurrentTimeMs = nEstimateTimeMs;
+ }
+ 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");
+
+ label_currentTime.Text = strCurrentTime;
+ label_estimateTime.Text = strEstimateTime;
+
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="button_CancelConverting.Location" type="System.Drawing.Point, System.Drawing">
+ <value>90, 204</value>
+ </data>
+ <data name="button_CancelConverting.Size" type="System.Drawing.Size, System.Drawing">
+ <value>88, 23</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="button_CancelConverting.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="button_CancelConverting.Text" xml:space="preserve">
+ <value>Cancel</value>
+ </data>
+ <data name=">>button_CancelConverting.Name" xml:space="preserve">
+ <value>button_CancelConverting</value>
+ </data>
+ <data name=">>button_CancelConverting.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>button_CancelConverting.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>button_CancelConverting.ZOrder" xml:space="preserve">
+ <value>13</value>
+ </data>
+ <data name="label_Recording.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_Recording.Location" type="System.Drawing.Point, System.Drawing">
+ <value>9, 21</value>
+ </data>
+ <data name="label_Recording.Size" type="System.Drawing.Size, System.Drawing">
+ <value>270, 12</value>
+ </data>
+ <data name="label_Recording.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="label_Recording.Text" xml:space="preserve">
+ <value>録音中です。演奏が終わるまで、そのままお待ちください。</value>
+ </data>
+ <data name=">>label_Recording.Name" xml:space="preserve">
+ <value>label_Recording</value>
+ </data>
+ <data name=">>label_Recording.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_Recording.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_Recording.ZOrder" xml:space="preserve">
+ <value>12</value>
+ </data>
+ <data name="progressBar_Recording.Location" type="System.Drawing.Point, System.Drawing">
+ <value>34, 160</value>
+ </data>
+ <data name="progressBar_Recording.Size" type="System.Drawing.Size, System.Drawing">
+ <value>209, 23</value>
+ </data>
+ <data name="progressBar_Recording.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name=">>progressBar_Recording.Name" xml:space="preserve">
+ <value>progressBar_Recording</value>
+ </data>
+ <data name=">>progressBar_Recording.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>progressBar_Recording.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>progressBar_Recording.ZOrder" xml:space="preserve">
+ <value>11</value>
+ </data>
+ <data name="label_boot.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_boot.Location" type="System.Drawing.Point, System.Drawing">
+ <value>108, 57</value>
+ </data>
+ <data name="label_boot.Size" type="System.Drawing.Size, System.Drawing">
+ <value>91, 12</value>
+ </data>
+ <data name="label_boot.TabIndex" type="System.Int32, mscorlib">
+ <value>3</value>
+ </data>
+ <data name="label_boot.Text" xml:space="preserve">
+ <value>DTXManiaの起動</value>
+ </data>
+ <data name=">>label_boot.Name" xml:space="preserve">
+ <value>label_boot</value>
+ </data>
+ <data name=">>label_boot.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_boot.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_boot.ZOrder" xml:space="preserve">
+ <value>10</value>
+ </data>
+ <data name="label_loading.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_loading.Location" type="System.Drawing.Point, System.Drawing">
+ <value>108, 82</value>
+ </data>
+ <data name="label_loading.Size" type="System.Drawing.Size, System.Drawing">
+ <value>101, 12</value>
+ </data>
+ <data name="label_loading.TabIndex" type="System.Int32, mscorlib">
+ <value>4</value>
+ </data>
+ <data name="label_loading.Text" xml:space="preserve">
+ <value>曲データの読み込み</value>
+ </data>
+ <data name=">>label_loading.Name" xml:space="preserve">
+ <value>label_loading</value>
+ </data>
+ <data name=">>label_loading.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_loading.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_loading.ZOrder" xml:space="preserve">
+ <value>9</value>
+ </data>
+ <data name="label_playing.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_playing.Location" type="System.Drawing.Point, System.Drawing">
+ <value>108, 108</value>
+ </data>
+ <data name="label_playing.Size" type="System.Drawing.Size, System.Drawing">
+ <value>29, 12</value>
+ </data>
+ <data name="label_playing.TabIndex" type="System.Int32, mscorlib">
+ <value>5</value>
+ </data>
+ <data name="label_playing.Text" xml:space="preserve">
+ <value>演奏</value>
+ </data>
+ <data name=">>label_playing.Name" xml:space="preserve">
+ <value>label_playing</value>
+ </data>
+ <data name=">>label_playing.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_playing.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_playing.ZOrder" xml:space="preserve">
+ <value>8</value>
+ </data>
+ <data name="label_exit.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_exit.Location" type="System.Drawing.Point, System.Drawing">
+ <value>108, 134</value>
+ </data>
+ <data name="label_exit.Size" type="System.Drawing.Size, System.Drawing">
+ <value>29, 12</value>
+ </data>
+ <data name="label_exit.TabIndex" type="System.Int32, mscorlib">
+ <value>6</value>
+ </data>
+ <data name="label_exit.Text" xml:space="preserve">
+ <value>終了</value>
+ </data>
+ <data name=">>label_exit.Name" xml:space="preserve">
+ <value>label_exit</value>
+ </data>
+ <data name=">>label_exit.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_exit.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_exit.ZOrder" xml:space="preserve">
+ <value>7</value>
+ </data>
+ <data name="label_state.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_state.Location" type="System.Drawing.Point, System.Drawing">
+ <value>220, 240</value>
+ </data>
+ <data name="label_state.Size" type="System.Drawing.Size, System.Drawing">
+ <value>23, 12</value>
+ </data>
+ <data name="label_state.TabIndex" type="System.Int32, mscorlib">
+ <value>7</value>
+ </data>
+ <data name="label_state.Text" xml:space="preserve">
+ <value>***</value>
+ </data>
+ <data name="label_state.Visible" type="System.Boolean, mscorlib">
+ <value>False</value>
+ </data>
+ <data name=">>label_state.Name" xml:space="preserve">
+ <value>label_state</value>
+ </data>
+ <data name=">>label_state.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_state.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_state.ZOrder" xml:space="preserve">
+ <value>6</value>
+ </data>
+ <data name="label_boot_check.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_boot_check.Location" type="System.Drawing.Point, System.Drawing">
+ <value>88, 57</value>
+ </data>
+ <data name="label_boot_check.Size" type="System.Drawing.Size, System.Drawing">
+ <value>0, 12</value>
+ </data>
+ <data name="label_boot_check.TabIndex" type="System.Int32, mscorlib">
+ <value>8</value>
+ </data>
+ <data name=">>label_boot_check.Name" xml:space="preserve">
+ <value>label_boot_check</value>
+ </data>
+ <data name=">>label_boot_check.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_boot_check.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_boot_check.ZOrder" xml:space="preserve">
+ <value>5</value>
+ </data>
+ <data name="label_loading_check.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_loading_check.Location" type="System.Drawing.Point, System.Drawing">
+ <value>88, 82</value>
+ </data>
+ <data name="label_loading_check.Size" type="System.Drawing.Size, System.Drawing">
+ <value>0, 12</value>
+ </data>
+ <data name="label_loading_check.TabIndex" type="System.Int32, mscorlib">
+ <value>9</value>
+ </data>
+ <data name=">>label_loading_check.Name" xml:space="preserve">
+ <value>label_loading_check</value>
+ </data>
+ <data name=">>label_loading_check.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_loading_check.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_loading_check.ZOrder" xml:space="preserve">
+ <value>4</value>
+ </data>
+ <data name="label_playing_check.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_playing_check.Location" type="System.Drawing.Point, System.Drawing">
+ <value>88, 108</value>
+ </data>
+ <data name="label_playing_check.Size" type="System.Drawing.Size, System.Drawing">
+ <value>0, 12</value>
+ </data>
+ <data name="label_playing_check.TabIndex" type="System.Int32, mscorlib">
+ <value>10</value>
+ </data>
+ <data name=">>label_playing_check.Name" xml:space="preserve">
+ <value>label_playing_check</value>
+ </data>
+ <data name=">>label_playing_check.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_playing_check.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_playing_check.ZOrder" xml:space="preserve">
+ <value>3</value>
+ </data>
+ <data name="label_exit_check.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_exit_check.Location" type="System.Drawing.Point, System.Drawing">
+ <value>88, 134</value>
+ </data>
+ <data name="label_exit_check.Size" type="System.Drawing.Size, System.Drawing">
+ <value>0, 12</value>
+ </data>
+ <data name="label_exit_check.TabIndex" type="System.Int32, mscorlib">
+ <value>11</value>
+ </data>
+ <data name=">>label_exit_check.Name" xml:space="preserve">
+ <value>label_exit_check</value>
+ </data>
+ <data name=">>label_exit_check.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_exit_check.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_exit_check.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
+ <data name="label_estimateTime.Location" type="System.Drawing.Point, System.Drawing">
+ <value>164, 186</value>
+ </data>
+ <data name="label_estimateTime.Size" type="System.Drawing.Size, System.Drawing">
+ <value>79, 12</value>
+ </data>
+ <data name="label_estimateTime.TabIndex" type="System.Int32, mscorlib">
+ <value>12</value>
+ </data>
+ <data name="label_estimateTime.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
+ <value>TopRight</value>
+ </data>
+ <data name=">>label_estimateTime.Name" xml:space="preserve">
+ <value>label_estimateTime</value>
+ </data>
+ <data name=">>label_estimateTime.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_estimateTime.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_estimateTime.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="label_currentTime.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label_currentTime.Location" type="System.Drawing.Point, System.Drawing">
+ <value>139, 166</value>
+ </data>
+ <data name="label_currentTime.Size" type="System.Drawing.Size, System.Drawing">
+ <value>0, 12</value>
+ </data>
+ <data name="label_currentTime.TabIndex" type="System.Int32, mscorlib">
+ <value>13</value>
+ </data>
+ <data name="label_currentTime.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
+ <value>TopCenter</value>
+ </data>
+ <data name=">>label_currentTime.Name" xml:space="preserve">
+ <value>label_currentTime</value>
+ </data>
+ <data name=">>label_currentTime.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label_currentTime.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label_currentTime.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
+ <value>6, 12</value>
+ </data>
+ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>284, 261</value>
+ </data>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
+ <value>CenterParent</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>DTX2WAV [Recording...]</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>Form_Recording</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
STDGBSValue<CScoreIni.C演奏記録> record;
+ long nLastSendMessageTime;
+
#if TEST_MEASUREFRAMEDRAWTIME
Stopwatch sw = new Stopwatch();
List<long> swlist = new List<long>(100000);
}
this.actPanel.SetPanelString( strPanel );
+ nLastSendMessageTime = 0;
+
#if TEST_MEASUREFRAMEDRAWTIME
swlist.Clear();
swlist.Capacity = 100000;
return (int)this.eフェードアウト完了時の戻り値;
}
+ // DTX2WAVに進捗状況を送信。1秒ごとに1回ずつ送信する。
+ if (CDTXMania.Instance.DTX2WAVmode.Enabled)
+ {
+ if (nLastSendMessageTime + 1000 < CDTXMania.Instance.Timer.n現在時刻)
+ {
+ int nEstimateTimeMs = (CDTXMania.Instance.DTX.listChip.Count > 0) ? CDTXMania.Instance.DTX.listChip[CDTXMania.Instance.DTX.listChip.Count - 1].n発声時刻ms : 0;
+ CDTXMania.Instance.DTX2WAVmode.SendMessage2DTX2WAV("TIME," + CDTXMania.Instance.Timer.n現在時刻.ToString() + "," + nEstimateTimeMs.ToString());
+ nLastSendMessageTime = CDTXMania.Instance.Timer.n現在時刻;
+ }
+ }
+
ManageMixerQueue();
// キー入力
{
public class CDTX2WAVmode
{
- public enum FormatType
+ public enum ECommand
+ {
+ Record,
+ Cancel,
+ Other
+ }
+ /// <summary>
+ /// DTXWAVからのコマンド
+ /// </summary>
+ public ECommand Command
+ {
+ get;
+ set;
+ }
+ public enum FormatType
{
WAV,
OGG,
public CDTX2WAVmode()
{
this.Enabled = false;
+ this.Command = ECommand.Other;
this.Format = FormatType.WAV;
this.VSyncWait = false; // とりあえず VSyncWait=OFF固定で考える
this.outfilename = "";
ConfigIni_backup = null;
}
+
+
+ private System.IntPtr hTargetMainWindowHandle = IntPtr.Zero;
+ private System.IntPtr hCurrentMainWindowHandle;
+
+ /// <summary>
+ /// DTX2WAVにメッセージを送信する
+ /// </summary>
+ /// <param name="strSend">送信するテキスト</param>
+ public void SendMessage2DTX2WAV(string strSend)
+ {
+ for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする
+ {
+ hCurrentMainWindowHandle = Process.GetCurrentProcess().MainWindowHandle;
+
+ if (hTargetMainWindowHandle == IntPtr.Zero)
+ {
+//Trace.TraceInformation("ハンドル創作");
+ #region [ 既に起動中のDTX2WAV(の録音中ダイアログ)プロセスを検索する。]
+
+ Process[] running = Process.GetProcesses();
+ foreach (Process p in running)
+ {
+//Trace.TraceInformation("WindowTitle: " + p.MainWindowTitle);
+ if (p.MainWindowHandle != IntPtr.Zero && p.MainWindowTitle.Contains("DTX2WAV Rel"))
+ {
+//Trace.TraceInformation("WindowTitle: " + p.MainWindowTitle);
+ hTargetMainWindowHandle = p.MainWindowHandle;
+ break;
+ }
+ }
+ #endregion
+
+ }
+
+ #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ]
+ if (hTargetMainWindowHandle != null && strSend != null)
+ {
+ CSendMessage.sendmessage(hTargetMainWindowHandle, hCurrentMainWindowHandle, strSend);
+//Trace.TraceInformation("SendToDTX2WAV: " + strSend + ", " + hTargetMainWindowHandle + ", " + hCurrentMainWindowHandle);
+ return;
+ }
+ #endregion
+ else
+ {
+ Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。");
+ Thread.Sleep(200);
+ }
+ }
+ }
}
}
public CStage終了 stage終了 { get; private set; }
public CStage r現在のステージ = null;
public CStage r直前のステージ = null;
+ public CStage r1フレーム前のステージ = null;
public string strEXEのあるフォルダ { get; private set; }
public string strコンパクトモードファイル { get; private set; }
public CTimer Timer { get; private set; }
else if (DTX2WAVmode.Enabled)
{
Trace.TraceInformation("DTX2WAVモードで起動します。[{0}]", strコンパクトモードファイル);
+ DTX2WAVmode.SendMessage2DTX2WAV("BOOT");
}
else
{
}
#endregion
- #region [ DTXCreatorからの指示 ]
+ #region [ DTXCreator/DTX2WAVからの指示 ]
if (this.Window.IsReceivedMessage) // ウインドウメッセージで、
{
string strMes = this.Window.strMessage;
this.Window.IsReceivedMessage = false;
-
if (strMes != null)
{
CommandParse.ParseArguments(strMes, ref DTXVmode, ref DTX2WAVmode);
}
}
}
+ if (DTX2WAVmode.Enabled)
+ {
+ if (DTX2WAVmode.Command == CDTX2WAVmode.ECommand.Cancel)
+ {
+ Trace.TraceInformation("録音のCancelコマンドをDTXMania本来が受信しました。");
+ // 録音を終了するために、[ESC]が押されたようにふるまう
+ //Microsoft.VisualBasic.Interaction.AppActivate("メモ帳");
+
+ //SendKeys.Send("{ESC}");
+ //SendKeys.SendWait("%{F4}");
+ //Application.Exit();
+ DTX.t全チップの再生停止();
+ DTX.On非活性化();
+ r現在のステージ.On非活性化();
+ base.Window.Close();
+ }
+ }
}
}
#endregion
//---------------------
#endregion
+ #region [ DTX2WAVモード時、ステージが変わるたびに、そのことをDTX2WAVアプリ側に通知する ]
+ if (DTX2WAVmode.Enabled && r現在のステージ != r1フレーム前のステージ)
+ {
+ r1フレーム前のステージ = r現在のステージ;
+ //Trace.TraceInformation("Stage変更 to : " + r現在のステージ.eステージID.ToString());
+ switch (r現在のステージ.eステージID)
+ {
+ case CStage.Eステージ.曲読み込み:
+ DTX2WAVmode.SendMessage2DTX2WAV("LOAD");
+ break;
+ case CStage.Eステージ.演奏:
+ DTX2WAVmode.SendMessage2DTX2WAV("PLAY");
+ break;
+ default:
+ break;
+ }
+ }
+ #endregion
CScoreIni scoreIni = null;
{
DTX2WAVmode.tUpdateConfigIni();
Trace.TraceInformation("DTX2WAVモードの設定情報を、Config.xmlに保存しました。");
+ DTX2WAVmode.SendMessage2DTX2WAV("TERM");
}
else
{
Trace.TraceInformation("cdtx2wav.outfilename=" + cdtx2wav.outfilename);
Trace.TraceInformation("cdtx2wav.dtxfilename=" + cdtx2wav.dtxfilename);
+ cdtx2wav.Command = CDTX2WAVmode.ECommand.Record;
+
analyzing = false;
}
#endregion
+ // -S
+ else if (arg.StartsWith("-C", StringComparison.OrdinalIgnoreCase)) // DTXV再生停止
+ {
+ cdtx2wav.Enabled = true;
+ cdtx2wav.Command = CDTX2WAVmode.ECommand.Cancel;
+ ret = ECommandType.DTX2WAV;
+ arg = arg.Substring(2);
+ }
else
{
analyzing = false;