File: script-mididebug.js

package info (click to toggle)
x42-plugins 20221119-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 16,200 kB
  • sloc: ansic: 225,391; cpp: 11,189; makefile: 4,834; objc: 468; sh: 244; javascript: 29
file content (31 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function (event) {

	function hideshowbytes (bytes) {
		var b2 = event.icon.find ('[mod-gui-role=byte2]');
		var b3 = event.icon.find ('[mod-gui-role=byte3]');
		if (bytes == 1) {
			b2.css('display', 'none');
			b3.css('display', 'none');
		} else if (bytes == 2) {
			b2.css('display', 'inline-block');
			b3.css('display', 'none');
		} else {
			b2.css('display', 'inline-block');
			b3.css('display', 'inline-block');
		}
	}

	if (event.type == 'start') {
		var ports = event.ports;
		for (var p in ports) {
			if (ports[p].symbol == 'bytes') {
				hideshowbytes (event.value);
			}
		}
	}
	else if (event.type == 'change') {
		if (event.symbol == 'bytes') {
			hideshowbytes (event.value);
		}
	}
}