OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / DTXCreatorプロジェクト / コード / 02.WAV_BMP_AVI / CWAV.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Drawing;\r
5 using System.Windows.Forms;\r
6 using FDK;\r
7 \r
8 namespace DTXCreator.WAV_BMP_AVI\r
9 {\r
10         internal class CWAV\r
11         {\r
12                 public bool bBGMとして使用;\r
13                 public Color col背景色 = SystemColors.Window;\r
14                 public Color col文字色 = SystemColors.WindowText;\r
15                 public int nWAV番号1to1295 = 1;\r
16                 public int n位置_100to100;\r
17                 public int n音量0to100 = 100;\r
18                 public string strファイル名 = "";\r
19                 public string strラベル名 = "";\r
20 \r
21                 public bool b内容が同じ・WAV番号を除くwith( CWAV wc )\r
22                 {\r
23                         return ( ( ( this.strラベル名.Equals( wc.strラベル名 ) && this.strファイル名.Equals( wc.strファイル名 ) ) && ( ( this.n音量0to100 == wc.n音量0to100 ) && ( this.n位置_100to100 == wc.n位置_100to100 ) ) ) && ( ( ( this.bBGMとして使用 == wc.bBGMとして使用 ) && ( this.col文字色 == wc.col文字色 ) ) && ( this.col背景色 == wc.col背景色 ) ) );\r
24                 }\r
25                 public bool b内容が同じwith( CWAV wc )\r
26                 {\r
27                         return ( ( ( this.strラベル名.Equals( wc.strラベル名 ) && ( this.nWAV番号1to1295 == wc.nWAV番号1to1295 ) ) && ( this.strファイル名.Equals( wc.strファイル名 ) && ( this.n音量0to100 == wc.n音量0to100 ) ) ) && ( ( ( this.n位置_100to100 == wc.n位置_100to100 ) && ( this.bBGMとして使用 == wc.bBGMとして使用 ) ) && ( ( this.col文字色 == wc.col文字色 ) && ( this.col背景色 == wc.col背景色 ) ) ) );\r
28                 }\r
29                 public void tコピーfrom( CWAV wc )\r
30                 {\r
31                         this.strラベル名 = wc.strラベル名;\r
32                         if( ( wc.nWAV番号1to1295 < 1 ) || ( wc.nWAV番号1to1295 > 0x50f ) )\r
33                         {\r
34                                 throw new Exception( "WAV番号が範囲を超えています。-> [" + this.nWAV番号1to1295 + "]" );\r
35                         }\r
36                         this.nWAV番号1to1295 = wc.nWAV番号1to1295;\r
37                         this.strファイル名 = wc.strファイル名;\r
38                         if( ( wc.n音量0to100 < 0 ) || ( wc.n音量0to100 > 100 ) )\r
39                         {\r
40                                 throw new Exception( "音量が範囲を超えています。-> [" + this.n音量0to100 + "]" );\r
41                         }\r
42                         this.n音量0to100 = wc.n音量0to100;\r
43                         if( ( wc.n位置_100to100 < -100 ) || ( wc.n位置_100to100 > 100 ) )\r
44                         {\r
45                                 throw new Exception( "位置が範囲を超えています。-> [" + this.n位置_100to100 + "]" );\r
46                         }\r
47                         this.n位置_100to100 = wc.n位置_100to100;\r
48                         this.bBGMとして使用 = wc.bBGMとして使用;\r
49                         this.col文字色 = wc.col文字色;\r
50                         this.col背景色 = wc.col背景色;\r
51                 }\r
52                 public void tコピーfrom( ListViewItem lvi )\r
53                 {\r
54                         this.strラベル名 = lvi.SubItems[ 0 ].Text;\r
55                         this.nWAV番号1to1295 = C変換.n36進数2桁の文字列を数値に変換して返す( lvi.SubItems[ 1 ].Text );\r
56                         this.strファイル名 = lvi.SubItems[ 2 ].Text;\r
57                         if( !int.TryParse( lvi.SubItems[ 3 ].Text, out this.n音量0to100 ) )\r
58                         {\r
59                                 this.n音量0to100 = 100;\r
60                         }\r
61                         if( ( this.n音量0to100 < 0 ) || ( this.n音量0to100 > 100 ) )\r
62                         {\r
63                                 throw new Exception( "音量の値が範囲を超えています。-> [" + this.n音量0to100 + "]" );\r
64                         }\r
65                         if( !int.TryParse( lvi.SubItems[ 4 ].Text, out this.n位置_100to100 ) )\r
66                         {\r
67                                 this.n位置_100to100 = 0;\r
68                         }\r
69                         if( ( this.n位置_100to100 < -100 ) || ( this.n位置_100to100 > 100 ) )\r
70                         {\r
71                                 throw new Exception( "位置の値が範囲を超えています。-> [" + this.n音量0to100 + "]" );\r
72                         }\r
73                         this.bBGMとして使用 = lvi.SubItems[ 5 ].Text.Equals( "o" );\r
74                         this.col文字色 = lvi.ForeColor;\r
75                         this.col背景色 = lvi.BackColor;\r
76                 }\r
77                 public void tコピーto( ListViewItem lvi )\r
78                 {\r
79                         lvi.SubItems[ 0 ].Text = this.strラベル名;\r
80                         lvi.SubItems[ 1 ].Text = C変換.str数値を36進数2桁に変換して返す( this.nWAV番号1to1295 );\r
81                         lvi.SubItems[ 2 ].Text = this.strファイル名;\r
82                         lvi.SubItems[ 3 ].Text = this.n音量0to100.ToString();\r
83                         lvi.SubItems[ 4 ].Text = this.n位置_100to100.ToString();\r
84                         lvi.SubItems[ 5 ].Text = this.bBGMとして使用 ? "o" : "";\r
85                         lvi.ForeColor = this.col文字色;\r
86                         lvi.BackColor = this.col背景色;\r
87                 }\r
88                 public ListViewItem t現在の内容から新しいListViewItemを作成して返す()\r
89                 {\r
90                         ListViewItem item = new ListViewItem( new string[] { this.strラベル名, C変換.str数値を36進数2桁に変換して返す( this.nWAV番号1to1295 ), this.strファイル名, this.n音量0to100.ToString(), this.n位置_100to100.ToString(), this.bBGMとして使用 ? "o" : "" } );\r
91                         item.ForeColor = this.col文字色;\r
92                         item.BackColor = this.col背景色;\r
93                         return item;\r
94                 }\r
95         }\r
96 }\r