-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathma2.kv
420 lines (356 loc) · 11 KB
/
ma2.kv
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
#:kivy 1.10.1
<TrackWidget>:
canvas:
<PatternWidget>:
canvas:
#<SongViewWidget>: # doesn't exist yet (or ever)
<Widget>:
font_name: 'RobotoMono-Regular'
font_size: dp(17)
<RetroButton@Button>:
text: ''
background_normal: ''
background_color: (0,0,0,1)
disabled_color: (.2,.2,.2,1)
canvas:
Color:
rgb: (.8,.8,.8) if not self.disabled else (.2,.2,.2)
Line:
rectangle: self.x+3, self.y+3, self.width-6, self.height-6
width: 1.2
joint: 'miter'
<OpaqueLabel@Label>:
background_color: 0, 0, 0, 1
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: self.pos
size: self.size
<Ma2Widget>:
theTrkWidget: thisTrkWidget
thePtnWidget: thisPtnWidget
btnTitle: btnTitleID
btnPtnTitle: btnPtnTitleID
btnPtnInfo: btnPtnInfoID
btnNoteInfo: btnNoteInfoID
BoxLayout:
orientation: "vertical"
size: root.size
BoxLayout:
orientation: "horizontal"
height: root.height * 0.05
size_hint_y: None
RetroButton:
id: btnTitleID
on_release: root.pressTitle()
size_hint_x: 0.4
# TODO: display button for BPM / OFFSET
RetroButton:
id: btnPtnTitleID
on_release: root.pressPtnTitle()
text: "PTN: bad performance"
size_hint_x: 0.4
RetroButton:
id: btnPtnInfoID
on_release: root.pressPtnInfo()
text: "PAT LEN (Beats)"
size_hint_x: 0.1
TrackWidget:
id: thisTrkWidget
height: 310
size_hint_y: None
PatternWidget:
id: thisPtnWidget
BoxLayout:
orientation: "horizontal"
height: root.height * 0.05
size_hint_y: None
RetroButton:
id: btnNoteInfoID
text: "NOTE INFO"
RetroButton:
on_release: root.pressBuildCode()
text: "Export GLSL"
size_hint_x: 0.33
<EditSynthDialog>:
size_hint: .4, .4
title: ""
background: "./transparent.png"
separator_height: 0
synthNameInput: synthNameInput
canvas:
Color:
rgb: (0.8, 0.8, 0.8)
Line:
rectangle: (self.x+2, self.y+2, self.width-4, self.height-4)
width: 2.4
joint: 'miter'
BoxLayout:
orientation: 'vertical'
size_hint: (.9, .9)
OpaqueLabel:
text: "Edit Synth (Name only, for now)"
background_color: 0,0,0,1
size_hint: (1, .15)
pos_hint: {'center_x': 0.5}
BoxLayout:
orientation: 'horizontal'
size_hint: (1, .15)
pos_hint: {'center_x':0.5, 'center_y':0.5}
Label:
text: "Name:"
size_hint: (.25, .5)
pos_hint: {'center_x':0.5, 'center_y':0.5}
TextInput:
id: synthNameInput
size_hint: (.75, .5)
pos_hint: {'center_x':0.5, 'center_y':0.5}
multiline: False
focus: True
on_text_validate:
root.synthChangeName(synthNameInput.text)
self.parent.parent.dismiss()
RetroButton:
text: "CHANGE NAME"
size_hint: (1, .15)
on_release:
root.synthChangeName(synthNameInput.text)
self.parent.parent.dismiss()
RetroButton:
text: "DEACTIVATE SYNTH"
size_hint: (1, .15)
on_release:
root.synthDeactivate()
self.parent.parent.dismiss()
RetroButton:
text: "CANCEL"
size_hint: (1, .15)
on_release:
self.parent.parent.dismiss()
<ImportPatternDialog>:
size_hint: .8, .8
title: ""
separator_height: 0
#background: ""
importPatternFilenameInput: importPatternFilenameInputID
importPatternFilterInput: importPatternFilterInputID
importPatternList: importPatternListID
importPatternButton: importPatternButtonID
on_open:
importPatternFilenameInputID.select_all()
canvas:
Color:
rgb: (.8, .8, .8)
Line:
rectangle: (self.x+2, self.y+2, self.width-4, self.height-4)
width: 2.4
joint: 'miter'
FloatLayout:
Label:
text: "Quite weird: you control this dialog by mouse. SORRY -- no time till Revision!"
size_hint: (0.6, 0.1)
pos_hint: {'x':0.2, 'top':1}
Label:
text: "Anyway. Import Pattern From File (XML)?"
size_hint: (0.6, 0.1)
pos_hint: {'x':0.2, 'top':.95}
BoxLayout:
orientation: 'horizontal'
size_hint: (0.8, None)
height: 36
pos_hint: {'x':0.1, 'top':.87}
Label:
text: "Filename:"
size_hint: (0.1, 1)
TextInput:
id: importPatternFilenameInputID
text: "enter filename here, then press PARSE (or ENTER)"
size_hint: (0.7, 1)
multiline: False
focus: True
on_text_validate: root.parseFile()
RetroButton:
text: "PARSE"
size_hint: (0.1, 1)
on_release: root.parseFile()
RetroButton:
text: "CLEAR"
size_hint: (0.1, 1)
on_release: root.clearFile()
BoxLayout:
orientation: 'horizontal'
size_hint: (0.8, None)
height: 36
pos_hint: {'x':0.1, 'top':.815}
Label:
text: "but only patterns beginning with..."
size_hint: (0.3, 1)
TextInput:
id: importPatternFilterInputID
text: ""
size_hint: (0.5, 1)
multiline: False
focus: False
on_text_validate:
root.parseFile()
PatternRecycleView:
id: importPatternListID
size_hint: (0.8, .52)
pos_hint: {'center_x': 0.5, 'center_y': 0.50}
RetroButton:
id: importPatternButtonID
text: "IMPORT SE SHIT!"
disabled: True
font_size: 72
size_hint: (0.55, 0.15)
pos_hint: {'x': 0.05, 'y': 0.05}
on_release:
if not self.disabled: root.parseSelectedPattern()
RetroButton:
id: importAllPatternsButtonID
text: "import all?"
size_hint: (0.15, .1)
pos_hint: {'x': 0.6, 'y': 0.075}
on_release:
root.parseAllPatterns()
RetroButton:
text: "do it not. (sorry)"
font_size: 16
size_hint: (0.16, 0.05)
pos_hint: {'x': 0.75, 'y': 0.1}
on_release:
self.parent.parent.dismiss()
<PatternLabel>:
canvas.before:
Color:
rgba: (.6, 0, .3, .6) if self.selected else (0, 0, 0, 1)
Rectangle:
pos: self.pos
size: self.size
<PatternRecycleView>:
viewclass: 'PatternLabel'
scroll_type: ['bars', 'content']
canvas.before:
Color:
rgb: (0, 0, 0)
Rectangle:
pos: self.pos
size: self.size
canvas.after:
Color:
rgb: (.8,.8,.8)
Line:
rectangle: (self.x, self.y, self.width, self.height)
width: 1.2
joint: 'miter'
PatternRecycleBoxLayout:
default_size: None, 28
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
multiselect: False
touch_multiselect: False
<ExportPatternDialog>:
<SelectSynthDialog>:
size_hint: .6, .9
title: ""
separator_height: 0
# selectSynthFilterInput: selectSynthFilterInputID
selectSynthList: selectSynthListID
canvas:
Color:
rgb: (.8, .8, .8)
Line:
rectangle: (self.x+2, self.y+2, self.width-4, self.height-4)
width: 2.4
joint: 'miter'
FloatLayout:
Label:
text: "Select Synth for current Track"
size_hint: (0.6, 0.1)
pos_hint: {'x':0.2, 'top':1}
# BoxLayout:
# orientation: 'horizontal'
# size_hint: (0.8, None)
# height: 36
# pos_hint: {'x':0.1, 'top':.91}
# Label:
# text: "FILTER:"
# size_hint: (0.1, 1)
# TextInput:
# id: selectSynthFilterInputID
# text: ""
# size_hint: (0.7, 1)
# multiline: False
# focus: True
# on_text_validate:
# root.applyFilter()
# RetroButton:
# text: "FILTER"
# size_hint: (0.1, 1)
# on_release:
# root.applyFilter()
# RetroButton:
# text: "CLEAR"
# size_hint: (0.1, 1)
# on_release:
# root.clearFilter()
SelectableRecycleView:
id: selectSynthListID
size_hint: (0.8, .76)
pos_hint: {'center_x': 0.5, 'center_y': 0.53}
BoxLayout:
orientation: 'horizontal'
size_hint: (0.8, .08)
pos_hint: {'x':0.1, 'y':.05}
RetroButton:
text: "choose selected"
on_release:
root.switchToSelected()
Label:
text: ""
size_hint_x: 0.1
RetroButton:
text: "take random"
on_release:
root.switchToRandom()
Label:
text: ""
size_hint_x: 0.1
RetroButton:
text: "do no shit"
on_release:
root.dontSwitch()
<SelectableLabel>:
canvas.before:
Color:
rgba: (.6, 0, .3, .6) if self.selected else (0, 0, 0, 1)
Rectangle:
pos: self.pos
size: self.size
<SelectableRecycleView>:
viewclass: 'SelectableLabel'
scroll_type: ['bars', 'content']
canvas.before:
Color:
rgb: (0, 0, 0)
Rectangle:
pos: self.pos
size: self.size
canvas.after:
Color:
rgb: (.8,.8,.8)
Line:
rectangle: (self.x, self.y, self.width, self.height)
width: 1.2
joint: 'miter'
SelectableRecycleBoxLayout:
default_size: None, 28
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
multiselect: False
touch_multiselect: False