From: Joe E. <jo...@em...> - 2005-03-08 04:38:16
|
This is making me really depressed. I'm trying.... again... to make a synthdriver. I figured I'd start with baby steps. All I wanted to do is make a driver that can receive a sysex message and dump it to the console. Before I even do *that*, I figured that I'd skip the sysex part and just try to create a blank patch and then see if I could dump it to the console. The dump is supposed to happen when I go to "Edit.." the patch. So, I made a Device class: > public class AlesisSR16Device extends Device { > > public AlesisSR16Device () { > super("Alesis", "SR-16", "000000000000000E0E000.00........f7", > "Let's see how this goes....", > "Joe Emenaker"); > } > > public AlesisSR16Device(Preferences prefs) { > this(); > this.prefs = prefs; > > addDriver (new HexDumpDriver ()); > } > } Then, I made HexDumpDriver..... > public class HexDumpDriver extends Driver { > > public HexDumpDriver() { > super("Sysex", "Joe Emenaker"); > sysexID = "F000000E13****"; > } > > public HexDumpDriver(String patchType, String authors) { > super(patchType, authors); > } > > boolean hasEditor() { > return true; > } > > protected JSLFrame editPatch(Patch p) { > SysexMessage[] messages = p.getMessages(); > for(int i=0; i<messages.length; i++) { > > System.out.println(core.Utility.hexDump(messages[i].getData(),0,-1,16)); > } > return null; > } > > protected Patch createNewPatch() { > byte[] b = new byte[20]; > for(int i=0; i<b.length; i++) { > b[i] = (byte) i; > } > Patch p = new Patch(new byte[20]); > editPatch(p); > return(p); > } I overrode editPatch() and I even overrode hasEditor(), but I still get no editor choice when I right-click on a new patch that I create. So... tell me what an idiot I'm being. - Joe |