From: Hiroo H. <hir...@co...> - 2005-01-29 04:52:45
|
Hi Denis, YAMAHA FS1R Performance Editor causes NullPointerException on both the latest release and the current CVS version. How to reproduce the bug; 1. "create new patch" -> select "Yamaha FS1R Performance" 2. "edit" the patch (herbie) hiroo[518] java -jar JSynthLib-0.19-pre1.jar 2 DBG>Something selected "JavaSound" DBG>Initializing driver:JavaSound DBG>open inport: Yamaha PCI External MIDI, port: 8 DBG>open outport: Yamaha PCI FM Synthesizer, port: 10 DBG>"JSynthLib Tool Bar" activated. =2E.. DBG>"JSynthLib Tool Bar" deactivated. DBG>"aaa.patchlib" activated. DBG>"aaa.patchlib" selected DBG>open inport: MIDI Yoke NT: 1, port: 0 DBG>"aaa.patchlib" deactivated. DBG>"Yamaha FS1R Performance Editor" activated. java.lang.NullPointerException at synthdrivers.YamahaFS1R.YamahaFS1RPerformanceEditor$1.JSLFrameAc= tivated(YamahaFS1RPerformanceEditor.java:115) at core.JSLFrame$JSLJFrame.windowActivated(JSLFrame.java:287) at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.= java:331) =2E... Here is the method which throws the exception. protected void frameOpened() { super.frameOpened(); for (int oPart =3D 0; oPart < 4; oPart++)=20 { // send part voice if bank is int if (mBankSelector[oPart].getValue() =3D=3D 1)// && mPartChannel[oPart].g= etValue() !=3D 17) { Patch oPatch =3D null; if (mVoicesInEdit[oPart] !=3D null) { // voice currently in editing oPatch =3D (Patch)mVoicesInEdit[oPart].getPatch(); } else=20 { oPatch =3D (Patch)YamahaFS1RBankDriver.getInstance().getPatch(((Yamaha= FS1RBankEditor)bankFrame).getBankPatch(), 128+mVoiceSelector[oPart].getValu= e()); } //System.out.println("SEND VOICE "+oPart+" "+mVoiceSelector[oPart].getV= alue()); YamahaFS1RVoiceDriver.getInstance().sendPatch (oPatch, oPart+1); } } } Both "mBankSelector[oPart].getValue() =3D=3D 1" and "mVoicesInEdit[oPart] != =3D null" are true, but "bankFrame" is null. I'm guessing the below may be a fix, but I don't understand this code well. if (mVoicesInEdit[oPart] !=3D null) { // voice currently in editing oPatch =3D (Patch)mVoicesInEdit[oPart].getPatch(); YamahaFS1RVoiceDriver.getInstance().sendPatch (oPatch, oPar= t+1); } else if (bankFrame !=3D null) { oPatch =3D (Patch)YamahaFS1RBankDriver.get Instance().getPatch(((YamahaFS= 1RBankEditor)bankFrame).getBankPatch(),128+mVoiceSelector[oPart].getValue()= ); YamahaFS1RVoiceDriver.getInstance().sendPatch (oPatch, oPar= t+1); } Is this correct? --=20 Hiroo Hayashi |