OSDN Git Service

#39180 ベースのRとBが重なって表示される問題を修正。
[dtxmania/dtxmania.git] / DTX2WAV / Form_Recording.cs
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                         //#region [ 進捗表示ラベルの背景色を透明にする ]
37                         //label_currentTime.BackColor = Color.Transparent;
38                         //label_currentTime.Parent = progressBar_Recording;
39                         //label_currentTime.ForeColor = Color.Black;
40                         //#endregion
41                 }
42
43
44                 /// <summary>
45                 /// DTXMania本体からDTX2WAVのメインForm経由でメッセージを受信する
46                 /// (メインFormのWndProcでメッセージを受信し、Form_Recordingのlabel_state経由でForm_Recordingが受け取る)
47                 /// そして、進捗表示をする
48                 /// </summary>
49                 /// <param name="sender"></param>
50                 /// <param name="e"></param>
51                 private void label_state_TextChanged(object sender, EventArgs e)
52                 {
53                         switch (label_state.Text.Substring(0,4).ToUpper())
54                         {
55                                 case "BOOT":
56                                         label_boot_check.Text = ">>";
57                                         label_loading_check.Text = "";
58                                         label_playing_check.Text = "";
59                                         label_exit_check.Text = "";
60                                         break;
61                                 case "LOAD":
62                                         label_boot_check.Text = "✔";
63                                         label_loading_check.Text = ">>";
64                                         label_playing_check.Text = "";
65                                         label_exit_check.Text = "";
66                                         break;
67                                 case "PLAY":
68                                         label_boot_check.Text = "✔";
69                                         label_loading_check.Text = "✔";
70                                         label_playing_check.Text = ">>";
71                                         label_exit_check.Text = "";
72                                         break;
73                                 case "TERM":
74                                         label_boot_check.Text = "✔";
75                                         label_loading_check.Text = "✔";
76                                         label_playing_check.Text = "✔";
77                                         label_exit_check.Text = ">>";
78                                         break;
79                                 case "TIME":
80                                         string[] s = label_state.Text.Split(new char[] { ',' });
81                                         int nEstimateTimeMs = Convert.ToInt32(s[2]);
82                                         int nCurrentTimeMs = Convert.ToInt32(s[1]);
83
84                                         if (nCurrentTimeMs > nEstimateTimeMs)
85                                         {
86                                                 nCurrentTimeMs = nEstimateTimeMs;
87                                         }
88                                         progressBar_Recording.Value = (int)(((double)nCurrentTimeMs / (double)nEstimateTimeMs) * 10000);
89
90                                         string strEstimateTime = (((double)nEstimateTimeMs) / 1000.0).ToString("####0.00");
91                                         string strCurrentTime = (((double)nCurrentTimeMs) / 1000.0).ToString("####0.00");
92
93                                         label_currentTime.Text = strCurrentTime;
94                                         label_estimateTime.Text = strEstimateTime;
95
96                                         break;
97
98                                 default:
99                                         break;
100                         }
101                 }
102         }
103 }
104