Spaces:
Sleeping
Sleeping
j
commited on
Commit
·
e378a99
1
Parent(s):
97016bb
update, add support for https
Browse files- reascripts/ReaSpeech/Makefile +1 -1
- reascripts/ReaSpeech/ReaSpeechDev.lua +1 -12
- reascripts/ReaSpeech/source/Fonts.lua +2 -1
- reascripts/ReaSpeech/source/KeyMap.lua +37 -0
- reascripts/ReaSpeech/source/ReaSpeechAPI.lua +3 -4
- reascripts/ReaSpeech/source/ReaSpeechControlsUI.lua +62 -176
- reascripts/ReaSpeech/source/ReaSpeechEULAContent.lua +0 -233
- reascripts/ReaSpeech/source/ReaSpeechProductActivation.lua +0 -151
- reascripts/ReaSpeech/source/ReaSpeechProductActivationUI.lua +0 -69
- reascripts/ReaSpeech/source/ReaSpeechUI.lua +3 -13
- reascripts/ReaSpeech/source/ReaSpeechWidgets.lua +263 -0
- reascripts/ReaSpeech/source/TranscriptEditor.lua +31 -17
- reascripts/ReaSpeech/source/TranscriptUI.lua +73 -32
- reascripts/ReaSpeech/source/WhisperLanguages.lua +60 -0
- reascripts/ReaSpeech/tests/TestReaSpeechUI.lua +3 -3
reascripts/ReaSpeech/Makefile
CHANGED
@@ -4,7 +4,7 @@ LUA54=lua5.4
|
|
4 |
LUAC54=luac5.4
|
5 |
LUACHECK=luacheck
|
6 |
|
7 |
-
LIBS=ImGuiTheme.lua
|
8 |
VENDOR=json.lua url.lua
|
9 |
|
10 |
source:=$(wildcard source/*.lua source/include/*.lua)
|
|
|
4 |
LUAC54=luac5.4
|
5 |
LUACHECK=luacheck
|
6 |
|
7 |
+
LIBS=ImGuiTheme.lua Polo.lua ReaIter.lua ReaUtil.lua Tempfile.lua
|
8 |
VENDOR=json.lua url.lua
|
9 |
|
10 |
source:=$(wildcard source/*.lua source/include/*.lua)
|
reascripts/ReaSpeech/ReaSpeechDev.lua
CHANGED
@@ -4,9 +4,6 @@ ReaSpeechDev.lua - ReaSpeech UI development version
|
|
4 |
|
5 |
]]--
|
6 |
|
7 |
-
-- Set to true to enable product activation flow, false to disable
|
8 |
-
local ENABLE_ACTIVATION = true
|
9 |
-
|
10 |
local script_path, _ = ({reaper.get_action_context()})[2]:match("(.-)([^/\\]+).lua$")
|
11 |
|
12 |
dofile(script_path .. 'source/include/globals.lua')
|
@@ -27,19 +24,11 @@ for _, source_dir in pairs({'resources/images', '../common/libs', 'source'}) do
|
|
27 |
end
|
28 |
end
|
29 |
|
30 |
-
-- Might be time before too long to standardize this interface across apps.
|
31 |
-
if not ENABLE_ACTIVATION then
|
32 |
-
function ReaSpeechProductActivation:activation_state_check() end
|
33 |
-
ReaSpeechProductActivation.state = 'activated'
|
34 |
-
|
35 |
-
local activation = ReaSpeechProductActivation.new()
|
36 |
-
activation.config:set('eula_signed', true)
|
37 |
-
end
|
38 |
-
|
39 |
-- We're not inside of docker! We're undocked!
|
40 |
Script = {
|
41 |
name = "ReaSpeechDev",
|
42 |
host = "localhost:9000",
|
|
|
43 |
lua = _VERSION:match('[%d.]+'),
|
44 |
timeout = 30000,
|
45 |
}
|
|
|
4 |
|
5 |
]]--
|
6 |
|
|
|
|
|
|
|
7 |
local script_path, _ = ({reaper.get_action_context()})[2]:match("(.-)([^/\\]+).lua$")
|
8 |
|
9 |
dofile(script_path .. 'source/include/globals.lua')
|
|
|
24 |
end
|
25 |
end
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
-- We're not inside of docker! We're undocked!
|
28 |
Script = {
|
29 |
name = "ReaSpeechDev",
|
30 |
host = "localhost:9000",
|
31 |
+
protocol = "http:",
|
32 |
lua = _VERSION:match('[%d.]+'),
|
33 |
timeout = 30000,
|
34 |
}
|
reascripts/ReaSpeech/source/Fonts.lua
CHANGED
@@ -29,7 +29,8 @@ function Fonts:load()
|
|
29 |
return
|
30 |
end
|
31 |
|
32 |
-
local
|
|
|
33 |
local icons_file = Tempfile:name()
|
34 |
|
35 |
local curl = "curl"
|
|
|
29 |
return
|
30 |
end
|
31 |
|
32 |
+
local protocol = Script.protocol or 'http:'
|
33 |
+
local icons_url = protocol .. '//' .. Script.host .. '/static/reascripts/ReaSpeech/icons.ttf'
|
34 |
local icons_file = Tempfile:name()
|
35 |
|
36 |
local curl = "curl"
|
reascripts/ReaSpeech/source/KeyMap.lua
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
--[[
|
2 |
+
|
3 |
+
KeyMap.lua - Keyboard bindings registrations & reactions
|
4 |
+
|
5 |
+
Initialize a new map of key bindings with a table of `key_code` => `binding`,
|
6 |
+
where `binding` can be a function or a list table of functions.
|
7 |
+
|
8 |
+
Invoke the `react` method as often as you like to check and handle any
|
9 |
+
bindings that match.
|
10 |
+
]]--
|
11 |
+
|
12 |
+
KeyMap = Polo {
|
13 |
+
new = function(bindings)
|
14 |
+
return {
|
15 |
+
bindings = bindings
|
16 |
+
}
|
17 |
+
end
|
18 |
+
}
|
19 |
+
|
20 |
+
function KeyMap:init()
|
21 |
+
self.ctx = self.ctx or ctx
|
22 |
+
self.bindings = self.bindings or {}
|
23 |
+
end
|
24 |
+
|
25 |
+
function KeyMap:react()
|
26 |
+
for key, binding in pairs(self.bindings) do
|
27 |
+
if ImGui.IsKeyPressed(self.ctx, key) then
|
28 |
+
if type(binding) == 'function' then
|
29 |
+
binding()
|
30 |
+
elseif type(binding) == 'table' then
|
31 |
+
for _, f in ipairs(binding) do
|
32 |
+
f()
|
33 |
+
end
|
34 |
+
end
|
35 |
+
end
|
36 |
+
end
|
37 |
+
end
|
reascripts/ReaSpeech/source/ReaSpeechAPI.lua
CHANGED
@@ -9,10 +9,9 @@ ReaSpeechAPI = {
|
|
9 |
base_url = nil,
|
10 |
}
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
self.base_url = base_url
|
16 |
end
|
17 |
|
18 |
function ReaSpeechAPI:get_api_url(remote_path)
|
|
|
9 |
base_url = nil,
|
10 |
}
|
11 |
|
12 |
+
function ReaSpeechAPI:init(host, protocol)
|
13 |
+
protocol = protocol or 'http:'
|
14 |
+
self.base_url = protocol .. '//' .. host
|
|
|
15 |
end
|
16 |
|
17 |
function ReaSpeechAPI:get_api_url(remote_path)
|
reascripts/ReaSpeech/source/ReaSpeechControlsUI.lua
CHANGED
@@ -5,44 +5,7 @@ ReaSpeechControlsUI.lua - UI elements for configuring ASR services
|
|
5 |
]]--
|
6 |
|
7 |
ReaSpeechControlsUI = Polo {
|
8 |
-
|
9 |
-
LANGUAGES = {
|
10 |
-
en = 'English', zh = 'Chinese', de = 'German',
|
11 |
-
es = 'Spanish', ru = 'Russian', ko = 'Korean',
|
12 |
-
fr = 'French', ja = 'Japanese', pt = 'Portuguese',
|
13 |
-
tr = 'Turkish', pl = 'Polish', ca = 'Catalan',
|
14 |
-
nl = 'Dutch', ar = 'Arabic', sv = 'Swedish',
|
15 |
-
it = 'Italian', id = 'Indonesian', hi = 'Hindi',
|
16 |
-
fi = 'Finnish', vi = 'Vietnamese', he = 'Hebrew',
|
17 |
-
uk = 'Ukrainian', el = 'Greek', ms = 'Malay',
|
18 |
-
cs = 'Czech', ro = 'Romanian', da = 'Danish',
|
19 |
-
hu = 'Hungarian', ta = 'Tamil', no = 'Norwegian',
|
20 |
-
th = 'Thai', ur = 'Urdu', hr = 'Croatian',
|
21 |
-
bg = 'Bulgarian', lt = 'Lithuanian', la = 'Latin',
|
22 |
-
mi = 'Maori', ml = 'Malayalam', cy = 'Welsh',
|
23 |
-
sk = 'Slovak', te = 'Telugu', fa = 'Persian',
|
24 |
-
lv = 'Latvian', bn = 'Bengali', sr = 'Serbian',
|
25 |
-
az = 'Azerbaijani', sl = 'Slovenian', kn = 'Kannada',
|
26 |
-
et = 'Estonian', mk = 'Macedonian', br = 'Breton',
|
27 |
-
eu = 'Basque', is = 'Icelandic', hy = 'Armenian',
|
28 |
-
ne = 'Nepali', mn = 'Mongolian', bs = 'Bosnian',
|
29 |
-
kk = 'Kazakh', sq = 'Albanian', sw = 'Swahili',
|
30 |
-
gl = 'Galician', mr = 'Marathi', pa = 'Punjabi',
|
31 |
-
si = 'Sinhala', km = 'Khmer', sn = 'Shona',
|
32 |
-
yo = 'Yoruba', so = 'Somali', af = 'Afrikaans',
|
33 |
-
oc = 'Occitan', ka = 'Georgian', be = 'Belarusian',
|
34 |
-
tg = 'Tajik', sd = 'Sindhi', gu = 'Gujarati',
|
35 |
-
am = 'Amharic', yi = 'Yiddish', lo = 'Lao',
|
36 |
-
uz = 'Uzbek', fo = 'Faroese', ht = 'Haitian Creole',
|
37 |
-
ps = 'Pashto', tk = 'Turkmen', nn = 'Nynorsk',
|
38 |
-
mt = 'Maltese', sa = 'Sanskrit', lb = 'Luxembourgish',
|
39 |
-
my = 'Myanmar', bo = 'Tibetan', tl = 'Tagalog',
|
40 |
-
mg = 'Malagasy', as = 'Assamese', tt = 'Tatar',
|
41 |
-
haw = 'Hawaiian', ln = 'Lingala', ha = 'Hausa',
|
42 |
-
ba = 'Bashkir', jw = 'Javanese', su = 'Sundanese'
|
43 |
-
},
|
44 |
-
|
45 |
-
LANGUAGE_CODES = {},
|
46 |
|
47 |
DEFAULT_LANGUAGE = '',
|
48 |
DEFAULT_MODEL_NAME = 'small',
|
@@ -60,83 +23,74 @@ ReaSpeechControlsUI = Polo {
|
|
60 |
NARROW_COLUMN_WIDTH = 150,
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
end)
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
75 |
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
-
|
79 |
-
self.
|
|
|
80 |
|
81 |
-
self.
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
self.
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
self:init_layouts()
|
92 |
end
|
93 |
|
94 |
function ReaSpeechControlsUI:get_request_data()
|
95 |
return {
|
96 |
-
language = self.language,
|
97 |
-
translate = self.translate,
|
98 |
-
hotwords = self.hotwords,
|
99 |
-
initial_prompt = self.initial_prompt,
|
100 |
-
model_name = self.model_name,
|
101 |
-
vad_filter = self.vad_filter,
|
102 |
}
|
103 |
end
|
104 |
|
105 |
function ReaSpeechControlsUI:init_layouts()
|
106 |
-
self:init_simple_layouts()
|
107 |
self:init_advanced_layouts()
|
108 |
end
|
109 |
|
110 |
-
function ReaSpeechControlsUI:init_simple_layouts()
|
111 |
-
local with_button_color = function (selected, f)
|
112 |
-
if selected then
|
113 |
-
ImGui.PushStyleColor(ctx, ImGui.Col_Button(), Theme.colors.dark_gray_translucent)
|
114 |
-
app:trap(f)
|
115 |
-
ImGui.PopStyleColor(ctx)
|
116 |
-
else
|
117 |
-
f()
|
118 |
-
end
|
119 |
-
end
|
120 |
-
|
121 |
-
self.model_sizes_layout = ColumnLayout.new {
|
122 |
-
column_padding = self.COLUMN_PADDING,
|
123 |
-
margin_bottom = self.MARGIN_BOTTOM,
|
124 |
-
margin_left = self.MARGIN_LEFT,
|
125 |
-
margin_right = self.MARGIN_RIGHT,
|
126 |
-
num_columns = #self.SIMPLE_MODEL_SIZES,
|
127 |
-
|
128 |
-
render_column = function (column)
|
129 |
-
self:render_input_label(column.num == 1 and 'Model Size' or '')
|
130 |
-
local label, model_name = table.unpack(self.SIMPLE_MODEL_SIZES[column.num])
|
131 |
-
with_button_color(self.model_name == model_name, function ()
|
132 |
-
if ImGui.Button(ctx, label, column.width) then
|
133 |
-
self.model_name = model_name
|
134 |
-
end
|
135 |
-
end)
|
136 |
-
end
|
137 |
-
}
|
138 |
-
end
|
139 |
-
|
140 |
function ReaSpeechControlsUI:init_advanced_layouts()
|
141 |
local renderers = {
|
142 |
{self.render_model_name, self.render_hotwords, self.render_language},
|
@@ -164,7 +118,7 @@ end
|
|
164 |
|
165 |
function ReaSpeechControlsUI:render()
|
166 |
self:render_heading()
|
167 |
-
if self.
|
168 |
self:render_advanced()
|
169 |
else
|
170 |
self:render_simple()
|
@@ -180,7 +134,7 @@ function ReaSpeechControlsUI:render_heading()
|
|
180 |
app.png_from_bytes('reaspeech-logo-small')
|
181 |
|
182 |
ImGui.SetCursorPos(ctx, init_x + self.MARGIN_LEFT + 2, init_y)
|
183 |
-
self:
|
184 |
|
185 |
ImGui.SetCursorPos(ctx, ImGui.GetWindowWidth(ctx) - 55, init_y)
|
186 |
app.png_from_bytes('heading-logo-tech-audio')
|
@@ -188,28 +142,8 @@ function ReaSpeechControlsUI:render_heading()
|
|
188 |
ImGui.SetCursorPos(ctx, init_x, init_y + 40)
|
189 |
end
|
190 |
|
191 |
-
function ReaSpeechControlsUI:render_tabs()
|
192 |
-
if ImGui.BeginTabBar(ctx, '##tabs', ImGui.TabBarFlags_None()) then
|
193 |
-
app:trap(function ()
|
194 |
-
if ImGui.BeginTabItem(ctx, 'Simple') then
|
195 |
-
app:trap(function ()
|
196 |
-
self.tab = 'simple'
|
197 |
-
end)
|
198 |
-
ImGui.EndTabItem(ctx)
|
199 |
-
end
|
200 |
-
if ImGui.BeginTabItem(ctx, 'Advanced') then
|
201 |
-
app:trap(function ()
|
202 |
-
self.tab = 'advanced'
|
203 |
-
end)
|
204 |
-
ImGui.EndTabItem(ctx)
|
205 |
-
end
|
206 |
-
end)
|
207 |
-
ImGui.EndTabBar(ctx)
|
208 |
-
end
|
209 |
-
end
|
210 |
-
|
211 |
function ReaSpeechControlsUI:render_simple()
|
212 |
-
self:
|
213 |
end
|
214 |
|
215 |
function ReaSpeechControlsUI:render_advanced()
|
@@ -224,38 +158,13 @@ function ReaSpeechControlsUI:render_input_label(text)
|
|
224 |
end
|
225 |
|
226 |
function ReaSpeechControlsUI:render_language(column)
|
227 |
-
self:
|
228 |
-
|
229 |
-
if ImGui.BeginCombo(ctx, "##language", self.LANGUAGES[self.language]) then
|
230 |
-
app:trap(function()
|
231 |
-
local combo_items = self.LANGUAGE_CODES
|
232 |
-
for _, combo_item in pairs(combo_items) do
|
233 |
-
local is_selected = (combo_item == self.language)
|
234 |
-
if ImGui.Selectable(ctx, self.LANGUAGES[combo_item], is_selected) then
|
235 |
-
self.language = combo_item
|
236 |
-
end
|
237 |
-
end
|
238 |
-
end)
|
239 |
-
ImGui.EndCombo(ctx)
|
240 |
-
end
|
241 |
|
242 |
-
|
243 |
-
if column.width < self.NARROW_COLUMN_WIDTH then
|
244 |
-
translate_label = "Translate"
|
245 |
-
end
|
246 |
-
local rv, value = ImGui.Checkbox(ctx, translate_label, self.translate)
|
247 |
-
if rv then
|
248 |
-
self.translate = value
|
249 |
-
end
|
250 |
end
|
251 |
|
252 |
function ReaSpeechControlsUI:render_model_name()
|
253 |
-
self:
|
254 |
-
|
255 |
-
local rv, value = ImGui.InputTextWithHint(ctx, '##model_name', self.model_name or "<default>")
|
256 |
-
if rv then
|
257 |
-
self.model_name = value
|
258 |
-
end
|
259 |
end
|
260 |
|
261 |
function ReaSpeechControlsUI:render_model_sizes()
|
@@ -263,49 +172,26 @@ function ReaSpeechControlsUI:render_model_sizes()
|
|
263 |
end
|
264 |
|
265 |
function ReaSpeechControlsUI:render_hotwords()
|
266 |
-
self:
|
267 |
-
|
268 |
-
local rv, value = ImGui.InputText(ctx, '##hotwords', self.hotwords)
|
269 |
-
if rv then
|
270 |
-
self.hotwords = value
|
271 |
-
end
|
272 |
end
|
273 |
|
274 |
function ReaSpeechControlsUI:render_options(column)
|
275 |
self:render_input_label('Options')
|
276 |
|
277 |
-
|
278 |
-
if column.width < self.NARROW_COLUMN_WIDTH then
|
279 |
-
vad_label = "VAD"
|
280 |
-
end
|
281 |
-
local rv, value = ImGui.Checkbox(ctx, vad_label, self.vad_filter)
|
282 |
-
if rv then
|
283 |
-
self.vad_filter = value
|
284 |
-
end
|
285 |
end
|
286 |
|
287 |
function ReaSpeechControlsUI:render_logging()
|
288 |
self:render_input_label('Logging')
|
289 |
|
290 |
-
|
291 |
-
if rv then
|
292 |
-
self.log_enable = value
|
293 |
-
end
|
294 |
|
295 |
-
if self.log_enable then
|
296 |
ImGui.SameLine(ctx)
|
297 |
-
|
298 |
-
if rv then
|
299 |
-
self.log_debug = value
|
300 |
-
end
|
301 |
end
|
302 |
end
|
303 |
|
304 |
function ReaSpeechControlsUI:render_initial_prompt()
|
305 |
-
self:
|
306 |
-
|
307 |
-
rv, value = ImGui.InputText(ctx, '##initial_prompt', self.initial_prompt)
|
308 |
-
if rv then
|
309 |
-
self.initial_prompt = value
|
310 |
-
end
|
311 |
end
|
|
|
5 |
]]--
|
6 |
|
7 |
ReaSpeechControlsUI = Polo {
|
8 |
+
DEFAULT_TAB = 'simple',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
DEFAULT_LANGUAGE = '',
|
11 |
DEFAULT_MODEL_NAME = 'small',
|
|
|
23 |
NARROW_COLUMN_WIDTH = 150,
|
24 |
}
|
25 |
|
26 |
+
function ReaSpeechControlsUI:init()
|
27 |
+
self.tabs = ReaSpeechTabBar.new {
|
28 |
+
default = self.DEFAULT_TAB,
|
29 |
+
tabs = {
|
30 |
+
ReaSpeechTabBar.tab('simple', 'Simple'),
|
31 |
+
ReaSpeechTabBar.tab('advanced', 'Advanced'),
|
32 |
+
}
|
33 |
+
}
|
34 |
|
35 |
+
self.log_enable = ReaSpeechCheckbox.simple(false, 'Enable')
|
36 |
+
self.log_debug = ReaSpeechCheckbox.simple(false, 'Debug')
|
|
|
37 |
|
38 |
+
self.language = ReaSpeechCombo.new {
|
39 |
+
default = self.DEFAULT_LANGUAGE,
|
40 |
+
label = 'Language',
|
41 |
+
items = WhisperLanguages.LANGUAGE_CODES,
|
42 |
+
item_labels = WhisperLanguages.LANGUAGES
|
43 |
+
}
|
44 |
|
45 |
+
self.translate = ReaSpeechCheckbox.new {
|
46 |
+
default = false,
|
47 |
+
label_long = 'Translate to English',
|
48 |
+
label_short = 'Translate',
|
49 |
+
width_threshold = self.NARROW_COLUMN_WIDTH
|
50 |
+
}
|
51 |
|
52 |
+
self.hotwords = ReaSpeechTextInput.simple('', 'Hot Words')
|
53 |
+
self.initial_prompt = ReaSpeechTextInput.simple('', 'Initial Prompt')
|
54 |
+
self.model_name = ReaSpeechTextInput.simple(self.DEFAULT_MODEL_NAME, 'Model Name')
|
55 |
|
56 |
+
self.vad_filter = ReaSpeechCheckbox.new {
|
57 |
+
default = true,
|
58 |
+
label_long = 'Voice Activity Detection',
|
59 |
+
label_short = 'VAD',
|
60 |
+
width_threshold = self.NARROW_COLUMN_WIDTH
|
61 |
+
}
|
62 |
|
63 |
+
self.model_name_buttons = ReaSpeechButtonBar.new {
|
64 |
+
default = self.DEFAULT_MODEL_NAME,
|
65 |
+
label = 'Model Name',
|
66 |
+
buttons = self.SIMPLE_MODEL_SIZES,
|
67 |
+
column_padding = self.COLUMN_PADDING,
|
68 |
+
margin_bottom = self.MARGIN_BOTTOM,
|
69 |
+
margin_left = self.MARGIN_LEFT,
|
70 |
+
margin_right = self.MARGIN_RIGHT,
|
71 |
+
}
|
72 |
+
self.model_name_buttons.on_set = function()
|
73 |
+
self.model_name:set(self.model_name_buttons:value())
|
74 |
+
end
|
75 |
|
76 |
self:init_layouts()
|
77 |
end
|
78 |
|
79 |
function ReaSpeechControlsUI:get_request_data()
|
80 |
return {
|
81 |
+
language = self.language:value(),
|
82 |
+
translate = self.translate:value(),
|
83 |
+
hotwords = self.hotwords:value(),
|
84 |
+
initial_prompt = self.initial_prompt:value(),
|
85 |
+
model_name = self.model_name:value(),
|
86 |
+
vad_filter = self.vad_filter:value(),
|
87 |
}
|
88 |
end
|
89 |
|
90 |
function ReaSpeechControlsUI:init_layouts()
|
|
|
91 |
self:init_advanced_layouts()
|
92 |
end
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
function ReaSpeechControlsUI:init_advanced_layouts()
|
95 |
local renderers = {
|
96 |
{self.render_model_name, self.render_hotwords, self.render_language},
|
|
|
118 |
|
119 |
function ReaSpeechControlsUI:render()
|
120 |
self:render_heading()
|
121 |
+
if self.tabs:value() == 'advanced' then
|
122 |
self:render_advanced()
|
123 |
else
|
124 |
self:render_simple()
|
|
|
134 |
app.png_from_bytes('reaspeech-logo-small')
|
135 |
|
136 |
ImGui.SetCursorPos(ctx, init_x + self.MARGIN_LEFT + 2, init_y)
|
137 |
+
self.tabs:render()
|
138 |
|
139 |
ImGui.SetCursorPos(ctx, ImGui.GetWindowWidth(ctx) - 55, init_y)
|
140 |
app.png_from_bytes('heading-logo-tech-audio')
|
|
|
142 |
ImGui.SetCursorPos(ctx, init_x, init_y + 40)
|
143 |
end
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
function ReaSpeechControlsUI:render_simple()
|
146 |
+
self.model_name_buttons:render()
|
147 |
end
|
148 |
|
149 |
function ReaSpeechControlsUI:render_advanced()
|
|
|
158 |
end
|
159 |
|
160 |
function ReaSpeechControlsUI:render_language(column)
|
161 |
+
self.language:render()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
+
self.translate:render(column)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
end
|
165 |
|
166 |
function ReaSpeechControlsUI:render_model_name()
|
167 |
+
self.model_name:render()
|
|
|
|
|
|
|
|
|
|
|
168 |
end
|
169 |
|
170 |
function ReaSpeechControlsUI:render_model_sizes()
|
|
|
172 |
end
|
173 |
|
174 |
function ReaSpeechControlsUI:render_hotwords()
|
175 |
+
self.hotwords:render()
|
|
|
|
|
|
|
|
|
|
|
176 |
end
|
177 |
|
178 |
function ReaSpeechControlsUI:render_options(column)
|
179 |
self:render_input_label('Options')
|
180 |
|
181 |
+
self.vad_filter:render(column)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
end
|
183 |
|
184 |
function ReaSpeechControlsUI:render_logging()
|
185 |
self:render_input_label('Logging')
|
186 |
|
187 |
+
self.log_enable:render()
|
|
|
|
|
|
|
188 |
|
189 |
+
if self.log_enable:value() then
|
190 |
ImGui.SameLine(ctx)
|
191 |
+
self.log_debug:render()
|
|
|
|
|
|
|
192 |
end
|
193 |
end
|
194 |
|
195 |
function ReaSpeechControlsUI:render_initial_prompt()
|
196 |
+
self.initial_prompt:render()
|
|
|
|
|
|
|
|
|
|
|
197 |
end
|
reascripts/ReaSpeech/source/ReaSpeechEULAContent.lua
DELETED
@@ -1,233 +0,0 @@
|
|
1 |
-
ReaSpeechEULAContent = [=[teamaud.io LLC
|
2 |
-
|
3 |
-
End User License Agreement
|
4 |
-
|
5 |
-
Important – Use of this Software is subject to license restrictions.
|
6 |
-
Carefully read this license agreement before using the software.
|
7 |
-
|
8 |
-
This End User License Agreement (this “Agreement”) is a legal
|
9 |
-
agreement between you, either individually or as an authorized
|
10 |
-
representative of the company or organization acquiring the license, and
|
11 |
-
teamaud.io LLC (“Team Audio”). THE DOWNLOAD AND USE OF THE SOFTWARE
|
12 |
-
INDICATES YOUR COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND
|
13 |
-
CONDITIONS SET FORTH IN THIS AGREEMENT. If you do not agree to these
|
14 |
-
terms and conditions, do not download or otherwise use the Software.
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
1. License Grant
|
19 |
-
|
20 |
-
a. The software programs you are installing, downloading, or have
|
21 |
-
acquired with this Agreement, including any audio plug-in, updates,
|
22 |
-
upgrades, modifications, revisions, copies, online materials and design
|
23 |
-
data (the “Software”) are copyrighted, proprietary information of
|
24 |
-
Team Audio and its affiliates, who maintain exclusive title to all
|
25 |
-
Software and retain all rights not expressly granted by this Agreement.
|
26 |
-
Team Audio grants to you, subject to your continued compliance with the
|
27 |
-
terms and conditions set forth in this Agreement, a non-exclusive,
|
28 |
-
non-transferable, revocable license to use a single copy of the Software
|
29 |
-
owned or distributed by Team Audio on up to three (3) computers owned or
|
30 |
-
controlled by you in machine readable, object-code form for your
|
31 |
-
personal home entertainment and commercial use on a compatible
|
32 |
-
electronic device, or for such use otherwise authorized by Team Audio.
|
33 |
-
|
34 |
-
2. Restrictions and Intellectual Property Ownership
|
35 |
-
|
36 |
-
a. You may not, without Team Audio’s prior written consent, (i)
|
37 |
-
decompile, disassemble or reverse engineer the Software or otherwise
|
38 |
-
attempt to gain access to its source code, except to the extent that
|
39 |
-
such restrictions are expressly prohibited by law; (ii) copy, offer for
|
40 |
-
public display, translate, adapt, modify or otherwise alter the
|
41 |
-
Software, or create derivative works thereof, including derivative works
|
42 |
-
with respect to artwork contained in the Software, except to the extent
|
43 |
-
that such restrictions are expressly prohibited by law; (iii) rent,
|
44 |
-
lease, loan, sublicense or distribute the Software, or offer it on a
|
45 |
-
pay-per-play, coin-op or other for charge (or free) basis; (iv) use the
|
46 |
-
Software to infringe the copyrights or other intellectual property
|
47 |
-
rights of others in any way; (v) remove, circumvent, disable, damage or
|
48 |
-
otherwise interfere with security-related or limiting features of the
|
49 |
-
Software, and/or (vi) modify or delete the copyright and other
|
50 |
-
proprietary rights notices on or in the Software.
|
51 |
-
|
52 |
-
b. The Software, which is copyrighted, including any modifications,
|
53 |
-
upgrades, or updates thereto, is the sole and exclusive property of Team
|
54 |
-
Audio and is a valuable asset and trade secret of Team Audio. Team
|
55 |
-
Audio retains all ownership and intellectual property rights to the
|
56 |
-
Software and to any modifications, upgrades, or updates thereto. Except
|
57 |
-
for the rights granted herein, you shall have no right, title, or
|
58 |
-
interest of any kind in or to the Software.
|
59 |
-
|
60 |
-
3. Additional Restrictions for Demo Version
|
61 |
-
|
62 |
-
If the Software was provided to you for demo use for a limited period of
|
63 |
-
time and/or number of uses, you agree not to use the Software beyond the
|
64 |
-
expiration or termination of the demo period. You acknowledge and agree
|
65 |
-
that the Software may include code designed to prevent you from
|
66 |
-
exceeding these limits, and that such code may remain on your computer
|
67 |
-
or device after deletion of the Software to prevent you from installing
|
68 |
-
another copy of the Software and repeating the demo.
|
69 |
-
|
70 |
-
4. Term and Termination.
|
71 |
-
|
72 |
-
a. This Agreement remains effective until expiration or termination.
|
73 |
-
This Agreement will immediately terminate upon notice if you exceed the
|
74 |
-
scope of the license granted or otherwise fail to comply with the
|
75 |
-
provisions in sections 1, 2, and 3 above. For any other material breach
|
76 |
-
of the Agreement, Team Audio may terminate this Agreement if you are in
|
77 |
-
breach and fail to cure the breach within thirty (30) days of written
|
78 |
-
notification. If Software is provided for a limited term use, this
|
79 |
-
Agreement will automatically expire at the end of the authorized term.
|
80 |
-
|
81 |
-
b. Upon termination of this Agreement for any reason, you agree to
|
82 |
-
delete from any permanent machine storage (i.e., hard disk) previously
|
83 |
-
loaded copies of the Software in all forms. Upon request of Team Audio,
|
84 |
-
you shall certify in writing that all copies of the Software and
|
85 |
-
associated documentation have been destroyed or returned to Team Audio.
|
86 |
-
The indemnity and limitation of liability obligations hereunder, as well
|
87 |
-
as your obligations with respect to confidential treatment of the
|
88 |
-
Software and Team Audio’s trade secrets, other intellectual property,
|
89 |
-
and proprietary information, shall survive the termination of this
|
90 |
-
Agreement.
|
91 |
-
|
92 |
-
5. Disclaimer of Warranties.
|
93 |
-
|
94 |
-
TEAM AUDIO DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED,
|
95 |
-
INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
96 |
-
PARTICULAR PURPOSE. TEAM AUDIO MAKES NO WARRANTY THAT ANY SOFTWARE WILL
|
97 |
-
PERFORM ERROR-FREE OR UNINTERRUPTED, OR THAT ALL ERRORS THEREIN CAN OR
|
98 |
-
WILL BE CORRECTED. TEAM AUDIO FURTHER DISCLAIMS ANY IMPLIED WARRANTIES
|
99 |
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
100 |
-
NON-INFRINGEMENT AND ANY WARRANTIES ARISING FROM COURSE OF PERFORMANCE,
|
101 |
-
COURSE OF DEALING OR USAGE OF TRADE. IN ADDITION, YOU ACKNOWLEDGE THAT
|
102 |
-
TEAM AUDIO IS NOT RESPONSIBLE FOR THE INTERNET OR WHETHER IT SHOULD
|
103 |
-
CONTINUE TO EXIST IN ITS PRESENT FORM OR WHETHER OR NOT A GOVERNMENT OR
|
104 |
-
GOVERNMENTAL AGENCY, EITHER FOREIGN OR DOMESTIC, WILL CONTROL, REGULATE
|
105 |
-
OR DISBAND THE INTERNET. USE OF THE INTERNET IS AT YOUR SOLE RISK.
|
106 |
-
|
107 |
-
6. Indemnity; Responsibility
|
108 |
-
|
109 |
-
a. In the event that some or all of the Software is held or is believed
|
110 |
-
by Team Audio to infringe upon patent or copyrights of third parties,
|
111 |
-
Team Audio shall have the option, at its expense: (i) to modify the
|
112 |
-
Software to be non-infringing; or (ii) to obtain for you a license to
|
113 |
-
continue using the Software. If it is not commercially feasible to
|
114 |
-
perform either of the above options, then Team Audio may require from
|
115 |
-
you return of the infringing Software and all rights thereto. Upon
|
116 |
-
return of the infringing Software to Team Audio, you may terminate the
|
117 |
-
Agreement with ten (10) days’ written notice. This subsection sets
|
118 |
-
forth Team Audio’s entire liability and exclusive remedy for
|
119 |
-
infringement.
|
120 |
-
|
121 |
-
b. You will defend and indemnify Team Audio and its affiliates against
|
122 |
-
any claim incurred by, borne by or asserted against Team Audio or its
|
123 |
-
affiliates that relates to or results from (i) your use of the Software,
|
124 |
-
(ii) any intentional or willful conduct or negligence by you or (iii)
|
125 |
-
any breach of an applicable representation, covenant or warranty
|
126 |
-
contained herein.
|
127 |
-
|
128 |
-
c. In no event shall Team Audio be held responsible for any damage in
|
129 |
-
the event your passwords are disclosed, including but limited to any
|
130 |
-
damage that occurs to your account, your characters or your scores.
|
131 |
-
Further, Team Audio shall not be liable for any financial or emotional
|
132 |
-
damage or distress you may suffer and/or for subsequent loss or damage
|
133 |
-
to your Account, characters, scores as a result of the disclosure of
|
134 |
-
your passwords to a third party. You shall not disclose your passwords
|
135 |
-
to any third party or allow anyone to use your password to access your
|
136 |
-
account, or to use the Software. It is also prohibited to obtain,
|
137 |
-
attempt to obtain, use, or attempt to use the password of anyone else.
|
138 |
-
|
139 |
-
d. You are solely responsible for any and all telecommunications or
|
140 |
-
other connectivity charges incurred through your use of the application.
|
141 |
-
|
142 |
-
7. Confidentiality
|
143 |
-
|
144 |
-
You agree that you will not, directly or indirectly, copy the structure,
|
145 |
-
sequence, or organization of the Software, nor will you copy any portion
|
146 |
-
of the Software or related documentation to produce software programs
|
147 |
-
that are substantially similar to the Software.
|
148 |
-
|
149 |
-
8. LIMITATION OF LIABILITY
|
150 |
-
|
151 |
-
EXCEPT WHERE THIS EXCLUSION OR RESTRICTION OF LIABILITY WOULD BE VOID OR
|
152 |
-
INEFFECTIVE UNDER APPLICABLE LAW, IN NO EVENT WILL TEAM AUDIO BE LIABLE
|
153 |
-
FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, OR
|
154 |
-
DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA, OR USE, INCURRED BY YOU OR
|
155 |
-
ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF TEAM
|
156 |
-
AUDIO OR ANY OTHER PERSON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
157 |
-
DAMAGES. TEAM AUDIO’S LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO
|
158 |
-
EVENT EXCEED THE AMOUNT OF FEES PAID BY YOU FOR THE SOFTWARE OR SERVICE
|
159 |
-
GIVING RISE TO THE CLAIM. IN THE CASE WHERE NO AMOUNT WAS PAID, TEAM
|
160 |
-
AUDIO SHALL HAVE NO LIABILITY FOR ANY DAMAGES WHATSOEVER.
|
161 |
-
|
162 |
-
9. Assignment; Jurisdiction.
|
163 |
-
|
164 |
-
This Agreement will be binding upon, and will inure to the benefit of,
|
165 |
-
the permitted successors and assigns of each party hereto. You may not
|
166 |
-
assign, delegate, transfer, or otherwise convey this Agreement, or any
|
167 |
-
of its rights hereunder, to any entity without the prior written consent
|
168 |
-
of Team Audio, which consent Team Audio may give or withhold in its sole
|
169 |
-
discretion, and any attempted assignment or delegation without such
|
170 |
-
consent shall be void. This Agreement, and all matters arising out of
|
171 |
-
or relating to this Agreement, shall be governed by the laws of the
|
172 |
-
State of Texas, United States of America. Any legal action or
|
173 |
-
proceeding relating to this Agreement shall be instituted in any state
|
174 |
-
or federal court in Travis County, Texas, United States of America.
|
175 |
-
Team Audio and you agree to submit to the jurisdiction of, and agree
|
176 |
-
that venue is proper in, the aforesaid courts in any such legal action
|
177 |
-
or proceeding.
|
178 |
-
|
179 |
-
10. Severability; Waiver
|
180 |
-
|
181 |
-
In the event any provision of this Agreement is held to be invalid or
|
182 |
-
unenforceable, the remaining provisions of this Agreement will remain in
|
183 |
-
full force. The waiver by either party of any default or breach of this
|
184 |
-
Agreement shall not constitute a waiver of any other or subsequent
|
185 |
-
default or breach. Except for actions for nonpayment or breach of
|
186 |
-
either party’s intellectual property rights, no action, regardless of
|
187 |
-
form, arising out of this Agreement may be brought by either party more
|
188 |
-
than two years after the cause of action has accrued. The headings
|
189 |
-
appearing in this Agreement are inserted for convenience only, and will
|
190 |
-
not be used to define, limit or enlarge the scope of this Agreement or
|
191 |
-
any of the obligations herein.
|
192 |
-
|
193 |
-
11. Interpretation; Compliance.
|
194 |
-
|
195 |
-
This Agreement constitutes the complete agreement between the Parties
|
196 |
-
and supersedes all previous and contemporaneous agreements, proposals,
|
197 |
-
or representations, written or oral, concerning the subject matter of
|
198 |
-
this Agreement. This Agreement may not be modified or amended except in
|
199 |
-
a writing signed by you and Team Audio; no other act, document, usage,
|
200 |
-
or custom shall be deemed to amend or modify this Agreement. It is
|
201 |
-
expressly agreed that the terms and conditions of this Agreement
|
202 |
-
supersede the terms of any purchase order. Each party agrees to comply
|
203 |
-
with all relevant export laws and regulations of the United States and
|
204 |
-
the country or territory in which the Services are provided (“Export
|
205 |
-
Laws”) to assure that neither any deliverable, if any, nor any direct
|
206 |
-
product thereof is (a) exported, directly or indirectly, in violation of
|
207 |
-
Export Laws or (b) intended to be used for any purposes prohibited by
|
208 |
-
the Export Laws, including without limitation nuclear, chemical, or
|
209 |
-
biological weapons proliferation. Each party agrees to comply with all
|
210 |
-
federal, state and local laws and regulations applicable to this
|
211 |
-
Agreement. Each party represents and warrants that it is qualified to
|
212 |
-
do business in the geographies in which it will perform its obligations
|
213 |
-
under this Agreement, and will obtain all necessary licenses and
|
214 |
-
permits, and satisfy any other legal, regulatory and administrative
|
215 |
-
requirements, necessary to its performance hereunder.
|
216 |
-
|
217 |
-
13. Notices; How to Contact Team Audio
|
218 |
-
|
219 |
-
The Software is made available to you by Team Audio, LLC located at 611
|
220 |
-
Cloud Ct., Round Rock, TX 78681 (or at an updated address posted online
|
221 |
-
at HYPERLINK "https://teamaud.io/" https://teamaud.io/ ). If you
|
222 |
-
have any questions about the Software, you may contact Team Audio at
|
223 | |
224 |
-
|
225 |
-
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS
|
226 |
-
AGREEMENT, AND YOU UNDERSTAND THAT, BY CONTINUING THE DOWNLOAD OR
|
227 |
-
INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY
|
228 |
-
PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER OR MOBILE DEVICE HARD
|
229 |
-
DRIVE, COMPUTER RAM, OR OTHER STORAGE, YOU AGREE TO BE BOUND BY THE
|
230 |
-
TERMS AND CONDITIONS OF THIS AGREEMENT.
|
231 |
-
|
232 |
-
Last updated: June 2022
|
233 |
-
]=]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reascripts/ReaSpeech/source/ReaSpeechProductActivation.lua
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
--[[
|
2 |
-
|
3 |
-
ReaSpeechProductActivation.lua - Product key entry and activation checks
|
4 |
-
|
5 |
-
]]--
|
6 |
-
|
7 |
-
ReaSpeechProductActivation = Polo {
|
8 |
-
ACTIVATION_URL = "https://techaud.io/ProductActivationDeveloper.php",
|
9 |
-
|
10 |
-
PRODUCT_ID = 79004057,
|
11 |
-
PRODUCT_CHECK_COUNT = 4,
|
12 |
-
PRODUCT_NAME = "ReaSpeech",
|
13 |
-
|
14 |
-
config = nil,
|
15 |
-
|
16 |
-
-- nil = not activated
|
17 |
-
-- 'pending' = activation in process
|
18 |
-
-- 'activated' = activation complete
|
19 |
-
state = nil,
|
20 |
-
activation_message =""
|
21 |
-
}
|
22 |
-
|
23 |
-
function ReaSpeechProductActivation:init()
|
24 |
-
self:init_config()
|
25 |
-
self:activation_state_check()
|
26 |
-
end
|
27 |
-
|
28 |
-
function ReaSpeechProductActivation:init_config()
|
29 |
-
self.config = OptionsConfig:new {
|
30 |
-
section = 'ReaSpeech',
|
31 |
-
options = {
|
32 |
-
product_run_check_count = {'number', 0},
|
33 |
-
product_license = {'string', ''},
|
34 |
-
product_license_value = {'string', ''},
|
35 |
-
eula_signed = {'boolean', false},
|
36 |
-
}
|
37 |
-
}
|
38 |
-
end
|
39 |
-
|
40 |
-
function ReaSpeechProductActivation:is_activated()
|
41 |
-
return self.state == 'activated' and self.config:get('eula_signed')
|
42 |
-
end
|
43 |
-
|
44 |
-
function ReaSpeechProductActivation:activation_state_check()
|
45 |
-
local has_l = self.config:exists('product_license')
|
46 |
-
local has_lv = self.config:exists('product_license_value')
|
47 |
-
|
48 |
-
if has_l and has_lv then
|
49 |
-
local count = self.config:get('product_run_check_count')
|
50 |
-
|
51 |
-
if count > self.PRODUCT_CHECK_COUNT then
|
52 |
-
self.state = 'pending'
|
53 |
-
self:handle_product_activation_recheck()
|
54 |
-
else
|
55 |
-
self.state = 'activated'
|
56 |
-
self.config:set('product_run_check_count', count + 1)
|
57 |
-
end
|
58 |
-
else
|
59 |
-
self.state = nil
|
60 |
-
end
|
61 |
-
end
|
62 |
-
|
63 |
-
function ReaSpeechProductActivation:handle_product_activation(product_key)
|
64 |
-
product_key = string.gsub(product_key, "%s+", "")
|
65 |
-
if #product_key == 0 then
|
66 |
-
self.state = nil
|
67 |
-
return
|
68 |
-
end
|
69 |
-
|
70 |
-
local process_result = self:send_activation_request(product_key, false)
|
71 |
-
|
72 |
-
if process_result then
|
73 |
-
self:process_activation_reply(product_key, process_result)
|
74 |
-
end
|
75 |
-
|
76 |
-
end
|
77 |
-
|
78 |
-
function ReaSpeechProductActivation:handle_product_activation_recheck()
|
79 |
-
local process_result = self:send_activation_request(self.config:get('product_license'), true)
|
80 |
-
|
81 |
-
if process_result then
|
82 |
-
if string.find(process_result, "SUCCESS") then
|
83 |
-
self.state = 'activated'
|
84 |
-
self.config:set('product_run_check_count', 0)
|
85 |
-
elseif string.find(process_result, "FAILURE") then
|
86 |
-
self.state = nil
|
87 |
-
self.config:delete('product_license')
|
88 |
-
self.config:delete('product_license_value')
|
89 |
-
else
|
90 |
-
-- Connection failed, silently ignore
|
91 |
-
self.state = 'activated'
|
92 |
-
end
|
93 |
-
else
|
94 |
-
-- Command failed, silently ignore
|
95 |
-
self.state = 'activated'
|
96 |
-
end
|
97 |
-
end
|
98 |
-
|
99 |
-
function ReaSpeechProductActivation:send_activation_request(product_key, is_recheck)
|
100 |
-
local curl = "curl"
|
101 |
-
if not reaper.GetOS():find("Win") then
|
102 |
-
curl = "/usr/bin/curl"
|
103 |
-
end
|
104 |
-
|
105 |
-
local cmd_data_id = "user_product_id=" .. self.PRODUCT_ID
|
106 |
-
local cmd_data_license = "user_license=" .. product_key
|
107 |
-
local cmd_data_p_n = "user_product_name=" .. self.PRODUCT_NAME
|
108 |
-
local cmd_data_p_v = "user_product_version=" .. ReaSpeechUI.VERSION
|
109 |
-
local cmd_data_recheck = "recheck=" .. tostring(is_recheck)
|
110 |
-
|
111 |
-
local cmd_args = (
|
112 |
-
curl.." -X POST"
|
113 |
-
.. " -d " .. cmd_data_id
|
114 |
-
.. " -d " .. cmd_data_license
|
115 |
-
.. " -d " .. cmd_data_p_n
|
116 |
-
.. " -d " .. cmd_data_p_v
|
117 |
-
.. " -d " .. cmd_data_recheck
|
118 |
-
.. " \"" .. self.ACTIVATION_URL .. "\""
|
119 |
-
)
|
120 |
-
|
121 |
-
local process_result = reaper.ExecProcess(cmd_args, 8000)
|
122 |
-
if process_result then
|
123 |
-
return process_result
|
124 |
-
else
|
125 |
-
self.activation_message = "Activation failed: Connection Error"
|
126 |
-
reaper.ShowConsoleMsg("Failed CURL at activation request" .. '\n')
|
127 |
-
return nil
|
128 |
-
end
|
129 |
-
|
130 |
-
end
|
131 |
-
|
132 |
-
function ReaSpeechProductActivation:process_activation_reply(product_key, process_result)
|
133 |
-
process_result = string.gsub(process_result, "%s+", "")
|
134 |
-
|
135 |
-
if string.find(process_result, "SUCCESS") then
|
136 |
-
self.config:set('product_run_check_count', 1)
|
137 |
-
self.config:set('product_license', product_key)
|
138 |
-
self.config:set('product_license_value', process_result)
|
139 |
-
|
140 |
-
self.state = 'activated'
|
141 |
-
self.activation_message = "Thanks for your support! Enjoy :)"
|
142 |
-
elseif string.find(process_result, "FAILURE") then
|
143 |
-
self.state = nil
|
144 |
-
if string.find(process_result, "Invalid_License") then
|
145 |
-
self.activation_message = "Activation failed: Sorry, we didn't find a valid license :("
|
146 |
-
else
|
147 |
-
self.activation_message = "Activation failed: Sorry, you are out of activations :("
|
148 |
-
end
|
149 |
-
|
150 |
-
end
|
151 |
-
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reascripts/ReaSpeech/source/ReaSpeechProductActivationUI.lua
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
--[[
|
2 |
-
|
3 |
-
ReaSpeechProductActivationUI.lua - ReaSpeech Product Activation UI
|
4 |
-
|
5 |
-
]]--
|
6 |
-
|
7 |
-
ReaSpeechProductActivationUI = Polo {
|
8 |
-
LARGE_ITEM_WIDTH = 375,
|
9 |
-
}
|
10 |
-
|
11 |
-
function ReaSpeechProductActivationUI:init()
|
12 |
-
assert(self.product_activation, 'missing product activation')
|
13 |
-
self.license_input = ''
|
14 |
-
end
|
15 |
-
|
16 |
-
function ReaSpeechProductActivationUI:render()
|
17 |
-
if self.product_activation.state ~= "activated" then
|
18 |
-
self:render_activation_inputs()
|
19 |
-
return
|
20 |
-
end
|
21 |
-
|
22 |
-
if not self.product_activation.config:get('eula_signed') then
|
23 |
-
self:render_EULA_inputs()
|
24 |
-
return
|
25 |
-
end
|
26 |
-
end
|
27 |
-
|
28 |
-
function ReaSpeechProductActivationUI:render_activation_inputs()
|
29 |
-
ImGui.Text(ctx, ('Welcome to ReaSpeech by Tech Audio'))
|
30 |
-
ImGui.Dummy(ctx, self.LARGE_ITEM_WIDTH, 25)
|
31 |
-
ImGui.Text(ctx, ('Please enter your license key to get started'))
|
32 |
-
ImGui.Dummy(ctx, self.LARGE_ITEM_WIDTH, 5)
|
33 |
-
ImGui.PushItemWidth(ctx, self.LARGE_ITEM_WIDTH)
|
34 |
-
app:trap(function ()
|
35 |
-
local rv, value = ImGui.InputText(ctx, '##', self.license_input)
|
36 |
-
if rv then
|
37 |
-
self.license_input = value
|
38 |
-
end
|
39 |
-
if self.product_activation.activation_message ~= "" then
|
40 |
-
--Possibly make this ColorText with and change depending on message
|
41 |
-
ImGui.SameLine(ctx)
|
42 |
-
ImGui.Text(ctx, self.product_activation.activation_message)
|
43 |
-
end
|
44 |
-
end)
|
45 |
-
ImGui.PopItemWidth(ctx)
|
46 |
-
ImGui.Dummy(ctx, self.LARGE_ITEM_WIDTH, 30)
|
47 |
-
if ImGui.Button(ctx, "Submit") then
|
48 |
-
self:handle_product_activation(self.license_input)
|
49 |
-
end
|
50 |
-
end
|
51 |
-
|
52 |
-
function ReaSpeechProductActivationUI:render_EULA_inputs()
|
53 |
-
ImGui.PushItemWidth(ctx, self.LARGE_ITEM_WIDTH)
|
54 |
-
app:trap(function ()
|
55 |
-
ImGui.Text(ctx, 'EULA')
|
56 |
-
ImGui.Dummy(ctx, self.LARGE_ITEM_WIDTH, 25)
|
57 |
-
ImGui.TextWrapped(ctx, ReaSpeechEULAContent)
|
58 |
-
ImGui.Dummy(ctx, self.LARGE_ITEM_WIDTH, 25)
|
59 |
-
if ImGui.Button(ctx, "Agree") then
|
60 |
-
self.product_activation.config:set('eula_signed', true)
|
61 |
-
end
|
62 |
-
end)
|
63 |
-
ImGui.PopItemWidth(ctx)
|
64 |
-
end
|
65 |
-
|
66 |
-
function ReaSpeechProductActivationUI:handle_product_activation(input_license)
|
67 |
-
--reaper.ShowConsoleMsg(tostring(input_license) .. '\n')
|
68 |
-
self.product_activation:handle_product_activation(input_license)
|
69 |
-
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reascripts/ReaSpeech/source/ReaSpeechUI.lua
CHANGED
@@ -25,7 +25,7 @@ function ReaSpeechUI:init()
|
|
25 |
self.responses = {}
|
26 |
self.logs = {}
|
27 |
|
28 |
-
ReaSpeechAPI:init(
|
29 |
|
30 |
self.worker = ReaSpeechWorker.new({
|
31 |
requests = self.requests,
|
@@ -33,11 +33,6 @@ function ReaSpeechUI:init()
|
|
33 |
logs = self.logs,
|
34 |
})
|
35 |
|
36 |
-
self.product_activation = ReaSpeechProductActivation.new()
|
37 |
-
self.product_activation_ui = ReaSpeechProductActivationUI.new {
|
38 |
-
product_activation = self.product_activation
|
39 |
-
}
|
40 |
-
|
41 |
self.controls_ui = ReaSpeechControlsUI.new()
|
42 |
|
43 |
self.actions_ui = ReaSpeechActionsUI.new({
|
@@ -163,9 +158,9 @@ end
|
|
163 |
function ReaSpeechUI:react_to_logging()
|
164 |
for _, log in pairs(self.logs) do
|
165 |
local msg, dbg = table.unpack(log)
|
166 |
-
if dbg and self.controls_ui.log_enable and self.controls_ui.log_debug then
|
167 |
reaper.ShowConsoleMsg(self:log_time() .. ' [DBG] ' .. tostring(msg) .. '\n')
|
168 |
-
elseif not dbg and self.controls_ui.log_enable then
|
169 |
reaper.ShowConsoleMsg(self:log_time() .. ' [LOG] ' .. tostring(msg) .. '\n')
|
170 |
end
|
171 |
end
|
@@ -177,11 +172,6 @@ function ReaSpeechUI:render()
|
|
177 |
ImGui.PushItemWidth(ctx, self.ITEM_WIDTH)
|
178 |
|
179 |
self:trap(function ()
|
180 |
-
if not self.product_activation:is_activated() then
|
181 |
-
self.product_activation_ui:render()
|
182 |
-
return
|
183 |
-
end
|
184 |
-
|
185 |
self.controls_ui:render()
|
186 |
self.actions_ui:render()
|
187 |
self.transcript_ui:render()
|
|
|
25 |
self.responses = {}
|
26 |
self.logs = {}
|
27 |
|
28 |
+
ReaSpeechAPI:init(Script.host, Script.protocol)
|
29 |
|
30 |
self.worker = ReaSpeechWorker.new({
|
31 |
requests = self.requests,
|
|
|
33 |
logs = self.logs,
|
34 |
})
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
self.controls_ui = ReaSpeechControlsUI.new()
|
37 |
|
38 |
self.actions_ui = ReaSpeechActionsUI.new({
|
|
|
158 |
function ReaSpeechUI:react_to_logging()
|
159 |
for _, log in pairs(self.logs) do
|
160 |
local msg, dbg = table.unpack(log)
|
161 |
+
if dbg and self.controls_ui.log_enable:value() and self.controls_ui.log_debug:value() then
|
162 |
reaper.ShowConsoleMsg(self:log_time() .. ' [DBG] ' .. tostring(msg) .. '\n')
|
163 |
+
elseif not dbg and self.controls_ui.log_enable:value() then
|
164 |
reaper.ShowConsoleMsg(self:log_time() .. ' [LOG] ' .. tostring(msg) .. '\n')
|
165 |
end
|
166 |
end
|
|
|
172 |
ImGui.PushItemWidth(ctx, self.ITEM_WIDTH)
|
173 |
|
174 |
self:trap(function ()
|
|
|
|
|
|
|
|
|
|
|
175 |
self.controls_ui:render()
|
176 |
self.actions_ui:render()
|
177 |
self.transcript_ui:render()
|
reascripts/ReaSpeech/source/ReaSpeechWidgets.lua
ADDED
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
--[[
|
2 |
+
|
3 |
+
ReaSpeechWidgets.lua - collection of common widgets that ReaSpeech uses
|
4 |
+
|
5 |
+
]]--
|
6 |
+
|
7 |
+
ReaSpeechWidget = Polo {
|
8 |
+
}
|
9 |
+
|
10 |
+
function ReaSpeechWidget:init()
|
11 |
+
assert(self.default ~= nil, "default value not provided")
|
12 |
+
assert(self.renderer, "renderer not provided")
|
13 |
+
self.ctx = self.ctx or ctx
|
14 |
+
self.widget_id = self.widget_id or reaper.genGuid()
|
15 |
+
self.on_set = nil
|
16 |
+
end
|
17 |
+
|
18 |
+
function ReaSpeechWidget:render(...)
|
19 |
+
ImGui.PushID(self.ctx, self.widget_id)
|
20 |
+
local args = ...
|
21 |
+
app:trap(function()
|
22 |
+
self.renderer(self, args)
|
23 |
+
end)
|
24 |
+
ImGui.PopID(self.ctx)
|
25 |
+
end
|
26 |
+
|
27 |
+
function ReaSpeechWidget:value()
|
28 |
+
return self._value
|
29 |
+
end
|
30 |
+
|
31 |
+
function ReaSpeechWidget:set(value)
|
32 |
+
self._value = value
|
33 |
+
if self.on_set then self:on_set() end
|
34 |
+
end
|
35 |
+
|
36 |
+
-- Widget Implementations
|
37 |
+
|
38 |
+
ReaSpeechCheckbox = {}
|
39 |
+
ReaSpeechCheckbox.new = function (options)
|
40 |
+
options = options or {
|
41 |
+
default = nil,
|
42 |
+
label_long = nil,
|
43 |
+
label_short = nil,
|
44 |
+
width_threshold = nil,
|
45 |
+
}
|
46 |
+
|
47 |
+
local o = ReaSpeechWidget.new({
|
48 |
+
default = options.default,
|
49 |
+
widget_id = options.widget_id,
|
50 |
+
renderer = ReaSpeechCheckbox.renderer,
|
51 |
+
options = options,
|
52 |
+
})
|
53 |
+
|
54 |
+
o._value = o.default
|
55 |
+
|
56 |
+
return o
|
57 |
+
end
|
58 |
+
|
59 |
+
ReaSpeechCheckbox.simple = function(default_value, label)
|
60 |
+
return ReaSpeechCheckbox.new {
|
61 |
+
default = default_value,
|
62 |
+
label_long = label,
|
63 |
+
label_short = label,
|
64 |
+
width_threshold = 0
|
65 |
+
}
|
66 |
+
end
|
67 |
+
|
68 |
+
ReaSpeechCheckbox.renderer = function (self, column)
|
69 |
+
local options = self.options
|
70 |
+
local label = options.label_long
|
71 |
+
|
72 |
+
if column and column.width < options.width_threshold then
|
73 |
+
label = options.label_short
|
74 |
+
end
|
75 |
+
|
76 |
+
local rv, value = ImGui.Checkbox(self.ctx, label, self:value())
|
77 |
+
|
78 |
+
if rv then
|
79 |
+
self:set(value)
|
80 |
+
end
|
81 |
+
end
|
82 |
+
|
83 |
+
ReaSpeechTextInput = {}
|
84 |
+
ReaSpeechTextInput.new = function (options)
|
85 |
+
options = options or {
|
86 |
+
default = nil,
|
87 |
+
label = nil,
|
88 |
+
}
|
89 |
+
|
90 |
+
local o = ReaSpeechWidget.new({
|
91 |
+
default = options.default,
|
92 |
+
widget_id = options.widget_id,
|
93 |
+
renderer = ReaSpeechTextInput.renderer,
|
94 |
+
options = options,
|
95 |
+
})
|
96 |
+
|
97 |
+
o._value = o.default
|
98 |
+
|
99 |
+
return o
|
100 |
+
end
|
101 |
+
|
102 |
+
ReaSpeechTextInput.simple = function(default_value, label)
|
103 |
+
return ReaSpeechTextInput.new {
|
104 |
+
default = default_value,
|
105 |
+
label = label
|
106 |
+
}
|
107 |
+
end
|
108 |
+
|
109 |
+
ReaSpeechTextInput.renderer = function (self)
|
110 |
+
local options = self.options
|
111 |
+
|
112 |
+
ImGui.Text(self.ctx, options.label)
|
113 |
+
ImGui.Dummy(self.ctx, 0, 0)
|
114 |
+
|
115 |
+
local imgui_label = ("##%s"):format(options.label)
|
116 |
+
|
117 |
+
local rv, value = ImGui.InputText(self.ctx, imgui_label, self:value())
|
118 |
+
|
119 |
+
if rv then
|
120 |
+
self:set(value)
|
121 |
+
end
|
122 |
+
end
|
123 |
+
|
124 |
+
ReaSpeechCombo = {}
|
125 |
+
|
126 |
+
ReaSpeechCombo.new = function (options)
|
127 |
+
options = options or {
|
128 |
+
default = nil,
|
129 |
+
label = nil,
|
130 |
+
items = {},
|
131 |
+
item_labels = {},
|
132 |
+
}
|
133 |
+
|
134 |
+
local o = ReaSpeechWidget.new({
|
135 |
+
default = options.default,
|
136 |
+
widget_id = options.widget_id,
|
137 |
+
renderer = ReaSpeechCombo.renderer,
|
138 |
+
options = options,
|
139 |
+
})
|
140 |
+
|
141 |
+
o._value = o.default
|
142 |
+
|
143 |
+
return o
|
144 |
+
end
|
145 |
+
|
146 |
+
ReaSpeechCombo.renderer = function (self)
|
147 |
+
local options = self.options
|
148 |
+
|
149 |
+
ImGui.Text(self.ctx, options.label)
|
150 |
+
ImGui.Dummy(self.ctx, 0, 0)
|
151 |
+
|
152 |
+
local imgui_label = ("##%s"):format(options.label)
|
153 |
+
|
154 |
+
if ImGui.BeginCombo(self.ctx, imgui_label, options.item_labels[self:value()]) then
|
155 |
+
app:trap(function()
|
156 |
+
for _, item in pairs(options.items) do
|
157 |
+
local is_selected = (item == self:value())
|
158 |
+
if ImGui.Selectable(self.ctx, options.item_labels[item], is_selected) then
|
159 |
+
self:set(item)
|
160 |
+
end
|
161 |
+
end
|
162 |
+
end)
|
163 |
+
ImGui.EndCombo(self.ctx)
|
164 |
+
end
|
165 |
+
end
|
166 |
+
|
167 |
+
ReaSpeechTabBar = {}
|
168 |
+
|
169 |
+
ReaSpeechTabBar.new = function (options)
|
170 |
+
options = options or {
|
171 |
+
default = nil,
|
172 |
+
tabs = {},
|
173 |
+
}
|
174 |
+
|
175 |
+
local o = ReaSpeechWidget.new({
|
176 |
+
default = options.default,
|
177 |
+
widget_id = options.widget_id,
|
178 |
+
renderer = ReaSpeechTabBar.renderer,
|
179 |
+
options = options,
|
180 |
+
})
|
181 |
+
|
182 |
+
o._value = o.default
|
183 |
+
|
184 |
+
return o
|
185 |
+
end
|
186 |
+
|
187 |
+
ReaSpeechTabBar.renderer = function (self)
|
188 |
+
if ImGui.BeginTabBar(self.ctx, 'TabBar') then
|
189 |
+
for _, tab in pairs(self.options.tabs) do
|
190 |
+
if ImGui.BeginTabItem(self.ctx, tab.label) then
|
191 |
+
app:trap(function()
|
192 |
+
self:set(tab.key)
|
193 |
+
end)
|
194 |
+
ImGui.EndTabItem(self.ctx)
|
195 |
+
end
|
196 |
+
end
|
197 |
+
ImGui.EndTabBar(self.ctx)
|
198 |
+
end
|
199 |
+
end
|
200 |
+
|
201 |
+
ReaSpeechTabBar.tab = function(key, label)
|
202 |
+
return {
|
203 |
+
key = key,
|
204 |
+
label = label
|
205 |
+
}
|
206 |
+
end
|
207 |
+
|
208 |
+
ReaSpeechButtonBar = {}
|
209 |
+
|
210 |
+
ReaSpeechButtonBar.new = function (options)
|
211 |
+
options = options or {
|
212 |
+
default = nil,
|
213 |
+
label = nil,
|
214 |
+
buttons = {},
|
215 |
+
styles = {}
|
216 |
+
}
|
217 |
+
|
218 |
+
local o = ReaSpeechWidget.new({
|
219 |
+
default = options.default,
|
220 |
+
widget_id = options.widget_id,
|
221 |
+
renderer = ReaSpeechButtonBar.renderer,
|
222 |
+
options = options,
|
223 |
+
})
|
224 |
+
|
225 |
+
o._value = o.default
|
226 |
+
|
227 |
+
local with_button_color = function (selected, f)
|
228 |
+
if selected then
|
229 |
+
ImGui.PushStyleColor(o.ctx, ImGui.Col_Button(), Theme.colors.dark_gray_translucent)
|
230 |
+
app:trap(f)
|
231 |
+
ImGui.PopStyleColor(o.ctx)
|
232 |
+
else
|
233 |
+
f()
|
234 |
+
end
|
235 |
+
end
|
236 |
+
|
237 |
+
o.layout = ColumnLayout.new {
|
238 |
+
column_padding = options.column_padding or 0,
|
239 |
+
margin_bottom = options.margin_bottom or 0,
|
240 |
+
margin_left = options.margin_left or 0,
|
241 |
+
margin_right = options.margin_right or 0,
|
242 |
+
width = options.width or 0,
|
243 |
+
num_columns = #options.buttons,
|
244 |
+
|
245 |
+
render_column = function (column)
|
246 |
+
local bar_label = column.num == 1 and options.label or ""
|
247 |
+
ImGui.Text(o.ctx, bar_label)
|
248 |
+
ImGui.Dummy(o.ctx, 0, 0)
|
249 |
+
|
250 |
+
local button_label, model_name = table.unpack(options.buttons[column.num])
|
251 |
+
with_button_color(o:value() == model_name, function ()
|
252 |
+
if ImGui.Button(o.ctx, button_label, column.width) then
|
253 |
+
o:set(model_name)
|
254 |
+
end
|
255 |
+
end)
|
256 |
+
end
|
257 |
+
}
|
258 |
+
return o
|
259 |
+
end
|
260 |
+
|
261 |
+
ReaSpeechButtonBar.renderer = function (self)
|
262 |
+
self.layout:render()
|
263 |
+
end
|
reascripts/ReaSpeech/source/TranscriptEditor.lua
CHANGED
@@ -25,6 +25,18 @@ function TranscriptEditor:init()
|
|
25 |
self.is_open = false
|
26 |
self.sync_time_selection = false
|
27 |
self.zoom_level = self.ZOOM_LEVEL.NONE.value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
end
|
29 |
|
30 |
function TranscriptEditor:edit_segment(segment, index)
|
@@ -37,10 +49,15 @@ function TranscriptEditor:edit_segment(segment, index)
|
|
37 |
for i, word in pairs(segment.words) do
|
38 |
self.editing.words[i] = word:copy()
|
39 |
end
|
40 |
-
self:edit_word(
|
41 |
end
|
42 |
|
43 |
-
function TranscriptEditor:edit_word(
|
|
|
|
|
|
|
|
|
|
|
44 |
self.editing.word = word
|
45 |
self.editing.word_index = index
|
46 |
if self.sync_time_selection then
|
@@ -64,7 +81,10 @@ function TranscriptEditor:render()
|
|
64 |
ImGui.SetNextWindowSize(ctx, self.WIDTH, self.HEIGHT, ImGui.Cond_FirstUseEver())
|
65 |
|
66 |
if ImGui.BeginPopupModal(ctx, self.TITLE, true, ImGui.WindowFlags_AlwaysAutoResize()) then
|
67 |
-
app:trap(function ()
|
|
|
|
|
|
|
68 |
ImGui.EndPopup(ctx)
|
69 |
else
|
70 |
self:_close()
|
@@ -86,7 +106,7 @@ function TranscriptEditor:render_content()
|
|
86 |
end
|
87 |
|
88 |
if edit_requested then
|
89 |
-
self:edit_word(
|
90 |
end
|
91 |
|
92 |
self:render_separator()
|
@@ -112,17 +132,11 @@ function TranscriptEditor:render_word_navigation()
|
|
112 |
ImGui.PushButtonRepeat(ctx, true)
|
113 |
app:trap(function ()
|
114 |
if ImGui.ArrowButton(ctx, '##left', ImGui.Dir_Left()) then
|
115 |
-
|
116 |
-
if index > 0 then
|
117 |
-
self:edit_word(words[index], index)
|
118 |
-
end
|
119 |
end
|
120 |
ImGui.SameLine(ctx, 0, spacing)
|
121 |
if ImGui.ArrowButton(ctx, '##right', ImGui.Dir_Right()) then
|
122 |
-
|
123 |
-
if index <= num_words then
|
124 |
-
self:edit_word(words[index], index)
|
125 |
-
end
|
126 |
end
|
127 |
end)
|
128 |
ImGui.PopButtonRepeat(ctx)
|
@@ -173,7 +187,7 @@ function TranscriptEditor:render_words()
|
|
173 |
end
|
174 |
app:trap(function()
|
175 |
if ImGui.Button(ctx, word.word .. '##' .. i) then
|
176 |
-
edit_requested =
|
177 |
end
|
178 |
end)
|
179 |
if self.editing.word_index ~= i then
|
@@ -363,7 +377,7 @@ function TranscriptEditor:handle_word_add()
|
|
363 |
end_ = words[word_index].end_,
|
364 |
probability = 1.0
|
365 |
})
|
366 |
-
self:edit_word(
|
367 |
end
|
368 |
|
369 |
function TranscriptEditor:handle_word_delete()
|
@@ -374,14 +388,14 @@ function TranscriptEditor:handle_word_delete()
|
|
374 |
if word_index > num_words then
|
375 |
word_index = num_words
|
376 |
end
|
377 |
-
self:edit_word(
|
378 |
end
|
379 |
|
380 |
function TranscriptEditor:handle_word_split()
|
381 |
local words = self.editing.words
|
382 |
local word_index = self.editing.word_index
|
383 |
TranscriptSegment.split_word(words, word_index)
|
384 |
-
self:edit_word(
|
385 |
end
|
386 |
|
387 |
function TranscriptEditor:handle_word_merge()
|
@@ -390,7 +404,7 @@ function TranscriptEditor:handle_word_merge()
|
|
390 |
local num_words = #words
|
391 |
if word_index < num_words then
|
392 |
TranscriptSegment.merge_words(words, word_index, word_index + 1)
|
393 |
-
self:edit_word(
|
394 |
end
|
395 |
end
|
396 |
|
|
|
25 |
self.is_open = false
|
26 |
self.sync_time_selection = false
|
27 |
self.zoom_level = self.ZOOM_LEVEL.NONE.value
|
28 |
+
self.key_bindings = self:make_key_bindings()
|
29 |
+
end
|
30 |
+
|
31 |
+
function TranscriptEditor:make_key_bindings()
|
32 |
+
return KeyMap.new({
|
33 |
+
[ImGui.Key_LeftArrow()] = function ()
|
34 |
+
self:edit_word(self.editing.word_index - 1)
|
35 |
+
end,
|
36 |
+
[ImGui.Key_RightArrow()] = function ()
|
37 |
+
self:edit_word(self.editing.word_index + 1)
|
38 |
+
end,
|
39 |
+
})
|
40 |
end
|
41 |
|
42 |
function TranscriptEditor:edit_segment(segment, index)
|
|
|
49 |
for i, word in pairs(segment.words) do
|
50 |
self.editing.words[i] = word:copy()
|
51 |
end
|
52 |
+
self:edit_word(1)
|
53 |
end
|
54 |
|
55 |
+
function TranscriptEditor:edit_word(index)
|
56 |
+
if index < 1 or index > #self.editing.words then
|
57 |
+
return
|
58 |
+
end
|
59 |
+
|
60 |
+
local word = self.editing.words[index]
|
61 |
self.editing.word = word
|
62 |
self.editing.word_index = index
|
63 |
if self.sync_time_selection then
|
|
|
81 |
ImGui.SetNextWindowSize(ctx, self.WIDTH, self.HEIGHT, ImGui.Cond_FirstUseEver())
|
82 |
|
83 |
if ImGui.BeginPopupModal(ctx, self.TITLE, true, ImGui.WindowFlags_AlwaysAutoResize()) then
|
84 |
+
app:trap(function ()
|
85 |
+
self.key_bindings:react()
|
86 |
+
self:render_content()
|
87 |
+
end)
|
88 |
ImGui.EndPopup(ctx)
|
89 |
else
|
90 |
self:_close()
|
|
|
106 |
end
|
107 |
|
108 |
if edit_requested then
|
109 |
+
self:edit_word(edit_requested)
|
110 |
end
|
111 |
|
112 |
self:render_separator()
|
|
|
132 |
ImGui.PushButtonRepeat(ctx, true)
|
133 |
app:trap(function ()
|
134 |
if ImGui.ArrowButton(ctx, '##left', ImGui.Dir_Left()) then
|
135 |
+
self:edit_word(self.editing.word_index - 1)
|
|
|
|
|
|
|
136 |
end
|
137 |
ImGui.SameLine(ctx, 0, spacing)
|
138 |
if ImGui.ArrowButton(ctx, '##right', ImGui.Dir_Right()) then
|
139 |
+
self:edit_word(self.editing.word_index + 1)
|
|
|
|
|
|
|
140 |
end
|
141 |
end)
|
142 |
ImGui.PopButtonRepeat(ctx)
|
|
|
187 |
end
|
188 |
app:trap(function()
|
189 |
if ImGui.Button(ctx, word.word .. '##' .. i) then
|
190 |
+
edit_requested = i
|
191 |
end
|
192 |
end)
|
193 |
if self.editing.word_index ~= i then
|
|
|
377 |
end_ = words[word_index].end_,
|
378 |
probability = 1.0
|
379 |
})
|
380 |
+
self:edit_word(word_index + 1)
|
381 |
end
|
382 |
|
383 |
function TranscriptEditor:handle_word_delete()
|
|
|
388 |
if word_index > num_words then
|
389 |
word_index = num_words
|
390 |
end
|
391 |
+
self:edit_word(word_index)
|
392 |
end
|
393 |
|
394 |
function TranscriptEditor:handle_word_split()
|
395 |
local words = self.editing.words
|
396 |
local word_index = self.editing.word_index
|
397 |
TranscriptSegment.split_word(words, word_index)
|
398 |
+
self:edit_word(word_index)
|
399 |
end
|
400 |
|
401 |
function TranscriptEditor:handle_word_merge()
|
|
|
404 |
local num_words = #words
|
405 |
if word_index < num_words then
|
406 |
TranscriptSegment.merge_words(words, word_index, word_index + 1)
|
407 |
+
self:edit_word(word_index)
|
408 |
end
|
409 |
end
|
410 |
|
reascripts/ReaSpeech/source/TranscriptUI.lua
CHANGED
@@ -12,13 +12,14 @@ TranscriptUI = Polo {
|
|
12 |
COLUMN_WIDTH = 55,
|
13 |
LARGE_COLUMN_WIDTH = 300,
|
14 |
|
15 |
-
|
|
|
16 |
|
17 |
SCORE_COLORS = {
|
18 |
bright_green = 0xa3ff00a6,
|
19 |
dark_green = 0x2cba00a6,
|
20 |
orange = 0xffa700a6,
|
21 |
-
red =
|
22 |
}
|
23 |
}
|
24 |
|
@@ -49,12 +50,34 @@ function TranscriptUI:init()
|
|
49 |
|
50 |
self.transcript_editor = TranscriptEditor.new { transcript = self.transcript }
|
51 |
self.transcript_exporter = TranscriptExporter.new { transcript = self.transcript }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
end
|
53 |
|
54 |
function TranscriptUI:render()
|
55 |
if self.transcript:has_segments() then
|
56 |
ImGui.SeparatorText(ctx, "Transcript")
|
57 |
-
self:
|
58 |
self:render_table()
|
59 |
end
|
60 |
|
@@ -62,56 +85,74 @@ function TranscriptUI:render()
|
|
62 |
self.transcript_exporter:render()
|
63 |
end
|
64 |
|
65 |
-
function TranscriptUI:
|
66 |
-
if ImGui.Button(ctx, "Create Regions") then
|
67 |
self:handle_create_markers(true)
|
68 |
end
|
69 |
-
|
70 |
-
|
|
|
|
|
71 |
self:handle_create_markers(false)
|
72 |
end
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
76 |
end
|
|
|
77 |
|
78 |
-
|
79 |
-
rv, value = ImGui.Checkbox(ctx, "
|
80 |
if rv then
|
81 |
self.words = value
|
82 |
end
|
83 |
|
84 |
if self.words then
|
85 |
ImGui.SameLine(ctx)
|
86 |
-
rv, value = ImGui.Checkbox(ctx, "
|
87 |
if rv then
|
88 |
self.colorize_words = value
|
89 |
end
|
90 |
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
ImGui.
|
94 |
-
|
95 |
-
if search_changed then
|
96 |
-
self:handle_search(search)
|
97 |
end
|
98 |
-
|
99 |
-
|
|
|
|
|
100 |
if rv then
|
101 |
self.autoplay = value
|
102 |
end
|
|
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
if ImGui.Button(ctx, "Clear") then
|
112 |
-
self:handle_transcript_clear()
|
113 |
end
|
114 |
-
end
|
|
|
115 |
end
|
116 |
|
117 |
function TranscriptUI:handle_create_markers(regions)
|
@@ -123,11 +164,11 @@ function TranscriptUI:handle_create_markers(regions)
|
|
123 |
reaper.PreventUIRefresh(-1)
|
124 |
end
|
125 |
|
126 |
-
function TranscriptUI:
|
127 |
reaper.PreventUIRefresh(1)
|
128 |
reaper.Undo_BeginBlock()
|
129 |
self.transcript:create_notes_track(self.words)
|
130 |
-
reaper.Undo_EndBlock("Create notes
|
131 |
reaper.PreventUIRefresh(-1)
|
132 |
end
|
133 |
|
|
|
12 |
COLUMN_WIDTH = 55,
|
13 |
LARGE_COLUMN_WIDTH = 300,
|
14 |
|
15 |
+
ACTIONS_MARGIN = 8,
|
16 |
+
ACTIONS_PADDING = 8,
|
17 |
|
18 |
SCORE_COLORS = {
|
19 |
bright_green = 0xa3ff00a6,
|
20 |
dark_green = 0x2cba00a6,
|
21 |
orange = 0xffa700a6,
|
22 |
+
red = 0xff2c2cff
|
23 |
}
|
24 |
}
|
25 |
|
|
|
50 |
|
51 |
self.transcript_editor = TranscriptEditor.new { transcript = self.transcript }
|
52 |
self.transcript_exporter = TranscriptExporter.new { transcript = self.transcript }
|
53 |
+
|
54 |
+
self:init_layouts()
|
55 |
+
end
|
56 |
+
|
57 |
+
function TranscriptUI:init_layouts()
|
58 |
+
local renderers = {
|
59 |
+
self.render_create_regions,
|
60 |
+
self.render_create_markers,
|
61 |
+
self.render_create_notes,
|
62 |
+
self.render_word_options,
|
63 |
+
self.render_result_actions,
|
64 |
+
self.render_auto_play,
|
65 |
+
self.render_search
|
66 |
+
}
|
67 |
+
|
68 |
+
self.actions_layout = ColumnLayout.new {
|
69 |
+
column_padding = self.ACTIONS_PADDING,
|
70 |
+
num_columns = #renderers,
|
71 |
+
render_column = function (column)
|
72 |
+
renderers[column.num](self, column)
|
73 |
+
end
|
74 |
+
}
|
75 |
end
|
76 |
|
77 |
function TranscriptUI:render()
|
78 |
if self.transcript:has_segments() then
|
79 |
ImGui.SeparatorText(ctx, "Transcript")
|
80 |
+
self.actions_layout:render()
|
81 |
self:render_table()
|
82 |
end
|
83 |
|
|
|
85 |
self.transcript_exporter:render()
|
86 |
end
|
87 |
|
88 |
+
function TranscriptUI:render_create_regions(column)
|
89 |
+
if ImGui.Button(ctx, "Create Regions", column.width) then
|
90 |
self:handle_create_markers(true)
|
91 |
end
|
92 |
+
end
|
93 |
+
|
94 |
+
function TranscriptUI:render_create_markers(column)
|
95 |
+
if ImGui.Button(ctx, "Create Markers", column.width) then
|
96 |
self:handle_create_markers(false)
|
97 |
end
|
98 |
+
end
|
99 |
+
|
100 |
+
function TranscriptUI:render_create_notes(column)
|
101 |
+
if ImGui.Button(ctx, "Create Notes", column.width) then
|
102 |
+
self:handle_create_notes()
|
103 |
end
|
104 |
+
end
|
105 |
|
106 |
+
function TranscriptUI:render_word_options()
|
107 |
+
local rv, value = ImGui.Checkbox(ctx, "Words", self.words)
|
108 |
if rv then
|
109 |
self.words = value
|
110 |
end
|
111 |
|
112 |
if self.words then
|
113 |
ImGui.SameLine(ctx)
|
114 |
+
rv, value = ImGui.Checkbox(ctx, "Colorize", self.colorize_words)
|
115 |
if rv then
|
116 |
self.colorize_words = value
|
117 |
end
|
118 |
end
|
119 |
+
end
|
120 |
+
|
121 |
+
function TranscriptUI:render_result_actions()
|
122 |
+
self:render_export()
|
123 |
+
ImGui.SameLine(ctx)
|
124 |
+
self:render_clear()
|
125 |
+
end
|
126 |
+
|
127 |
+
function TranscriptUI:render_export()
|
128 |
+
if ImGui.Button(ctx, "Export") then
|
129 |
+
self:handle_export()
|
130 |
+
end
|
131 |
+
end
|
132 |
|
133 |
+
function TranscriptUI:render_clear()
|
134 |
+
if ImGui.Button(ctx, "Clear") then
|
135 |
+
self:handle_transcript_clear()
|
|
|
|
|
136 |
end
|
137 |
+
end
|
138 |
+
|
139 |
+
function TranscriptUI:render_auto_play()
|
140 |
+
local rv, value = ImGui.Checkbox(ctx, "Auto Play", self.autoplay)
|
141 |
if rv then
|
142 |
self.autoplay = value
|
143 |
end
|
144 |
+
end
|
145 |
|
146 |
+
function TranscriptUI:render_search(column)
|
147 |
+
ImGui.SetCursorPosX(ctx, ImGui.GetWindowWidth(ctx) - column.width - self.ACTIONS_MARGIN)
|
148 |
+
ImGui.PushItemWidth(ctx, column.width)
|
149 |
+
app:trap(function()
|
150 |
+
local search_changed, search = ImGui.InputTextWithHint(ctx, '##search', 'Search', self.transcript.search)
|
151 |
+
if search_changed then
|
152 |
+
self:handle_search(search)
|
|
|
|
|
153 |
end
|
154 |
+
end)
|
155 |
+
ImGui.PopItemWidth(ctx)
|
156 |
end
|
157 |
|
158 |
function TranscriptUI:handle_create_markers(regions)
|
|
|
164 |
reaper.PreventUIRefresh(-1)
|
165 |
end
|
166 |
|
167 |
+
function TranscriptUI:handle_create_notes()
|
168 |
reaper.PreventUIRefresh(1)
|
169 |
reaper.Undo_BeginBlock()
|
170 |
self.transcript:create_notes_track(self.words)
|
171 |
+
reaper.Undo_EndBlock("Create notes from speech", -1)
|
172 |
reaper.PreventUIRefresh(-1)
|
173 |
end
|
174 |
|
reascripts/ReaSpeech/source/WhisperLanguages.lua
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
--[[
|
2 |
+
|
3 |
+
WhisperLanguages.lua - A list of languages supported by the Whisper API
|
4 |
+
|
5 |
+
]]--
|
6 |
+
|
7 |
+
WhisperLanguages = {
|
8 |
+
-- Copied from whisper.tokenizer.LANGUAGES
|
9 |
+
LANGUAGES = {
|
10 |
+
en = 'English', zh = 'Chinese', de = 'German',
|
11 |
+
es = 'Spanish', ru = 'Russian', ko = 'Korean',
|
12 |
+
fr = 'French', ja = 'Japanese', pt = 'Portuguese',
|
13 |
+
tr = 'Turkish', pl = 'Polish', ca = 'Catalan',
|
14 |
+
nl = 'Dutch', ar = 'Arabic', sv = 'Swedish',
|
15 |
+
it = 'Italian', id = 'Indonesian', hi = 'Hindi',
|
16 |
+
fi = 'Finnish', vi = 'Vietnamese', he = 'Hebrew',
|
17 |
+
uk = 'Ukrainian', el = 'Greek', ms = 'Malay',
|
18 |
+
cs = 'Czech', ro = 'Romanian', da = 'Danish',
|
19 |
+
hu = 'Hungarian', ta = 'Tamil', no = 'Norwegian',
|
20 |
+
th = 'Thai', ur = 'Urdu', hr = 'Croatian',
|
21 |
+
bg = 'Bulgarian', lt = 'Lithuanian', la = 'Latin',
|
22 |
+
mi = 'Maori', ml = 'Malayalam', cy = 'Welsh',
|
23 |
+
sk = 'Slovak', te = 'Telugu', fa = 'Persian',
|
24 |
+
lv = 'Latvian', bn = 'Bengali', sr = 'Serbian',
|
25 |
+
az = 'Azerbaijani', sl = 'Slovenian', kn = 'Kannada',
|
26 |
+
et = 'Estonian', mk = 'Macedonian', br = 'Breton',
|
27 |
+
eu = 'Basque', is = 'Icelandic', hy = 'Armenian',
|
28 |
+
ne = 'Nepali', mn = 'Mongolian', bs = 'Bosnian',
|
29 |
+
kk = 'Kazakh', sq = 'Albanian', sw = 'Swahili',
|
30 |
+
gl = 'Galician', mr = 'Marathi', pa = 'Punjabi',
|
31 |
+
si = 'Sinhala', km = 'Khmer', sn = 'Shona',
|
32 |
+
yo = 'Yoruba', so = 'Somali', af = 'Afrikaans',
|
33 |
+
oc = 'Occitan', ka = 'Georgian', be = 'Belarusian',
|
34 |
+
tg = 'Tajik', sd = 'Sindhi', gu = 'Gujarati',
|
35 |
+
am = 'Amharic', yi = 'Yiddish', lo = 'Lao',
|
36 |
+
uz = 'Uzbek', fo = 'Faroese', ht = 'Haitian Creole',
|
37 |
+
ps = 'Pashto', tk = 'Turkmen', nn = 'Nynorsk',
|
38 |
+
mt = 'Maltese', sa = 'Sanskrit', lb = 'Luxembourgish',
|
39 |
+
my = 'Myanmar', bo = 'Tibetan', tl = 'Tagalog',
|
40 |
+
mg = 'Malagasy', as = 'Assamese', tt = 'Tatar',
|
41 |
+
haw = 'Hawaiian', ln = 'Lingala', ha = 'Hausa',
|
42 |
+
ba = 'Bashkir', jw = 'Javanese', su = 'Sundanese'
|
43 |
+
},
|
44 |
+
|
45 |
+
LANGUAGE_CODES = {},
|
46 |
+
}
|
47 |
+
|
48 |
+
-- initialize LANGUAGE_CODES
|
49 |
+
(function()
|
50 |
+
for code, _ in pairs(WhisperLanguages.LANGUAGES) do
|
51 |
+
table.insert(WhisperLanguages.LANGUAGE_CODES, code)
|
52 |
+
end
|
53 |
+
|
54 |
+
table.sort(WhisperLanguages.LANGUAGE_CODES, function (a, b)
|
55 |
+
return WhisperLanguages.LANGUAGES[a] < WhisperLanguages.LANGUAGES[b]
|
56 |
+
end)
|
57 |
+
|
58 |
+
table.insert(WhisperLanguages.LANGUAGE_CODES, 1, '')
|
59 |
+
WhisperLanguages.LANGUAGES[''] = 'Detect'
|
60 |
+
end)()
|
reascripts/ReaSpeech/tests/TestReaSpeechUI.lua
CHANGED
@@ -2,24 +2,24 @@ package.path = '../common/libs/?.lua;../common/vendor/?.lua;' .. package.path
|
|
2 |
|
3 |
local lu = require('luaunit')
|
4 |
|
5 |
-
require('OptionsConfig')
|
6 |
require('Polo')
|
7 |
require('ReaUtil')
|
8 |
require('mock_reaper')
|
9 |
|
10 |
require('source/AlertPopup')
|
11 |
require('source/ColumnLayout')
|
|
|
12 |
require('source/ReaSpeechActionsUI')
|
13 |
require('source/ReaSpeechAPI')
|
14 |
-
require('source/ReaSpeechProductActivation')
|
15 |
-
require('source/ReaSpeechProductActivationUI')
|
16 |
require('source/ReaSpeechUI')
|
17 |
require('source/ReaSpeechControlsUI')
|
|
|
18 |
require('source/ReaSpeechWorker')
|
19 |
require('source/Transcript')
|
20 |
require('source/TranscriptUI')
|
21 |
require('source/TranscriptEditor')
|
22 |
require('source/TranscriptExporter')
|
|
|
23 |
|
24 |
--
|
25 |
|
|
|
2 |
|
3 |
local lu = require('luaunit')
|
4 |
|
|
|
5 |
require('Polo')
|
6 |
require('ReaUtil')
|
7 |
require('mock_reaper')
|
8 |
|
9 |
require('source/AlertPopup')
|
10 |
require('source/ColumnLayout')
|
11 |
+
require('source/KeyMap')
|
12 |
require('source/ReaSpeechActionsUI')
|
13 |
require('source/ReaSpeechAPI')
|
|
|
|
|
14 |
require('source/ReaSpeechUI')
|
15 |
require('source/ReaSpeechControlsUI')
|
16 |
+
require('source/ReaSpeechWidgets')
|
17 |
require('source/ReaSpeechWorker')
|
18 |
require('source/Transcript')
|
19 |
require('source/TranscriptUI')
|
20 |
require('source/TranscriptEditor')
|
21 |
require('source/TranscriptExporter')
|
22 |
+
require('source/WhisperLanguages')
|
23 |
|
24 |
--
|
25 |
|