@intechstudio/grid-protocol 1.20250625.817 → 1.20250630.1305
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/grid-protocol.d.ts +3 -2
- package/dist/index.js +68 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/grid-protocol.d.ts
CHANGED
|
@@ -20,10 +20,11 @@ export declare enum EventType {
|
|
|
20
20
|
UTILITY = "utility",
|
|
21
21
|
MIDIRX = "midi rx",
|
|
22
22
|
TIMER = "timer",
|
|
23
|
-
ENDLESS = "endless"
|
|
23
|
+
ENDLESS = "endless",
|
|
24
|
+
DRAW = "draw"
|
|
24
25
|
}
|
|
25
26
|
export declare function NumberToEventType(value: Number): EventType;
|
|
26
|
-
export declare function EventTypeToNumber(value: EventType): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
27
|
+
export declare function EventTypeToNumber(value: EventType): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
27
28
|
export declare enum ElementType {
|
|
28
29
|
SYSTEM = "system",
|
|
29
30
|
BUTTON = "button",
|
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,
|
|
@@ -19832,6 +19844,7 @@ var EventType;
|
|
|
19832
19844
|
EventType["MIDIRX"] = "midi rx";
|
|
19833
19845
|
EventType["TIMER"] = "timer";
|
|
19834
19846
|
EventType["ENDLESS"] = "endless";
|
|
19847
|
+
EventType["DRAW"] = "draw";
|
|
19835
19848
|
})(EventType || (EventType = {}));
|
|
19836
19849
|
function NumberToEventType(value) {
|
|
19837
19850
|
switch (value) {
|
|
@@ -19851,6 +19864,8 @@ function NumberToEventType(value) {
|
|
|
19851
19864
|
return EventType.TIMER;
|
|
19852
19865
|
case 7:
|
|
19853
19866
|
return EventType.ENDLESS;
|
|
19867
|
+
case 8:
|
|
19868
|
+
return EventType.DRAW;
|
|
19854
19869
|
default:
|
|
19855
19870
|
throw "Unknown event type";
|
|
19856
19871
|
}
|
|
@@ -19873,6 +19888,8 @@ function EventTypeToNumber(value) {
|
|
|
19873
19888
|
return 6;
|
|
19874
19889
|
case EventType.ENDLESS:
|
|
19875
19890
|
return 7;
|
|
19891
|
+
case EventType.DRAW:
|
|
19892
|
+
return 8;
|
|
19876
19893
|
default:
|
|
19877
19894
|
throw "Unknown event type";
|
|
19878
19895
|
}
|
|
@@ -20256,6 +20273,11 @@ var CEEAT = (_a = {},
|
|
|
20256
20273
|
value: 7,
|
|
20257
20274
|
key: "ENDLESS",
|
|
20258
20275
|
},
|
|
20276
|
+
_a[EventType.DRAW] = {
|
|
20277
|
+
desc: EventType.DRAW,
|
|
20278
|
+
value: 8,
|
|
20279
|
+
key: "DRAW",
|
|
20280
|
+
},
|
|
20259
20281
|
_a);
|
|
20260
20282
|
// Define the module types and their associated element types
|
|
20261
20283
|
var moduleElements = (_b = {},
|
|
@@ -20333,6 +20355,7 @@ var elementEvents = (_c = {},
|
|
|
20333
20355
|
],
|
|
20334
20356
|
_c[ElementType.LCD] = [
|
|
20335
20357
|
__assign(__assign({}, CEEAT[EventType.SETUP]), { defaultConfig: grid_protocol.GRID_ACTIONSTRING_LCD_INIT }),
|
|
20358
|
+
__assign(__assign({}, CEEAT[EventType.DRAW]), { defaultConfig: grid_protocol.GRID_ACTIONSTRING_LCD_DRAW }),
|
|
20336
20359
|
],
|
|
20337
20360
|
_c);
|
|
20338
20361
|
var GridProperty = /** @class */ (function () {
|
|
@@ -28221,46 +28244,55 @@ var cmp_1 = cmp;
|
|
|
28221
28244
|
|
|
28222
28245
|
const { safeRe: re, t } = reExports;
|
|
28223
28246
|
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
this.max = 1000;
|
|
28227
|
-
this.map = new Map();
|
|
28228
|
-
}
|
|
28247
|
+
var lrucache;
|
|
28248
|
+
var hasRequiredLrucache;
|
|
28229
28249
|
|
|
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
|
-
}
|
|
28250
|
+
function requireLrucache () {
|
|
28251
|
+
if (hasRequiredLrucache) return lrucache;
|
|
28252
|
+
hasRequiredLrucache = 1;
|
|
28241
28253
|
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28254
|
+
class LRUCache {
|
|
28255
|
+
constructor () {
|
|
28256
|
+
this.max = 1000;
|
|
28257
|
+
this.map = new Map();
|
|
28258
|
+
}
|
|
28245
28259
|
|
|
28246
|
-
|
|
28247
|
-
|
|
28260
|
+
get (key) {
|
|
28261
|
+
const value = this.map.get(key);
|
|
28262
|
+
if (value === undefined) {
|
|
28263
|
+
return undefined
|
|
28264
|
+
} else {
|
|
28265
|
+
// Remove the key from the map and add it to the end
|
|
28266
|
+
this.map.delete(key);
|
|
28267
|
+
this.map.set(key, value);
|
|
28268
|
+
return value
|
|
28269
|
+
}
|
|
28270
|
+
}
|
|
28248
28271
|
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
const firstKey = this.map.keys().next().value;
|
|
28253
|
-
this.delete(firstKey);
|
|
28254
|
-
}
|
|
28272
|
+
delete (key) {
|
|
28273
|
+
return this.map.delete(key)
|
|
28274
|
+
}
|
|
28255
28275
|
|
|
28256
|
-
|
|
28257
|
-
|
|
28276
|
+
set (key, value) {
|
|
28277
|
+
const deleted = this.delete(key);
|
|
28258
28278
|
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28279
|
+
if (!deleted && value !== undefined) {
|
|
28280
|
+
// If cache is full, delete the least recently used item
|
|
28281
|
+
if (this.map.size >= this.max) {
|
|
28282
|
+
const firstKey = this.map.keys().next().value;
|
|
28283
|
+
this.delete(firstKey);
|
|
28284
|
+
}
|
|
28262
28285
|
|
|
28263
|
-
|
|
28286
|
+
this.map.set(key, value);
|
|
28287
|
+
}
|
|
28288
|
+
|
|
28289
|
+
return this
|
|
28290
|
+
}
|
|
28291
|
+
}
|
|
28292
|
+
|
|
28293
|
+
lrucache = LRUCache;
|
|
28294
|
+
return lrucache;
|
|
28295
|
+
}
|
|
28264
28296
|
|
|
28265
28297
|
var range;
|
|
28266
28298
|
var hasRequiredRange;
|
|
@@ -28483,7 +28515,7 @@ function requireRange () {
|
|
|
28483
28515
|
|
|
28484
28516
|
range = Range;
|
|
28485
28517
|
|
|
28486
|
-
const LRU =
|
|
28518
|
+
const LRU = requireLrucache();
|
|
28487
28519
|
const cache = new LRU();
|
|
28488
28520
|
|
|
28489
28521
|
const parseOptions = parseOptions_1;
|