iconnectivity-js
Advanced tools
Comparing version 1.1.5 to 1.2.0
@@ -78,2 +78,5 @@ "use strict"; | ||
try { | ||
// Explicitly try to open the device's MIDI ports | ||
await input.open(); | ||
await output.open(); | ||
const device = new connection_1.Connection(input, output); | ||
@@ -91,2 +94,11 @@ const deviceInfo = await (0, get_device_1.getDevice)({ device }); | ||
const devices = (0, uniqBy_1.default)(answers.filter(array_1.isTruthy), (d) => d.serialNumberString); | ||
// Close MIDI ports of unused devices | ||
for (const output of this.midiAccess.outputs.values()) { | ||
const input = inputs.find((input) => input.name === output.name); | ||
if (!input || devices.some((d) => d.output.id === output.id)) { | ||
continue; | ||
} | ||
await input.close(); | ||
await output.close(); | ||
} | ||
return devices; | ||
@@ -93,0 +105,0 @@ } |
{ | ||
"name": "iconnectivity-js", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81577
1749