Callback for MidiOverlay?
-
I sat up the Broadcaster to register a mouse event when the mouse is over the MidiOverlay component, and that is working fine, however if I drag a midi file to the component, the broadcaster doesn't register any events.
Is there another way to get a callback from the Floatingtile?
-
@ulrik hey Ulrik, did you manage to solve this? i have the same issue. my midioverlay panel doesnt repaint when i add a midi file in. it only shows up when i press play
-
@Adam_G I skipped the floating tile and used a panel instead.
-
@ulrik ahh thanks for the tip :)
-
@ulrik said in Callback for MidiOverlay?:
@Adam_G I skipped the floating tile and used a panel instead.
trying to use this but im not sure what goes into callbackLevel and dropFunction. im assuming wildcard is "*.mid" ?
-
@Adam_G this is a code I have in one project
DropPnl.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.setFont("default", 12); g.fillAll("0xff666666"); var text = this.data.text.length > 0 ? this.data.text : "Midi Drop"; g.setColour(Colours.white); g.drawFittedText(text + "\n" + this.data.filename, this.getLocalBounds(0), "centred", 2, 0); }); DropPnl.setFileDropCallback("All Callbacks", "*.mid", function(file) { if (file.hover) { this.data.text = "Drop to load!"; // Getting the midi file name from the path string this.data.filename = file.fileName.substring(file.fileName.lastIndexOf("/")+1, file.fileName.lastIndexOf(".")); this.data.dropped = false; this.changed(); } if (file.drop) { var obj = {}; obj.fileName = file.fileName; this.setValue(obj); this.data.text = "loaded"; this.data.dropped = true; this.changed(); } }); // Drop Panel Callback inline function onDropPnlControl(component, value) { if (isDefined(value.fileName) && component.data.dropped == true) { MPlayer.setFile(value.fileName, true, true); // SET TOPBAR PARAMETERS setParameters(); } }; Content.getComponent("DropPnl").setControlCallback(onDropPnlControl);
Maybe you can get some information from that
-
@ulrik very much appreciated! everything looks to be working good until i drop midi file, then i get error:
Interface:! Line 37, column 21: Aborting script execution after error occured during changed() callback {SW50ZXJmYWNlfHwxMDA3fDM3fDIx}
maybe im missing something?
-
@ulrik i started a new thread for this. perhaps you could take a look at the snippet ive shared there and let me know if im on the right track- https://forum.hise.audio/topic/7530/midi-player-drop-panel/4