OSDN Git Service

#32661 Beat Detection機能と、それに付随するBPM自動設定機能を追加。使い方はチケット参照のこと。
[dtxmania/dtxmania.git] / DTXCreatorプロジェクト / コード / 05.譜面 / Cレーン.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Drawing;\r
5 \r
6 namespace DTXCreator.譜面\r
7 {\r
8         public class Cレーン\r
9         {\r
10                 public const int LANEWIDTH = 30;\r
11 \r
12                 public enum E種別\r
13                 {\r
14                         BPM,\r
15                         BEAT,\r
16                         WAV,\r
17                         BMP,\r
18                         AVI,\r
19                         FI,\r
20                         GtV,\r
21                         GtR,\r
22                         GtG,\r
23                         GtB,\r
24                         GtW,\r
25                         BsV,\r
26                         BsR,\r
27                         BsG,\r
28                         BsB,\r
29                         BsW\r
30                 }\r
31                 public enum ELaneType\r
32                 {\r
33                         BPM,\r
34                         Beat,\r
35                         Drums,\r
36                         BGM,\r
37                         SE1_5,\r
38                         SE6_32,\r
39                         Guitar,\r
40                         Bass,\r
41                         AVI,\r
42                         BGA1_5,\r
43                         BGA6_8,\r
44                         END                     // 何か非値を設定したくなったときのための値(nullの代わり)\r
45                 }\r
46                 \r
47                 public bool b左側の線が太線;\r
48                 public Color col背景色 = Color.Black;\r
49                 public E種別 eレーン種別 = E種別.WAV;\r
50                 public int nチャンネル番号・表00toFF;\r
51                 public int nチャンネル番号・裏00toFF;\r
52                 public int nレーン割付チップ・表0or1to1295;\r
53                 public int nレーン割付チップ・裏0or1to1295;\r
54                 public int n位置Xdot;\r
55                 public int n幅dot = 30;\r
56                 public string strレーン名 = "";\r
57                 public ELaneType eLaneType { get; set; }\r
58                 public bool bIsVisible          // \r
59                 {\r
60                         get\r
61                         {\r
62                                 return ( n幅dot > 0 );\r
63                         }\r
64                         set\r
65                         {\r
66                                 n幅dot = ( value == true ) ? LANEWIDTH : 0;\r
67                         }\r
68                 }\r
69 \r
70 \r
71                 /// <summary>\r
72                 /// コンストラクタ\r
73                 /// </summary>\r
74                 public Cレーン()\r
75                 {\r
76                         this.eレーン種別 = E種別.WAV;\r
77                         this.strレーン名 = "";\r
78                         this.nチャンネル番号・表00toFF = 0;\r
79                         this.nチャンネル番号・裏00toFF = 0;\r
80                         this.b左側の線が太線 = false;\r
81                         this.col背景色 = Color.FromArgb(0, 0, 0, 0);\r
82                         this.n位置Xdot = 0;\r
83                         this.n幅dot = 30;\r
84                         this.eLaneType = ELaneType.SE1_5;\r
85                         this.bIsVisible = true;\r
86                 }\r
87 \r
88                 /// <summary>\r
89                 /// コンストラクタ(初期化用)\r
90                 /// </summary>\r
91                 /// <param name="eレーン種別"></param>\r
92                 /// <param name="strレーン名"></param>\r
93                 /// <param name="nチャンネル番号・表00toFF"></param>\r
94                 /// <param name="nチャンネル番号・裏00toFF"></param>\r
95                 /// <param name="b左側の線が太線"></param>\r
96                 /// <param name="col背景色"></param>\r
97                 /// <param name="n位置Xdot"></param>\r
98                 /// <param name="n幅dot"></param>\r
99                 /// <param name="eLaneType"></param>\r
100                 /// <param name="bIsVisible"></param>\r
101                 public Cレーン(\r
102                         E種別 eレーン種別_, string strレーン名_,\r
103                         int nチャンネル番号・表00toFF_, int nチャンネル番号・裏00toFF_,\r
104                         bool b左側の線が太線_,\r
105                         Color col背景色_,\r
106                         int n位置Xdot_, int n幅dot_,\r
107                         ELaneType eLaneType_,\r
108                         bool bIsVisible_ )\r
109                 {\r
110                         this.eレーン種別 = eレーン種別_;\r
111                         this.strレーン名 = strレーン名_;\r
112                         this.nチャンネル番号・表00toFF = nチャンネル番号・表00toFF_;\r
113                         this.nチャンネル番号・裏00toFF = nチャンネル番号・裏00toFF_;\r
114                         this.b左側の線が太線 = b左側の線が太線_;\r
115                         this.col背景色 = col背景色_;\r
116                         this.n位置Xdot = n位置Xdot_;\r
117                         this.n幅dot = n幅dot_;\r
118                         this.eLaneType = eLaneType_;\r
119                         this.bIsVisible = bIsVisible_;\r
120                 }\r
121 \r
122                 public bool bパターンレーンである()\r
123                 {\r
124                         if( ( this.eレーン種別 != E種別.GtR ) && ( this.eレーン種別 != E種別.GtG ) && ( this.eレーン種別 != E種別.GtB ) && ( this.eレーン種別 != E種別.BsR ) && ( this.eレーン種別 != E種別.BsG ) && ( this.eレーン種別 != E種別.BsB ) )\r
125                         {\r
126                                 return false;\r
127                         }\r
128                         return true;\r
129                 }\r
130         }\r
131 }\r