-
Notifications
You must be signed in to change notification settings - Fork 2
/
Debug.lua
70 lines (63 loc) · 2.36 KB
/
Debug.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
Debug = {enabled = false}
function Debug.ShowInfo()
local opt = {"NoOp", "Insert", "Delete", "Pitch + dur", "Vel", "Move"}
if reaper.ImGui_BeginListBox(App.ctx, "Undo stack", 300, 200 ) then
if #UR.undo_stack > 0 then
for i, v in ipairs(UR.undo_stack) do
local rec = v.note_list
reaper.ImGui_Text(App.ctx, "[Rec: " .. i .. ", Type: " .. opt[v.type] .. "]")
for j, m in ipairs(rec) do
reaper.ImGui_Text(App.ctx, " Note: " .. rec[j].offset .. "-" .. rec[j].string_idx)
end
end
end
reaper.ImGui_EndListBox(App.ctx)
end
reaper.ImGui_SameLine(App.ctx)
if reaper.ImGui_BeginListBox(App.ctx, "Redo stack", 300, 200 ) then
if #UR.redo_stack > 0 then
for i, v in ipairs(UR.redo_stack) do
local rec = v.note_list
reaper.ImGui_Text(App.ctx, "[Rec: " .. i .. ", Type: " .. opt[v.type] .. "]")
for j, m in ipairs(rec) do
reaper.ImGui_Text(App.ctx, " Note: " .. rec[j].offset .. "-" .. rec[j].string_idx)
end
end
end
reaper.ImGui_EndListBox(App.ctx)
end
reaper.ImGui_SameLine(App.ctx)
if reaper.ImGui_BeginListBox(App.ctx, "Clipboard", 300, 200 ) then
if #Clipboard.note_list > 0 then
for i, v in ipairs(Clipboard.note_list) do
reaper.ImGui_Text(App.ctx, "Note: " .. v.offset .. "-" .. v.string_idx)
end
end
reaper.ImGui_EndListBox(App.ctx)
end
if reaper.ImGui_BeginListBox(App.ctx, "Notes", 300, 200 ) then
if #App.note_list > 0 then
for i, v in ipairs(App.note_list) do
reaper.ImGui_Text(App.ctx, i .. " - X:" .. v.offset .. " - Y:" .. v.string_idx .. " - Dur:" ..v.duration)
end
end
reaper.ImGui_EndListBox(App.ctx)
end
reaper.ImGui_SameLine(App.ctx)
if reaper.ImGui_BeginListBox(App.ctx, "Selected", 300, 200 ) then
if #App.note_list_selected > 0 then
for i, v in ipairs(App.note_list_selected) do
local idx = App.note_list_selected.indices[i]
reaper.ImGui_Text(App.ctx, idx .. " - X:" .. v.offset .. " - Y:" .. v.string_idx .. " - Dur:" ..v.duration)
end
end
reaper.ImGui_EndListBox(App.ctx)
end
reaper.ImGui_SameLine(App.ctx)
if reaper.ImGui_BeginListBox(App.ctx, "Last Clicked", 300, 50 ) then
if App.last_note_clicked ~= nil then
reaper.ImGui_Text(App.ctx, App.last_note_clicked.idx .. " - X:" .. App.last_note_clicked.offset .. " - Y:" .. App.last_note_clicked.string_idx .. " - Dur:" ..App.last_note_clicked.duration)
end
reaper.ImGui_EndListBox(App.ctx)
end
end