while (PatchEdit.MidiIn.messagesWaiting (prefsDialog.masterController)>0)
while (PatchEdit.MidiIn.messagesWaiting (appConfig.getMasterController())>0)
            public void actionPerformed (ActionEvent evt)            {                                try                {                    //FIXME there is a bug in the javaMIDI classes so this routine gets the inputmessages from the faderbox as well as the                    // master controller. I cant figure out a way to fix it so let's just handle them here.                                        if ((prefsDialog.faderEnable) &(PatchEdit.MidiIn.messagesWaiting (prefsDialog.masterController)>0))                        for (int i=0;i<33;i++) newFaderValue[i]=255;                    while (PatchEdit.MidiIn.messagesWaiting (prefsDialog.masterController)>0)                    {                        int size;                         int port;                        size=PatchEdit.MidiIn.readMessage (prefsDialog.masterController,buffer,128);                        p=PatchEdit.Clipboard;                        if ((desktop.getSelectedFrame () instanceof PatchBasket)&&(!(desktop.getSelectedFrame () instanceof PatchEditorFrame)))                        {                            if ((desktop.getSelectedFrame () instanceof LibraryFrame ) &                            ((LibraryFrame)((desktop.getSelectedFrame ()))).table.getSelectedRowCount ()==0)                                break;                            ((PatchBasket)desktop.getSelectedFrame ()).CopySelectedPatch ();                        }                        else                             Clipboard=((PatchEditorFrame)desktop.getSelectedFrame ()).p;                        //   port=(PatchEdit.deviceList.get (Clipboard.deviceNum)).                        port=((Device) (PatchEdit.deviceList.get (Clipboard.deviceNum))).getPort();                        if ((prefsDialog.faderEnable)&(desktop.getSelectedFrame () instanceof PatchEditorFrame) && (buffer[0]&0xF0) == 0xB0)                            sendFaderMessage (buffer[0],buffer[1],buffer[2]);                        else                        {                            if (((buffer[0] & 0xF0) > 0x70) && ((buffer[0] & 0xF0) <0xF0 ))                                buffer[0]=(byte)((buffer[0] & 0xF0) +((Device) (PatchEdit.deviceList.get (Clipboard.deviceNum))).getChannel()-1);                            PatchEdit.MidiOut.writeLongMessage (port,buffer,size);                        }                        PatchEdit.Clipboard=p;                    }                                    } catch (Exception ex)                {ErrorMsg.reportStatus (ex);};                            }