OSDN Git Service

DTXManiaソリューション、DTXManiaプロジェクト、DTXCreatorプロジェクト、FDKプロジェクトについて英語化。
[dtxmania/dtxmania.git] / DTXCreator / コード / 02.WAV_BMP_AVI / Cサウンドプロパティダイアログ.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows.Forms;
5 using System.ComponentModel;
6 using System.Drawing;
7 using DTXCreator.汎用;
8 using DTXCreator.Properties;
9 using FDK;
10
11 namespace DTXCreator.WAV_BMP_AVI
12 {
13         internal partial class Cサウンドプロパティダイアログ : Form
14         {
15                 internal CWAV wav;
16
17                 public Cサウンドプロパティダイアログ( string str相対パスの基点フォルダ, string str初期フォルダ, CWAVリスト管理.DGサウンドを再生する dgサウンドを再生する )
18                 {
19                         this.str相対パスの基点フォルダ = str相対パスの基点フォルダ;
20                         this.str初期フォルダ = str初期フォルダ;
21                         this.dgサウンドを再生する = dgサウンドを再生する;
22
23                         this.InitializeComponent();
24                 }
25                 public void t位置testBoxの値を範囲修正したのちtextBox位置とhScrollBar位置へ反映させる()
26                 {
27                         int num;
28                         if( this.textBox位置.Text.Length == 0 )
29                         {
30                                 num = 0;
31                         }
32                         else if( !int.TryParse( this.textBox位置.Text, out num ) )
33                         {
34                                 num = 0;
35                         }
36                         else
37                         {
38                                 num = C変換.n値を範囲内に丸めて返す( num, -100, 100 );
39                         }
40                         this.textBox位置.Text = num.ToString();
41                         this.hScrollBar位置.Value = num + 100;
42                 }
43                 public void t音量textBoxの値を範囲修正したのちtextBox音量とhScrollBar音量へ反映させる()
44                 {
45                         int num;
46                         if( this.textBox音量.Text.Length == 0 )
47                         {
48                                 num = 0;
49                         }
50                         else if( !int.TryParse( this.textBox音量.Text, out num ) )
51                         {
52                                 num = 0;
53                         }
54                         else
55                         {
56                                 num = C変換.n値を範囲内に丸めて返す( num, 0, 100 );
57                         }
58                         this.textBox音量.Text = num.ToString();
59                         this.hScrollBar音量.Value = num;
60                 }
61
62                 private CWAVリスト管理.DGサウンドを再生する dgサウンドを再生する;
63                 private string str初期フォルダ = "";
64                 private string str相対パスの基点フォルダ = "";
65                 private static int[] カスタムカラー;
66
67                 private void textBoxラベル_KeyDown( object sender, KeyEventArgs e )
68                 {
69                         if( e.KeyCode == Keys.Return )
70                         {
71                                 this.buttonOK.PerformClick();
72                         }
73                         if( e.KeyCode == Keys.Escape )
74                         {
75                                 this.buttonキャンセル.PerformClick();
76                         }
77                 }
78                 private void textBoxファイル_KeyDown( object sender, KeyEventArgs e )
79                 {
80                         if( e.KeyCode == Keys.Return )
81                         {
82                                 this.buttonOK.PerformClick();
83                         }
84                         if( e.KeyCode == Keys.Escape )
85                         {
86                                 this.buttonキャンセル.PerformClick();
87                         }
88                 }
89                 private void button参照_Click( object sender, EventArgs e )
90                 {
91                         var dialog = new OpenFileDialog() {
92                                 Title = Resources.strサウンドファイル選択ダイアログのタイトル,
93                                 Filter = Resources.strサウンドファイル選択ダイアログのフィルタ,
94                                 FilterIndex = 1,
95                                 InitialDirectory = this.str初期フォルダ,
96                         };
97                         if( dialog.ShowDialog() == DialogResult.OK )
98                         {
99                                 string str = Cファイル選択_パス変換.str基点からの相対パスに変換して返す( dialog.FileName, this.str相対パスの基点フォルダ );
100                                 str.Replace( '/', '\\' );
101                                 this.textBoxファイル.Text = str;
102                         }
103                 }
104                 private void button参照_KeyDown( object sender, KeyEventArgs e )
105                 {
106                         if( e.KeyCode == Keys.Escape )
107                         {
108                                 this.buttonキャンセル.PerformClick();
109                         }
110                 }
111                 private void hScrollBar音量_ValueChanged( object sender, EventArgs e )
112                 {
113                         this.textBox音量.Text = C変換.n値を範囲内に丸めて返す( this.hScrollBar音量.Value, 0, 100 ).ToString();
114                 }
115                 private void textBox音量_KeyDown( object sender, KeyEventArgs e )
116                 {
117                         if( e.KeyCode == Keys.Return )
118                         {
119                                 this.t音量textBoxの値を範囲修正したのちtextBox音量とhScrollBar音量へ反映させる();
120                                 this.buttonOK.PerformClick();
121                         }
122                         if( e.KeyCode == Keys.Escape )
123                         {
124                                 this.buttonキャンセル.PerformClick();
125                         }
126                 }
127                 private void textBox音量_Leave( object sender, EventArgs e )
128                 {
129                         this.t音量textBoxの値を範囲修正したのちtextBox音量とhScrollBar音量へ反映させる();
130                 }
131                 private void textBox位置_KeyDown( object sender, KeyEventArgs e )
132                 {
133                         if( e.KeyCode == Keys.Return )
134                         {
135                                 this.t位置testBoxの値を範囲修正したのちtextBox位置とhScrollBar位置へ反映させる();
136                                 this.buttonOK.PerformClick();
137                         }
138                         if( e.KeyCode == Keys.Escape )
139                         {
140                                 this.buttonキャンセル.PerformClick();
141                         }
142                 }
143                 private void textBox位置_Leave( object sender, EventArgs e )
144                 {
145                         this.t位置testBoxの値を範囲修正したのちtextBox位置とhScrollBar位置へ反映させる();
146                 }
147                 private void hScrollBar位置_ValueChanged( object sender, EventArgs e )
148                 {
149                         this.textBox位置.Text = ( C変換.n値を範囲内に丸めて返す( this.hScrollBar位置.Value, 0, 200 ) - 100 ).ToString();
150                 }
151                 private void button背景色_Click( object sender, EventArgs e )
152                 {
153                         var dialog = new ColorDialog() {
154                                 AllowFullOpen = true,
155                                 FullOpen = true,
156                                 Color = this.textBoxWAV番号.BackColor,
157                                 CustomColors = カスタムカラー,
158                         };
159                         if( dialog.ShowDialog() == DialogResult.OK )
160                         {
161                                 this.textBoxWAV番号.BackColor = dialog.Color;
162                                 カスタムカラー = dialog.CustomColors;
163                         }
164                 }
165                 private void button背景色_KeyDown( object sender, KeyEventArgs e )
166                 {
167                         if( e.KeyCode == Keys.Escape )
168                         {
169                                 this.buttonキャンセル.PerformClick();
170                         }
171                 }
172                 private void button文字色_Click( object sender, EventArgs e )
173                 {
174                         var dialog = new ColorDialog() {
175                                 AllowFullOpen = true,
176                                 FullOpen = true,
177                                 Color = this.textBoxWAV番号.ForeColor,
178                                 CustomColors = カスタムカラー,
179                         };
180                         if( dialog.ShowDialog() == DialogResult.OK )
181                         {
182                                 this.textBoxWAV番号.ForeColor = dialog.Color;
183                                 カスタムカラー = dialog.CustomColors;
184                         }
185                 }
186                 private void button文字色_KeyDown( object sender, KeyEventArgs e )
187                 {
188                         if( e.KeyCode == Keys.Escape )
189                         {
190                                 this.buttonキャンセル.PerformClick();
191                         }
192                 }
193                 private void button標準色に戻す_Click( object sender, EventArgs e )
194                 {
195                         this.textBoxWAV番号.ForeColor = SystemColors.WindowText;
196                         this.textBoxWAV番号.BackColor = SystemColors.Window;
197                 }
198                 private void button標準色に戻す_KeyDown( object sender, KeyEventArgs e )
199                 {
200                         if( e.KeyCode == Keys.Escape )
201                         {
202                                 this.buttonキャンセル.PerformClick();
203                         }
204                 }
205                 private void button試聴_Click( object sender, EventArgs e )
206                 {
207                         int num = C変換.n36進数2桁の文字列を数値に変換して返す( this.textBoxWAV番号.Text );
208                         this.dgサウンドを再生する( num );
209                 }
210                 private void button試聴_KeyDown( object sender, KeyEventArgs e )
211                 {
212                         if( e.KeyCode == Keys.Escape )
213                         {
214                                 this.buttonキャンセル.PerformClick();
215                         }
216                 }
217         }
218 }