Revisão | 48e3f67971323725c3fa49089a79849ab70ed781 (tree) |
---|---|
Hora | 2018-01-31 01:19:20 |
Autor | yyagi <yyagi.dtxmania@gmai...> |
Commiter | yyagi |
#28263 DTX2WAV: キャンセル操作の追加, 進捗表示の追加。
@@ -0,0 +1,92 @@ | ||
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Runtime.InteropServices; | |
4 | +using System.Diagnostics; | |
5 | +using System.Text; | |
6 | +using System.Threading; | |
7 | + | |
8 | +namespace DTX2WAV | |
9 | +{ | |
10 | + public static class CSendMessage | |
11 | + { | |
12 | + #region #28821 2014.1.23 yyagi add: 外部からの文字列メッセージ送受信 定数定義 | |
13 | + [StructLayout(LayoutKind.Sequential)] | |
14 | + public struct COPYDATASTRUCT | |
15 | + { | |
16 | + public IntPtr dwData; | |
17 | + public UInt32 cbData; | |
18 | + public IntPtr lpData; | |
19 | + } | |
20 | + #endregion | |
21 | + public const int WM_COPYDATA = 0x004A; | |
22 | + | |
23 | + [DllImport("USER32.dll")] | |
24 | + static extern uint SendMessage(IntPtr window, int msg, IntPtr wParam, ref COPYDATASTRUCT lParam); | |
25 | + | |
26 | + /// <summary> | |
27 | + /// 別のウインドウにメッセージを送信する | |
28 | + /// DTXCreatorで使っているコードをほぼそのまま流用(FDK依存をなくしただけ) | |
29 | + /// </summary> | |
30 | + /// <param name="MainWindowHandle"></param> | |
31 | + /// <param name="FromWindowHandle"></param> | |
32 | + /// <param name="arg"></param> | |
33 | + /// <returns></returns> | |
34 | + public static uint sendmessage(IntPtr MainWindowHandle, IntPtr FromWindowHandle, string arg) | |
35 | + { | |
36 | + uint len = (uint)arg.Length; | |
37 | + | |
38 | + COPYDATASTRUCT cds; | |
39 | + cds.dwData = IntPtr.Zero; // 使用しない | |
40 | + cds.lpData = Marshal.StringToHGlobalUni(arg); // テキストのポインターをセット | |
41 | + cds.cbData = (len + 1) * 2; // 長さをセット | |
42 | + | |
43 | + //文字列を送る | |
44 | + uint result = SendMessage(MainWindowHandle, WM_COPYDATA, FromWindowHandle, ref cds); | |
45 | + | |
46 | + Marshal.FreeHGlobal(cds.lpData); | |
47 | + | |
48 | + return result; | |
49 | + } | |
50 | + } | |
51 | + | |
52 | + | |
53 | + /// <summary> | |
54 | + /// 起動中のDTXMania本体にメッセージを送信する | |
55 | + /// DTXManiaのProgram.cs内のロジックを一部修正して流用 | |
56 | + /// </summary> | |
57 | + public static class CSendMessageToDTXMania | |
58 | + { | |
59 | + public static void SendMessage(string strSend) | |
60 | + { | |
61 | + for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする | |
62 | + { | |
63 | + #region [ 既に起動中のDTXManiaプロセスを検索する。] | |
64 | + Process current = Process.GetCurrentProcess(); | |
65 | + Process target = null; | |
66 | + | |
67 | + Process[] running = Process.GetProcesses(); | |
68 | + foreach (Process p in running) | |
69 | + { | |
70 | + if (p.MainWindowHandle != IntPtr.Zero && p.MainWindowTitle.Contains("DTX2WAV (")) | |
71 | + { | |
72 | + target = p; | |
73 | + break; | |
74 | + } | |
75 | + } | |
76 | + #endregion | |
77 | + | |
78 | + #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ] | |
79 | + if (target != null && strSend != null) | |
80 | + { | |
81 | + CSendMessage.sendmessage(target.MainWindowHandle, current.MainWindowHandle, strSend); | |
82 | + } | |
83 | + #endregion | |
84 | + else | |
85 | + { | |
86 | + Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。"); | |
87 | + Thread.Sleep(200); | |
88 | + } | |
89 | + } | |
90 | + } | |
91 | + } | |
92 | +} |
@@ -48,17 +48,24 @@ | ||
48 | 48 | <Reference Include="System.Xml" /> |
49 | 49 | </ItemGroup> |
50 | 50 | <ItemGroup> |
51 | + <Compile Include="CSendMessage.cs" /> | |
51 | 52 | <Compile Include="Form1.cs"> |
52 | 53 | <SubType>Form</SubType> |
53 | 54 | </Compile> |
54 | 55 | <Compile Include="Form1.Designer.cs"> |
55 | 56 | <DependentUpon>Form1.cs</DependentUpon> |
56 | 57 | </Compile> |
57 | - <Compile Include="Form_Converting.cs"> | |
58 | + <Compile Include="Form_FInished.cs"> | |
58 | 59 | <SubType>Form</SubType> |
59 | 60 | </Compile> |
60 | - <Compile Include="Form_Converting.Designer.cs"> | |
61 | - <DependentUpon>Form_Converting.cs</DependentUpon> | |
61 | + <Compile Include="Form_FInished.Designer.cs"> | |
62 | + <DependentUpon>Form_FInished.cs</DependentUpon> | |
63 | + </Compile> | |
64 | + <Compile Include="Form_Recording.cs"> | |
65 | + <SubType>Form</SubType> | |
66 | + </Compile> | |
67 | + <Compile Include="Form_Recording.Designer.cs"> | |
68 | + <DependentUpon>Form_Recording.cs</DependentUpon> | |
62 | 69 | </Compile> |
63 | 70 | <Compile Include="Program.cs" /> |
64 | 71 | <Compile Include="Properties\AssemblyInfo.cs" /> |
@@ -68,8 +75,11 @@ | ||
68 | 75 | <EmbeddedResource Include="Form1.resx"> |
69 | 76 | <DependentUpon>Form1.cs</DependentUpon> |
70 | 77 | </EmbeddedResource> |
71 | - <EmbeddedResource Include="Form_Converting.resx"> | |
72 | - <DependentUpon>Form_Converting.cs</DependentUpon> | |
78 | + <EmbeddedResource Include="Form_FInished.resx"> | |
79 | + <DependentUpon>Form_FInished.cs</DependentUpon> | |
80 | + </EmbeddedResource> | |
81 | + <EmbeddedResource Include="Form_Recording.resx"> | |
82 | + <DependentUpon>Form_Recording.cs</DependentUpon> | |
73 | 83 | </EmbeddedResource> |
74 | 84 | <EmbeddedResource Include="Properties\Resources.resx"> |
75 | 85 | <Generator>ResXFileCodeGenerator</Generator> |
@@ -184,7 +184,7 @@ | ||
184 | 184 | resources.ApplyResources(this.button_BrowseAudio, "button_BrowseAudio"); |
185 | 185 | this.button_BrowseAudio.Name = "button_BrowseAudio"; |
186 | 186 | this.button_BrowseAudio.UseVisualStyleBackColor = true; |
187 | - this.button_BrowseAudio.Click += new System.EventHandler(this.button2_Click); | |
187 | + this.button_BrowseAudio.Click += new System.EventHandler(this.button_browseWAV_Click); | |
188 | 188 | // |
189 | 189 | // textBox_BrowseAudio |
190 | 190 | // |
@@ -9,12 +9,13 @@ using System.Threading.Tasks; | ||
9 | 9 | using System.Windows.Forms; |
10 | 10 | using System.IO; |
11 | 11 | using System.Diagnostics; |
12 | +using System.Runtime.InteropServices; | |
12 | 13 | |
13 | 14 | namespace DTX2WAV |
14 | 15 | { |
15 | 16 | public partial class Main : Form |
16 | 17 | { |
17 | - Form_Converting f; | |
18 | + Form_Recording formRecording; | |
18 | 19 | |
19 | 20 | public Main() |
20 | 21 | { |
@@ -101,7 +102,7 @@ namespace DTX2WAV | ||
101 | 102 | |
102 | 103 | } |
103 | 104 | |
104 | - private void button2_Click(object sender, EventArgs e) | |
105 | + private void button_browseWAV_Click(object sender, EventArgs e) | |
105 | 106 | { |
106 | 107 | SaveFileDialog sfd = new SaveFileDialog(); |
107 | 108 |
@@ -183,32 +184,38 @@ namespace DTX2WAV | ||
183 | 184 | p.Start(); |
184 | 185 | |
185 | 186 | //モーダルで変換中ダイアログを表示して、処理をいったん止める(キャンセル or 正常終了イベント待ち) |
186 | - f = new Form_Converting(); | |
187 | - f.ShowDialog(this); | |
187 | + formRecording = new Form_Recording(); | |
188 | + //formRecording.StartPosition = FormStartPosition.CenterParent; | |
189 | + formRecording.ShowDialog(this); | |
188 | 190 | |
189 | - if (f != null) | |
191 | + if (formRecording != null) | |
190 | 192 | { |
191 | 193 | //フォームでCancelボタンが押されると、ここに来る |
192 | 194 | //変換終了時のイベントで正常終了する場合は、p_Exited()で終了して、fがnullになって、ここはスキップされる |
193 | - f.Dispose(); | |
194 | - f = null; | |
195 | + formRecording.Dispose(); | |
196 | + formRecording = null; | |
195 | 197 | } |
196 | 198 | } |
197 | 199 | |
198 | 200 | private void p_Exited(object sender, EventArgs e) |
199 | 201 | { |
200 | - if (f != null) | |
202 | + if (formRecording != null) | |
201 | 203 | { |
202 | - f.Dispose(); | |
203 | - f = null; | |
204 | + formRecording.Dispose(); | |
205 | + formRecording = null; | |
204 | 206 | } |
205 | 207 | |
206 | - MessageBox.Show( | |
207 | - "変換が正常に終了しました。", | |
208 | - "変換終了", | |
209 | - MessageBoxButtons.OK, | |
210 | - MessageBoxIcon.Information | |
211 | - ); | |
208 | + //MessageBox.Show( | |
209 | + // "録音が正常に終了しました。", | |
210 | + // "録音終了", | |
211 | + // MessageBoxButtons.OK, | |
212 | + // MessageBoxIcon.Information | |
213 | + //); | |
214 | + | |
215 | + using (Form_Finished f = new Form_Finished()) | |
216 | + { | |
217 | + f.ShowDialog(); | |
218 | + } | |
212 | 219 | } |
213 | 220 | |
214 | 221 | /// <summary> |
@@ -302,6 +309,32 @@ namespace DTX2WAV | ||
302 | 309 | |
303 | 310 | Properties.Settings.Default.Save(); |
304 | 311 | } |
312 | + | |
313 | + | |
314 | + #region #28821 2014.1.23 yyagi add: 外部からの文字列メッセージ送受信 定数定義 | |
315 | + [StructLayout(LayoutKind.Sequential)] | |
316 | + public struct COPYDATASTRUCT | |
317 | + { | |
318 | + public IntPtr dwData; | |
319 | + public UInt32 cbData; | |
320 | + public IntPtr lpData; | |
321 | + } | |
322 | + #endregion | |
323 | + /// <summary> | |
324 | + /// メッセージを受信する | |
325 | + /// </summary> | |
326 | + /// <param name="m"></param> | |
327 | + protected override void WndProc(ref Message m) | |
328 | + { | |
329 | + if (m.Msg == 0x004A) //WM_COPYDATA | |
330 | + { | |
331 | + COPYDATASTRUCT cds = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT)); | |
332 | + string strMessage = Marshal.PtrToStringUni(cds.lpData); | |
333 | +//Debug.WriteLine("Msg received: " + strMessage); | |
334 | + formRecording.label_state.Text = strMessage; // Form_Recordingにメッセージの内容を伝える | |
335 | + } | |
336 | + base.WndProc(ref m); | |
337 | + } | |
305 | 338 | } |
306 | 339 | |
307 | 340 | } |
@@ -121,6 +121,30 @@ | ||
121 | 121 | <value>17, 17</value> |
122 | 122 | </metadata> |
123 | 123 | <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
124 | + <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
125 | + <value>93, 22</value> | |
126 | + </data> | |
127 | + <data name="exitToolStripMenuItem.Text" xml:space="preserve"> | |
128 | + <value>E&xit</value> | |
129 | + </data> | |
130 | + <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing"> | |
131 | + <value>37, 20</value> | |
132 | + </data> | |
133 | + <data name="toolStripMenuItem1.Text" xml:space="preserve"> | |
134 | + <value>&File</value> | |
135 | + </data> | |
136 | + <data name="editToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
137 | + <value>39, 20</value> | |
138 | + </data> | |
139 | + <data name="editToolStripMenuItem.Text" xml:space="preserve"> | |
140 | + <value>&Edit</value> | |
141 | + </data> | |
142 | + <data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
143 | + <value>44, 20</value> | |
144 | + </data> | |
145 | + <data name="helpToolStripMenuItem.Text" xml:space="preserve"> | |
146 | + <value>&Help</value> | |
147 | + </data> | |
124 | 148 | <data name="menuStrip1.Location" type="System.Drawing.Point, System.Drawing"> |
125 | 149 | <value>0, 0</value> |
126 | 150 | </data> |
@@ -146,30 +170,6 @@ | ||
146 | 170 | <data name=">>menuStrip1.ZOrder" xml:space="preserve"> |
147 | 171 | <value>2</value> |
148 | 172 | </data> |
149 | - <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing"> | |
150 | - <value>37, 20</value> | |
151 | - </data> | |
152 | - <data name="toolStripMenuItem1.Text" xml:space="preserve"> | |
153 | - <value>&File</value> | |
154 | - </data> | |
155 | - <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
156 | - <value>93, 22</value> | |
157 | - </data> | |
158 | - <data name="exitToolStripMenuItem.Text" xml:space="preserve"> | |
159 | - <value>E&xit</value> | |
160 | - </data> | |
161 | - <data name="editToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
162 | - <value>39, 20</value> | |
163 | - </data> | |
164 | - <data name="editToolStripMenuItem.Text" xml:space="preserve"> | |
165 | - <value>&Edit</value> | |
166 | - </data> | |
167 | - <data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> | |
168 | - <value>44, 20</value> | |
169 | - </data> | |
170 | - <data name="helpToolStripMenuItem.Text" xml:space="preserve"> | |
171 | - <value>&Help</value> | |
172 | - </data> | |
173 | 173 | <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
174 | 174 | <value>132, 17</value> |
175 | 175 | </metadata> |
@@ -231,114 +231,6 @@ | ||
231 | 231 | <data name=">>label1.ZOrder" xml:space="preserve"> |
232 | 232 | <value>7</value> |
233 | 233 | </data> |
234 | - <data name=">>comboBox_AudioFormat.Name" xml:space="preserve"> | |
235 | - <value>comboBox_AudioFormat</value> | |
236 | - </data> | |
237 | - <data name=">>comboBox_AudioFormat.Type" xml:space="preserve"> | |
238 | - <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
239 | - </data> | |
240 | - <data name=">>comboBox_AudioFormat.Parent" xml:space="preserve"> | |
241 | - <value>groupBox1</value> | |
242 | - </data> | |
243 | - <data name=">>comboBox_AudioFormat.ZOrder" xml:space="preserve"> | |
244 | - <value>0</value> | |
245 | - </data> | |
246 | - <data name=">>label3.Name" xml:space="preserve"> | |
247 | - <value>label3</value> | |
248 | - </data> | |
249 | - <data name=">>label3.Type" xml:space="preserve"> | |
250 | - <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
251 | - </data> | |
252 | - <data name=">>label3.Parent" xml:space="preserve"> | |
253 | - <value>groupBox1</value> | |
254 | - </data> | |
255 | - <data name=">>label3.ZOrder" xml:space="preserve"> | |
256 | - <value>1</value> | |
257 | - </data> | |
258 | - <data name=">>button_BrowseAudio.Name" xml:space="preserve"> | |
259 | - <value>button_BrowseAudio</value> | |
260 | - </data> | |
261 | - <data name=">>button_BrowseAudio.Type" xml:space="preserve"> | |
262 | - <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
263 | - </data> | |
264 | - <data name=">>button_BrowseAudio.Parent" xml:space="preserve"> | |
265 | - <value>groupBox1</value> | |
266 | - </data> | |
267 | - <data name=">>button_BrowseAudio.ZOrder" xml:space="preserve"> | |
268 | - <value>2</value> | |
269 | - </data> | |
270 | - <data name=">>textBox_BrowseAudio.Name" xml:space="preserve"> | |
271 | - <value>textBox_BrowseAudio</value> | |
272 | - </data> | |
273 | - <data name=">>textBox_BrowseAudio.Type" xml:space="preserve"> | |
274 | - <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
275 | - </data> | |
276 | - <data name=">>textBox_BrowseAudio.Parent" xml:space="preserve"> | |
277 | - <value>groupBox1</value> | |
278 | - </data> | |
279 | - <data name=">>textBox_BrowseAudio.ZOrder" xml:space="preserve"> | |
280 | - <value>3</value> | |
281 | - </data> | |
282 | - <data name=">>label2.Name" xml:space="preserve"> | |
283 | - <value>label2</value> | |
284 | - </data> | |
285 | - <data name=">>label2.Type" xml:space="preserve"> | |
286 | - <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
287 | - </data> | |
288 | - <data name=">>label2.Parent" xml:space="preserve"> | |
289 | - <value>groupBox1</value> | |
290 | - </data> | |
291 | - <data name=">>label2.ZOrder" xml:space="preserve"> | |
292 | - <value>4</value> | |
293 | - </data> | |
294 | - <data name=">>button_browseDTX.Name" xml:space="preserve"> | |
295 | - <value>button_browseDTX</value> | |
296 | - </data> | |
297 | - <data name=">>button_browseDTX.Type" xml:space="preserve"> | |
298 | - <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
299 | - </data> | |
300 | - <data name=">>button_browseDTX.Parent" xml:space="preserve"> | |
301 | - <value>groupBox1</value> | |
302 | - </data> | |
303 | - <data name=">>button_browseDTX.ZOrder" xml:space="preserve"> | |
304 | - <value>5</value> | |
305 | - </data> | |
306 | - <data name=">>textBox_BrowseDTX.Name" xml:space="preserve"> | |
307 | - <value>textBox_BrowseDTX</value> | |
308 | - </data> | |
309 | - <data name=">>textBox_BrowseDTX.Type" xml:space="preserve"> | |
310 | - <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
311 | - </data> | |
312 | - <data name=">>textBox_BrowseDTX.Parent" xml:space="preserve"> | |
313 | - <value>groupBox1</value> | |
314 | - </data> | |
315 | - <data name=">>textBox_BrowseDTX.ZOrder" xml:space="preserve"> | |
316 | - <value>6</value> | |
317 | - </data> | |
318 | - <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> | |
319 | - <value>6, 6</value> | |
320 | - </data> | |
321 | - <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> | |
322 | - <value>633, 138</value> | |
323 | - </data> | |
324 | - <data name="groupBox1.TabIndex" type="System.Int32, mscorlib"> | |
325 | - <value>3</value> | |
326 | - </data> | |
327 | - <data name="groupBox1.Text" xml:space="preserve"> | |
328 | - <value>変換ファイルの指定</value> | |
329 | - </data> | |
330 | - <data name=">>groupBox1.Name" xml:space="preserve"> | |
331 | - <value>groupBox1</value> | |
332 | - </data> | |
333 | - <data name=">>groupBox1.Type" xml:space="preserve"> | |
334 | - <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
335 | - </data> | |
336 | - <data name=">>groupBox1.Parent" xml:space="preserve"> | |
337 | - <value>tabPage1</value> | |
338 | - </data> | |
339 | - <data name=">>groupBox1.ZOrder" xml:space="preserve"> | |
340 | - <value>3</value> | |
341 | - </data> | |
342 | 234 | <data name="comboBox_AudioFormat.Items" xml:space="preserve"> |
343 | 235 | <value>WAV</value> |
344 | 236 | </data> |
@@ -528,6 +420,30 @@ | ||
528 | 420 | <data name=">>textBox_BrowseDTX.ZOrder" xml:space="preserve"> |
529 | 421 | <value>6</value> |
530 | 422 | </data> |
423 | + <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> | |
424 | + <value>6, 6</value> | |
425 | + </data> | |
426 | + <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> | |
427 | + <value>633, 138</value> | |
428 | + </data> | |
429 | + <data name="groupBox1.TabIndex" type="System.Int32, mscorlib"> | |
430 | + <value>3</value> | |
431 | + </data> | |
432 | + <data name="groupBox1.Text" xml:space="preserve"> | |
433 | + <value>変換ファイルの指定</value> | |
434 | + </data> | |
435 | + <data name=">>groupBox1.Name" xml:space="preserve"> | |
436 | + <value>groupBox1</value> | |
437 | + </data> | |
438 | + <data name=">>groupBox1.Type" xml:space="preserve"> | |
439 | + <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
440 | + </data> | |
441 | + <data name=">>groupBox1.Parent" xml:space="preserve"> | |
442 | + <value>tabPage1</value> | |
443 | + </data> | |
444 | + <data name=">>groupBox1.ZOrder" xml:space="preserve"> | |
445 | + <value>3</value> | |
446 | + </data> | |
531 | 447 | <data name="button_Cancel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> |
532 | 448 | <value>NoControl</value> |
533 | 449 | </data> |
@@ -568,7 +484,7 @@ | ||
568 | 484 | <value>5</value> |
569 | 485 | </data> |
570 | 486 | <data name="button_Convert.Text" xml:space="preserve"> |
571 | - <value>変換</value> | |
487 | + <value>録音</value> | |
572 | 488 | </data> |
573 | 489 | <data name=">>button_Convert.Name" xml:space="preserve"> |
574 | 490 | <value>button_Convert</value> |
@@ -1197,24 +1113,6 @@ | ||
1197 | 1113 | <data name=">>tabControl1.ZOrder" xml:space="preserve"> |
1198 | 1114 | <value>0</value> |
1199 | 1115 | </data> |
1200 | - <metadata name="bindingSource_Master.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1201 | - <value>177, 56</value> | |
1202 | - </metadata> | |
1203 | - <metadata name="bindingSource_Bass.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1204 | - <value>17, 56</value> | |
1205 | - </metadata> | |
1206 | - <metadata name="bindingSource_Guitar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1207 | - <value>1069, 17</value> | |
1208 | - </metadata> | |
1209 | - <metadata name="bindingSource_Drums.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1210 | - <value>932, 17</value> | |
1211 | - </metadata> | |
1212 | - <metadata name="bindingSource_SE.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1213 | - <value>783, 17</value> | |
1214 | - </metadata> | |
1215 | - <metadata name="bindingSource_BGM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
1216 | - <value>621, 17</value> | |
1217 | - </metadata> | |
1218 | 1116 | <metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
1219 | 1117 | <value>388, 17</value> |
1220 | 1118 | </metadata> |
@@ -1,83 +0,0 @@ | ||
1 | -namespace DTX2WAV | |
2 | -{ | |
3 | - partial class Form_Converting | |
4 | - { | |
5 | - /// <summary> | |
6 | - /// Required designer variable. | |
7 | - /// </summary> | |
8 | - private System.ComponentModel.IContainer components = null; | |
9 | - | |
10 | - /// <summary> | |
11 | - /// Clean up any resources being used. | |
12 | - /// </summary> | |
13 | - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
14 | - protected override void Dispose(bool disposing) | |
15 | - { | |
16 | - if (disposing && (components != null)) | |
17 | - { | |
18 | - components.Dispose(); | |
19 | - } | |
20 | - base.Dispose(disposing); | |
21 | - } | |
22 | - | |
23 | - #region Windows Form Designer generated code | |
24 | - | |
25 | - /// <summary> | |
26 | - /// Required method for Designer support - do not modify | |
27 | - /// the contents of this method with the code editor. | |
28 | - /// </summary> | |
29 | - private void InitializeComponent() | |
30 | - { | |
31 | - this.button_CancelConverting = new System.Windows.Forms.Button(); | |
32 | - this.label_Converting = new System.Windows.Forms.Label(); | |
33 | - this.progressBar_Converting = new System.Windows.Forms.ProgressBar(); | |
34 | - this.SuspendLayout(); | |
35 | - // | |
36 | - // button_CancelConverting | |
37 | - // | |
38 | - this.button_CancelConverting.Location = new System.Drawing.Point(66, 183); | |
39 | - this.button_CancelConverting.Name = "button_CancelConverting"; | |
40 | - this.button_CancelConverting.Size = new System.Drawing.Size(144, 23); | |
41 | - this.button_CancelConverting.TabIndex = 0; | |
42 | - this.button_CancelConverting.Text = "Cancel(まだ使えません)"; | |
43 | - this.button_CancelConverting.UseVisualStyleBackColor = true; | |
44 | - // | |
45 | - // label_Converting | |
46 | - // | |
47 | - this.label_Converting.AutoSize = true; | |
48 | - this.label_Converting.Location = new System.Drawing.Point(12, 86); | |
49 | - this.label_Converting.Name = "label_Converting"; | |
50 | - this.label_Converting.Size = new System.Drawing.Size(270, 12); | |
51 | - this.label_Converting.TabIndex = 1; | |
52 | - this.label_Converting.Text = "変換中です。演奏が終わるまで、そのままお待ちください。"; | |
53 | - // | |
54 | - // progressBar_Converting | |
55 | - // | |
56 | - this.progressBar_Converting.Location = new System.Drawing.Point(36, 142); | |
57 | - this.progressBar_Converting.Name = "progressBar_Converting"; | |
58 | - this.progressBar_Converting.Size = new System.Drawing.Size(209, 23); | |
59 | - this.progressBar_Converting.TabIndex = 2; | |
60 | - // | |
61 | - // Form_Converting | |
62 | - // | |
63 | - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |
64 | - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
65 | - this.ClientSize = new System.Drawing.Size(284, 261); | |
66 | - this.ControlBox = false; | |
67 | - this.Controls.Add(this.progressBar_Converting); | |
68 | - this.Controls.Add(this.label_Converting); | |
69 | - this.Controls.Add(this.button_CancelConverting); | |
70 | - this.Name = "Form_Converting"; | |
71 | - this.Text = "Converting..."; | |
72 | - this.ResumeLayout(false); | |
73 | - this.PerformLayout(); | |
74 | - | |
75 | - } | |
76 | - | |
77 | - #endregion | |
78 | - | |
79 | - private System.Windows.Forms.Button button_CancelConverting; | |
80 | - private System.Windows.Forms.Label label_Converting; | |
81 | - private System.Windows.Forms.ProgressBar progressBar_Converting; | |
82 | - } | |
83 | -} | |
\ No newline at end of file |
@@ -0,0 +1,66 @@ | ||
1 | +namespace DTX2WAV | |
2 | +{ | |
3 | + partial class Form_Finished | |
4 | + { | |
5 | + /// <summary> | |
6 | + /// Required designer variable. | |
7 | + /// </summary> | |
8 | + private System.ComponentModel.IContainer components = null; | |
9 | + | |
10 | + /// <summary> | |
11 | + /// Clean up any resources being used. | |
12 | + /// </summary> | |
13 | + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
14 | + protected override void Dispose(bool disposing) | |
15 | + { | |
16 | + if (disposing && (components != null)) | |
17 | + { | |
18 | + components.Dispose(); | |
19 | + } | |
20 | + base.Dispose(disposing); | |
21 | + } | |
22 | + | |
23 | + #region Windows Form Designer generated code | |
24 | + | |
25 | + /// <summary> | |
26 | + /// Required method for Designer support - do not modify | |
27 | + /// the contents of this method with the code editor. | |
28 | + /// </summary> | |
29 | + private void InitializeComponent() | |
30 | + { | |
31 | + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Finished)); | |
32 | + this.button_OK = new System.Windows.Forms.Button(); | |
33 | + this.label_finished = new System.Windows.Forms.Label(); | |
34 | + this.SuspendLayout(); | |
35 | + // | |
36 | + // button_OK | |
37 | + // | |
38 | + resources.ApplyResources(this.button_OK, "button_OK"); | |
39 | + this.button_OK.Name = "button_OK"; | |
40 | + this.button_OK.UseVisualStyleBackColor = true; | |
41 | + this.button_OK.Click += new System.EventHandler(this.button_OK_Click); | |
42 | + // | |
43 | + // label_finished | |
44 | + // | |
45 | + resources.ApplyResources(this.label_finished, "label_finished"); | |
46 | + this.label_finished.Name = "label_finished"; | |
47 | + // | |
48 | + // Form_FInished | |
49 | + // | |
50 | + resources.ApplyResources(this, "$this"); | |
51 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
52 | + this.ControlBox = false; | |
53 | + this.Controls.Add(this.label_finished); | |
54 | + this.Controls.Add(this.button_OK); | |
55 | + this.Name = "Form_FInished"; | |
56 | + this.ResumeLayout(false); | |
57 | + this.PerformLayout(); | |
58 | + | |
59 | + } | |
60 | + | |
61 | + #endregion | |
62 | + | |
63 | + private System.Windows.Forms.Button button_OK; | |
64 | + private System.Windows.Forms.Label label_finished; | |
65 | + } | |
66 | +} | |
\ No newline at end of file |
@@ -10,11 +10,15 @@ using System.Windows.Forms; | ||
10 | 10 | |
11 | 11 | namespace DTX2WAV |
12 | 12 | { |
13 | - public partial class Form_Converting : Form | |
13 | + public partial class Form_Finished : Form | |
14 | 14 | { |
15 | - public Form_Converting() | |
15 | + public Form_Finished() | |
16 | 16 | { |
17 | 17 | InitializeComponent(); |
18 | 18 | } |
19 | + | |
20 | + private void button_OK_Click(object sender, EventArgs e) | |
21 | + { | |
22 | + this.Close(); } | |
19 | 23 | } |
20 | 24 | } |
@@ -117,4 +117,79 @@ | ||
117 | 117 | <resheader name="writer"> |
118 | 118 | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
119 | 119 | </resheader> |
120 | + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | |
121 | + <data name="button_OK.Location" type="System.Drawing.Point, System.Drawing"> | |
122 | + <value>42, 85</value> | |
123 | + </data> | |
124 | + <data name="button_OK.Size" type="System.Drawing.Size, System.Drawing"> | |
125 | + <value>75, 23</value> | |
126 | + </data> | |
127 | + <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
128 | + <data name="button_OK.TabIndex" type="System.Int32, mscorlib"> | |
129 | + <value>0</value> | |
130 | + </data> | |
131 | + <data name="button_OK.Text" xml:space="preserve"> | |
132 | + <value>OK</value> | |
133 | + </data> | |
134 | + <data name=">>button_OK.Name" xml:space="preserve"> | |
135 | + <value>button_OK</value> | |
136 | + </data> | |
137 | + <data name=">>button_OK.Type" xml:space="preserve"> | |
138 | + <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
139 | + </data> | |
140 | + <data name=">>button_OK.Parent" xml:space="preserve"> | |
141 | + <value>$this</value> | |
142 | + </data> | |
143 | + <data name=">>button_OK.ZOrder" xml:space="preserve"> | |
144 | + <value>1</value> | |
145 | + </data> | |
146 | + <data name="label_finished.AutoSize" type="System.Boolean, mscorlib"> | |
147 | + <value>True</value> | |
148 | + </data> | |
149 | + <data name="label_finished.Location" type="System.Drawing.Point, System.Drawing"> | |
150 | + <value>30, 35</value> | |
151 | + </data> | |
152 | + <data name="label_finished.Size" type="System.Drawing.Size, System.Drawing"> | |
153 | + <value>107, 12</value> | |
154 | + </data> | |
155 | + <data name="label_finished.TabIndex" type="System.Int32, mscorlib"> | |
156 | + <value>1</value> | |
157 | + </data> | |
158 | + <data name="label_finished.Text" xml:space="preserve"> | |
159 | + <value>録音が終了しました。</value> | |
160 | + </data> | |
161 | + <data name=">>label_finished.Name" xml:space="preserve"> | |
162 | + <value>label_finished</value> | |
163 | + </data> | |
164 | + <data name=">>label_finished.Type" xml:space="preserve"> | |
165 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
166 | + </data> | |
167 | + <data name=">>label_finished.Parent" xml:space="preserve"> | |
168 | + <value>$this</value> | |
169 | + </data> | |
170 | + <data name=">>label_finished.ZOrder" xml:space="preserve"> | |
171 | + <value>0</value> | |
172 | + </data> | |
173 | + <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |
174 | + <value>True</value> | |
175 | + </metadata> | |
176 | + <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> | |
177 | + <value>6, 12</value> | |
178 | + </data> | |
179 | + <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> | |
180 | + <value>167, 120</value> | |
181 | + </data> | |
182 | + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
183 | + <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms"> | |
184 | + <value>CenterParent</value> | |
185 | + </data> | |
186 | + <data name="$this.Text" xml:space="preserve"> | |
187 | + <value>録音終了</value> | |
188 | + </data> | |
189 | + <data name=">>$this.Name" xml:space="preserve"> | |
190 | + <value>Form_FInished</value> | |
191 | + </data> | |
192 | + <data name=">>$this.Type" xml:space="preserve"> | |
193 | + <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
194 | + </data> | |
120 | 195 | </root> |
\ No newline at end of file |
@@ -0,0 +1,166 @@ | ||
1 | +namespace DTX2WAV | |
2 | +{ | |
3 | + partial class Form_Recording | |
4 | + { | |
5 | + /// <summary> | |
6 | + /// Required designer variable. | |
7 | + /// </summary> | |
8 | + private System.ComponentModel.IContainer components = null; | |
9 | + | |
10 | + /// <summary> | |
11 | + /// Clean up any resources being used. | |
12 | + /// </summary> | |
13 | + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
14 | + protected override void Dispose(bool disposing) | |
15 | + { | |
16 | + if (disposing && (components != null)) | |
17 | + { | |
18 | + components.Dispose(); | |
19 | + } | |
20 | + base.Dispose(disposing); | |
21 | + } | |
22 | + | |
23 | + #region Windows Form Designer generated code | |
24 | + | |
25 | + /// <summary> | |
26 | + /// Required method for Designer support - do not modify | |
27 | + /// the contents of this method with the code editor. | |
28 | + /// </summary> | |
29 | + private void InitializeComponent() | |
30 | + { | |
31 | + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Recording)); | |
32 | + this.button_CancelConverting = new System.Windows.Forms.Button(); | |
33 | + this.label_Recording = new System.Windows.Forms.Label(); | |
34 | + this.progressBar_Recording = new System.Windows.Forms.ProgressBar(); | |
35 | + this.label_boot = new System.Windows.Forms.Label(); | |
36 | + this.label_loading = new System.Windows.Forms.Label(); | |
37 | + this.label_playing = new System.Windows.Forms.Label(); | |
38 | + this.label_exit = new System.Windows.Forms.Label(); | |
39 | + this.label_state = new System.Windows.Forms.Label(); | |
40 | + this.label_boot_check = new System.Windows.Forms.Label(); | |
41 | + this.label_loading_check = new System.Windows.Forms.Label(); | |
42 | + this.label_playing_check = new System.Windows.Forms.Label(); | |
43 | + this.label_exit_check = new System.Windows.Forms.Label(); | |
44 | + this.label_estimateTime = new System.Windows.Forms.Label(); | |
45 | + this.label_currentTime = new System.Windows.Forms.Label(); | |
46 | + this.SuspendLayout(); | |
47 | + // | |
48 | + // button_CancelConverting | |
49 | + // | |
50 | + resources.ApplyResources(this.button_CancelConverting, "button_CancelConverting"); | |
51 | + this.button_CancelConverting.Name = "button_CancelConverting"; | |
52 | + this.button_CancelConverting.UseVisualStyleBackColor = true; | |
53 | + this.button_CancelConverting.Click += new System.EventHandler(this.button_CancelConverting_Click); | |
54 | + // | |
55 | + // label_Recording | |
56 | + // | |
57 | + resources.ApplyResources(this.label_Recording, "label_Recording"); | |
58 | + this.label_Recording.Name = "label_Recording"; | |
59 | + // | |
60 | + // progressBar_Recording | |
61 | + // | |
62 | + resources.ApplyResources(this.progressBar_Recording, "progressBar_Recording"); | |
63 | + this.progressBar_Recording.Maximum = 10000; | |
64 | + this.progressBar_Recording.Name = "progressBar_Recording"; | |
65 | + // | |
66 | + // label_boot | |
67 | + // | |
68 | + resources.ApplyResources(this.label_boot, "label_boot"); | |
69 | + this.label_boot.Name = "label_boot"; | |
70 | + // | |
71 | + // label_loading | |
72 | + // | |
73 | + resources.ApplyResources(this.label_loading, "label_loading"); | |
74 | + this.label_loading.Name = "label_loading"; | |
75 | + // | |
76 | + // label_playing | |
77 | + // | |
78 | + resources.ApplyResources(this.label_playing, "label_playing"); | |
79 | + this.label_playing.Name = "label_playing"; | |
80 | + // | |
81 | + // label_exit | |
82 | + // | |
83 | + resources.ApplyResources(this.label_exit, "label_exit"); | |
84 | + this.label_exit.Name = "label_exit"; | |
85 | + // | |
86 | + // label_state | |
87 | + // | |
88 | + resources.ApplyResources(this.label_state, "label_state"); | |
89 | + this.label_state.Name = "label_state"; | |
90 | + this.label_state.TextChanged += new System.EventHandler(this.label_state_TextChanged); | |
91 | + // | |
92 | + // label_boot_check | |
93 | + // | |
94 | + resources.ApplyResources(this.label_boot_check, "label_boot_check"); | |
95 | + this.label_boot_check.Name = "label_boot_check"; | |
96 | + // | |
97 | + // label_loading_check | |
98 | + // | |
99 | + resources.ApplyResources(this.label_loading_check, "label_loading_check"); | |
100 | + this.label_loading_check.Name = "label_loading_check"; | |
101 | + // | |
102 | + // label_playing_check | |
103 | + // | |
104 | + resources.ApplyResources(this.label_playing_check, "label_playing_check"); | |
105 | + this.label_playing_check.Name = "label_playing_check"; | |
106 | + // | |
107 | + // label_exit_check | |
108 | + // | |
109 | + resources.ApplyResources(this.label_exit_check, "label_exit_check"); | |
110 | + this.label_exit_check.Name = "label_exit_check"; | |
111 | + // | |
112 | + // label_estimateTime | |
113 | + // | |
114 | + resources.ApplyResources(this.label_estimateTime, "label_estimateTime"); | |
115 | + this.label_estimateTime.Name = "label_estimateTime"; | |
116 | + this.label_estimateTime.UseMnemonic = false; | |
117 | + // | |
118 | + // label_currentTime | |
119 | + // | |
120 | + resources.ApplyResources(this.label_currentTime, "label_currentTime"); | |
121 | + this.label_currentTime.Name = "label_currentTime"; | |
122 | + // | |
123 | + // Form_Recording | |
124 | + // | |
125 | + resources.ApplyResources(this, "$this"); | |
126 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
127 | + this.ControlBox = false; | |
128 | + this.Controls.Add(this.label_currentTime); | |
129 | + this.Controls.Add(this.label_estimateTime); | |
130 | + this.Controls.Add(this.label_exit_check); | |
131 | + this.Controls.Add(this.label_playing_check); | |
132 | + this.Controls.Add(this.label_loading_check); | |
133 | + this.Controls.Add(this.label_boot_check); | |
134 | + this.Controls.Add(this.label_state); | |
135 | + this.Controls.Add(this.label_exit); | |
136 | + this.Controls.Add(this.label_playing); | |
137 | + this.Controls.Add(this.label_loading); | |
138 | + this.Controls.Add(this.label_boot); | |
139 | + this.Controls.Add(this.progressBar_Recording); | |
140 | + this.Controls.Add(this.label_Recording); | |
141 | + this.Controls.Add(this.button_CancelConverting); | |
142 | + this.Name = "Form_Recording"; | |
143 | + this.Load += new System.EventHandler(this.Form_Recording_Load); | |
144 | + this.ResumeLayout(false); | |
145 | + this.PerformLayout(); | |
146 | + | |
147 | + } | |
148 | + | |
149 | + #endregion | |
150 | + | |
151 | + private System.Windows.Forms.Button button_CancelConverting; | |
152 | + private System.Windows.Forms.Label label_Recording; | |
153 | + private System.Windows.Forms.ProgressBar progressBar_Recording; | |
154 | + private System.Windows.Forms.Label label_boot; | |
155 | + private System.Windows.Forms.Label label_loading; | |
156 | + private System.Windows.Forms.Label label_playing; | |
157 | + private System.Windows.Forms.Label label_exit; | |
158 | + public System.Windows.Forms.Label label_state; | |
159 | + private System.Windows.Forms.Label label_boot_check; | |
160 | + private System.Windows.Forms.Label label_loading_check; | |
161 | + private System.Windows.Forms.Label label_playing_check; | |
162 | + private System.Windows.Forms.Label label_exit_check; | |
163 | + private System.Windows.Forms.Label label_estimateTime; | |
164 | + private System.Windows.Forms.Label label_currentTime; | |
165 | + } | |
166 | +} | |
\ No newline at end of file |
@@ -0,0 +1,101 @@ | ||
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.ComponentModel; | |
4 | +using System.Data; | |
5 | +using System.Drawing; | |
6 | +using System.Linq; | |
7 | +using System.Text; | |
8 | +using System.Threading.Tasks; | |
9 | +using System.Windows.Forms; | |
10 | +using System.Runtime.InteropServices; | |
11 | +using System.Diagnostics; | |
12 | +using System.Text.RegularExpressions; | |
13 | + | |
14 | +namespace DTX2WAV | |
15 | +{ | |
16 | + public partial class Form_Recording : Form | |
17 | + { | |
18 | + public Form_Recording() | |
19 | + { | |
20 | + InitializeComponent(); | |
21 | + } | |
22 | + | |
23 | + /// <summary> | |
24 | + /// DTXMania本体に、録音中止のメッセージを送信 | |
25 | + /// </summary> | |
26 | + /// <param name="sender"></param> | |
27 | + /// <param name="e"></param> | |
28 | + private void button_CancelConverting_Click(object sender, EventArgs e) | |
29 | + { | |
30 | + CSendMessageToDTXMania.SendMessage("-C"); | |
31 | + } | |
32 | + | |
33 | + private void Form_Recording_Load(object sender, EventArgs e) | |
34 | + { | |
35 | + progressBar_Recording.Value = 0; | |
36 | + } | |
37 | + | |
38 | + | |
39 | + /// <summary> | |
40 | + /// DTXMania本体からDTX2WAVのメインForm経由でメッセージを受信する | |
41 | + /// (メインFormのWndProcでメッセージを受信し、Form_Recordingのlabel_state経由でForm_Recordingが受け取る) | |
42 | + /// そして、進捗表示をする | |
43 | + /// </summary> | |
44 | + /// <param name="sender"></param> | |
45 | + /// <param name="e"></param> | |
46 | + private void label_state_TextChanged(object sender, EventArgs e) | |
47 | + { | |
48 | + switch (label_state.Text.Substring(0,4).ToUpper()) | |
49 | + { | |
50 | + case "BOOT": | |
51 | + label_boot_check.Text = "→"; | |
52 | + label_loading_check.Text = ""; | |
53 | + label_playing_check.Text = ""; | |
54 | + label_exit_check.Text = ""; | |
55 | + break; | |
56 | + case "LOAD": | |
57 | + label_boot_check.Text = "✔"; | |
58 | + label_loading_check.Text = "→"; | |
59 | + label_playing_check.Text = ""; | |
60 | + label_exit_check.Text = ""; | |
61 | + break; | |
62 | + case "PLAY": | |
63 | + label_boot_check.Text = "✔"; | |
64 | + label_loading_check.Text = "✔"; | |
65 | + label_playing_check.Text = "→"; | |
66 | + label_exit_check.Text = ""; | |
67 | + break; | |
68 | + case "TERM": | |
69 | + label_boot_check.Text = "✔"; | |
70 | + label_loading_check.Text = "✔"; | |
71 | + label_playing_check.Text = "✔"; | |
72 | + label_exit_check.Text = "→"; | |
73 | + break; | |
74 | + case "TIME": | |
75 | + string[] s = label_state.Text.Split(new char[] { ',' }); | |
76 | + int nEstimateTimeMs = Convert.ToInt32(s[2]); | |
77 | + int nCurrentTimeMs = Convert.ToInt32(s[1]); | |
78 | +//Debug.WriteLine(label_state.Text + ": " + nCurrentTimeMs + " : " + nEstimateTimeMs); | |
79 | + | |
80 | + if (nCurrentTimeMs > nEstimateTimeMs) | |
81 | + { | |
82 | + nCurrentTimeMs = nEstimateTimeMs; | |
83 | + } | |
84 | + progressBar_Recording.Value = (int)(((double)nCurrentTimeMs / (double)nEstimateTimeMs) * 10000); | |
85 | + | |
86 | + //int nEstimateTimeMs = (CDTXMania.Instance.DTX.listChip.Count > 0) ? CDTXMania.Instance.DTX.listChip[CDTXMania.Instance.DTX.listChip.Count - 1].n発声時刻ms : 0; | |
87 | + string strEstimateTime = (((double)nEstimateTimeMs) / 1000.0).ToString("####0.00"); | |
88 | + string strCurrentTime = (((double)nCurrentTimeMs) / 1000.0).ToString("####0.00"); | |
89 | + | |
90 | + label_currentTime.Text = strCurrentTime; | |
91 | + label_estimateTime.Text = strEstimateTime; | |
92 | + | |
93 | + break; | |
94 | + | |
95 | + default: | |
96 | + break; | |
97 | + } | |
98 | + } | |
99 | + } | |
100 | +} | |
101 | + |
@@ -0,0 +1,501 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<root> | |
3 | + <!-- | |
4 | + Microsoft ResX Schema | |
5 | + | |
6 | + Version 2.0 | |
7 | + | |
8 | + The primary goals of this format is to allow a simple XML format | |
9 | + that is mostly human readable. The generation and parsing of the | |
10 | + various data types are done through the TypeConverter classes | |
11 | + associated with the data types. | |
12 | + | |
13 | + Example: | |
14 | + | |
15 | + ... ado.net/XML headers & schema ... | |
16 | + <resheader name="resmimetype">text/microsoft-resx</resheader> | |
17 | + <resheader name="version">2.0</resheader> | |
18 | + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |
19 | + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |
20 | + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |
21 | + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |
22 | + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |
23 | + <value>[base64 mime encoded serialized .NET Framework object]</value> | |
24 | + </data> | |
25 | + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |
26 | + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |
27 | + <comment>This is a comment</comment> | |
28 | + </data> | |
29 | + | |
30 | + There are any number of "resheader" rows that contain simple | |
31 | + name/value pairs. | |
32 | + | |
33 | + Each data row contains a name, and value. The row also contains a | |
34 | + type or mimetype. Type corresponds to a .NET class that support | |
35 | + text/value conversion through the TypeConverter architecture. | |
36 | + Classes that don't support this are serialized and stored with the | |
37 | + mimetype set. | |
38 | + | |
39 | + The mimetype is used for serialized objects, and tells the | |
40 | + ResXResourceReader how to depersist the object. This is currently not | |
41 | + extensible. For a given mimetype the value must be set accordingly: | |
42 | + | |
43 | + Note - application/x-microsoft.net.object.binary.base64 is the format | |
44 | + that the ResXResourceWriter will generate, however the reader can | |
45 | + read any of the formats listed below. | |
46 | + | |
47 | + mimetype: application/x-microsoft.net.object.binary.base64 | |
48 | + value : The object must be serialized with | |
49 | + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |
50 | + : and then encoded with base64 encoding. | |
51 | + | |
52 | + mimetype: application/x-microsoft.net.object.soap.base64 | |
53 | + value : The object must be serialized with | |
54 | + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |
55 | + : and then encoded with base64 encoding. | |
56 | + | |
57 | + mimetype: application/x-microsoft.net.object.bytearray.base64 | |
58 | + value : The object must be serialized into a byte array | |
59 | + : using a System.ComponentModel.TypeConverter | |
60 | + : and then encoded with base64 encoding. | |
61 | + --> | |
62 | + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |
63 | + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |
64 | + <xsd:element name="root" msdata:IsDataSet="true"> | |
65 | + <xsd:complexType> | |
66 | + <xsd:choice maxOccurs="unbounded"> | |
67 | + <xsd:element name="metadata"> | |
68 | + <xsd:complexType> | |
69 | + <xsd:sequence> | |
70 | + <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |
71 | + </xsd:sequence> | |
72 | + <xsd:attribute name="name" use="required" type="xsd:string" /> | |
73 | + <xsd:attribute name="type" type="xsd:string" /> | |
74 | + <xsd:attribute name="mimetype" type="xsd:string" /> | |
75 | + <xsd:attribute ref="xml:space" /> | |
76 | + </xsd:complexType> | |
77 | + </xsd:element> | |
78 | + <xsd:element name="assembly"> | |
79 | + <xsd:complexType> | |
80 | + <xsd:attribute name="alias" type="xsd:string" /> | |
81 | + <xsd:attribute name="name" type="xsd:string" /> | |
82 | + </xsd:complexType> | |
83 | + </xsd:element> | |
84 | + <xsd:element name="data"> | |
85 | + <xsd:complexType> | |
86 | + <xsd:sequence> | |
87 | + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |
88 | + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |
89 | + </xsd:sequence> | |
90 | + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |
91 | + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |
92 | + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |
93 | + <xsd:attribute ref="xml:space" /> | |
94 | + </xsd:complexType> | |
95 | + </xsd:element> | |
96 | + <xsd:element name="resheader"> | |
97 | + <xsd:complexType> | |
98 | + <xsd:sequence> | |
99 | + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |
100 | + </xsd:sequence> | |
101 | + <xsd:attribute name="name" type="xsd:string" use="required" /> | |
102 | + </xsd:complexType> | |
103 | + </xsd:element> | |
104 | + </xsd:choice> | |
105 | + </xsd:complexType> | |
106 | + </xsd:element> | |
107 | + </xsd:schema> | |
108 | + <resheader name="resmimetype"> | |
109 | + <value>text/microsoft-resx</value> | |
110 | + </resheader> | |
111 | + <resheader name="version"> | |
112 | + <value>2.0</value> | |
113 | + </resheader> | |
114 | + <resheader name="reader"> | |
115 | + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
116 | + </resheader> | |
117 | + <resheader name="writer"> | |
118 | + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
119 | + </resheader> | |
120 | + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | |
121 | + <data name="button_CancelConverting.Location" type="System.Drawing.Point, System.Drawing"> | |
122 | + <value>90, 204</value> | |
123 | + </data> | |
124 | + <data name="button_CancelConverting.Size" type="System.Drawing.Size, System.Drawing"> | |
125 | + <value>88, 23</value> | |
126 | + </data> | |
127 | + <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
128 | + <data name="button_CancelConverting.TabIndex" type="System.Int32, mscorlib"> | |
129 | + <value>0</value> | |
130 | + </data> | |
131 | + <data name="button_CancelConverting.Text" xml:space="preserve"> | |
132 | + <value>Cancel</value> | |
133 | + </data> | |
134 | + <data name=">>button_CancelConverting.Name" xml:space="preserve"> | |
135 | + <value>button_CancelConverting</value> | |
136 | + </data> | |
137 | + <data name=">>button_CancelConverting.Type" xml:space="preserve"> | |
138 | + <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
139 | + </data> | |
140 | + <data name=">>button_CancelConverting.Parent" xml:space="preserve"> | |
141 | + <value>$this</value> | |
142 | + </data> | |
143 | + <data name=">>button_CancelConverting.ZOrder" xml:space="preserve"> | |
144 | + <value>13</value> | |
145 | + </data> | |
146 | + <data name="label_Recording.AutoSize" type="System.Boolean, mscorlib"> | |
147 | + <value>True</value> | |
148 | + </data> | |
149 | + <data name="label_Recording.Location" type="System.Drawing.Point, System.Drawing"> | |
150 | + <value>9, 21</value> | |
151 | + </data> | |
152 | + <data name="label_Recording.Size" type="System.Drawing.Size, System.Drawing"> | |
153 | + <value>270, 12</value> | |
154 | + </data> | |
155 | + <data name="label_Recording.TabIndex" type="System.Int32, mscorlib"> | |
156 | + <value>1</value> | |
157 | + </data> | |
158 | + <data name="label_Recording.Text" xml:space="preserve"> | |
159 | + <value>録音中です。演奏が終わるまで、そのままお待ちください。</value> | |
160 | + </data> | |
161 | + <data name=">>label_Recording.Name" xml:space="preserve"> | |
162 | + <value>label_Recording</value> | |
163 | + </data> | |
164 | + <data name=">>label_Recording.Type" xml:space="preserve"> | |
165 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
166 | + </data> | |
167 | + <data name=">>label_Recording.Parent" xml:space="preserve"> | |
168 | + <value>$this</value> | |
169 | + </data> | |
170 | + <data name=">>label_Recording.ZOrder" xml:space="preserve"> | |
171 | + <value>12</value> | |
172 | + </data> | |
173 | + <data name="progressBar_Recording.Location" type="System.Drawing.Point, System.Drawing"> | |
174 | + <value>34, 160</value> | |
175 | + </data> | |
176 | + <data name="progressBar_Recording.Size" type="System.Drawing.Size, System.Drawing"> | |
177 | + <value>209, 23</value> | |
178 | + </data> | |
179 | + <data name="progressBar_Recording.TabIndex" type="System.Int32, mscorlib"> | |
180 | + <value>2</value> | |
181 | + </data> | |
182 | + <data name=">>progressBar_Recording.Name" xml:space="preserve"> | |
183 | + <value>progressBar_Recording</value> | |
184 | + </data> | |
185 | + <data name=">>progressBar_Recording.Type" xml:space="preserve"> | |
186 | + <value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
187 | + </data> | |
188 | + <data name=">>progressBar_Recording.Parent" xml:space="preserve"> | |
189 | + <value>$this</value> | |
190 | + </data> | |
191 | + <data name=">>progressBar_Recording.ZOrder" xml:space="preserve"> | |
192 | + <value>11</value> | |
193 | + </data> | |
194 | + <data name="label_boot.AutoSize" type="System.Boolean, mscorlib"> | |
195 | + <value>True</value> | |
196 | + </data> | |
197 | + <data name="label_boot.Location" type="System.Drawing.Point, System.Drawing"> | |
198 | + <value>108, 57</value> | |
199 | + </data> | |
200 | + <data name="label_boot.Size" type="System.Drawing.Size, System.Drawing"> | |
201 | + <value>91, 12</value> | |
202 | + </data> | |
203 | + <data name="label_boot.TabIndex" type="System.Int32, mscorlib"> | |
204 | + <value>3</value> | |
205 | + </data> | |
206 | + <data name="label_boot.Text" xml:space="preserve"> | |
207 | + <value>DTXManiaの起動</value> | |
208 | + </data> | |
209 | + <data name=">>label_boot.Name" xml:space="preserve"> | |
210 | + <value>label_boot</value> | |
211 | + </data> | |
212 | + <data name=">>label_boot.Type" xml:space="preserve"> | |
213 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
214 | + </data> | |
215 | + <data name=">>label_boot.Parent" xml:space="preserve"> | |
216 | + <value>$this</value> | |
217 | + </data> | |
218 | + <data name=">>label_boot.ZOrder" xml:space="preserve"> | |
219 | + <value>10</value> | |
220 | + </data> | |
221 | + <data name="label_loading.AutoSize" type="System.Boolean, mscorlib"> | |
222 | + <value>True</value> | |
223 | + </data> | |
224 | + <data name="label_loading.Location" type="System.Drawing.Point, System.Drawing"> | |
225 | + <value>108, 82</value> | |
226 | + </data> | |
227 | + <data name="label_loading.Size" type="System.Drawing.Size, System.Drawing"> | |
228 | + <value>101, 12</value> | |
229 | + </data> | |
230 | + <data name="label_loading.TabIndex" type="System.Int32, mscorlib"> | |
231 | + <value>4</value> | |
232 | + </data> | |
233 | + <data name="label_loading.Text" xml:space="preserve"> | |
234 | + <value>曲データの読み込み</value> | |
235 | + </data> | |
236 | + <data name=">>label_loading.Name" xml:space="preserve"> | |
237 | + <value>label_loading</value> | |
238 | + </data> | |
239 | + <data name=">>label_loading.Type" xml:space="preserve"> | |
240 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
241 | + </data> | |
242 | + <data name=">>label_loading.Parent" xml:space="preserve"> | |
243 | + <value>$this</value> | |
244 | + </data> | |
245 | + <data name=">>label_loading.ZOrder" xml:space="preserve"> | |
246 | + <value>9</value> | |
247 | + </data> | |
248 | + <data name="label_playing.AutoSize" type="System.Boolean, mscorlib"> | |
249 | + <value>True</value> | |
250 | + </data> | |
251 | + <data name="label_playing.Location" type="System.Drawing.Point, System.Drawing"> | |
252 | + <value>108, 108</value> | |
253 | + </data> | |
254 | + <data name="label_playing.Size" type="System.Drawing.Size, System.Drawing"> | |
255 | + <value>29, 12</value> | |
256 | + </data> | |
257 | + <data name="label_playing.TabIndex" type="System.Int32, mscorlib"> | |
258 | + <value>5</value> | |
259 | + </data> | |
260 | + <data name="label_playing.Text" xml:space="preserve"> | |
261 | + <value>演奏</value> | |
262 | + </data> | |
263 | + <data name=">>label_playing.Name" xml:space="preserve"> | |
264 | + <value>label_playing</value> | |
265 | + </data> | |
266 | + <data name=">>label_playing.Type" xml:space="preserve"> | |
267 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
268 | + </data> | |
269 | + <data name=">>label_playing.Parent" xml:space="preserve"> | |
270 | + <value>$this</value> | |
271 | + </data> | |
272 | + <data name=">>label_playing.ZOrder" xml:space="preserve"> | |
273 | + <value>8</value> | |
274 | + </data> | |
275 | + <data name="label_exit.AutoSize" type="System.Boolean, mscorlib"> | |
276 | + <value>True</value> | |
277 | + </data> | |
278 | + <data name="label_exit.Location" type="System.Drawing.Point, System.Drawing"> | |
279 | + <value>108, 134</value> | |
280 | + </data> | |
281 | + <data name="label_exit.Size" type="System.Drawing.Size, System.Drawing"> | |
282 | + <value>29, 12</value> | |
283 | + </data> | |
284 | + <data name="label_exit.TabIndex" type="System.Int32, mscorlib"> | |
285 | + <value>6</value> | |
286 | + </data> | |
287 | + <data name="label_exit.Text" xml:space="preserve"> | |
288 | + <value>終了</value> | |
289 | + </data> | |
290 | + <data name=">>label_exit.Name" xml:space="preserve"> | |
291 | + <value>label_exit</value> | |
292 | + </data> | |
293 | + <data name=">>label_exit.Type" xml:space="preserve"> | |
294 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
295 | + </data> | |
296 | + <data name=">>label_exit.Parent" xml:space="preserve"> | |
297 | + <value>$this</value> | |
298 | + </data> | |
299 | + <data name=">>label_exit.ZOrder" xml:space="preserve"> | |
300 | + <value>7</value> | |
301 | + </data> | |
302 | + <data name="label_state.AutoSize" type="System.Boolean, mscorlib"> | |
303 | + <value>True</value> | |
304 | + </data> | |
305 | + <data name="label_state.Location" type="System.Drawing.Point, System.Drawing"> | |
306 | + <value>220, 240</value> | |
307 | + </data> | |
308 | + <data name="label_state.Size" type="System.Drawing.Size, System.Drawing"> | |
309 | + <value>23, 12</value> | |
310 | + </data> | |
311 | + <data name="label_state.TabIndex" type="System.Int32, mscorlib"> | |
312 | + <value>7</value> | |
313 | + </data> | |
314 | + <data name="label_state.Text" xml:space="preserve"> | |
315 | + <value>***</value> | |
316 | + </data> | |
317 | + <data name="label_state.Visible" type="System.Boolean, mscorlib"> | |
318 | + <value>False</value> | |
319 | + </data> | |
320 | + <data name=">>label_state.Name" xml:space="preserve"> | |
321 | + <value>label_state</value> | |
322 | + </data> | |
323 | + <data name=">>label_state.Type" xml:space="preserve"> | |
324 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
325 | + </data> | |
326 | + <data name=">>label_state.Parent" xml:space="preserve"> | |
327 | + <value>$this</value> | |
328 | + </data> | |
329 | + <data name=">>label_state.ZOrder" xml:space="preserve"> | |
330 | + <value>6</value> | |
331 | + </data> | |
332 | + <data name="label_boot_check.AutoSize" type="System.Boolean, mscorlib"> | |
333 | + <value>True</value> | |
334 | + </data> | |
335 | + <data name="label_boot_check.Location" type="System.Drawing.Point, System.Drawing"> | |
336 | + <value>88, 57</value> | |
337 | + </data> | |
338 | + <data name="label_boot_check.Size" type="System.Drawing.Size, System.Drawing"> | |
339 | + <value>0, 12</value> | |
340 | + </data> | |
341 | + <data name="label_boot_check.TabIndex" type="System.Int32, mscorlib"> | |
342 | + <value>8</value> | |
343 | + </data> | |
344 | + <data name=">>label_boot_check.Name" xml:space="preserve"> | |
345 | + <value>label_boot_check</value> | |
346 | + </data> | |
347 | + <data name=">>label_boot_check.Type" xml:space="preserve"> | |
348 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
349 | + </data> | |
350 | + <data name=">>label_boot_check.Parent" xml:space="preserve"> | |
351 | + <value>$this</value> | |
352 | + </data> | |
353 | + <data name=">>label_boot_check.ZOrder" xml:space="preserve"> | |
354 | + <value>5</value> | |
355 | + </data> | |
356 | + <data name="label_loading_check.AutoSize" type="System.Boolean, mscorlib"> | |
357 | + <value>True</value> | |
358 | + </data> | |
359 | + <data name="label_loading_check.Location" type="System.Drawing.Point, System.Drawing"> | |
360 | + <value>88, 82</value> | |
361 | + </data> | |
362 | + <data name="label_loading_check.Size" type="System.Drawing.Size, System.Drawing"> | |
363 | + <value>0, 12</value> | |
364 | + </data> | |
365 | + <data name="label_loading_check.TabIndex" type="System.Int32, mscorlib"> | |
366 | + <value>9</value> | |
367 | + </data> | |
368 | + <data name=">>label_loading_check.Name" xml:space="preserve"> | |
369 | + <value>label_loading_check</value> | |
370 | + </data> | |
371 | + <data name=">>label_loading_check.Type" xml:space="preserve"> | |
372 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
373 | + </data> | |
374 | + <data name=">>label_loading_check.Parent" xml:space="preserve"> | |
375 | + <value>$this</value> | |
376 | + </data> | |
377 | + <data name=">>label_loading_check.ZOrder" xml:space="preserve"> | |
378 | + <value>4</value> | |
379 | + </data> | |
380 | + <data name="label_playing_check.AutoSize" type="System.Boolean, mscorlib"> | |
381 | + <value>True</value> | |
382 | + </data> | |
383 | + <data name="label_playing_check.Location" type="System.Drawing.Point, System.Drawing"> | |
384 | + <value>88, 108</value> | |
385 | + </data> | |
386 | + <data name="label_playing_check.Size" type="System.Drawing.Size, System.Drawing"> | |
387 | + <value>0, 12</value> | |
388 | + </data> | |
389 | + <data name="label_playing_check.TabIndex" type="System.Int32, mscorlib"> | |
390 | + <value>10</value> | |
391 | + </data> | |
392 | + <data name=">>label_playing_check.Name" xml:space="preserve"> | |
393 | + <value>label_playing_check</value> | |
394 | + </data> | |
395 | + <data name=">>label_playing_check.Type" xml:space="preserve"> | |
396 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
397 | + </data> | |
398 | + <data name=">>label_playing_check.Parent" xml:space="preserve"> | |
399 | + <value>$this</value> | |
400 | + </data> | |
401 | + <data name=">>label_playing_check.ZOrder" xml:space="preserve"> | |
402 | + <value>3</value> | |
403 | + </data> | |
404 | + <data name="label_exit_check.AutoSize" type="System.Boolean, mscorlib"> | |
405 | + <value>True</value> | |
406 | + </data> | |
407 | + <data name="label_exit_check.Location" type="System.Drawing.Point, System.Drawing"> | |
408 | + <value>88, 134</value> | |
409 | + </data> | |
410 | + <data name="label_exit_check.Size" type="System.Drawing.Size, System.Drawing"> | |
411 | + <value>0, 12</value> | |
412 | + </data> | |
413 | + <data name="label_exit_check.TabIndex" type="System.Int32, mscorlib"> | |
414 | + <value>11</value> | |
415 | + </data> | |
416 | + <data name=">>label_exit_check.Name" xml:space="preserve"> | |
417 | + <value>label_exit_check</value> | |
418 | + </data> | |
419 | + <data name=">>label_exit_check.Type" xml:space="preserve"> | |
420 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
421 | + </data> | |
422 | + <data name=">>label_exit_check.Parent" xml:space="preserve"> | |
423 | + <value>$this</value> | |
424 | + </data> | |
425 | + <data name=">>label_exit_check.ZOrder" xml:space="preserve"> | |
426 | + <value>2</value> | |
427 | + </data> | |
428 | + <data name="label_estimateTime.Location" type="System.Drawing.Point, System.Drawing"> | |
429 | + <value>164, 186</value> | |
430 | + </data> | |
431 | + <data name="label_estimateTime.Size" type="System.Drawing.Size, System.Drawing"> | |
432 | + <value>79, 12</value> | |
433 | + </data> | |
434 | + <data name="label_estimateTime.TabIndex" type="System.Int32, mscorlib"> | |
435 | + <value>12</value> | |
436 | + </data> | |
437 | + <data name="label_estimateTime.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing"> | |
438 | + <value>TopRight</value> | |
439 | + </data> | |
440 | + <data name=">>label_estimateTime.Name" xml:space="preserve"> | |
441 | + <value>label_estimateTime</value> | |
442 | + </data> | |
443 | + <data name=">>label_estimateTime.Type" xml:space="preserve"> | |
444 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
445 | + </data> | |
446 | + <data name=">>label_estimateTime.Parent" xml:space="preserve"> | |
447 | + <value>$this</value> | |
448 | + </data> | |
449 | + <data name=">>label_estimateTime.ZOrder" xml:space="preserve"> | |
450 | + <value>1</value> | |
451 | + </data> | |
452 | + <data name="label_currentTime.AutoSize" type="System.Boolean, mscorlib"> | |
453 | + <value>True</value> | |
454 | + </data> | |
455 | + <data name="label_currentTime.Location" type="System.Drawing.Point, System.Drawing"> | |
456 | + <value>139, 166</value> | |
457 | + </data> | |
458 | + <data name="label_currentTime.Size" type="System.Drawing.Size, System.Drawing"> | |
459 | + <value>0, 12</value> | |
460 | + </data> | |
461 | + <data name="label_currentTime.TabIndex" type="System.Int32, mscorlib"> | |
462 | + <value>13</value> | |
463 | + </data> | |
464 | + <data name="label_currentTime.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing"> | |
465 | + <value>TopCenter</value> | |
466 | + </data> | |
467 | + <data name=">>label_currentTime.Name" xml:space="preserve"> | |
468 | + <value>label_currentTime</value> | |
469 | + </data> | |
470 | + <data name=">>label_currentTime.Type" xml:space="preserve"> | |
471 | + <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
472 | + </data> | |
473 | + <data name=">>label_currentTime.Parent" xml:space="preserve"> | |
474 | + <value>$this</value> | |
475 | + </data> | |
476 | + <data name=">>label_currentTime.ZOrder" xml:space="preserve"> | |
477 | + <value>0</value> | |
478 | + </data> | |
479 | + <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |
480 | + <value>True</value> | |
481 | + </metadata> | |
482 | + <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> | |
483 | + <value>6, 12</value> | |
484 | + </data> | |
485 | + <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> | |
486 | + <value>284, 261</value> | |
487 | + </data> | |
488 | + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
489 | + <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms"> | |
490 | + <value>CenterParent</value> | |
491 | + </data> | |
492 | + <data name="$this.Text" xml:space="preserve"> | |
493 | + <value>DTX2WAV [Recording...]</value> | |
494 | + </data> | |
495 | + <data name=">>$this.Name" xml:space="preserve"> | |
496 | + <value>Form_Recording</value> | |
497 | + </data> | |
498 | + <data name=">>$this.Type" xml:space="preserve"> | |
499 | + <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
500 | + </data> | |
501 | +</root> | |
\ No newline at end of file |
@@ -104,6 +104,8 @@ namespace DTXMania | ||
104 | 104 | |
105 | 105 | STDGBSValue<CScoreIni.C演奏記録> record; |
106 | 106 | |
107 | + long nLastSendMessageTime; | |
108 | + | |
107 | 109 | #if TEST_MEASUREFRAMEDRAWTIME |
108 | 110 | Stopwatch sw = new Stopwatch(); |
109 | 111 | List<long> swlist = new List<long>(100000); |
@@ -510,6 +512,8 @@ namespace DTXMania | ||
510 | 512 | } |
511 | 513 | this.actPanel.SetPanelString( strPanel ); |
512 | 514 | |
515 | + nLastSendMessageTime = 0; | |
516 | + | |
513 | 517 | #if TEST_MEASUREFRAMEDRAWTIME |
514 | 518 | swlist.Clear(); |
515 | 519 | swlist.Capacity = 100000; |
@@ -834,6 +838,17 @@ namespace DTXMania | ||
834 | 838 | return (int)this.eフェードアウト完了時の戻り値; |
835 | 839 | } |
836 | 840 | |
841 | + // DTX2WAVに進捗状況を送信。1秒ごとに1回ずつ送信する。 | |
842 | + if (CDTXMania.Instance.DTX2WAVmode.Enabled) | |
843 | + { | |
844 | + if (nLastSendMessageTime + 1000 < CDTXMania.Instance.Timer.n現在時刻) | |
845 | + { | |
846 | + int nEstimateTimeMs = (CDTXMania.Instance.DTX.listChip.Count > 0) ? CDTXMania.Instance.DTX.listChip[CDTXMania.Instance.DTX.listChip.Count - 1].n発声時刻ms : 0; | |
847 | + CDTXMania.Instance.DTX2WAVmode.SendMessage2DTX2WAV("TIME," + CDTXMania.Instance.Timer.n現在時刻.ToString() + "," + nEstimateTimeMs.ToString()); | |
848 | + nLastSendMessageTime = CDTXMania.Instance.Timer.n現在時刻; | |
849 | + } | |
850 | + } | |
851 | + | |
837 | 852 | ManageMixerQueue(); |
838 | 853 | |
839 | 854 | // キー入力 |
@@ -13,7 +13,21 @@ namespace DTXMania | ||
13 | 13 | { |
14 | 14 | public class CDTX2WAVmode |
15 | 15 | { |
16 | - public enum FormatType | |
16 | + public enum ECommand | |
17 | + { | |
18 | + Record, | |
19 | + Cancel, | |
20 | + Other | |
21 | + } | |
22 | + /// <summary> | |
23 | + /// DTXWAVからのコマンド | |
24 | + /// </summary> | |
25 | + public ECommand Command | |
26 | + { | |
27 | + get; | |
28 | + set; | |
29 | + } | |
30 | + public enum FormatType | |
17 | 31 | { |
18 | 32 | WAV, |
19 | 33 | OGG, |
@@ -57,6 +71,7 @@ namespace DTXMania | ||
57 | 71 | public CDTX2WAVmode() |
58 | 72 | { |
59 | 73 | this.Enabled = false; |
74 | + this.Command = ECommand.Other; | |
60 | 75 | this.Format = FormatType.WAV; |
61 | 76 | this.VSyncWait = false; // とりあえず VSyncWait=OFF固定で考える |
62 | 77 | this.outfilename = ""; |
@@ -86,5 +101,55 @@ namespace DTXMania | ||
86 | 101 | |
87 | 102 | ConfigIni_backup = null; |
88 | 103 | } |
104 | + | |
105 | + | |
106 | + private System.IntPtr hTargetMainWindowHandle = IntPtr.Zero; | |
107 | + private System.IntPtr hCurrentMainWindowHandle; | |
108 | + | |
109 | + /// <summary> | |
110 | + /// DTX2WAVにメッセージを送信する | |
111 | + /// </summary> | |
112 | + /// <param name="strSend">送信するテキスト</param> | |
113 | + public void SendMessage2DTX2WAV(string strSend) | |
114 | + { | |
115 | + for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする | |
116 | + { | |
117 | + hCurrentMainWindowHandle = Process.GetCurrentProcess().MainWindowHandle; | |
118 | + | |
119 | + if (hTargetMainWindowHandle == IntPtr.Zero) | |
120 | + { | |
121 | +//Trace.TraceInformation("ハンドル創作"); | |
122 | + #region [ 既に起動中のDTX2WAV(の録音中ダイアログ)プロセスを検索する。] | |
123 | + | |
124 | + Process[] running = Process.GetProcesses(); | |
125 | + foreach (Process p in running) | |
126 | + { | |
127 | +//Trace.TraceInformation("WindowTitle: " + p.MainWindowTitle); | |
128 | + if (p.MainWindowHandle != IntPtr.Zero && p.MainWindowTitle.Contains("DTX2WAV Rel")) | |
129 | + { | |
130 | +//Trace.TraceInformation("WindowTitle: " + p.MainWindowTitle); | |
131 | + hTargetMainWindowHandle = p.MainWindowHandle; | |
132 | + break; | |
133 | + } | |
134 | + } | |
135 | + #endregion | |
136 | + | |
137 | + } | |
138 | + | |
139 | + #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ] | |
140 | + if (hTargetMainWindowHandle != null && strSend != null) | |
141 | + { | |
142 | + CSendMessage.sendmessage(hTargetMainWindowHandle, hCurrentMainWindowHandle, strSend); | |
143 | +//Trace.TraceInformation("SendToDTX2WAV: " + strSend + ", " + hTargetMainWindowHandle + ", " + hCurrentMainWindowHandle); | |
144 | + return; | |
145 | + } | |
146 | + #endregion | |
147 | + else | |
148 | + { | |
149 | + Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。"); | |
150 | + Thread.Sleep(200); | |
151 | + } | |
152 | + } | |
153 | + } | |
89 | 154 | } |
90 | 155 | } |
@@ -147,6 +147,7 @@ namespace DTXMania | ||
147 | 147 | public CStage終了 stage終了 { get; private set; } |
148 | 148 | public CStage r現在のステージ = null; |
149 | 149 | public CStage r直前のステージ = null; |
150 | + public CStage r1フレーム前のステージ = null; | |
150 | 151 | public string strEXEのあるフォルダ { get; private set; } |
151 | 152 | public string strコンパクトモードファイル { get; private set; } |
152 | 153 | public CTimer Timer { get; private set; } |
@@ -501,6 +502,7 @@ namespace DTXMania | ||
501 | 502 | else if (DTX2WAVmode.Enabled) |
502 | 503 | { |
503 | 504 | Trace.TraceInformation("DTX2WAVモードで起動します。[{0}]", strコンパクトモードファイル); |
505 | + DTX2WAVmode.SendMessage2DTX2WAV("BOOT"); | |
504 | 506 | } |
505 | 507 | else |
506 | 508 | { |
@@ -1194,12 +1196,11 @@ namespace DTXMania | ||
1194 | 1196 | } |
1195 | 1197 | #endregion |
1196 | 1198 | |
1197 | - #region [ DTXCreatorからの指示 ] | |
1199 | + #region [ DTXCreator/DTX2WAVからの指示 ] | |
1198 | 1200 | if (this.Window.IsReceivedMessage) // ウインドウメッセージで、 |
1199 | 1201 | { |
1200 | 1202 | string strMes = this.Window.strMessage; |
1201 | 1203 | this.Window.IsReceivedMessage = false; |
1202 | - | |
1203 | 1204 | if (strMes != null) |
1204 | 1205 | { |
1205 | 1206 | CommandParse.ParseArguments(strMes, ref DTXVmode, ref DTX2WAVmode); |
@@ -1238,6 +1239,23 @@ namespace DTXMania | ||
1238 | 1239 | } |
1239 | 1240 | } |
1240 | 1241 | } |
1242 | + if (DTX2WAVmode.Enabled) | |
1243 | + { | |
1244 | + if (DTX2WAVmode.Command == CDTX2WAVmode.ECommand.Cancel) | |
1245 | + { | |
1246 | + Trace.TraceInformation("録音のCancelコマンドをDTXMania本来が受信しました。"); | |
1247 | + // 録音を終了するために、[ESC]が押されたようにふるまう | |
1248 | + //Microsoft.VisualBasic.Interaction.AppActivate("メモ帳"); | |
1249 | + | |
1250 | + //SendKeys.Send("{ESC}"); | |
1251 | + //SendKeys.SendWait("%{F4}"); | |
1252 | + //Application.Exit(); | |
1253 | + DTX.t全チップの再生停止(); | |
1254 | + DTX.On非活性化(); | |
1255 | + r現在のステージ.On非活性化(); | |
1256 | + base.Window.Close(); | |
1257 | + } | |
1258 | + } | |
1241 | 1259 | } |
1242 | 1260 | } |
1243 | 1261 | #endregion |
@@ -1265,6 +1283,24 @@ namespace DTXMania | ||
1265 | 1283 | //--------------------- |
1266 | 1284 | #endregion |
1267 | 1285 | |
1286 | + #region [ DTX2WAVモード時、ステージが変わるたびに、そのことをDTX2WAVアプリ側に通知する ] | |
1287 | + if (DTX2WAVmode.Enabled && r現在のステージ != r1フレーム前のステージ) | |
1288 | + { | |
1289 | + r1フレーム前のステージ = r現在のステージ; | |
1290 | + //Trace.TraceInformation("Stage変更 to : " + r現在のステージ.eステージID.ToString()); | |
1291 | + switch (r現在のステージ.eステージID) | |
1292 | + { | |
1293 | + case CStage.Eステージ.曲読み込み: | |
1294 | + DTX2WAVmode.SendMessage2DTX2WAV("LOAD"); | |
1295 | + break; | |
1296 | + case CStage.Eステージ.演奏: | |
1297 | + DTX2WAVmode.SendMessage2DTX2WAV("PLAY"); | |
1298 | + break; | |
1299 | + default: | |
1300 | + break; | |
1301 | + } | |
1302 | + } | |
1303 | + #endregion | |
1268 | 1304 | |
1269 | 1305 | CScoreIni scoreIni = null; |
1270 | 1306 |
@@ -2670,6 +2706,7 @@ namespace DTXMania | ||
2670 | 2706 | { |
2671 | 2707 | DTX2WAVmode.tUpdateConfigIni(); |
2672 | 2708 | Trace.TraceInformation("DTX2WAVモードの設定情報を、Config.xmlに保存しました。"); |
2709 | + DTX2WAVmode.SendMessage2DTX2WAV("TERM"); | |
2673 | 2710 | } |
2674 | 2711 | else |
2675 | 2712 | { |
@@ -268,9 +268,19 @@ namespace DTXMania | ||
268 | 268 | Trace.TraceInformation("cdtx2wav.outfilename=" + cdtx2wav.outfilename); |
269 | 269 | Trace.TraceInformation("cdtx2wav.dtxfilename=" + cdtx2wav.dtxfilename); |
270 | 270 | |
271 | + cdtx2wav.Command = CDTX2WAVmode.ECommand.Record; | |
272 | + | |
271 | 273 | analyzing = false; |
272 | 274 | } |
273 | 275 | #endregion |
276 | + // -S | |
277 | + else if (arg.StartsWith("-C", StringComparison.OrdinalIgnoreCase)) // DTXV再生停止 | |
278 | + { | |
279 | + cdtx2wav.Enabled = true; | |
280 | + cdtx2wav.Command = CDTX2WAVmode.ECommand.Cancel; | |
281 | + ret = ECommandType.DTX2WAV; | |
282 | + arg = arg.Substring(2); | |
283 | + } | |
274 | 284 | else |
275 | 285 | { |
276 | 286 | analyzing = false; |