File size: 2,640 Bytes
402daee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eee32fb
 
 
 
402daee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eee32fb
 
 
 
 
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
reaper = reaper or {
  __ext_state__ = {},

  __test_setUp = function ()
    reaper.__ext_state__ = {}
  end,

  APIExists = function (_)
    return false
  end,

  ColorToNative = function (r, g, b)
    return (math.tointeger(r) or 0) + ((math.tointeger(g) or 0) << 8) + ((math.tointeger(b) or 0) << 16)
  end,

  GetExtState = function (section, key)
    if reaper.__ext_state__[section] then
      return reaper.__ext_state__[section][key]
    end
  end,

  HasExtState = function (section, key)
    return reaper.GetExtState(section, key) ~= nil
  end,

  SetExtState = function (section, key, value)
    if not reaper.__ext_state__[section] then
      reaper.__ext_state__[section] = {}
    end
    reaper.__ext_state__[section][key] = value
  end,

  DeleteExtState = function (section, key)
    if reaper.__ext_state__[section] then
      reaper.__ext_state__[section][key] = nil
    end
  end,

  genGuid = function()
    return '{00000000-0000-0000-0000-000000000000}'
  end,

  GetOS = function ()
    return 'Win64'
  end,

  GetAppVersion = function ()
    return '7.07/x64'
  end,

  GetResourcePath = function ()
    return 'tests/resources'
  end,

  MB = print,
  ShowConsoleMsg = print,
  ShowMessageBox = print,

  ImGui_PushStyleColor = function (_context, _key, _value) end,
  ImGui_PopStyleColor = function (_context, _count) end,

  ImGui_PushStyleVar = function (_context, _key, _varlength) end,
  ImGui_PopStyleVar = function (_context, _count) end,

  defer = function (f)
    f()
  end,

  get_action_context = function ()
    local path = debug.getinfo(2, "S").source:sub(2)
    return false, path
  end,

  ImGui_BeginDisabled = function(_context, _disabled) end,
  ImGui_EndDisabled = function(_context) end,
}

if reaper.__test_setUp then reaper.__test_setUp() end

gfx = gfx or {
  init = function (name, w, h, dock, x, y)
    gfx.__name = name
    gfx.w = w
    gfx.h = h
    gfx.__dock = dock
    gfx.x = x
    gfx.y = y
  end,

  clear = function (_) end,

  clienttoscreen = function (_, _)
    return 0, 0
  end,

  dock = function (_, _, _, _, _)
    return 0, 0, 0, 0, 0
  end,

  measurestr = function (_)
    return 0, 0
  end,

  circle = function (_, _, _, _, _) end,
  drawstr = function (_) end,
  muladdrect = function (_, _, _, _, _, _, _, _, _, _, _, _) end,
  rect = function (_, _, _, _) end,
  roundrect = function (_, _, _, _, _, _, _) end,
  set = function (_, _, _, _) end,
  setfont = function (_, _, _, _) end,
  setimgdim = function (_, _, _) end,
  quit = function () end,
}

ImGui = ImGui or {
  Key_LeftArrow = function() return 1 end,
  Key_RightArrow = function() return 2 end,
}