|
From: <tt_...@gm...> - 2004-09-10 12:35:21
|
Hi Hiroo,
a quick test shows that this hack doesn't work, alas.
Hiroo Hayashi wrote:
> Torsten,
>
> Does this solve your problem?
>
> Index: Converter.java
> ===================================================================
> RCS file: /cvsroot/jsynthlib/JSynthLib/core/Converter.java,v
> retrieving revision 1.14
> diff -u -r1.14 Converter.java
> --- Converter.java 6 Sep 2004 21:13:29 -0000 1.14
> +++ Converter.java 10 Sep 2004 04:27:14 -0000
> @@ -31,8 +31,10 @@
> String patchString = patarray[i].getPatchHeader();
> for (int jdrv = 0; jdrv < dev.driverCount(); jdrv++) {
> IPatchDriver drv = (IPatchDriver) dev.getDriver(jdrv);
> - if (drv.supportsPatch(patchString, patarray[i].getByteArray()))
> + if (drv.supportsPatch(patchString, patarray[i].getByteArray())) {
> patarray[i].setDriver(drv);
> + break;
> + }
> }
> }
> return patarray;
>
Hiroo Hayashi wrote:
> tt_ml_2_g7> But in the core.Driver.createPatch(SysexMessage[]) method I found only the lines
> tt_ml_2_g7> // if Conveter for the patch exist, convert the patch.
> tt_ml_2_g7> IPatch[] patarray = createPatch(patchSysex);
> And Patch.valueOf() calls it.
Alas Patch.valueof() isn't called anytime.
I've made a small fix with calling
IPatch[] patarray = Patch.valueOf(patchSysex);
instead of
IPatch[] patarray = createPatch(patchSysex);
And now the converter is concerned properly.
I think that the old call missed the proper driver information to work correctly.
But Patch.valueOf() determine the right driver and call the proper createPatch() method.
If you agree, I will commit this fix.
Thanks and bye
Torsten
|