forked from palesius/AutoGH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclsElements.vb
366 lines (333 loc) · 11.6 KB
/
clsElements.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
'Enum enumGame
' gmGH2
' gmGH3
' gmRB
' gmRB2
' gmRBB
' gmLRB
'End Enum
Enum enumLevel
lvlEasy = 0
lvlMedium = 1
lvlHard = 2
lvlExpert = 3
End Enum
'Friend Class clsGame
' Friend name As String
' Friend path As String
' 'Friend game As enumGame
' Friend Sub New(newName As String, newPath As String, newGame As enumGame)
' name = newName
' path = newPath
' game = newGame
' End Sub
' Friend ReadOnly Property strum As Boolean
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return False
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return True
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property noteGreen As Integer
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return &H10000
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return clsController.XBButtons.btnA
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property noteRed As Integer
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return clsController.XBButtons.btnLB
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return clsController.XBButtons.btnB
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property noteBlue As Integer
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return &H20000
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return clsController.XBButtons.btnX
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property noteYellow As Integer
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return clsController.XBButtons.btnRB
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return clsController.XBButtons.btnY
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property noteOrange As Integer
' Get
' Select Case game
' Case enumGame.gmGH2, enumGame.gmGH3
' Return clsController.XBButtons.btnA
' Case enumGame.gmRB, enumGame.gmRB2, enumGame.gmRBB, enumGame.gmLRB
' Return clsController.XBButtons.btnLB
' Case Else
' Return True
' End Select
' End Get
' End Property
' Friend ReadOnly Property dilation As Decimal
' Get
' Select Case game
' Case enumGame.gmGH2
' Return 1.0025
' Case enumGame.gmGH3
' Return 1.00008
' Case Else
' Return 1
' End Select
' End Get
' End Property
' Friend ReadOnly Property loadTime As Integer
' Get
' Select Case game
' Case enumGame.gmGH2
' Return 2100
' Case enumGame.gmGH3
' Return 3600
' Case enumGame.gmRB
' Return 4000
' Case Else
' Return 4000
' End Select
' End Get
' End Property
' Friend ReadOnly Property truncation As Integer
' Get
' Return 100
' End Get
' End Property
' Friend ReadOnly Property minimumDuration As Integer
' Get
' Select Case game
' Case enumGame.gmGH2
' Return 50
' Case enumGame.gmGH3
' Return 25
' Case enumGame.gmLRB
' Return 35
' Case Else
' Return 50
' End Select
' End Get
' End Property
' Public Overrides Function toString() As String
' Return name
' End Function
'End Class
Friend Class clsSong
Friend _game As clsRhythmGame
Friend name As String
Friend fi As IO.FileInfo
Private _mf As NAudio.Midi.MidiFile
Private _startTime As Date
Friend ReadOnly Property mf As NAudio.Midi.MidiFile
Get
If _mf Is Nothing Then _mf = New NAudio.Midi.MidiFile(fi.FullName, False)
Return _mf
End Get
End Property
Friend Sub New(newFI As IO.FileInfo, game As clsRhythmGame)
fi = newFI
name = IO.Path.GetFileNameWithoutExtension(fi.FullName)
_game = game
End Sub
Public Overrides Function toString() As String
Return name
End Function
'Public Sub startPlay(c As clsController)
' Select Case _game.game
' Case enumGame.gmGH2
' c.pressButtons(clsController.XBButtons.btnStart, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnDown, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnA, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnA, 100)
' _startTime = Now
' Case enumGame.gmGH3
' c.pressButtons(clsController.XBButtons.btnStart, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnDown, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnA, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnDown, 100)
' System.Threading.Thread.Sleep(500)
' c.pressButtons(clsController.XBButtons.btnA, 100)
' _startTime = Now
' End Select
' _startTime = _startTime.AddMilliseconds(_game.loadTime)
'End Sub
'Public Sub startRetry(c As clsController)
' Select Case _game.game
' Case enumGame.gmGH2, enumGame.gmGH3
' c.pressButtons(clsController.XBButtons.btnA, 100)
' _startTime = Now
' End Select
' _startTime = _startTime.AddMilliseconds(_game.loadTime)
'End Sub
End Class
Friend Class clsTrack
Friend _game As clsRhythmGame
Friend _song As clsSong
Friend name As String
Friend mf As NAudio.Midi.MidiFile
Friend mfPath As String
Friend index As Integer
Friend lefty As Boolean
Friend hopo As Boolean
Friend ReadOnly Property strumButton(Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "GUITAR"
If solo Then Return _game.soloStrum Else Return _game.strum
Case "BASS", "RHYTHM", "GUITAR COOP"
Return _game.strum
Case Else
Return 0
End Select
End Get
End Property
Friend ReadOnly Property noteGreen(Optional nostrum As Boolean = False, Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "DRUMS"
Return _game.drumNotes(0) + IIf(nostrum, 0, strumButton(solo))
Case Else
If lefty Then
Return _game.notes(4) + IIf(nostrum, 0, strumButton(solo))
Else
Return _game.notes(0) + IIf(nostrum, 0, strumButton(solo))
End If
End Select
End Get
End Property
Friend ReadOnly Property noteRed(Optional nostrum As Boolean = False, Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "DRUMS"
Return _game.drumNotes(1) + IIf(nostrum, 0, strumButton(solo))
Case Else
If lefty Then
Return _game.notes(3) + IIf(nostrum, 0, strumButton(solo))
Else
Return _game.notes(1) + IIf(nostrum, 0, strumButton(solo))
End If
End Select
End Get
End Property
Friend ReadOnly Property noteYellow(Optional nostrum As Boolean = False, Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "DRUMS"
Return _game.drumNotes(2) + IIf(nostrum, 0, strumButton(solo))
Case Else
Return _game.notes(2) + IIf(nostrum, 0, strumButton(solo))
End Select
End Get
End Property
Friend ReadOnly Property noteBlue(Optional nostrum As Boolean = False, Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "DRUMS"
Return _game.drumNotes(3) + IIf(nostrum, 0, strumButton(solo))
Case Else
If lefty Then
Return _game.notes(1) + IIf(nostrum, 0, strumButton(solo))
Else
Return _game.notes(3) + IIf(nostrum, 0, strumButton(solo))
End If
End Select
End Get
End Property
Friend ReadOnly Property noteOrange(Optional nostrum As Boolean = False, Optional solo As Boolean = False) As Integer
Get
Select Case name
Case "DRUMS"
Return _game.drumNotes(4) + IIf(nostrum, 0, strumButton(solo))
Case Else
If lefty Then
Return _game.notes(0) + IIf(nostrum, 0, strumButton(solo))
Else
Return _game.notes(4) + IIf(nostrum, 0, strumButton(solo))
End If
End Select
End Get
End Property
Friend Sub New(newMF As NAudio.Midi.MidiFile, newIndex As Integer, newName As String, song As clsSong)
mf = newMF
index = newIndex
name = newName
_song = song
_game = _song._game
lefty = False
End Sub
Public Overrides Function toString() As String
Return name
End Function
End Class
Friend Class clsLevel
Friend index As enumLevel
Friend Sub New(newIndex As enumLevel)
index = newIndex
End Sub
Friend ReadOnly Property baseNote As Integer
Get
Select Case index
Case enumLevel.lvlEasy
Return 60
Case enumLevel.lvlMedium
Return 72
Case enumLevel.lvlHard
Return 84
Case enumLevel.lvlExpert
Return 96
Case Else
Return -1
End Select
End Get
End Property
Public Overrides Function toString() As String
Select Case index
Case enumLevel.lvlEasy
Return "Easy"
Case enumLevel.lvlMedium
Return "Medium"
Case enumLevel.lvlHard
Return "Hard"
Case enumLevel.lvlExpert
Return "Expert"
Case Else
Return vbNullString
End Select
End Function
End Class