@mfcc64/ytms 18.1.0 → 18.2.0
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/package.json +1 -1
- package/script.mjs +80 -102
package/package.json
CHANGED
package/script.mjs
CHANGED
|
@@ -340,7 +340,7 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
340
340
|
menu.appendChild(menu_img);
|
|
341
341
|
var menu_is_hidden = true;
|
|
342
342
|
var menu_div = document.createElement("div");
|
|
343
|
-
var menu_table = document.createElement("
|
|
343
|
+
var menu_table = document.createElement("div");
|
|
344
344
|
set_fixed_style(menu_div, 10000001);
|
|
345
345
|
menu_div.style.left = "0px";
|
|
346
346
|
menu_div.style.top = "0px";
|
|
@@ -349,70 +349,66 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
349
349
|
menu_div.style.color = "white";
|
|
350
350
|
menu_div.style.fontSize = "10pt";
|
|
351
351
|
menu_div.style.backgroundColor = "#000000DD";
|
|
352
|
-
menu_div.style.
|
|
353
|
-
menu_div.style.
|
|
354
|
-
menu_div.style.
|
|
352
|
+
menu_div.style.maxHeight = "100%";
|
|
353
|
+
menu_div.style.maxWidth = "100%";
|
|
354
|
+
menu_div.style.boxSizing = "border-box";
|
|
355
355
|
menu_div.style.overflow = "auto";
|
|
356
356
|
menu_div.style.scrollbarWidth = "8px";
|
|
357
357
|
menu_div.style.scrollbarColor = "#555555 #222222dd";
|
|
358
358
|
menu_div.style.visibility = "hidden";
|
|
359
359
|
menu_div.style.cursor = "default";
|
|
360
|
-
menu_table.style.width = "860px";
|
|
361
360
|
menu_div.style.display = "block";
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
361
|
+
menu_table.style.display = "grid";
|
|
362
|
+
menu_table.style.padding = "0px";
|
|
363
|
+
menu_table.style.margin = "0px";
|
|
364
|
+
menu_table.style.border = "0px";
|
|
365
|
+
menu_table.style.gridTemplateColumns = "repeat(3, 48px 80px 80px 40px 32px)";
|
|
366
|
+
menu_table.style.gridAutoRows = "32px";
|
|
367
|
+
menu_table.style.alignItems = "center";
|
|
368
|
+
|
|
369
|
+
function get_grid_item(n) {
|
|
370
|
+
var div = document.createElement("div");
|
|
371
|
+
div.style.display = "block";
|
|
372
|
+
div.style.padding = "0px";
|
|
373
|
+
div.style.margin = "0px";
|
|
374
|
+
div.style.border = "0px";
|
|
375
|
+
div.style.overflow = "hidden";
|
|
376
|
+
div.style.whiteSpace = "nowrap";
|
|
377
|
+
div.style.lineHeight = "1em";
|
|
378
|
+
div.style.gridColumn = "span " + n;
|
|
379
|
+
menu_table.appendChild(div);
|
|
380
|
+
return div;
|
|
377
381
|
}
|
|
378
382
|
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
|
|
383
|
+
function set_common_stretched_input_style(e) {
|
|
384
|
+
e.style.cursor = "pointer";
|
|
385
|
+
e.style.width = "100%";
|
|
386
|
+
e.style.margin = "0px";
|
|
387
|
+
e.style.outline = "none";
|
|
388
|
+
e.style.boxSizing = "border-box";
|
|
382
389
|
}
|
|
383
390
|
|
|
384
391
|
function create_child_range_menu(title, name, callback) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
td.style.width = "120px";
|
|
393
|
-
td.colSpan = 2;
|
|
392
|
+
get_grid_item(1);
|
|
393
|
+
var label = get_grid_item(1);
|
|
394
|
+
var container = get_grid_item(2);
|
|
395
|
+
var text = get_grid_item(1);
|
|
396
|
+
label.textContent = title;
|
|
397
|
+
text.style.textAlign = "right";
|
|
398
|
+
|
|
394
399
|
var child = child_menu[name] = document.createElement("input");
|
|
395
|
-
|
|
396
|
-
child.style.cursor = "pointer";
|
|
397
|
-
child.style.width = "100%";
|
|
400
|
+
set_common_stretched_input_style(child);
|
|
398
401
|
child.type = "range";
|
|
399
402
|
child.min = defaults[name].min;
|
|
400
403
|
child.max = defaults[name].max;
|
|
401
404
|
child.step = 1;
|
|
402
405
|
child.value = get_opt(name);
|
|
403
|
-
child.oninput =
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
this.oninput();
|
|
408
|
-
if (callback)
|
|
409
|
-
callback(child);
|
|
406
|
+
child.oninput = () => { text.textContent = child.value; };
|
|
407
|
+
child.onchange = () => {
|
|
408
|
+
child.oninput();
|
|
409
|
+
callback?.(child);
|
|
410
410
|
};
|
|
411
|
-
|
|
412
|
-
tr.appendChild(td);
|
|
413
|
-
tr.appendChild(child_text);
|
|
414
|
-
child_text.style.textAlign = "right";
|
|
415
|
-
child_text.style.width = "32px";
|
|
411
|
+
container.appendChild(child);
|
|
416
412
|
child.onchange();
|
|
417
413
|
}
|
|
418
414
|
|
|
@@ -462,27 +458,27 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
462
458
|
create_child_range_menu("Scale Y", "scale_y", (child) => cqt.dataset.scaleY = child.value);
|
|
463
459
|
|
|
464
460
|
function create_child_select_menu(title, name, select_opt, callback) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
var
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
tr.appendChild(td);
|
|
471
|
-
td = document.createElement("td");
|
|
472
|
-
td.colSpan = 3;
|
|
461
|
+
get_grid_item(1);
|
|
462
|
+
var label = get_grid_item(1);
|
|
463
|
+
var container = get_grid_item(3);
|
|
464
|
+
|
|
465
|
+
label.textContent = title;
|
|
473
466
|
var child = document.createElement("select");
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
child.style.width = "100%";
|
|
467
|
+
set_common_stretched_input_style(child);
|
|
468
|
+
|
|
477
469
|
for (let k = 0; k < select_opt.length; k++) {
|
|
478
470
|
const opt = document.createElement("option");
|
|
479
471
|
opt.textContent = select_opt[k];
|
|
480
472
|
opt.value = k;
|
|
481
473
|
child.appendChild(opt);
|
|
482
474
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
475
|
+
|
|
476
|
+
if (name) {
|
|
477
|
+
child_menu[name] = child;
|
|
478
|
+
child.value = get_opt(name);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
container.appendChild(child);
|
|
486
482
|
child.onchange = () => callback?.(child);
|
|
487
483
|
child.onchange();
|
|
488
484
|
}
|
|
@@ -592,32 +588,24 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
592
588
|
const color_rotation = new ColorRotation();
|
|
593
589
|
|
|
594
590
|
function create_child_color_menu(title, name, callback) {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
var
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
td.style.width = "80px";
|
|
603
|
-
var child_text = document.createElement("td");
|
|
604
|
-
child_text.style.textAlign = "right";
|
|
605
|
-
child_text.colSpan = 2;
|
|
591
|
+
get_grid_item(1);
|
|
592
|
+
var label = get_grid_item(1);
|
|
593
|
+
var container = get_grid_item(1);
|
|
594
|
+
var text = get_grid_item(2);
|
|
595
|
+
|
|
596
|
+
label.textContent = title;
|
|
597
|
+
text.style.textAlign = "right";
|
|
606
598
|
var child = child_menu[name] = document.createElement("input");
|
|
607
|
-
child
|
|
608
|
-
child.style.width = "100%";
|
|
599
|
+
set_common_stretched_input_style(child);
|
|
609
600
|
child.type = "color";
|
|
610
601
|
child.value = number2color(get_opt(name));
|
|
611
|
-
child.onchange =
|
|
612
|
-
|
|
613
|
-
child.textContent = child.value;
|
|
602
|
+
child.onchange = () => {
|
|
603
|
+
text.textContent = child.value;
|
|
614
604
|
callback?.(child);
|
|
615
605
|
update_color_table();
|
|
616
606
|
};
|
|
617
607
|
child.oninput = child.onchange;
|
|
618
|
-
|
|
619
|
-
tr.appendChild(td);
|
|
620
|
-
tr.appendChild(child_text);
|
|
608
|
+
container.appendChild(child);
|
|
621
609
|
child.onchange();
|
|
622
610
|
}
|
|
623
611
|
|
|
@@ -779,25 +767,19 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
779
767
|
cqt.post_render_callback = p => line_visualizer.render(p);
|
|
780
768
|
|
|
781
769
|
function create_child_checkbox_menu(title, name, callback) {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
var
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
tr.appendChild(td);
|
|
788
|
-
td = document.createElement("td");
|
|
789
|
-
td.colSpan = 3;
|
|
770
|
+
get_grid_item(1);
|
|
771
|
+
var label = get_grid_item(1);
|
|
772
|
+
var container = get_grid_item(3)
|
|
773
|
+
|
|
774
|
+
label.textContent = title;
|
|
790
775
|
var child = child_menu[name] = document.createElement("input");
|
|
791
776
|
child.style.cursor = "pointer";
|
|
777
|
+
child.style.outline = "none";
|
|
792
778
|
child.type = "checkbox";
|
|
793
779
|
child.checked = get_opt(name) * 1;
|
|
794
|
-
child.onchange =
|
|
795
|
-
|
|
796
|
-
callback(child);
|
|
797
|
-
};
|
|
780
|
+
child.onchange = () => callback?.(child);
|
|
781
|
+
container.appendChild(child);
|
|
798
782
|
child.onchange();
|
|
799
|
-
td.appendChild(child);
|
|
800
|
-
tr.appendChild(td);
|
|
801
783
|
}
|
|
802
784
|
|
|
803
785
|
create_child_range_menu("Peak Range", "peak_range");
|
|
@@ -906,20 +888,17 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
906
888
|
}
|
|
907
889
|
create_child_select_presets();
|
|
908
890
|
|
|
909
|
-
|
|
910
|
-
set_common_tr_style(get_menu_table_tr());
|
|
911
|
-
current_tr = null;
|
|
891
|
+
get_grid_item(15);
|
|
912
892
|
|
|
913
|
-
var child_buttons_td =
|
|
914
|
-
child_buttons_td.colSpan = 4 * 3;
|
|
893
|
+
var child_buttons_td = get_grid_item(15);
|
|
915
894
|
child_buttons_td.style.textAlign = "right";
|
|
916
|
-
get_menu_table_tr().appendChild(child_buttons_td);
|
|
917
895
|
|
|
918
896
|
function create_child_button_menu(title, callback) {
|
|
919
897
|
var child = document.createElement("input");
|
|
920
898
|
child.type = "button";
|
|
921
899
|
child.value = title;
|
|
922
900
|
child.style.cursor = "pointer";
|
|
901
|
+
child.style.outline = "none";
|
|
923
902
|
child.style.fontFamily = "inherit";
|
|
924
903
|
child.style.fontSize = "inherit";
|
|
925
904
|
child.style.marginLeft = "8px";
|
|
@@ -963,8 +942,7 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
|
|
|
963
942
|
setTimeout(function(){ child.value = "Reset Default Settings"; }, 300);
|
|
964
943
|
});
|
|
965
944
|
|
|
966
|
-
|
|
967
|
-
.appendChild(menu_table);
|
|
945
|
+
menu_div.appendChild(menu_table);
|
|
968
946
|
menu.onclick = function() {
|
|
969
947
|
menu_is_hidden = !menu_is_hidden;
|
|
970
948
|
if (menu_is_hidden)
|