-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdowngrade_gui.lua
130 lines (94 loc) · 2.97 KB
/
downgrade_gui.lua
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
--------------------------------------------------------------------------------
-- gui
--------------------------------------------------------------------------------
function show_downgrade_dialog()
vb = renoise.ViewBuilder()
local DIALOG_MARGIN =
renoise.ViewBuilder.DEFAULT_DIALOG_MARGIN
local CONTENT_SPACING =
renoise.ViewBuilder.DEFAULT_CONTROL_SPACING
local CONTENT_MARGIN =
renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN
local DEFAULT_CONTROL_HEIGHT =
renoise.ViewBuilder.DEFAULT_CONTROL_HEIGHT
local DEFAULT_DIALOG_BUTTON_HEIGHT =
renoise.ViewBuilder.DEFAULT_DIALOG_BUTTON_HEIGHT
local DEFAULT_MINI_CONTROL_HEIGHT =
renoise.ViewBuilder.DEFAULT_MINI_CONTROL_HEIGHT
local CONTROL_MARGIN =
renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN
local TEXT_ROW_WIDTH = 80
if helper_dialog and helper_dialog.visible then
helper_dialog:show()
return
end
local dialog_title = "Convert song to speed model"
local dialog_content = vb:column {
margin = DIALOG_MARGIN,
spacing = CONTENT_SPACING,
uniform = true,
vb:column
{
style = "panel",
margin = CONTROL_MARGIN,
vb:horizontal_aligner {
mode = "center",
spacing = CONTENT_SPACING,
vb:checkbox {
value = true,
id="checkbox_replace_zk"
},
vb:text {
width = 180,
text = "Replace ZK command with ZL"
},
},
},
vb:horizontal_aligner {
margin = CONTROL_MARGIN,
mode = "center",
vb:button {
width = 100,
height = DEFAULT_DIALOG_BUTTON_HEIGHT,
text = "Downgrade",
notifier = function()
call_downgrade(vb.views.checkbox_replace_zk.value)
end
},
},
}
downgrade_dialog = renoise.app():show_custom_dialog(dialog_title, dialog_content)
end
function show_downgrade_log_dialog(message)
--local vb = renoise.ViewBuilder()
local dialog_title = "Downgrade Log"
local dialog_buttons = {"Close"};
local DEFAULT_MARGIN = renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN
local DEFAULT_DIALOG_BUTTON_HEIGHT = renoise.ViewBuilder.DEFAULT_DIALOG_BUTTON_HEIGHT
local downgrade_log_dialog = nil
local dialog_content = vb:column {
margin = DEFAULT_MARGIN,
vb:column {
style = "group",
margin = DEFAULT_MARGIN,
vb:multiline_textfield {
width = 500,
height = 200,
value = message
}
},
vb:horizontal_aligner {
mode = "distribute",
margin = 8,
spacing = 8,
vb:button {
height = DEFAULT_DIALOG_BUTTON_HEIGHT,
text = "Close",
notifier = function()
downgrade_log_dialog:close();
end
},
}
}
downgrade_log_dialog = renoise.app():show_custom_dialog(dialog_title, dialog_content)
end