oEffectsPane.add(new KnobWidget("Volume", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x0B, aPart), new YamahaFS1RPerformanceDriver.Sender(0x0B, aPart))); oEffectsPane.add(new CheckBoxWidget("Insertion", p, new YamahaFS1RPerformanceDriver.Model(p, 0x14, aPart), new YamahaFS1RPerformanceDriver.Sender(0x14, aPart))); oEffectsPane.add(new KnobWidget("Dry", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x11, aPart), new YamahaFS1RPerformanceDriver.Sender(0x11, aPart))); oEffectsPane.add(new KnobWidget("Variation", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x12, aPart), new YamahaFS1RPerformanceDriver.Sender(0x12, aPart))); oEffectsPane.add(new KnobWidget("Reverb", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x13, aPart), new YamahaFS1RPerformanceDriver.Sender(0x13, aPart)));
oEffectsPane.add(new KnobWidget("Volume", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model((Patch)p, 0x0B, aPart), new YamahaFS1RPerformanceDriver.Sender(0x0B, aPart))); oEffectsPane.add(new CheckBoxWidget("Insertion", p, new YamahaFS1RPerformanceDriver.Model((Patch)p, 0x14, aPart), new YamahaFS1RPerformanceDriver.Sender(0x14, aPart))); oEffectsPane.add(new KnobWidget("Dry", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model((Patch)p, 0x11, aPart), new YamahaFS1RPerformanceDriver.Sender(0x11, aPart))); oEffectsPane.add(new KnobWidget("Variation", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model((Patch)p, 0x12, aPart), new YamahaFS1RPerformanceDriver.Sender(0x12, aPart))); oEffectsPane.add(new KnobWidget("Reverb", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model((Patch)p, 0x13, aPart), new YamahaFS1RPerformanceDriver.Sender(0x13, aPart)));
	private Container buildPartWindow(final int aPart)	{		JTabbedPane oTabs = new JTabbedPane();		Box oPanel = Box.createVerticalBox();		JPanel oPartPane = new JPanel(new FlowLayout(FlowLayout.LEFT));		// afficher les noms de voices PrA..PrK		YamahaFS1RPerformanceDriver.Model oModel = new YamahaFS1RPerformanceDriver.Model(p, 1, aPart);		ComboBoxWidget oBankCB = new ComboBoxWidget("Bank", p, oModel, new YamahaFS1RPerformanceDriver.Sender(1, aPart), mVoicesBanks);		ItemListener oList1[] = oBankCB.cb.getItemListeners();		oBankCB.cb.removeItemListener(oList1[0]);		oBankCB.addEventListener(new BankItemListener(aPart));		oBankCB.addEventListener(oList1[0]);		mBankSelector[aPart-1] = oBankCB;		oPartPane.add(oBankCB);		mVoiceSelector[aPart-1] = new ComboBoxWidget("Voice", p, new YamahaFS1RPerformanceDriver.Model(p, 2, aPart), new YamahaFS1RPerformanceDriver.Sender(2, aPart), mPrVoices[0]);		// j'inverse l'ordre des listeners sinon le sysex annule		// l'envoi du patch et on retombe sur un son interne du FS1R et non		// celui de la banque courante		ItemListener oList[] = mVoiceSelector[aPart-1].cb.getItemListeners();		mVoiceSelector[aPart-1].cb.removeItemListener(oList[0]);		mVoiceSelector[aPart-1].addEventListener(new ItemListener() {			// send the bank voice to the current part			public void itemStateChanged (ItemEvent e) {				if (e.getStateChange() == ItemEvent.SELECTED)				{					if (mBankSelector[aPart-1].getValue() == 1)					{						// envoi sysex de la voice interne selectionnee						JComboBox oCB = (JComboBox)e.getSource();						Patch oPatch = YamahaFS1RBankDriver.getInstance().getPatch(((YamahaFS1RBankEditor)bankFrame).getBankPatch(), 128+oCB.getSelectedIndex());						YamahaFS1RVoiceDriver.getInstance().sendPatch (oPatch, aPart);					}				}			}		});		mVoiceSelector[aPart-1].addEventListener(oList[0]);		oPartPane.add(mVoiceSelector[aPart-1]);		// get the part voice		JButton oEditButton = new JButton("Edit");		oEditButton.addActionListener(new ActionListener() {			public void actionPerformed (ActionEvent e) {				if (mBankSelector[aPart-1].getValue() == 1 && bankFrame != null) {					// int bank, on edite le voice de la banque					int oIndex = 128+mVoiceSelector[aPart-1].getValue();					PatchEditorFrame oEdit = (PatchEditorFrame)((YamahaFS1RBankEditor)bankFrame).EditPatch(oIndex, aPart);					mVoicesInEdit[aPart-1] = (YamahaFS1RVoiceEditor)oEdit;					oEdit.addJSLFrameListener(new JSLFrameListener() {						public void JSLFrameClosing(JSLFrameEvent e) {							mVoicesInEdit[aPart-1] = null;						}						public void JSLFrameOpened(JSLFrameEvent e) {}						public void JSLFrameActivated(JSLFrameEvent e) {}						public void JSLFrameClosed(JSLFrameEvent e) {}						public void JSLFrameDeactivated(JSLFrameEvent e) {}						public void JSLFrameDeiconified(JSLFrameEvent e) {}						public void JSLFrameIconified(JSLFrameEvent e) {}					});					JSLDesktop.add(oEdit);					oEdit.setVisible(true);					oEdit.moveToFront();				}			}}		);		oPartPane.add(oEditButton);		// TODO gerer le OFF		mPartChannel[aPart-1] = new ComboBoxWidget("Chan", p, new YamahaFS1RPerformanceDriver.Model(p, 0x04, aPart), new YamahaFS1RPerformanceDriver.Sender(0x04, aPart), mPartChannels);		oPartPane.add(mPartChannel[aPart-1]);		oPanel.add(oPartPane);		JPanel oEffectsPane = new JPanel(new FlowLayout(FlowLayout.LEFT));		oEffectsPane.add(new KnobWidget("Volume", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x0B, aPart), new YamahaFS1RPerformanceDriver.Sender(0x0B, aPart)));		oEffectsPane.add(new CheckBoxWidget("Insertion", p, new YamahaFS1RPerformanceDriver.Model(p, 0x14, aPart), new YamahaFS1RPerformanceDriver.Sender(0x14, aPart)));		oEffectsPane.add(new KnobWidget("Dry", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x11, aPart), new YamahaFS1RPerformanceDriver.Sender(0x11, aPart)));		oEffectsPane.add(new KnobWidget("Variation", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x12, aPart), new YamahaFS1RPerformanceDriver.Sender(0x12, aPart)));		oEffectsPane.add(new KnobWidget("Reverb", p, 0, 127, 0, new YamahaFS1RPerformanceDriver.Model(p, 0x13, aPart), new YamahaFS1RPerformanceDriver.Sender(0x13, aPart)));		// TODO gerer le rnd pour 0		oEffectsPane.add(new KnobWidget("Pan", p, 0, 127, -64, new YamahaFS1RPerformanceDriver.Model(p, 0x0E, aPart), new YamahaFS1RPerformanceDriver.Sender(0x0E, aPart)));		oPanel.add(oEffectsPane);		JPanel oFreqPane = new JPanel(new FlowLayout(FlowLayout.LEFT));		oFreqPane.add(new KnobWidget("Note shift", p, 0, 48, -24, new YamahaFS1RPerformanceDriver.Model(p, 8, aPart), new YamahaFS1RPerformanceDriver.Sender(8, aPart)));		oFreqPane.add(new KnobWidget("Detune", p, 0, 127, -64, new YamahaFS1RPerformanceDriver.Model(p, 9, aPart), new YamahaFS1RPerformanceDriver.Sender(9, aPart)));		oPanel.add(oFreqPane);		JPanel oOthersPane = new JPanel(new FlowLayout(FlowLayout.LEFT));		oOthersPane.add(new CheckBoxWidget("Filter", p, new YamahaFS1RPerformanceDriver.Model(p, 7, aPart), new YamahaFS1RPerformanceDriver.Sender(7, aPart)));		oOthersPane.add(new KnobWidget("Cutoff", p, 0, 127, -64, new YamahaFS1RPerformanceDriver.Model(p, 0x18, aPart), new YamahaFS1RPerformanceDriver.Sender(0x18, aPart)));		oOthersPane.add(new KnobWidget("Res", p, 0, 127, -64, new YamahaFS1RPerformanceDriver.Model(p, 0x19, aPart), new YamahaFS1RPerformanceDriver.Sender(0x19, aPart)));		oOthersPane.add(new KnobWidget("EG depth", p, 0, 127, -64, new YamahaFS1RPerformanceDriver.Model(p, 0x1F, aPart), new YamahaFS1RPerformanceDriver.Sender(0x1F, aPart)));		oOthersPane.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Filter", TitledBorder.LEFT, TitledBorder.CENTER));		oPanel.add(oOthersPane);		oTabs.addTab("Main", oPanel);		oTabs.addTab("Details", new PartDetailsWindow(p, aPart));		return oTabs;	}