mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-11 00:10:40 +00:00
fix
This commit is contained in:
@@ -642,6 +642,8 @@
|
||||
new MIDIInterface(function(midi) {
|
||||
that._midi = midi;
|
||||
});
|
||||
|
||||
this.addWidget("combo","Device",this.properties.port,{ property: "port", values: this.getMIDIOutputs.bind(this) });
|
||||
}
|
||||
|
||||
LGMIDIOut.MIDIInterface = MIDIInterface;
|
||||
@@ -650,22 +652,28 @@
|
||||
LGMIDIOut.desc = "Sends MIDI to output channel";
|
||||
LGMIDIOut.color = MIDI_COLOR;
|
||||
|
||||
LGMIDIOut.prototype.getPropertyInfo = function(name) {
|
||||
LGMIDIOut.prototype.onGetPropertyInfo = function(name) {
|
||||
if (!this._midi) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == "port") {
|
||||
var values = {};
|
||||
for (var i = 0; i < this._midi.output_ports.size; ++i) {
|
||||
var output = this._midi.output_ports.get(i);
|
||||
values[i] =
|
||||
i + ".- " + output.name + " version:" + output.version;
|
||||
}
|
||||
var values = this.getMIDIOutputs();
|
||||
return { type: "enum", values: values };
|
||||
}
|
||||
};
|
||||
|
||||
LGMIDIOut.prototype.getMIDIOutputs = function()
|
||||
{
|
||||
var values = {};
|
||||
for (var i = 0; i < this._midi.output_ports.size; ++i) {
|
||||
var output = this._midi.output_ports.get(i);
|
||||
if(output)
|
||||
values[i] = i + ".- " + output.name + " version:" + output.version;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
LGMIDIOut.prototype.onAction = function(event, midi_event) {
|
||||
//console.log(midi_event);
|
||||
if (!this._midi) {
|
||||
@@ -687,6 +695,7 @@
|
||||
|
||||
LiteGraph.registerNodeType("midi/output", LGMIDIOut);
|
||||
|
||||
|
||||
function LGMIDIShow() {
|
||||
this.addInput("on_midi", LiteGraph.EVENT);
|
||||
this._str = "";
|
||||
|
||||
Reference in New Issue
Block a user