@intechstudio/grid-protocol 1.20250625.817 → 1.20250630.1242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +57 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var GRID_PARAMETER_EVENT_MAPMODE = "4";
|
|
|
17
17
|
var GRID_PARAMETER_EVENT_MIDIRX = "5";
|
|
18
18
|
var GRID_PARAMETER_EVENT_TIMER = "6";
|
|
19
19
|
var GRID_PARAMETER_EVENT_ENDLESS = "7";
|
|
20
|
+
var GRID_PARAMETER_EVENT_DRAW = "8";
|
|
20
21
|
var GRID_MODULE_PO16_RevB = "0";
|
|
21
22
|
var GRID_MODULE_PO16_RevC = "8";
|
|
22
23
|
var GRID_MODULE_PO16_RevD = "1";
|
|
@@ -535,6 +536,8 @@ var GRID_LUA_FNC_A_MIDIRX_short = "mrx";
|
|
|
535
536
|
var GRID_LUA_FNC_A_MIDIRX_human = "midirx";
|
|
536
537
|
var GRID_LUA_FNC_A_ENDLESS_short = "epc";
|
|
537
538
|
var GRID_LUA_FNC_A_ENDLESS_human = "endless_handler";
|
|
539
|
+
var GRID_LUA_FNC_A_DRAW_short = "ld";
|
|
540
|
+
var GRID_LUA_FNC_A_DRAW_human = "draw_handler";
|
|
538
541
|
var GRID_LUA_KW_ELEMENT_short = "ele";
|
|
539
542
|
var GRID_LUA_KW_ELEMENT_human = "element";
|
|
540
543
|
var GRID_CLASS_MIDI_code = "0x000";
|
|
@@ -837,7 +840,8 @@ var GRID_LUA_FNC_L_DRAW_DEMO_short = "ldd";
|
|
|
837
840
|
var GRID_LUA_FNC_L_DRAW_DEMO_human = "draw_demo";
|
|
838
841
|
var GRID_LUA_FNC_L_DRAW_DEMO_usage = "lcd:draw_demo(n) Draws the n-th iteration of the demo.";
|
|
839
842
|
var GRID_LUA_L_META_init = "lcd_meta = { __index = {type = 'lcd', \" GRID_LUA_FNC_ASSIGN_META_GTV(GRID_LUA_FNC_L_ELEMENT_INDEX_short, GRID_LUA_FNC_L_ELEMENT_INDEX_index) \",\" GRID_LUA_FNC_ASSIGN_META_GTV(GRID_LUA_FNC_L_SCREEN_INDEX_short, GRID_LUA_FNC_L_SCREEN_INDEX_index) \",\" GRID_LUA_FNC_ASSIGN_META_GTV(GRID_LUA_FNC_L_SCREEN_WIDTH_short, GRID_LUA_FNC_L_SCREEN_WIDTH_index) \",\" GRID_LUA_FNC_ASSIGN_META_GTV(GRID_LUA_FNC_L_SCREEN_HEIGHT_short, GRID_LUA_FNC_L_SCREEN_HEIGHT_index) \",\" GRID_LUA_FNC_ASSIGN_META_UNDEF(GRID_LUA_FNC_A_INIT_short) \",post_init_cb = function (self) self:\"GRID_LUA_FNC_A_INIT_short\"() end,\" GRID_LUA_FNC_ASSIGN_META_PAR1(\"gtt\", GRID_LUA_FNC_G_TIMER_START_short) \",\" GRID_LUA_FNC_ASSIGN_META_PAR0(\"gtp\", GRID_LUA_FNC_G_TIMER_STOP_short) \",\" GRID_LUA_FNC_ASSIGN_META_PAR1(\"get\", GRID_LUA_FNC_G_EVENT_TRIGGER_short) \",\" GRID_LUA_FNC_ASSIGN_META_PAR1_RET(\"gen\", GRID_LUA_FNC_G_ELEMENTNAME_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_SWAP_short, GRID_LUA_FNC_G_GUI_DRAW_SWAP_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_PIXEL_short, GRID_LUA_FNC_G_GUI_DRAW_PIXEL_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_LINE_short, GRID_LUA_FNC_G_GUI_DRAW_LINE_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_RECTANGLE_short, GRID_LUA_FNC_G_GUI_DRAW_RECTANGLE_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_RECTANGLE_FILLED_short, GRID_LUA_FNC_G_GUI_DRAW_RECTANGLE_FILLED_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_RECTANGLE_ROUNDED_short, GRID_LUA_FNC_G_GUI_DRAW_RECTANGLE_ROUNDED_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_RECTANGLE_ROUNDED_FILLED_short, GRID_LUA_FNC_G_GUI_DRAW_RECTANGLE_ROUNDED_FILLED_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_POLYGON_short, GRID_LUA_FNC_G_GUI_DRAW_POLYGON_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_POLYGON_FILLED_short, GRID_LUA_FNC_G_GUI_DRAW_POLYGON_FILLED_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_TEXT_short, GRID_LUA_FNC_G_GUI_DRAW_TEXT_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_FASTTEXT_short, GRID_LUA_FNC_G_GUI_DRAW_FASTTEXT_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_AREA_FILLED_short, GRID_LUA_FNC_G_GUI_DRAW_AREA_FILLED_short) \",\" GRID_LUA_FNC_ASSIGN_META_DRAW(GRID_LUA_FNC_L_DRAW_DEMO_short, GRID_LUA_FNC_G_GUI_DRAW_DEMO_short) \",}}";
|
|
840
|
-
var GRID_ACTIONSTRING_LCD_INIT = "<?lua --[[@cb]] local x={0,0,38,64,64,65,104,130,130,131,170,183,183,145,119,119,118,79,53,53,52,13}local y={42,38,0,0,39,39,0,0,39,39,0,0,4,42,42,3,3,42,42,3,3,42}self:ldrf(0,0,320,240,{0,0,0})self:ldpof(x,y,{200,200,200})self:ldt('Intech Studio',2,55,34,{160,160,160})self:ldsw() ?>";
|
|
843
|
+
var GRID_ACTIONSTRING_LCD_INIT = "<?lua --[[@cb]] local x={0,0,38,64,64,65,104,130,130,131,170,183,183,145,119,119,118,79,53,53,52,13}local y={42,38,0,0,39,39,0,0,39,39,0,0,4,42,42,3,3,42,42,3,3,42}self:ldrf(0,0,320,240,{0,0,0})self:ldpof(x,y,{200,200,200})self:ldt('Intech Studio',2,55,34,{160,160,160})self:ldsw()glsb(255) ?>";
|
|
844
|
+
var GRID_ACTIONSTRING_LCD_DRAW = "<?lua --[[@cb]] --[[draw]] ?>";
|
|
841
845
|
var grid_protocol_bot = {
|
|
842
846
|
GRID_PROTOCOL_VERSION_MAJOR: GRID_PROTOCOL_VERSION_MAJOR,
|
|
843
847
|
GRID_PROTOCOL_VERSION_MINOR: GRID_PROTOCOL_VERSION_MINOR,
|
|
@@ -856,6 +860,7 @@ var grid_protocol_bot = {
|
|
|
856
860
|
GRID_PARAMETER_EVENT_MIDIRX: GRID_PARAMETER_EVENT_MIDIRX,
|
|
857
861
|
GRID_PARAMETER_EVENT_TIMER: GRID_PARAMETER_EVENT_TIMER,
|
|
858
862
|
GRID_PARAMETER_EVENT_ENDLESS: GRID_PARAMETER_EVENT_ENDLESS,
|
|
863
|
+
GRID_PARAMETER_EVENT_DRAW: GRID_PARAMETER_EVENT_DRAW,
|
|
859
864
|
GRID_MODULE_PO16_RevB: GRID_MODULE_PO16_RevB,
|
|
860
865
|
GRID_MODULE_PO16_RevC: GRID_MODULE_PO16_RevC,
|
|
861
866
|
GRID_MODULE_PO16_RevD: GRID_MODULE_PO16_RevD,
|
|
@@ -1374,6 +1379,8 @@ var grid_protocol_bot = {
|
|
|
1374
1379
|
GRID_LUA_FNC_A_MIDIRX_human: GRID_LUA_FNC_A_MIDIRX_human,
|
|
1375
1380
|
GRID_LUA_FNC_A_ENDLESS_short: GRID_LUA_FNC_A_ENDLESS_short,
|
|
1376
1381
|
GRID_LUA_FNC_A_ENDLESS_human: GRID_LUA_FNC_A_ENDLESS_human,
|
|
1382
|
+
GRID_LUA_FNC_A_DRAW_short: GRID_LUA_FNC_A_DRAW_short,
|
|
1383
|
+
GRID_LUA_FNC_A_DRAW_human: GRID_LUA_FNC_A_DRAW_human,
|
|
1377
1384
|
GRID_LUA_KW_ELEMENT_short: GRID_LUA_KW_ELEMENT_short,
|
|
1378
1385
|
GRID_LUA_KW_ELEMENT_human: GRID_LUA_KW_ELEMENT_human,
|
|
1379
1386
|
GRID_CLASS_MIDI_code: GRID_CLASS_MIDI_code,
|
|
@@ -1676,7 +1683,8 @@ var grid_protocol_bot = {
|
|
|
1676
1683
|
GRID_LUA_FNC_L_DRAW_DEMO_human: GRID_LUA_FNC_L_DRAW_DEMO_human,
|
|
1677
1684
|
GRID_LUA_FNC_L_DRAW_DEMO_usage: GRID_LUA_FNC_L_DRAW_DEMO_usage,
|
|
1678
1685
|
GRID_LUA_L_META_init: GRID_LUA_L_META_init,
|
|
1679
|
-
GRID_ACTIONSTRING_LCD_INIT: GRID_ACTIONSTRING_LCD_INIT
|
|
1686
|
+
GRID_ACTIONSTRING_LCD_INIT: GRID_ACTIONSTRING_LCD_INIT,
|
|
1687
|
+
GRID_ACTIONSTRING_LCD_DRAW: GRID_ACTIONSTRING_LCD_DRAW
|
|
1680
1688
|
};
|
|
1681
1689
|
|
|
1682
1690
|
var protocol_data = /*#__PURE__*/Object.freeze({
|
|
@@ -1688,6 +1696,7 @@ var protocol_data = /*#__PURE__*/Object.freeze({
|
|
|
1688
1696
|
GRID_ACTIONSTRING_ENDLESS_BUTTON: GRID_ACTIONSTRING_ENDLESS_BUTTON,
|
|
1689
1697
|
GRID_ACTIONSTRING_ENDLESS_ENDLESS: GRID_ACTIONSTRING_ENDLESS_ENDLESS,
|
|
1690
1698
|
GRID_ACTIONSTRING_ENDLESS_INIT: GRID_ACTIONSTRING_ENDLESS_INIT,
|
|
1699
|
+
GRID_ACTIONSTRING_LCD_DRAW: GRID_ACTIONSTRING_LCD_DRAW,
|
|
1691
1700
|
GRID_ACTIONSTRING_LCD_INIT: GRID_ACTIONSTRING_LCD_INIT,
|
|
1692
1701
|
GRID_ACTIONSTRING_POTMETER_INIT: GRID_ACTIONSTRING_POTMETER_INIT,
|
|
1693
1702
|
GRID_ACTIONSTRING_POTMETER_POTMETER: GRID_ACTIONSTRING_POTMETER_POTMETER,
|
|
@@ -1968,6 +1977,8 @@ var protocol_data = /*#__PURE__*/Object.freeze({
|
|
|
1968
1977
|
GRID_LUA_E_META_init: GRID_LUA_E_META_init,
|
|
1969
1978
|
GRID_LUA_FNC_A_BUTTON_human: GRID_LUA_FNC_A_BUTTON_human,
|
|
1970
1979
|
GRID_LUA_FNC_A_BUTTON_short: GRID_LUA_FNC_A_BUTTON_short,
|
|
1980
|
+
GRID_LUA_FNC_A_DRAW_human: GRID_LUA_FNC_A_DRAW_human,
|
|
1981
|
+
GRID_LUA_FNC_A_DRAW_short: GRID_LUA_FNC_A_DRAW_short,
|
|
1971
1982
|
GRID_LUA_FNC_A_ENCODER_human: GRID_LUA_FNC_A_ENCODER_human,
|
|
1972
1983
|
GRID_LUA_FNC_A_ENCODER_short: GRID_LUA_FNC_A_ENCODER_short,
|
|
1973
1984
|
GRID_LUA_FNC_A_ENDLESS_human: GRID_LUA_FNC_A_ENDLESS_human,
|
|
@@ -2488,6 +2499,7 @@ var protocol_data = /*#__PURE__*/Object.freeze({
|
|
|
2488
2499
|
GRID_PARAMETER_ELEMENT_POTMETER: GRID_PARAMETER_ELEMENT_POTMETER,
|
|
2489
2500
|
GRID_PARAMETER_ELEMENT_SYSTEM: GRID_PARAMETER_ELEMENT_SYSTEM,
|
|
2490
2501
|
GRID_PARAMETER_EVENT_BUTTON: GRID_PARAMETER_EVENT_BUTTON,
|
|
2502
|
+
GRID_PARAMETER_EVENT_DRAW: GRID_PARAMETER_EVENT_DRAW,
|
|
2491
2503
|
GRID_PARAMETER_EVENT_ENCODER: GRID_PARAMETER_EVENT_ENCODER,
|
|
2492
2504
|
GRID_PARAMETER_EVENT_ENDLESS: GRID_PARAMETER_EVENT_ENDLESS,
|
|
2493
2505
|
GRID_PARAMETER_EVENT_INIT: GRID_PARAMETER_EVENT_INIT,
|
|
@@ -28221,46 +28233,55 @@ var cmp_1 = cmp;
|
|
|
28221
28233
|
|
|
28222
28234
|
const { safeRe: re, t } = reExports;
|
|
28223
28235
|
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
this.max = 1000;
|
|
28227
|
-
this.map = new Map();
|
|
28228
|
-
}
|
|
28236
|
+
var lrucache;
|
|
28237
|
+
var hasRequiredLrucache;
|
|
28229
28238
|
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
return undefined
|
|
28234
|
-
} else {
|
|
28235
|
-
// Remove the key from the map and add it to the end
|
|
28236
|
-
this.map.delete(key);
|
|
28237
|
-
this.map.set(key, value);
|
|
28238
|
-
return value
|
|
28239
|
-
}
|
|
28240
|
-
}
|
|
28239
|
+
function requireLrucache () {
|
|
28240
|
+
if (hasRequiredLrucache) return lrucache;
|
|
28241
|
+
hasRequiredLrucache = 1;
|
|
28241
28242
|
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28243
|
+
class LRUCache {
|
|
28244
|
+
constructor () {
|
|
28245
|
+
this.max = 1000;
|
|
28246
|
+
this.map = new Map();
|
|
28247
|
+
}
|
|
28245
28248
|
|
|
28246
|
-
|
|
28247
|
-
|
|
28249
|
+
get (key) {
|
|
28250
|
+
const value = this.map.get(key);
|
|
28251
|
+
if (value === undefined) {
|
|
28252
|
+
return undefined
|
|
28253
|
+
} else {
|
|
28254
|
+
// Remove the key from the map and add it to the end
|
|
28255
|
+
this.map.delete(key);
|
|
28256
|
+
this.map.set(key, value);
|
|
28257
|
+
return value
|
|
28258
|
+
}
|
|
28259
|
+
}
|
|
28248
28260
|
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
const firstKey = this.map.keys().next().value;
|
|
28253
|
-
this.delete(firstKey);
|
|
28254
|
-
}
|
|
28261
|
+
delete (key) {
|
|
28262
|
+
return this.map.delete(key)
|
|
28263
|
+
}
|
|
28255
28264
|
|
|
28256
|
-
|
|
28257
|
-
|
|
28265
|
+
set (key, value) {
|
|
28266
|
+
const deleted = this.delete(key);
|
|
28258
28267
|
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28268
|
+
if (!deleted && value !== undefined) {
|
|
28269
|
+
// If cache is full, delete the least recently used item
|
|
28270
|
+
if (this.map.size >= this.max) {
|
|
28271
|
+
const firstKey = this.map.keys().next().value;
|
|
28272
|
+
this.delete(firstKey);
|
|
28273
|
+
}
|
|
28262
28274
|
|
|
28263
|
-
|
|
28275
|
+
this.map.set(key, value);
|
|
28276
|
+
}
|
|
28277
|
+
|
|
28278
|
+
return this
|
|
28279
|
+
}
|
|
28280
|
+
}
|
|
28281
|
+
|
|
28282
|
+
lrucache = LRUCache;
|
|
28283
|
+
return lrucache;
|
|
28284
|
+
}
|
|
28264
28285
|
|
|
28265
28286
|
var range;
|
|
28266
28287
|
var hasRequiredRange;
|
|
@@ -28483,7 +28504,7 @@ function requireRange () {
|
|
|
28483
28504
|
|
|
28484
28505
|
range = Range;
|
|
28485
28506
|
|
|
28486
|
-
const LRU =
|
|
28507
|
+
const LRU = requireLrucache();
|
|
28487
28508
|
const cache = new LRU();
|
|
28488
28509
|
|
|
28489
28510
|
const parseOptions = parseOptions_1;
|