Subversion Repositories svn.mios

Compare Revisions

Ignore whitespace Rev 807 → Rev 808

/trunk/java/org/midibox/midi/MidiParameterControlManagerDevice.java
File deleted
/trunk/java/org/midibox/midi/MidiMapDevice.java
File deleted
/trunk/java/org/midibox/midi/SysexSendReceiveDeviceManager.java
File deleted
/trunk/java/org/midibox/midi/MidiRouterDevice.java
File deleted
\ No newline at end of file
/trunk/java/org/midibox/midi/MidiFilterDeviceManager.java
File deleted
/trunk/java/org/midibox/midi/SysexSendReceiveDevice.java
File deleted
/trunk/java/org/midibox/midi/MidiFilterDevice.java
File deleted
/trunk/java/org/midibox/midi/MidiKeyboardControllerDevice.java
File deleted
/trunk/java/org/midibox/midi/MidiMonitorFilteredDevice.java
File deleted
/trunk/java/org/midibox/midi/MidiMapDeviceManager.java
File deleted
/trunk/java/org/midibox/midi/gui/MidiMapDeviceManagerGUI.java
File deleted
\ No newline at end of file
/trunk/java/org/midibox/midi/gui/SysexSendReceiveDeviceManagerGUI.java
File deleted
/trunk/java/org/midibox/midi/gui/MidiFilterDeviceManagerGUI.java
File deleted
\ No newline at end of file
/trunk/java/org/midibox/midi/gui/MidiDeviceManagerGUI.java
175,7 → 175,7
((Boolean) value).booleanValue());
 
checkBox.setOpaque(false);
 
checkBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
fireEditingStopped();
/trunk/java/org/midibox/midi/gui/MidiDeviceRoutingGUI.java
48,6 → 48,7
import java.util.Vector;
 
import javax.sound.midi.MidiDevice;
import javax.sound.midi.Receiver;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
72,6 → 73,7
import javax.swing.event.ListSelectionListener;
 
import org.midibox.midi.MidiDeviceRouting;
import org.midibox.midi.VirtualMidiDevice;
import org.midibox.utils.gui.DialogOwner;
import org.midibox.utils.gui.GuiUtils;
import org.midibox.utils.gui.ImageLoader;
351,6 → 353,20
}
 
public Icon getMidiDeviceIcon(MidiDevice md) {
 
if (md instanceof VirtualMidiDevice) {
 
Receiver receiver = ((VirtualMidiDevice) md).getMidiInReceiver();
 
if (icons.containsKey(receiver)) {
return (Icon) icons.get(receiver);
}
 
if (icons.containsKey(receiver.getClass())) {
return (Icon) icons.get(receiver.getClass());
}
}
 
if (icons.containsKey(md)) {
return (Icon) icons.get(md);
}
/trunk/java/org/midibox/midi/gui/MidiMapManagerGUI.java
New file
0,0 → 1,233
/*
* @(#)MidiMapDeviceManagerGUI.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi.gui;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Hashtable;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
 
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
 
import org.midibox.midi.MidiMap;
import org.midibox.midi.MidiMapManager;
 
public class MidiMapManagerGUI extends JPanel implements Observer,
ActionListener, ListSelectionListener {
 
private MidiMapManager midiMapDeviceManager;
 
private JTable midiMapsTable;
 
private FiltersDataModel filtersDataModel;
 
private JButton propertiesButton;
 
private JButton removeButton;
 
private Hashtable mapPropertiesDialogs;
 
public MidiMapManagerGUI(MidiMapManager midiMapManager) {
super(new BorderLayout());
this.midiMapDeviceManager = midiMapManager;
midiMapManager.addObserver(this);
add(createMainPanel(), BorderLayout.CENTER);
add(createButtonPanel(), BorderLayout.SOUTH);
mapPropertiesDialogs = new Hashtable();
setButtonStates();
}
 
private JPanel createMainPanel() {
JPanel mainPanel = new JPanel(new BorderLayout());
filtersDataModel = new FiltersDataModel(midiMapDeviceManager
.getMidiMaps());
midiMapsTable = new JTable(filtersDataModel);
midiMapsTable.getSelectionModel().setSelectionMode(
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
midiMapsTable.getSelectionModel().addListSelectionListener(this);
midiMapsTable
.setPreferredScrollableViewportSize(new Dimension(200, 200));
JScrollPane scrollPane = new JScrollPane(midiMapsTable);
scrollPane
.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
mainPanel.add(scrollPane);
return mainPanel;
}
 
private JPanel createButtonPanel() {
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
 
JButton button = new JButton("Add Map");
button.setActionCommand("add");
button.addActionListener(this);
buttonPanel.add(button);
 
propertiesButton = new JButton("Map Properites");
propertiesButton.setActionCommand("properties");
propertiesButton.addActionListener(this);
buttonPanel.add(propertiesButton);
 
removeButton = new JButton("Remove Map");
removeButton.setActionCommand("remove");
removeButton.addActionListener(this);
buttonPanel.add(removeButton);
return buttonPanel;
}
 
public MidiMapManager getMidiMapDeviceManager() {
return midiMapDeviceManager;
}
 
private void showMapProperties() {
 
int[] selectedRows = midiMapsTable.getSelectedRows();
 
for (int m = 0; m < selectedRows.length; m++) {
 
final MidiMap midiMap = (MidiMap) midiMapDeviceManager
.getMidiMaps().elementAt(selectedRows[m]);
 
if (!mapPropertiesDialogs.containsKey(midiMap)) {
 
final MidiMapGUI midiMapGUI = new MidiMapGUI(midiMap);
 
JDialog mapPropertiesDialog = new JDialog();
mapPropertiesDialog.setContentPane(midiMapGUI);
mapPropertiesDialog.setModal(false);
mapPropertiesDialog
.setTitle("MIDI Map "
+ (midiMapDeviceManager.getMidiMaps().indexOf(
midiMap) + 1));
mapPropertiesDialog.pack();
mapPropertiesDialog.setLocationRelativeTo(this);
Point location = mapPropertiesDialog.getLocation();
mapPropertiesDialog.setLocation(location.x + m * 20, location.y
+ m * 20);
mapPropertiesDialog.setVisible(true);
 
mapPropertiesDialogs.put(midiMap, mapPropertiesDialog);
 
mapPropertiesDialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
midiMap.deleteObserver(midiMapGUI);
mapPropertiesDialogs.remove(midiMap);
}
});
}
((JDialog) mapPropertiesDialogs.get(midiMap)).requestFocus();
}
}
 
private void setButtonStates() {
boolean rowSelected = midiMapsTable.getSelectedRowCount() > 0;
propertiesButton.setEnabled(rowSelected);
removeButton.setEnabled(rowSelected);
}
 
public void valueChanged(ListSelectionEvent lse) {
setButtonStates();
}
 
public void update(Observable observable, Object object) {
if (observable == midiMapDeviceManager) {
filtersDataModel.fireTableDataChanged();
}
}
 
public void actionPerformed(ActionEvent ae) {
String actionCommand = ae.getActionCommand();
 
if (actionCommand.equals("add")) {
midiMapDeviceManager.addMidiMap();
} else if (actionCommand.equals("properties")) {
showMapProperties();
} else if (actionCommand.equals("remove")) {
 
int[] selectedRows = midiMapsTable.getSelectedRows();
 
for (int m = selectedRows.length - 1; m >= 0; m--) {
midiMapDeviceManager
.removeMidiMap((MidiMap) midiMapDeviceManager
.getMidiMaps().elementAt(selectedRows[m]));
}
}
}
 
class FiltersDataModel extends DefaultTableModel {
private String[] headers = { "Map Name" };
 
private Vector midiMaps;
 
public FiltersDataModel(Vector midiMaps) {
this.midiMaps = midiMaps;
}
 
public int getColumnCount() {
return headers.length;
}
 
public int getRowCount() {
if (midiMaps != null) {
return midiMaps.size();
}
return 0;
}
 
public String getColumnName(int col) {
return headers[col];
}
 
public Object getValueAt(int row, int col) {
 
MidiMap midiMap = (MidiMap) midiMaps.elementAt(row);
 
if (col == 0) {
return "MIDI Map " + (row + 1);
}
 
return null;
}
 
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
 
public boolean isCellEditable(int row, int col) {
return false;
}
}
}
/trunk/java/org/midibox/midi/gui/SysexSendReceiveManagerGUI.java
New file
0,0 → 1,205
/*
* @(#)SysexSendReceiveDeviceManagerGUI.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi.gui;
 
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
 
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
 
import org.midibox.midi.SysexSendReceive;
import org.midibox.midi.SysexSendReceiveManager;
import org.midibox.utils.gui.ImageLoader;
 
public class SysexSendReceiveManagerGUI extends JPanel implements
ActionListener, Observer {
 
private SysexSendReceiveManager sysexSendReceiveManager;
 
private JTabbedPane tabbedPane;
 
private Vector sysexSendReceiveGUIs;
 
public SysexSendReceiveManagerGUI(SysexSendReceiveManager uploadTaskManager) {
super(new BorderLayout());
 
this.sysexSendReceiveManager = uploadTaskManager;
uploadTaskManager.addObserver(this);
 
sysexSendReceiveGUIs = new Vector();
 
add(createButtonPanel(), BorderLayout.NORTH);
add(createTabPanel(), BorderLayout.CENTER);
 
createGUIs();
}
 
private JPanel createButtonPanel() {
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 4));
 
JLabel label = new JLabel("Sysex Send/Receive:", JLabel.LEFT);
label.setOpaque(true);
buttonPanel.add(label);
buttonPanel.add(Box.createHorizontalStrut(10));
 
JButton button = new JButton("New Tab");
button.setActionCommand("newSendReceive");
button.setToolTipText("Open new upload tab");
button.addActionListener(this);
buttonPanel.add(button);
 
button = new JButton("Close Tab");
button.setActionCommand("closeSendReceive");
button.setToolTipText("Close current upload tab");
button.addActionListener(this);
buttonPanel.add(button);
 
return buttonPanel;
}
 
private JPanel createTabPanel() {
JPanel tabPanel = new JPanel(new BorderLayout());
tabbedPane = new JTabbedPane();
tabPanel.add(tabbedPane, BorderLayout.CENTER);
tabPanel.add(new JSeparator(JSeparator.HORIZONTAL), BorderLayout.NORTH);
 
return tabPanel;
}
 
private void createGUIs() {
 
Iterator it = sysexSendReceiveManager.getSysexSendReceives().iterator();
 
while (it.hasNext()) {
 
SysexSendReceive sysexSendReceive = (SysexSendReceive) it.next();
 
boolean hasGUI = false;
 
Iterator it2 = sysexSendReceiveGUIs.iterator();
 
while (it2.hasNext()) {
 
SysexSendReceiveGUI sysexSendReceiveGUI = (SysexSendReceiveGUI) it2
.next();
 
if (sysexSendReceiveGUI.getSysexSendReceive() == sysexSendReceive) {
hasGUI = true;
}
}
 
if (!hasGUI) {
 
SysexSendReceiveGUI sysexSendReceiveGUI = new SysexSendReceiveGUI(
sysexSendReceive);
 
sysexSendReceiveGUIs.add(sysexSendReceiveGUI);
 
tabbedPane.addTab("Sysex Send/Receive"
+ (sysexSendReceiveManager.getSysexSendReceives()
.indexOf(sysexSendReceive) + 1), ImageLoader
.getImageIcon("sysex.png"), sysexSendReceiveGUI);
}
}
 
it = ((Vector) sysexSendReceiveGUIs.clone()).iterator();
 
while (it.hasNext()) {
 
SysexSendReceiveGUI sysexSendReceiveGUI = (SysexSendReceiveGUI) it
.next();
 
boolean hasDevice = false;
 
Iterator it2 = sysexSendReceiveManager.getSysexSendReceives()
.iterator();
 
while (it2.hasNext()) {
 
SysexSendReceive sysexSendReceive = (SysexSendReceive) it2
.next();
 
if (sysexSendReceiveGUI.getSysexSendReceive() == sysexSendReceive) {
hasDevice = true;
}
}
 
if (!hasDevice) {
sysexSendReceiveGUIs.remove(sysexSendReceiveGUI);
tabbedPane.remove(sysexSendReceiveGUI);
}
}
 
for (int i = 0; i < sysexSendReceiveManager.getSysexSendReceives()
.size(); i++) {
 
tabbedPane.setTitleAt(i, "Sysex Send/Receive " + (i + 1));
}
}
 
public void addNewSendReceiveTab() {
sysexSendReceiveManager.newSysexSendReceive();
}
 
public void closeSendReceiveTab() {
int selectedTab = tabbedPane.getSelectedIndex();
 
if (selectedTab > -1) {
sysexSendReceiveManager
.removeSysexSendReceive((SysexSendReceive) sysexSendReceiveManager
.getSysexSendReceives().elementAt(selectedTab));
}
}
 
public JTabbedPane getTabbedPane() {
return tabbedPane;
}
 
public void update(Observable observable, Object object) {
if (observable == sysexSendReceiveManager) {
createGUIs();
}
}
 
public void actionPerformed(ActionEvent ae) {
 
String command = ae.getActionCommand();
 
if (command.equals("newSendReceive")) {
addNewSendReceiveTab();
}
 
if (command.equals("closeSendReceive")) {
closeSendReceiveTab();
}
}
}
/trunk/java/org/midibox/midi/gui/MidiFilterManagerGUI.java
New file
0,0 → 1,239
/*
* @(#)MidiFilterDeviceManagerGUI.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi.gui;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Hashtable;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
 
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
 
import org.midibox.midi.MidiFilter;
import org.midibox.midi.MidiFilterManager;
import org.midibox.utils.gui.DialogOwner;
 
public class MidiFilterManagerGUI extends JPanel implements Observer,
ActionListener, ListSelectionListener {
 
private MidiFilterManager midiFilterManager;
 
private JTable midiFiltersTable;
 
private FiltersDataModel filtersDataModel;
 
private JButton propertiesButton;
 
private JButton removeButton;
 
private Hashtable filterPropertiesDialogs;
 
public MidiFilterManagerGUI(MidiFilterManager midiFilterManager) {
super(new BorderLayout());
this.midiFilterManager = midiFilterManager;
midiFilterManager.addObserver(this);
add(createMainPanel(), BorderLayout.CENTER);
add(createButtonPanel(), BorderLayout.SOUTH);
filterPropertiesDialogs = new Hashtable();
setButtonStates();
}
 
private JPanel createMainPanel() {
JPanel mainPanel = new JPanel(new BorderLayout());
filtersDataModel = new FiltersDataModel(midiFilterManager
.getMidiFilters());
midiFiltersTable = new JTable(filtersDataModel);
midiFiltersTable.getSelectionModel().setSelectionMode(
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
midiFiltersTable.getSelectionModel().addListSelectionListener(this);
midiFiltersTable.setPreferredScrollableViewportSize(new Dimension(200,
200));
JScrollPane scrollPane = new JScrollPane(midiFiltersTable);
scrollPane
.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
mainPanel.add(scrollPane);
return mainPanel;
}
 
private JPanel createButtonPanel() {
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
 
JButton button = new JButton("Add Filter");
button.setActionCommand("add");
button.addActionListener(this);
buttonPanel.add(button);
 
propertiesButton = new JButton("Filter Properites");
propertiesButton.setActionCommand("properties");
propertiesButton.addActionListener(this);
buttonPanel.add(propertiesButton);
 
removeButton = new JButton("Remove Filter");
removeButton.setActionCommand("remove");
removeButton.addActionListener(this);
buttonPanel.add(removeButton);
return buttonPanel;
}
 
public MidiFilterManager getMidiFilterManager() {
return midiFilterManager;
}
 
private void showFilterProperties() {
 
int[] selectedRows = midiFiltersTable.getSelectedRows();
 
for (int f = 0; f < selectedRows.length; f++) {
 
final MidiFilter midiFilter = (MidiFilter) midiFilterManager
.getMidiFilters().elementAt(selectedRows[f]);
 
if (!filterPropertiesDialogs.containsKey(midiFilter)) {
 
final MidiFilterGUI midiFilterGUI = new MidiFilterGUI(
midiFilter);
 
JDialog filterPropertiesDialog = new JDialog(DialogOwner
.getFrame(), "MIDI Filter"
+ (midiFilterManager.getMidiFilters().indexOf(
midiFilter) + 1));
filterPropertiesDialog.setContentPane(midiFilterGUI);
filterPropertiesDialog.pack();
filterPropertiesDialog.setLocationRelativeTo(this);
Point location = filterPropertiesDialog.getLocation();
filterPropertiesDialog.setLocation(location.x + f * 20,
location.y + f * 20);
filterPropertiesDialog.setVisible(true);
 
filterPropertiesDialogs.put(midiFilter, filterPropertiesDialog);
 
filterPropertiesDialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
midiFilter.deleteObserver(midiFilterGUI);
filterPropertiesDialogs.remove(midiFilter);
}
});
}
((JDialog) filterPropertiesDialogs.get(midiFilter)).requestFocus();
 
}
}
 
private void setButtonStates() {
boolean rowSelected = midiFiltersTable.getSelectedRowCount() > 0;
propertiesButton.setEnabled(rowSelected);
removeButton.setEnabled(rowSelected);
}
 
public void valueChanged(ListSelectionEvent lse) {
setButtonStates();
}
 
public void update(Observable observable, Object object) {
if (observable == midiFilterManager) {
filtersDataModel.fireTableDataChanged();
}
}
 
public void actionPerformed(ActionEvent ae) {
String actionCommand = ae.getActionCommand();
 
if (actionCommand.equals("add")) {
 
midiFilterManager.newMidiFilter();
 
} else if (actionCommand.equals("properties")) {
 
showFilterProperties();
 
} else if (actionCommand.equals("remove")) {
 
int[] selectedRows = midiFiltersTable.getSelectedRows();
 
for (int f = selectedRows.length - 1; f >= 0; f--) {
 
midiFilterManager
.removeMidiFilter((MidiFilter) midiFilterManager
.getMidiFilters().elementAt(selectedRows[f]));
}
}
}
 
class FiltersDataModel extends DefaultTableModel {
private String[] headers = { "Filter Name" };
 
private Vector midiFilterDevices;
 
public FiltersDataModel(Vector midiFilterDevices) {
this.midiFilterDevices = midiFilterDevices;
}
 
public int getColumnCount() {
return headers.length;
}
 
public int getRowCount() {
if (midiFilterDevices != null) {
return midiFilterDevices.size();
}
return 0;
}
 
public String getColumnName(int col) {
return headers[col];
}
 
public Object getValueAt(int row, int col) {
 
MidiFilter midiFilterDevice = (MidiFilter) midiFilterDevices
.elementAt(row);
 
if (col == 0) {
return "MIDI Filter " + (row + 1);
}
return null;
}
 
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
 
public boolean isCellEditable(int row, int col) {
return false;
}
}
}
/trunk/java/org/midibox/midi/gui/MidiFilterGUI.java
117,15 → 117,15
private JTable channelsTable;
 
private DefaultTableModel channelsModel;
 
private JPopupMenu MRUPopupMenu;
 
private SplitButton openMRUButton;
 
private static int maxMRU = 10;
private static int maxMRU = 10;
 
private static String currentDirectory = "";
 
private static Vector MRU = new Vector();
 
private static JFileChooser fc = null;
418,7 → 418,7
 
openMRUButton = new SplitButton(button, MRUPopupMenu);
openMRUButton.setRollover(true);
 
toolBar.add(openMRUButton);
 
button = new JButton(ImageLoader.getImageIcon("save.png"));
463,18 → 463,18
currentDirectory = fc.getCurrentDirectory().toString();
}
}
 
protected void loadFilterDefinition(File file) {
 
if (file.exists()) {
 
MidiFilterXML midiFilterXML = new MidiFilterXML(midiFilter,
MidiFilterXML.TAG_ROOT_ELEMENT);
 
midiFilterXML.loadXML(file);
 
saveMRU(file.getPath());
 
} else {
JOptionPane.showMessageDialog(this,
"MIDI filter definition no longer exists",
481,7 → 481,7
"File does not exist", JOptionPane.ERROR_MESSAGE);
}
}
 
private void buildMRUMenu(JComponent menu) {
 
menu.removeAll();
505,7 → 505,7
menu.add(menuItem, 0);
}
}
 
public static void saveMRU(String file) {
 
MRU.remove(file);
517,7 → 517,7
MRU.removeElementAt(i - 1);
}
}
 
public static Vector getMRU() {
return MRU;
}
548,7 → 548,7
midiFilterXML.saveXML(file);
 
saveMRU(file.getPath());
 
currentDirectory = fc.getCurrentDirectory().toString();
}
}
/trunk/java/org/midibox/midi/gui/SysexSendReceiveGUI.java
298,6 → 298,5
public static void setCurrentDirectory(String currentDirectory) {
SysexSendReceiveGUI.currentDirectory = currentDirectory;
}
 
}
/trunk/java/org/midibox/midi/VirtualMidiDevice.java
45,8 → 45,10
 
protected LinkedList receivers;
 
protected MidiOutPort midiOutPort;
protected Receiver midiInReceiver;
 
protected Receiver midiOutReceiver;
 
protected long timeStart = System.currentTimeMillis();
 
public VirtualMidiDevice(String name, int maxNoTransmitters,
58,10 → 60,11
this.maxNoReceivers = maxNoReceivers;
this.transmitters = new LinkedList();
this.receivers = new LinkedList();
this.midiOutPort = new MidiOutPort();
this.midiOutReceiver = new MidiOutReceiver();
}
 
public void setName(String name) {
 
this.info = new VirtualMidiDevice.MyInfo(name, "midibox.org",
"Virtual MIDI Device", "v1.0");
 
110,10 → 113,18
return (LinkedList) receivers.clone();
}
 
public MidiOutPort getMidiOutPort() {
return midiOutPort;
public Receiver getMidiOutReceiver() {
return midiOutReceiver;
}
 
public Receiver getMidiInReceiver() {
return midiInReceiver;
}
 
public void setMidiInReceiver(Receiver midiInReceiver) {
this.midiInReceiver = midiInReceiver;
}
 
public Transmitter getTransmitter() {
MyTransmitter transmitter = new MyTransmitter();
transmitters.add(transmitter);
124,25 → 135,6
return info;
}
 
protected void receiveFromReceivers(MidiMessage message, long timestamp) {
 
}
 
protected void sendToTransmitters(MidiMessage message, long timeStamp) {
synchronized (transmitters) {
Iterator it = transmitters.iterator();
while (it.hasNext()) {
Transmitter transmitter = (Transmitter) it.next();
if (transmitter != null) {
Receiver receiver = transmitter.getReceiver();
if (receiver != null) {
receiver.send(message, timeStamp);
}
}
}
}
}
 
public class MyReceiver implements Receiver {
 
public void close() {
152,7 → 144,11
}
 
public void send(MidiMessage message, long timeStamp) {
receiveFromReceivers(message, timeStamp);
 
if (midiInReceiver != null) {
 
midiInReceiver.send(message, timeStamp);
}
}
}
 
183,13 → 179,25
}
}
 
public class MidiOutPort implements Receiver {
public class MidiOutReceiver implements Receiver {
 
public void close() {
 
}
 
public void send(MidiMessage message, long timestamp) {
sendToTransmitters(message, timestamp);
public void send(MidiMessage message, long timeStamp) {
synchronized (transmitters) {
Iterator it = transmitters.iterator();
while (it.hasNext()) {
Transmitter transmitter = (Transmitter) it.next();
if (transmitter != null) {
Receiver receiver = transmitter.getReceiver();
if (receiver != null) {
receiver.send(message, timeStamp);
}
}
}
}
}
}
}
/trunk/java/org/midibox/midi/MidiMapManager.java
New file
0,0 → 1,61
/*
* @(#)MidiMapDeviceManager.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi;
 
import java.util.Observable;
import java.util.Vector;
 
public class MidiMapManager extends Observable {
 
private Vector midiMaps;
 
public MidiMapManager() {
 
midiMaps = new Vector();
}
 
public MidiMap addMidiMap() {
 
MidiMap midiMap = new MidiMap(null);
 
midiMaps.add(midiMap);
 
setChanged();
notifyObservers(midiMap);
clearChanged();
 
return midiMap;
}
 
public void removeMidiMap(MidiMap midiMap) {
 
midiMaps.remove(midiMap);
 
setChanged();
notifyObservers(midiMap);
clearChanged();
}
 
public Vector getMidiMaps() {
 
return midiMaps;
}
}
/trunk/java/org/midibox/midi/xml/MidiKeyboardControllerDeviceXML.java
File deleted
/trunk/java/org/midibox/midi/xml/MidiMonitorFilteredDeviceXML.java
File deleted
/trunk/java/org/midibox/midi/xml/MidiFilterDeviceManagerXML.java
File deleted
/trunk/java/org/midibox/midi/xml/SysexSendReceiveDeviceManagerXML.java
File deleted
/trunk/java/org/midibox/midi/xml/MidiFilterDeviceXML.java
File deleted
/trunk/java/org/midibox/midi/xml/SysexSendReceiveDeviceXML.java
File deleted
/trunk/java/org/midibox/midi/xml/MidiFilterManagerXML.java
New file
0,0 → 1,84
package org.midibox.midi.xml;
 
import java.util.Iterator;
import java.util.Vector;
 
import org.midibox.midi.MidiFilter;
import org.midibox.midi.MidiFilterManager;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
public class MidiFilterManagerXML extends XMLUtils {
 
public final static String TAG_ROOT_ELEMENT = "midiFilterManager";
 
public final static String TAG_MIDI_FILTERS = "midiFilters";
 
protected MidiFilterManager midiFilterManager;
 
public MidiFilterManagerXML(MidiFilterManager midiFilterManager,
String rootElementTag) {
 
super(rootElementTag);
 
this.midiFilterManager = midiFilterManager;
 
addTag(TAG_MIDI_FILTERS);
addTag(MidiFilterXML.TAG_ROOT_ELEMENT);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
 
} else if (name == TAG_MIDI_FILTERS) {
 
Iterator it = ((Vector) midiFilterManager.getMidiFilters().clone())
.iterator();
 
while (it.hasNext()) {
 
MidiFilter midiFilter = (MidiFilter) it.next();
 
midiFilterManager.removeMidiFilter(midiFilter);
}
 
} else if (name == MidiFilterXML.TAG_ROOT_ELEMENT) {
 
MidiFilter midiFilter = new MidiFilter(null);
 
MidiFilterXML midiFilterXML = new MidiFilterXML(midiFilter,
MidiFilterXML.TAG_ROOT_ELEMENT);
 
midiFilterManager.addMidiFilter(midiFilter);
 
midiFilterXML.loadXML(element);
}
}
 
public void saveXML(Node node) {
 
super.saveXML(node);
 
Element midiFiltersElement = document.createElement(TAG_MIDI_FILTERS);
 
rootElement.appendChild(midiFiltersElement);
 
Iterator it = midiFilterManager.getMidiFilters().iterator();
 
while (it.hasNext()) {
 
MidiFilter midiFilter = (MidiFilter) it.next();
 
MidiFilterXML midiFilterXML = new MidiFilterXML(midiFilter,
MidiFilterXML.TAG_ROOT_ELEMENT);
 
midiFilterXML.saveXML(midiFiltersElement);
}
}
}
/trunk/java/org/midibox/midi/xml/SysexSendReceiveManagerXML.java
New file
0,0 → 1,88
package org.midibox.midi.xml;
 
import java.util.Iterator;
import java.util.Vector;
 
import org.midibox.midi.SysexSendReceive;
import org.midibox.midi.SysexSendReceiveManager;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
public class SysexSendReceiveManagerXML extends XMLUtils {
 
public final static String TAG_ROOT_ELEMENT = "hexFileUploadManager";
 
public final static String TAG_HEX_FILE_UPLOADS = "hexFileUploads";
 
protected SysexSendReceiveManager sysexSendReceiveManager;
 
public SysexSendReceiveManagerXML(
SysexSendReceiveManager sysexSendReceiveManager,
String rootElementTag) {
 
super(rootElementTag);
 
this.sysexSendReceiveManager = sysexSendReceiveManager;
 
addTag(TAG_HEX_FILE_UPLOADS);
addTag(SysexSendReceiveXML.TAG_ROOT_ELEMENT);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
 
} else if (name == TAG_HEX_FILE_UPLOADS) {
 
Iterator it = ((Vector) sysexSendReceiveManager
.getSysexSendReceives().clone()).iterator();
 
while (it.hasNext()) {
 
SysexSendReceive sysexSendReceive = (SysexSendReceive) it
.next();
 
sysexSendReceiveManager
.removeSysexSendReceive(sysexSendReceive);
}
 
} else if (name == SysexSendReceiveXML.TAG_ROOT_ELEMENT) {
 
SysexSendReceive sysexSendReceive = new SysexSendReceive(null);
 
SysexSendReceiveXML sysexSendReceiveXML = new SysexSendReceiveXML(
sysexSendReceive, SysexSendReceiveXML.TAG_ROOT_ELEMENT);
 
sysexSendReceiveManager.newSysexSendReceive();
 
sysexSendReceiveXML.loadXML(element);
}
}
 
public void saveXML(Node node) {
 
super.saveXML(node);
 
Element hexFileUploadDevicesElement = document
.createElement(TAG_HEX_FILE_UPLOADS);
 
rootElement.appendChild(hexFileUploadDevicesElement);
 
Iterator it = sysexSendReceiveManager.getSysexSendReceives().iterator();
 
while (it.hasNext()) {
 
SysexSendReceive sysexSendReceive = (SysexSendReceive) it.next();
 
SysexSendReceiveXML sysexSendReceiveXML = new SysexSendReceiveXML(
sysexSendReceive, SysexSendReceiveXML.TAG_ROOT_ELEMENT);
 
sysexSendReceiveXML.saveXML(hexFileUploadDevicesElement);
}
}
}
/trunk/java/org/midibox/midi/SysexSendReceiveManager.java
New file
0,0 → 1,59
/*
* @(#)SysexSendReceiveDeviceManager.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi;
 
import java.util.Observable;
import java.util.Vector;
 
public class SysexSendReceiveManager extends Observable {
 
private Vector sysexSendReceives;
 
public SysexSendReceiveManager() {
sysexSendReceives = new Vector();
}
 
public SysexSendReceive newSysexSendReceive() {
 
SysexSendReceive sysexSendReceive = new SysexSendReceive(null);
 
sysexSendReceives.add(sysexSendReceive);
 
setChanged();
notifyObservers(sysexSendReceive);
clearChanged();
 
return sysexSendReceive;
}
 
public void removeSysexSendReceive(SysexSendReceive sysexSendReceive) {
 
sysexSendReceives.remove(sysexSendReceive);
 
setChanged();
notifyObservers(sysexSendReceive);
clearChanged();
}
 
public Vector getSysexSendReceives() {
return sysexSendReceives;
}
}
/trunk/java/org/midibox/midi/MidiFilterManager.java
New file
0,0 → 1,68
/*
* @(#)MidiFilterDeviceManager.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.midi;
 
import java.util.Observable;
import java.util.Vector;
 
public class MidiFilterManager extends Observable {
 
private Vector midiFilters;
 
public MidiFilterManager() {
 
midiFilters = new Vector();
}
 
public MidiFilter newMidiFilter() {
 
MidiFilter midiFilter = new MidiFilter(null);
 
addMidiFilter(midiFilter);
 
return midiFilter;
}
 
public MidiFilter addMidiFilter(MidiFilter midiFilter) {
 
midiFilters.add(midiFilter);
 
setChanged();
notifyObservers(midiFilter);
clearChanged();
 
return midiFilter;
}
 
public void removeMidiFilter(MidiFilter midiFilter) {
 
midiFilters.remove(midiFilter);
 
setChanged();
notifyObservers(midiFilter);
clearChanged();
}
 
public Vector getMidiFilters() {
 
return midiFilters;
}
}
/trunk/java/org/midibox/midi/SysexSendReceive.java
107,6 → 107,10
 
}
 
public void setReceiver(Receiver receiver) {
this.receiver = receiver;
}
 
public class SysexSendReceiveWorkerTask extends Thread {
 
public void run() {
/trunk/java/org/midibox/midi/MidiFilter.java
358,4 → 358,8
receiver.send(message, timestamp);
}
}
 
public void setReceiver(Receiver receiver) {
this.receiver = receiver;
}
}
/trunk/java/org/midibox/apps/miosstudio/MIOSStudio.java
20,7 → 20,9
 
package org.midibox.apps.miosstudio;
 
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Observable;
import java.util.Observer;
 
28,18 → 30,17
 
import org.midibox.midi.MidiDeviceManager;
import org.midibox.midi.MidiDeviceRouting;
import org.midibox.midi.MidiFilterDevice;
import org.midibox.midi.MidiFilterDeviceManager;
import org.midibox.midi.MidiKeyboardControllerDevice;
import org.midibox.midi.MidiFilter;
import org.midibox.midi.MidiFilterManager;
import org.midibox.midi.MidiKeyboardController;
import org.midibox.midi.MidiMonitorFiltered;
import org.midibox.midi.MidiMonitorFilteredDevice;
import org.midibox.midi.MidiRouterDevice;
import org.midibox.midi.SysexSendReceiveDevice;
import org.midibox.midi.SysexSendReceiveDeviceManager;
import org.midibox.mios.DebugFunctionDevice;
import org.midibox.mios.HexFileUploadDevice;
import org.midibox.mios.HexFileUploadDeviceManager;
import org.midibox.mios.LCDMessageDevice;
import org.midibox.midi.SysexSendReceive;
import org.midibox.midi.SysexSendReceiveManager;
import org.midibox.midi.VirtualMidiDevice;
import org.midibox.mios.DebugFunction;
import org.midibox.mios.HexFileUpload;
import org.midibox.mios.HexFileUploadManager;
import org.midibox.mios.LCDMessage;
import org.midibox.mios.MIOSTerminal;
 
public class MIOSStudio extends Observable implements Observer {
50,64 → 51,58
 
protected MidiDeviceRouting midiDeviceRouting;
 
protected MidiRouterDevice miosStudioInPort;
protected VirtualMidiDevice miosStudioInPort;
 
protected MidiFilterDevice midiThruFilterDevice;
protected MidiFilter midiThruFilter;
 
// TODO: implement a map for MIDI thru
protected VirtualMidiDevice midiThruFilterDevice;
 
/*
* private MidiMapDevice midiThruMapDevice;
*/
protected VirtualMidiDevice miosStudioThruPort;
 
protected MidiRouterDevice miosStudioThruPort;
protected VirtualMidiDevice miosStudioOutPort;
 
protected MidiRouterDevice miosStudioOutPort;
 
private MidiDeviceManager midiDeviceManager;
 
private MidiFilterDeviceManager midiFilterManager;
private MidiFilterManager midiFilterManager;
 
/*
* private MidiMapDeviceManager midiMapManager;
*/
private MidiMonitorFiltered midiInPortMonitor;
 
private MidiMonitorFilteredDevice midiInPortMonitorDevice;
private VirtualMidiDevice midiInPortMonitorDevice;
 
private MidiMonitorFilteredDevice midiOutPortMonitorDevice;
private MidiMonitorFiltered midiOutPortMonitor;
 
// Debuging for command line
private VirtualMidiDevice midiOutPortMonitorDevice;
 
/*
* private DumpReceiverDevice inDumpReceiverDevice;
*
* private DumpReceiverDevice outDumpReceiverDevice;
*/
private MidiKeyboardController midiKeyboardController;
 
private MidiKeyboardControllerDevice midiKeyboardControllerDevice;
private VirtualMidiDevice midiKeyboardControllerDevice;
 
// TODO: implement a manager for sysex sending and receing tasks
private SysexSendReceiveManager sysexSendReceiveManager;
 
private SysexSendReceiveDeviceManager sysexSendReceiveDeviceManager;
private HexFileUploadManager hexFileUploadManager;
 
private HexFileUploadDeviceManager hexFileUploadDeviceManager;
private LCDMessage lcdMessage;
 
// TODO: implement a device for reading and writing to MIOS
private VirtualMidiDevice lcdMessageDevice;
 
/*
* private MemoryReadWriteDevice memoryReadWriteDevice;
*/
private DebugFunction debugFunction;
 
private LCDMessageDevice lcdMessageDevice;
private VirtualMidiDevice debugFunctionDevice;
 
private DebugFunctionDevice debugFunctionDevice;
private MidiMonitorFiltered miosTerminal;
 
private MidiMonitorFilteredDevice miosTerminalDevice;
private VirtualMidiDevice miosTerminalDevice;
 
private boolean routeIndividualDevices;
 
private boolean midiThruOutPort = false;
 
private LinkedHashMap midiFilterDevices;
 
private LinkedHashMap sysexSendReceiveDevices;
 
private LinkedHashMap hexFileUploadDevices;
 
public MIOSStudio() {
 
createDevices();
121,80 → 116,89
 
midiDeviceRouting = new MidiDeviceRouting();
 
miosStudioInPort = new MidiRouterDevice("MIOS Studio In Port");
miosStudioInPort = new VirtualMidiDevice("MIOS Studio In Port", -1, -1);
miosStudioInPort.setMidiInReceiver(miosStudioInPort
.getMidiOutReceiver());
 
midiThruFilterDevice = new MidiFilterDevice("MIOS Studio Thru Filter");
midiThruFilterDevice = new VirtualMidiDevice("MIOS Studio Thru Filter",
-1, -1);
midiThruFilter = new MidiFilter(midiThruFilterDevice
.getMidiOutReceiver());
midiThruFilterDevice.setMidiInReceiver(midiThruFilter);
 
/*
* midiThruMapDevice = new MidiMapDevice("MIOS Studio Thru Map");
*/
miosStudioThruPort = new VirtualMidiDevice("MIOS Studio Thru Port", -1,
-1);
miosStudioThruPort.setMidiInReceiver(miosStudioThruPort
.getMidiOutReceiver());
 
miosStudioThruPort = new MidiRouterDevice("MIOS Studio Thru Port");
miosStudioOutPort = new VirtualMidiDevice("MIOS Studio Out Port", -1,
-1);
miosStudioOutPort.setMidiInReceiver(miosStudioOutPort
.getMidiOutReceiver());
 
miosStudioOutPort = new MidiRouterDevice("MIOS Studio Out Port");
 
midiDeviceManager = new MidiDeviceManager();
midiDeviceManager.addObserver(this);
 
midiFilterManager = new MidiFilterDeviceManager();
midiFilterManager = new MidiFilterManager();
midiFilterManager.addObserver(this);
 
/*
* midiMapManager = new MidiMapDeviceManager();
* midiMapManager.addObserver(this);
*/
midiFilterDevices = new LinkedHashMap();
 
midiInPortMonitorDevice = new MidiMonitorFilteredDevice(
"MIDI Monitor: IN");
midiInPortMonitorDevice = new VirtualMidiDevice("MIDI Monitor: IN", 0,
-1);
midiInPortMonitor = new MidiMonitorFiltered();
midiInPortMonitorDevice.setMidiInReceiver(midiInPortMonitor);
 
midiOutPortMonitorDevice = new MidiMonitorFilteredDevice(
"MIDI Monitor: OUT");
midiOutPortMonitorDevice = new VirtualMidiDevice("MIDI Monitor: OUT",
0, -1);
midiOutPortMonitor = new MidiMonitorFiltered();
midiOutPortMonitorDevice.setMidiInReceiver(midiOutPortMonitor);
 
/*
* inDumpReceiverDevice = new DumpReceiverDevice("Dump Receiver: IN");
*
* outDumpReceiverDevice = new DumpReceiverDevice("Dump Receiver: OUT");
*/
midiKeyboardControllerDevice = new VirtualMidiDevice(
"MIDI Keyboard Controller", -1, -1);
midiKeyboardController = new MidiKeyboardController(
midiKeyboardControllerDevice.getMidiOutReceiver(), 0);
midiKeyboardControllerDevice.setMidiInReceiver(midiKeyboardController);
 
midiKeyboardControllerDevice = new MidiKeyboardControllerDevice(
"MIDI Keyboard Controller", 0);
sysexSendReceiveManager = new SysexSendReceiveManager();
 
sysexSendReceiveDeviceManager = new SysexSendReceiveDeviceManager();
sysexSendReceiveManager.addObserver(this);
 
sysexSendReceiveDeviceManager.addObserver(this);
sysexSendReceiveDevices = new LinkedHashMap();
 
hexFileUploadDeviceManager = new HexFileUploadDeviceManager();
hexFileUploadManager = new HexFileUploadManager();
 
hexFileUploadDeviceManager.addObserver(this);
hexFileUploadManager.addObserver(this);
 
/*
* memoryReadWriteDevice = new MemoryReadWriteDevice( "MIOS Memory
* Read/Write");
*/
hexFileUploadDevices = new LinkedHashMap();
 
lcdMessageDevice = new LCDMessageDevice("MIOS LCD Message");
lcdMessageDevice = new VirtualMidiDevice("MIOS LCD Message", -1, -1);
lcdMessage = new LCDMessage(lcdMessageDevice.getMidiOutReceiver());
lcdMessageDevice.setMidiInReceiver(lcdMessage);
 
debugFunctionDevice = new DebugFunctionDevice("MIOS Debug Function");
debugFunctionDevice = new VirtualMidiDevice("MIOS Debug Function", -1,
-1);
debugFunction = new DebugFunction(debugFunctionDevice
.getMidiOutReceiver());
debugFunctionDevice.setMidiInReceiver(debugFunction);
 
MidiMonitorFiltered miosTerminalFiltered = new MidiMonitorFiltered(
new MIOSTerminal());
miosTerminalDevice = new VirtualMidiDevice("MIOS Terminal", 0, -1);
miosTerminal = new MidiMonitorFiltered(new MIOSTerminal());
miosTerminalDevice.setMidiInReceiver(miosTerminal);
 
miosTerminalDevice = new MidiMonitorFilteredDevice("MIOS Terminal",
miosTerminalFiltered);
 
// special for MIOS Terminal:
// disable all messages by default, only allow pass SysEx
// user can enable other MIDI events again if required
 
miosTerminalFiltered.getMidiFilter().setVoiceMessages(false);
miosTerminal.getMidiFilter().setVoiceMessages(false);
 
miosTerminalFiltered.getMidiFilter().setSystemCommonMessages(false);
miosTerminal.getMidiFilter().setSystemCommonMessages(false);
 
miosTerminalFiltered.getMidiFilter().setSystemRealtimeMessages(false);
miosTerminal.getMidiFilter().setSystemRealtimeMessages(false);
 
miosTerminalFiltered.getMidiFilter().setSysexMessages(true);
miosTerminal.getMidiFilter().setSysexMessages(true);
 
miosTerminalFiltered.getMidiFilter().setMetaMessages(false);
miosTerminal.getMidiFilter().setMetaMessages(false);
}
 
public MidiDeviceManager getMidiDeviceManager() {
201,54 → 205,44
return midiDeviceManager;
}
 
public MidiFilterDeviceManager getMidiFilterManager() {
public MidiFilterManager getMidiFilterManager() {
return midiFilterManager;
}
 
/*
* public MidiMapDeviceManager getMidiMapManager() { return midiMapManager;
* }
*/
 
public MidiDeviceRouting getMidiDeviceRouting() {
return midiDeviceRouting;
}
 
public MidiMonitorFilteredDevice getMidiOutPortMonitorDevice() {
return midiOutPortMonitorDevice;
public MidiMonitorFiltered getMidiOutPortMonitor() {
return midiOutPortMonitor;
}
 
public MidiMonitorFilteredDevice getMidiInPortMonitorDevice() {
return midiInPortMonitorDevice;
public MidiMonitorFiltered getMidiInPortMonitor() {
return midiInPortMonitor;
}
 
public MidiKeyboardControllerDevice getMidiKeyboardControllerDevice() {
return midiKeyboardControllerDevice;
public MidiKeyboardController getMidiKeyboardController() {
return midiKeyboardController;
}
 
public SysexSendReceiveDeviceManager getSysexSendReceiveDeviceManager() {
return sysexSendReceiveDeviceManager;
public SysexSendReceiveManager getSysexSendReceiveManager() {
return sysexSendReceiveManager;
}
 
public HexFileUploadDeviceManager getHexFileUploadDeviceManager() {
return hexFileUploadDeviceManager;
public HexFileUploadManager getHexFileUploadManager() {
return hexFileUploadManager;
}
 
public DebugFunctionDevice getDebugFunctionDevice() {
return debugFunctionDevice;
public DebugFunction getDebugFunction() {
return debugFunction;
}
 
/*
* public MemoryReadWriteDevice getMemoryReadWriteDevice() { return
* memoryReadWriteDevice; }
*/
 
public LCDMessageDevice getLcdMessageDevice() {
return lcdMessageDevice;
public LCDMessage getLcdMessage() {
return lcdMessage;
}
 
public MidiMonitorFilteredDevice getMIOSTerminalDevice() {
return miosTerminalDevice;
public MidiMonitorFiltered getMIOSTerminal() {
return miosTerminal;
}
 
public boolean isMidiThruOutPort() {
263,11 → 257,6
 
if (midiThru) {
 
/*
* midiDeviceRouting.connectDevices(midiThruFilterDevice,
* midiThruMapDevice);
*/
 
midiDeviceRouting.disconnectDevice(miosStudioThruPort);
 
midiDeviceRouting.disconnectDevices(midiThruFilterDevice,
277,11 → 266,6
miosStudioOutPort);
} else {
 
/*
* midiDeviceRouting.disconnectDevices(midiThruFilterDevice,
* midiThruMapDevice);
*/
 
midiDeviceRouting.disconnectDevices(midiThruFilterDevice,
miosStudioOutPort);
 
298,27 → 282,24
clearChanged();
}
 
public MidiRouterDevice getMiosStudioInPort() {
public VirtualMidiDevice getMiosStudioInPort() {
return miosStudioInPort;
}
 
public MidiRouterDevice getMiosStudioOutPort() {
public VirtualMidiDevice getMiosStudioOutPort() {
return miosStudioOutPort;
}
 
public MidiFilterDevice getMidiThruFilterDevice() {
return midiThruFilterDevice;
public MidiFilter getMidiThruFilter() {
return midiThruFilter;
}
 
/*
* public MidiMapDevice getMidiThruMapDevice() { return midiThruMapDevice; }
*/
 
public boolean isRouteIndividualDevices() {
return routeIndividualDevices;
}
 
public void setRouteIndividualDevices(boolean routeIndividualDevices) {
 
this.routeIndividualDevices = routeIndividualDevices;
 
// remove all devices
339,37 → 320,10
}
}
 
reorder();
midiDeviceRouting.addMidiReadDevices(midiFilterDevices.values());
 
setChanged();
midiDeviceRouting.addMidiWriteDevices(midiFilterDevices.values());
 
notifyObservers(ROUTE_INDIVIDUAL_DEVICES);
 
clearChanged();
}
 
public void reorder() {
 
midiDeviceRouting.getMidiReadDevices().removeAll(
midiFilterManager.getMidiFilterDevices());
midiDeviceRouting.getMidiWriteDevices().removeAll(
midiFilterManager.getMidiFilterDevices());
 
midiDeviceRouting.getMidiReadDevices().removeAll(
midiDeviceManager.getSelectedMidiReadDevices().values());
midiDeviceRouting.getMidiWriteDevices().removeAll(
midiDeviceManager.getSelectedMidiWriteDevices().values());
 
/*
* midiReadDevices.removeAll(midiMapManager.getMidiMapDevices());
* midiWriteDevices.removeAll(midiMapManager.getMidiMapDevices());
*/
 
midiDeviceRouting.addMidiReadDevices(midiFilterManager
.getMidiFilterDevices());
midiDeviceRouting.addMidiWriteDevices(midiFilterManager
.getMidiFilterDevices());
 
Iterator it = midiDeviceManager.getMidiReadDevices().values()
.iterator();
 
384,6 → 338,7
}
 
it = midiDeviceManager.getMidiWriteDevices().values().iterator();
 
while (it.hasNext()) {
 
Object object = it.next();
394,10 → 349,11
}
}
 
/*
* midiReadDevices.addAll(midiMapManager.getMidiMapDevices());
* midiWriteDevices.addAll(midiMapManager.getMidiMapDevices());
*/
setChanged();
 
notifyObservers(ROUTE_INDIVIDUAL_DEVICES);
 
clearChanged();
}
 
protected void routeIndividualDevices() {
408,16 → 364,12
midiDeviceRouting.addMidiWriteDevice(midiThruFilterDevice);
midiDeviceRouting.addMidiReadDevice(midiThruFilterDevice);
 
/*
* midiDeviceRouting.addMidiWriteDevice(midiThruMapDevice);
* midiDeviceRouting.addMidiReadDevice(midiThruMapDevice);
*/
 
if (!midiThruOutPort) {
 
midiDeviceRouting.addMidiWriteDevice(miosStudioThruPort);
midiDeviceRouting.addMidiReadDevice(miosStudioThruPort);
}
 
midiDeviceRouting.addMidiWriteDevice(miosStudioOutPort);
midiDeviceRouting.addMidiReadDevice(miosStudioOutPort);
 
425,30 → 377,21
 
midiDeviceRouting.addMidiWriteDevice(midiInPortMonitorDevice);
 
/*
* midiDeviceRouting.addMidiWriteDevice(inDumpReceiverDevice);
*
* midiDeviceRouting.addMidiWriteDevice(outDumpReceiverDevice);
*/
 
midiDeviceRouting.addMidiWriteDevice(midiKeyboardControllerDevice);
midiDeviceRouting.addMidiReadDevice(midiKeyboardControllerDevice);
 
midiDeviceRouting.addMidiReadDevices(sysexSendReceiveDeviceManager
.getSysexSendReceiveDevices());
Collection virtualMidiDevices = sysexSendReceiveDevices.values();
 
midiDeviceRouting.addMidiWriteDevices(sysexSendReceiveDeviceManager
.getSysexSendReceiveDevices());
midiDeviceRouting.addMidiReadDevices(virtualMidiDevices);
 
midiDeviceRouting.addMidiReadDevices(hexFileUploadDeviceManager
.getHexFileUploadDevices());
midiDeviceRouting.addMidiWriteDevices(hexFileUploadDeviceManager
.getHexFileUploadDevices());
/*
* midiDeviceRouting.addMidiWriteDevice(memoryReadWriteDevice);
* midiDeviceRouting.addMidiReadDevice(memoryReadWriteDevice);
*/
midiDeviceRouting.addMidiWriteDevices(virtualMidiDevices);
 
virtualMidiDevices = hexFileUploadDevices.values();
 
midiDeviceRouting.addMidiReadDevices(virtualMidiDevices);
 
midiDeviceRouting.addMidiWriteDevices(virtualMidiDevices);
 
midiDeviceRouting.addMidiReadDevice(lcdMessageDevice);
 
midiDeviceRouting.addMidiWriteDevice(debugFunctionDevice);
467,48 → 410,36
midiDeviceRouting.connectDevices(miosStudioOutPort,
midiOutPortMonitorDevice);
 
/*
* midiDeviceRouting.connectDevices(inVirtualMidiPortDevice,
* inDumpReceiverDevice);
* midiDeviceRouting.connectDevices(outVirtualMidiPortDevice,
* outDumpReceiverDevice);
*/
 
midiDeviceRouting.connectDevices(miosStudioInPort,
midiKeyboardControllerDevice);
midiDeviceRouting.connectDevices(midiKeyboardControllerDevice,
miosStudioOutPort);
 
Iterator it = sysexSendReceiveDeviceManager
.getSysexSendReceiveDevices().iterator();
Iterator it = sysexSendReceiveDevices.values().iterator();
 
while (it.hasNext()) {
SysexSendReceiveDevice sysexSendReceiveDevice = (SysexSendReceiveDevice) it
.next();
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) it.next();
 
midiDeviceRouting.connectDevices(miosStudioInPort,
sysexSendReceiveDevice);
midiDeviceRouting.connectDevices(sysexSendReceiveDevice,
virtualMidiDevice);
 
midiDeviceRouting.connectDevices(virtualMidiDevice,
miosStudioOutPort);
}
 
it = hexFileUploadDeviceManager.getHexFileUploadDevices().iterator();
it = hexFileUploadDevices.values().iterator();
 
while (it.hasNext()) {
HexFileUploadDevice hexFileUploadDevice = (HexFileUploadDevice) it
.next();
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) it.next();
 
midiDeviceRouting.connectDevices(miosStudioInPort,
hexFileUploadDevice);
midiDeviceRouting.connectDevices(hexFileUploadDevice,
virtualMidiDevice);
midiDeviceRouting.connectDevices(virtualMidiDevice,
miosStudioOutPort);
}
 
/*
* midiDeviceRouting.connectDevices(miosStudioInPort,
* memoryReadWriteDevice);
* midiDeviceRouting.connectDevices(memoryReadWriteDevice,
* miosStudioOutPort);
*/
 
midiDeviceRouting.connectDevices(lcdMessageDevice, miosStudioOutPort);
midiDeviceRouting.connectDevices(miosStudioInPort, debugFunctionDevice);
midiDeviceRouting
519,39 → 450,92
 
public void update(Observable observable, Object object) {
 
if (observable == hexFileUploadDeviceManager) {
if (observable == hexFileUploadManager) {
 
HexFileUploadDevice hexFileUploadDevice = (HexFileUploadDevice) object;
HexFileUpload hexFileUpload = (HexFileUpload) object;
 
if (hexFileUploadDeviceManager.getHexFileUploadDevices().contains(
hexFileUploadDevice)) {
if (hexFileUploadDevices.containsKey(hexFileUpload)) {
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) hexFileUploadDevices
.get(hexFileUpload);
 
midiDeviceRouting.disconnectDevice(virtualMidiDevice);
 
hexFileUploadDevices.remove(hexFileUpload);
 
} else {
 
VirtualMidiDevice virtualMidiDevice = new VirtualMidiDevice("",
-1, -1);
 
virtualMidiDevice.setMidiInReceiver(hexFileUpload);
 
hexFileUpload.setReceiver(virtualMidiDevice
.getMidiOutReceiver());
 
midiDeviceRouting.connectDevices(miosStudioInPort,
hexFileUploadDevice);
midiDeviceRouting.connectDevices(hexFileUploadDevice,
virtualMidiDevice);
midiDeviceRouting.connectDevices(virtualMidiDevice,
miosStudioOutPort);
} else {
midiDeviceRouting.disconnectDevice(hexFileUploadDevice);
 
hexFileUploadDevices.put(hexFileUpload, virtualMidiDevice);
}
 
Collection virtualMidiDevices = hexFileUploadDevices.values();
 
for (int i = 0; i < virtualMidiDevices.size(); i++) {
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) virtualMidiDevices
.toArray()[i];
 
virtualMidiDevice.setName("Hex File Upload " + (i + 1));
}
 
setRouteIndividualDevices(routeIndividualDevices);
}
if (observable == sysexSendReceiveDeviceManager) {
 
SysexSendReceiveDevice sysexSendReceiveDevice = (SysexSendReceiveDevice) object;
if (observable == sysexSendReceiveManager) {
 
if (sysexSendReceiveDeviceManager.getSysexSendReceiveDevices().contains(
sysexSendReceiveDevice)) {
SysexSendReceive sysexSendReceive = (SysexSendReceive) object;
 
if (sysexSendReceiveDevices.containsKey(sysexSendReceive)) {
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) sysexSendReceiveDevices
.get(sysexSendReceive);
 
midiDeviceRouting.disconnectDevice(virtualMidiDevice);
 
sysexSendReceiveDevices.remove(sysexSendReceive);
 
} else {
 
VirtualMidiDevice virtualMidiDevice = new VirtualMidiDevice("",
-1, -1);
 
virtualMidiDevice.setMidiInReceiver(sysexSendReceive);
 
sysexSendReceive.setReceiver(virtualMidiDevice
.getMidiOutReceiver());
 
midiDeviceRouting.connectDevices(miosStudioInPort,
sysexSendReceiveDevice);
midiDeviceRouting.connectDevices(sysexSendReceiveDevice,
virtualMidiDevice);
midiDeviceRouting.connectDevices(virtualMidiDevice,
miosStudioOutPort);
} else {
midiDeviceRouting.disconnectDevice(sysexSendReceiveDevice);
 
sysexSendReceiveDevices
.put(sysexSendReceive, virtualMidiDevice);
}
 
Collection virtualMidiDevices = sysexSendReceiveDevices.values();
 
for (int i = 0; i < virtualMidiDevices.size(); i++) {
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) virtualMidiDevices
.toArray()[i];
 
virtualMidiDevice.setName("Sysex Send/Receive " + (i + 1));
}
 
setRouteIndividualDevices(routeIndividualDevices);
}
 
571,12 → 555,38
 
if (observable == midiFilterManager) {
 
MidiDevice midiFilter = (MidiDevice) object;
MidiFilter midiFilter = (MidiFilter) object;
 
if (!midiFilterManager.getMidiFilterDevices().contains(midiFilter)) {
midiDeviceRouting.disconnectDevice(midiFilter);
if (midiFilterDevices.containsKey(midiFilter)) {
 
midiDeviceRouting
.disconnectDevice((VirtualMidiDevice) midiFilterDevices
.get(midiFilter));
 
midiFilterDevices.remove(midiFilter);
 
} else {
 
VirtualMidiDevice virtualMidiDevice = new VirtualMidiDevice("",
-1, -1);
 
virtualMidiDevice.setMidiInReceiver(midiFilter);
 
midiFilter.setReceiver(virtualMidiDevice.getMidiOutReceiver());
 
midiFilterDevices.put(midiFilter, virtualMidiDevice);
}
 
Collection virtualMidiDevices = midiFilterDevices.values();
 
for (int i = 0; i < virtualMidiDevices.size(); i++) {
 
VirtualMidiDevice virtualMidiDevice = (VirtualMidiDevice) virtualMidiDevices
.toArray()[i];
 
virtualMidiDevice.setName("MIDI Filter " + (i + 1));
}
 
setRouteIndividualDevices(routeIndividualDevices);
}
}
/trunk/java/org/midibox/apps/miosstudio/xml/MIOSStudioXML.java
3,14 → 3,14
import org.midibox.apps.miosstudio.MIOSStudio;
import org.midibox.midi.xml.MidiDeviceManagerXML;
import org.midibox.midi.xml.MidiDeviceRoutingXML;
import org.midibox.midi.xml.MidiFilterDeviceManagerXML;
import org.midibox.midi.xml.MidiFilterDeviceXML;
import org.midibox.midi.xml.MidiKeyboardControllerDeviceXML;
import org.midibox.midi.xml.MidiMonitorFilteredDeviceXML;
import org.midibox.midi.xml.SysexSendReceiveDeviceManagerXML;
import org.midibox.mios.xml.DebugFunctionDeviceXML;
import org.midibox.mios.xml.HexFileUploadDeviceManagerXML;
import org.midibox.mios.xml.LCDMessageDeviceXML;
import org.midibox.midi.xml.MidiFilterManagerXML;
import org.midibox.midi.xml.MidiFilterXML;
import org.midibox.midi.xml.MidiKeyboardControllerXML;
import org.midibox.midi.xml.MidiMonitorFilteredXML;
import org.midibox.midi.xml.SysexSendReceiveManagerXML;
import org.midibox.mios.xml.DebugFunctionXML;
import org.midibox.mios.xml.HexFileUploadManagerXML;
import org.midibox.mios.xml.LCDMessageXML;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
19,28 → 19,28
 
public static final String TAG_ROOT_ELEMENT = "miosStudio";
 
public static final String TAG_MIDI_THRU_FILTER_DEVICE = "thruMidiFilterDevice";
public static final String TAG_MIDI_THRU_FILTER = "thruMidiFilter";
 
public static final String TAG_MIDI_DEVICE_MANAGER = "midiDeviceManager";
 
public static final String TAG_MIDI_FILTER_DEVICE_MANAGER = "midiFilterDeviceManager";
public static final String TAG_MIDI_FILTER_MANAGER = "midiFilterManager";
 
public static final String TAG_IN_PORT_MIDI_MONITOR_FILTERED_DEVICE = "inPortMidiMonitorFilteredDevice";
public static final String TAG_IN_PORT_MIDI_MONITOR_FILTERED = "inPortMidiMonitorFiltered";
 
public static final String TAG_OUT_PORT_MIDI_MONITOR_FILTERED_DEVICE = "outPortMidiMonitorFilteredDevice";
public static final String TAG_OUT_PORT_MIDI_MONITOR_FILTERED = "outPortMidiMonitorFiltered";
 
public static final String TAG_MIDI_KEYBOARD_CONTROLLER_DEVICE = "midiKeyboardControllerDevice";
public static final String TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER = "sysexSendReciveDeviceManager";
public static final String TAG_MIDI_KEYBOARD_CONTROLLER = "midiKeyboardController";
 
public static final String TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER = "hexFileUploadDeviceManager";
public static final String TAG_SYSEX_SEND_RECEIVE_MANAGER = "sysexSendReciveManager";
 
public static final String TAG_LCD_MESSAGE_DEVICE = "lcdMessageDevice";
public static final String TAG_HEX_FILE_UPLOAD_MANAGER = "hexFileUploadManager";
 
public static final String TAG_DEBUG_FUNCTION_DEVICE = "debugFunctionDevice";
public static final String TAG_LCD_MESSAGE = "lcdMessage";
 
public static final String TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED_DEVICE = "miosTeminalMidiMonitorFilteredDevice";
public static final String TAG_DEBUG_FUNCTION = "debugFunction";
 
public static final String TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED = "miosTeminalMidiMonitorFiltered";
 
public static final String TAG_MIDI_DEVICE_ROUTING = "midiDeviceRouting";
 
public static final String ATTR_MIDI_THRU_OUT_PORT = "midiThruOutPort";
55,17 → 55,17
 
this.miosStudio = miosStudio;
 
addTag(TAG_MIDI_THRU_FILTER_DEVICE);
addTag(TAG_MIDI_THRU_FILTER);
addTag(TAG_MIDI_DEVICE_MANAGER);
addTag(TAG_MIDI_FILTER_DEVICE_MANAGER);
addTag(TAG_OUT_PORT_MIDI_MONITOR_FILTERED_DEVICE);
addTag(TAG_IN_PORT_MIDI_MONITOR_FILTERED_DEVICE);
addTag(TAG_MIDI_KEYBOARD_CONTROLLER_DEVICE);
addTag(TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER);
addTag(TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER);
addTag(TAG_LCD_MESSAGE_DEVICE);
addTag(TAG_DEBUG_FUNCTION_DEVICE);
addTag(TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED_DEVICE);
addTag(TAG_MIDI_FILTER_MANAGER);
addTag(TAG_OUT_PORT_MIDI_MONITOR_FILTERED);
addTag(TAG_IN_PORT_MIDI_MONITOR_FILTERED);
addTag(TAG_MIDI_KEYBOARD_CONTROLLER);
addTag(TAG_SYSEX_SEND_RECEIVE_MANAGER);
addTag(TAG_HEX_FILE_UPLOAD_MANAGER);
addTag(TAG_LCD_MESSAGE);
addTag(TAG_DEBUG_FUNCTION);
addTag(TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED);
addTag(TAG_MIDI_DEVICE_ROUTING);
}
 
83,13 → 83,12
miosStudio.setRouteIndividualDevices(stringToBoolean(element
.getAttribute(ATTR_ROUTE_INDIVIDUAL_DEVICES)));
 
} else if (name == TAG_MIDI_THRU_FILTER_DEVICE) {
} else if (name == TAG_MIDI_THRU_FILTER) {
 
MidiFilterDeviceXML midiFilterDeviceXML = new MidiFilterDeviceXML(
miosStudio.getMidiThruFilterDevice(),
TAG_MIDI_THRU_FILTER_DEVICE);
MidiFilterXML midiFilterXML = new MidiFilterXML(miosStudio
.getMidiThruFilter(), TAG_MIDI_THRU_FILTER);
 
midiFilterDeviceXML.loadXML(element);
midiFilterXML.loadXML(element);
 
} else if (name == TAG_MIDI_DEVICE_MANAGER) {
 
98,76 → 97,74
 
midiDeviceManagerXML.loadXML(element);
 
} else if (name == TAG_MIDI_FILTER_DEVICE_MANAGER) {
} else if (name == TAG_MIDI_FILTER_MANAGER) {
 
MidiFilterDeviceManagerXML midiFilterDeviceManagerXML = new MidiFilterDeviceManagerXML(
miosStudio.getMidiFilterManager(),
TAG_MIDI_FILTER_DEVICE_MANAGER);
MidiFilterManagerXML midiFilterDeviceManagerXML = new MidiFilterManagerXML(
miosStudio.getMidiFilterManager(), TAG_MIDI_FILTER_MANAGER);
 
midiFilterDeviceManagerXML.loadXML(element);
 
} else if (name == TAG_OUT_PORT_MIDI_MONITOR_FILTERED_DEVICE) {
} else if (name == TAG_OUT_PORT_MIDI_MONITOR_FILTERED) {
 
MidiMonitorFilteredDeviceXML midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMidiOutPortMonitorDevice(),
TAG_OUT_PORT_MIDI_MONITOR_FILTERED_DEVICE);
MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
miosStudio.getMidiOutPortMonitor(),
TAG_OUT_PORT_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.loadXML(element);
midiMonitorFilteredXML.loadXML(element);
 
} else if (name == TAG_IN_PORT_MIDI_MONITOR_FILTERED_DEVICE) {
} else if (name == TAG_IN_PORT_MIDI_MONITOR_FILTERED) {
 
MidiMonitorFilteredDeviceXML midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMidiInPortMonitorDevice(),
TAG_IN_PORT_MIDI_MONITOR_FILTERED_DEVICE);
MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
miosStudio.getMidiInPortMonitor(),
TAG_IN_PORT_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.loadXML(element);
midiMonitorFilteredXML.loadXML(element);
 
} else if (name == TAG_MIDI_KEYBOARD_CONTROLLER_DEVICE) {
} else if (name == TAG_MIDI_KEYBOARD_CONTROLLER) {
 
MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
miosStudio.getMidiKeyboardControllerDevice(),
TAG_MIDI_KEYBOARD_CONTROLLER_DEVICE);
MidiKeyboardControllerXML midiKeyboardControllerXML = new MidiKeyboardControllerXML(
miosStudio.getMidiKeyboardController(),
TAG_MIDI_KEYBOARD_CONTROLLER);
 
midiKeyboardControllerDeviceXML.loadXML(element);
midiKeyboardControllerXML.loadXML(element);
 
} else if (name == TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER) {
} else if (name == TAG_SYSEX_SEND_RECEIVE_MANAGER) {
 
SysexSendReceiveDeviceManagerXML sysexSendReceiveDeviceManagerXML = new SysexSendReceiveDeviceManagerXML(
miosStudio.getSysexSendReceiveDeviceManager(),
TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER);
SysexSendReceiveManagerXML sysexSendReceiveManagerXML = new SysexSendReceiveManagerXML(
miosStudio.getSysexSendReceiveManager(),
TAG_SYSEX_SEND_RECEIVE_MANAGER);
 
sysexSendReceiveDeviceManagerXML.loadXML(element);
sysexSendReceiveManagerXML.loadXML(element);
 
} else if (name == TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER) {
} else if (name == TAG_HEX_FILE_UPLOAD_MANAGER) {
 
HexFileUploadDeviceManagerXML hexFileUploadDeviceManagerXML = new HexFileUploadDeviceManagerXML(
miosStudio.getHexFileUploadDeviceManager(),
TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER);
HexFileUploadManagerXML hexFileUploadManagerXML = new HexFileUploadManagerXML(
miosStudio.getHexFileUploadManager(),
TAG_HEX_FILE_UPLOAD_MANAGER);
 
hexFileUploadDeviceManagerXML.loadXML(element);
hexFileUploadManagerXML.loadXML(element);
 
} else if (name == TAG_LCD_MESSAGE_DEVICE) {
} else if (name == TAG_LCD_MESSAGE) {
 
LCDMessageDeviceXML lcdMessageDeviceXML = new LCDMessageDeviceXML(
miosStudio.getLcdMessageDevice(), TAG_LCD_MESSAGE_DEVICE);
LCDMessageXML lcdMessageXML = new LCDMessageXML(miosStudio
.getLcdMessage(), TAG_LCD_MESSAGE);
 
lcdMessageDeviceXML.loadXML(element);
lcdMessageXML.loadXML(element);
 
} else if (name == TAG_DEBUG_FUNCTION_DEVICE) {
} else if (name == TAG_DEBUG_FUNCTION) {
 
DebugFunctionDeviceXML debugFunctionDeviceXML = new DebugFunctionDeviceXML(
miosStudio.getDebugFunctionDevice(),
TAG_DEBUG_FUNCTION_DEVICE);
DebugFunctionXML debugFunctionXML = new DebugFunctionXML(miosStudio
.getDebugFunction(), TAG_DEBUG_FUNCTION);
 
debugFunctionDeviceXML.loadXML(element);
debugFunctionXML.loadXML(element);
 
} else if (name == TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED_DEVICE) {
} else if (name == TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED) {
 
MidiMonitorFilteredDeviceXML midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMIOSTerminalDevice(),
TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED_DEVICE);
MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
miosStudio.getMIOSTerminal(),
TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.loadXML(element);
midiMonitorFilteredXML.loadXML(element);
 
} else if (name == TAG_MIDI_DEVICE_ROUTING) {
 
195,11 → 192,10
rootElement.setAttribute(ATTR_MIDI_THRU_OUT_PORT, miosStudio
.isMidiThruOutPort() ? "true" : "false");
 
MidiFilterDeviceXML midiFilterDeviceXML = new MidiFilterDeviceXML(
miosStudio.getMidiThruFilterDevice(),
TAG_MIDI_THRU_FILTER_DEVICE);
MidiFilterXML midiFilterXML = new MidiFilterXML(miosStudio
.getMidiThruFilter(), TAG_MIDI_THRU_FILTER);
 
midiFilterDeviceXML.saveXML(rootElement);
midiFilterXML.saveXML(rootElement);
 
saveMIDIXML(miosStudio);
 
218,59 → 214,57
 
midiDeviceManagerXML.saveXML(rootElement);
 
MidiFilterDeviceManagerXML midiFilterDeviceManagerXML = new MidiFilterDeviceManagerXML(
miosStudio.getMidiFilterManager(),
TAG_MIDI_FILTER_DEVICE_MANAGER);
MidiFilterManagerXML midiFilterDeviceManagerXML = new MidiFilterManagerXML(
miosStudio.getMidiFilterManager(), TAG_MIDI_FILTER_MANAGER);
 
midiFilterDeviceManagerXML.saveXML(rootElement);
 
MidiMonitorFilteredDeviceXML midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMidiOutPortMonitorDevice(),
TAG_OUT_PORT_MIDI_MONITOR_FILTERED_DEVICE);
MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
miosStudio.getMidiOutPortMonitor(),
TAG_OUT_PORT_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.saveXML(rootElement);
midiMonitorFilteredXML.saveXML(rootElement);
 
midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMidiInPortMonitorDevice(),
TAG_IN_PORT_MIDI_MONITOR_FILTERED_DEVICE);
midiMonitorFilteredXML = new MidiMonitorFilteredXML(miosStudio
.getMidiInPortMonitor(), TAG_IN_PORT_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.saveXML(rootElement);
midiMonitorFilteredXML.saveXML(rootElement);
 
MidiKeyboardControllerDeviceXML midiControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
miosStudio.getMidiKeyboardControllerDevice(),
TAG_MIDI_KEYBOARD_CONTROLLER_DEVICE);
MidiKeyboardControllerXML midiControllerXML = new MidiKeyboardControllerXML(
miosStudio.getMidiKeyboardController(),
TAG_MIDI_KEYBOARD_CONTROLLER);
 
midiControllerDeviceXML.saveXML(rootElement);
SysexSendReceiveDeviceManagerXML sysexSendReceiveDeviceManagerXML = new SysexSendReceiveDeviceManagerXML(
miosStudio.getSysexSendReceiveDeviceManager(),
TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER);
midiControllerXML.saveXML(rootElement);
 
sysexSendReceiveDeviceManagerXML.saveXML(rootElement);
SysexSendReceiveManagerXML sysexSendReceiveManagerXML = new SysexSendReceiveManagerXML(
miosStudio.getSysexSendReceiveManager(),
TAG_SYSEX_SEND_RECEIVE_MANAGER);
 
sysexSendReceiveManagerXML.saveXML(rootElement);
}
 
protected void saveMIOSXML(MIOSStudio miosStudio) {
 
HexFileUploadDeviceManagerXML hexFileUploadDeviceManagerXML = new HexFileUploadDeviceManagerXML(
miosStudio.getHexFileUploadDeviceManager(),
TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER);
HexFileUploadManagerXML hexFileUploadManagerXML = new HexFileUploadManagerXML(
miosStudio.getHexFileUploadManager(),
TAG_HEX_FILE_UPLOAD_MANAGER);
 
hexFileUploadDeviceManagerXML.saveXML(rootElement);
hexFileUploadManagerXML.saveXML(rootElement);
 
LCDMessageDeviceXML lcdMessageDeviceXML = new LCDMessageDeviceXML(
miosStudio.getLcdMessageDevice(), TAG_LCD_MESSAGE_DEVICE);
LCDMessageXML lcdMessageXML = new LCDMessageXML(miosStudio
.getLcdMessage(), TAG_LCD_MESSAGE);
 
lcdMessageDeviceXML.saveXML(rootElement);
lcdMessageXML.saveXML(rootElement);
 
DebugFunctionDeviceXML debugFunctionDeviceXML = new DebugFunctionDeviceXML(
miosStudio.getDebugFunctionDevice(), TAG_DEBUG_FUNCTION_DEVICE);
DebugFunctionXML debugFunctionXML = new DebugFunctionXML(miosStudio
.getDebugFunction(), TAG_DEBUG_FUNCTION);
 
debugFunctionDeviceXML.saveXML(rootElement);
debugFunctionXML.saveXML(rootElement);
 
MidiMonitorFilteredDeviceXML midiMonitorFilteredDeviceXML = new MidiMonitorFilteredDeviceXML(
miosStudio.getMIOSTerminalDevice(),
TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED_DEVICE);
MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
miosStudio.getMIOSTerminal(),
TAG_MIOS_TERMINAL_MIDI_MONITOR_FILTERED);
 
midiMonitorFilteredDeviceXML.saveXML(rootElement);
midiMonitorFilteredXML.saveXML(rootElement);
}
}
/trunk/java/org/midibox/apps/miosstudio/gui/xml/MIOSStudioGUIXML.java
38,15 → 38,15
 
public final static String TAG_WORKSPACE_CURRENT_DIRECTORY = "workspaceCurrentDirectory";
 
public final static String TAG_MIDI_FILTER_DEVICE_MANAGER_GUI = "midiFilterDeviceManagerGUI";
public final static String TAG_MIDI_FILTER_MANAGER_GUI = "midiFilterManagerGUI";
 
public final static String TAG_MIDI_FILTER_GUI_CURRENT_DIRECTORY = "midiFilterGUICurrentDirectory";
 
public final static String TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER_GUI = "hexFileUploadDeviceManagerGUI";
public final static String TAG_HEX_FILE_UPLOAD_MANAGER_GUI = "hexFileUploadManagerGUI";
 
public final static String TAG_HEX_FILE_UPLOAD_GUI_CURRENT_DIRECTORY = "hexFileUploadGUICurrentDirectory";
 
public final static String TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER_GUI = "sysexSendReceiveDeviceManagerGUI";
public final static String TAG_SYSEX_SEND_RECEIVE_MANAGER_GUI = "sysexSendReceiveManagerGUI";
 
public final static String TAG_SYSEX_SEND_RECEIVE_GUI_CURRENT_DIRECTORY = "sysexSendReceiveGUICurrentDirectory";
 
151,8 → 151,8
 
addTag(TAG_MAIN_WINDOW);
addTag(TAG_INTERNAL_FRAMES);
addTag(TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER_GUI);
addTag(TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER_GUI);
addTag(TAG_SYSEX_SEND_RECEIVE_MANAGER_GUI);
addTag(TAG_HEX_FILE_UPLOAD_MANAGER_GUI);
}
 
if (includeExternalCommands) {
171,7 → 171,7
addTag(TAG_WORKSPACE_CURRENT_DIRECTORY);
addTag(TAG_WORKSPACE_MRU_LIST);
addTag(TAG_WORKSPACE_MRU);
addTag(TAG_MIDI_FILTER_DEVICE_MANAGER_GUI);
addTag(TAG_MIDI_FILTER_MANAGER_GUI);
addTag(TAG_MIDI_FILTER_GUI_CURRENT_DIRECTORY);
addTag(TAG_MIDI_FILTER_GUI_MRU_LIST);
addTag(TAG_MIDI_FILTER_GUI_MRU);
334,14 → 334,14
 
MIOSStudioGUI.setCurrentDirectory(element.getTextContent());
 
} else if (name == TAG_MIDI_FILTER_DEVICE_MANAGER_GUI) {
} else if (name == TAG_MIDI_FILTER_MANAGER_GUI) {
 
} else if (name == TAG_MIDI_FILTER_GUI_CURRENT_DIRECTORY) {
 
MidiFilterGUI.setCurrentDirectory(element.getTextContent());
 
} else if (name == TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER_GUI) {
} else if (name == TAG_SYSEX_SEND_RECEIVE_MANAGER_GUI) {
 
int tabIndex = stringToInt(element.getAttribute(ATTR_SELECTED_TAB));
 
if (tabIndex < miosStudioGUI.getSysexSendReceiveDeviceManagerGUI()
356,7 → 356,7
 
SysexSendReceiveGUI.setCurrentDirectory(element.getTextContent());
 
} else if (name == TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER_GUI) {
} else if (name == TAG_HEX_FILE_UPLOAD_MANAGER_GUI) {
 
int tabIndex = stringToInt(element.getAttribute(ATTR_SELECTED_TAB));
 
488,7 → 488,7
}
 
sysexSendReceiveDeviceManagerGUIelement = document
.createElement(TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER_GUI);
.createElement(TAG_SYSEX_SEND_RECEIVE_MANAGER_GUI);
 
rootElement.appendChild(sysexSendReceiveDeviceManagerGUIelement);
 
498,7 → 498,7
.getTabbedPane().getSelectedIndex()));
 
hexFileUploadDeviceManagerGUIelement = document
.createElement(TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER_GUI);
.createElement(TAG_HEX_FILE_UPLOAD_MANAGER_GUI);
 
rootElement.appendChild(hexFileUploadDeviceManagerGUIelement);
 
543,7 → 543,7
 
if (sysexSendReceiveDeviceManagerGUIelement == null) {
sysexSendReceiveDeviceManagerGUIelement = document
.createElement(TAG_SYSEX_SEND_RECEIVE_DEVICE_MANAGER_GUI);
.createElement(TAG_SYSEX_SEND_RECEIVE_MANAGER_GUI);
 
rootElement
.appendChild(sysexSendReceiveDeviceManagerGUIelement);
560,7 → 560,7
 
if (hexFileUploadDeviceManagerGUIelement == null) {
hexFileUploadDeviceManagerGUIelement = document
.createElement(TAG_HEX_FILE_UPLOAD_DEVICE_MANAGER_GUI);
.createElement(TAG_HEX_FILE_UPLOAD_MANAGER_GUI);
 
rootElement.appendChild(hexFileUploadDeviceManagerGUIelement);
}
612,7 → 612,7
}
 
Element midiFilterDeviceManagerGUIelement = document
.createElement(TAG_MIDI_FILTER_DEVICE_MANAGER_GUI);
.createElement(TAG_MIDI_FILTER_MANAGER_GUI);
 
rootElement.appendChild(midiFilterDeviceManagerGUIelement);
 
/trunk/java/org/midibox/apps/miosstudio/gui/MIOSStudioGUI.java
75,20 → 75,20
import org.midibox.apps.miosstudio.MIOSStudio;
import org.midibox.apps.miosstudio.gui.xml.MIOSStudioGUIXML;
import org.midibox.apps.miosstudio.xml.MIOSStudioXML;
import org.midibox.midi.MidiFilterDevice;
import org.midibox.midi.MidiKeyboardControllerDevice;
import org.midibox.midi.MidiRouterDevice;
import org.midibox.midi.SysexSendReceiveDevice;
import org.midibox.midi.MidiFilter;
import org.midibox.midi.MidiKeyboardController;
import org.midibox.midi.SysexSendReceive;
import org.midibox.midi.VirtualMidiDevice;
import org.midibox.midi.gui.MidiDeviceManagerGUI;
import org.midibox.midi.gui.MidiDeviceRoutingGUI;
import org.midibox.midi.gui.MidiFilterDeviceManagerGUI;
import org.midibox.midi.gui.MidiFilterGUI;
import org.midibox.midi.gui.MidiFilterManagerGUI;
import org.midibox.midi.gui.MidiKeyboardControllerGUI;
import org.midibox.midi.gui.MidiMonitorFilteredGUI;
import org.midibox.midi.gui.SysexSendReceiveDeviceManagerGUI;
import org.midibox.mios.HexFileUploadDevice;
import org.midibox.midi.gui.SysexSendReceiveManagerGUI;
import org.midibox.mios.HexFileUpload;
import org.midibox.mios.gui.DebugFunctionGUI;
import org.midibox.mios.gui.HexFileUploadDeviceManagerGUI;
import org.midibox.mios.gui.HexFileUploadManagerGUI;
import org.midibox.mios.gui.LCDMessageGUI;
import org.midibox.utils.ResourceLoader;
import org.midibox.utils.gui.DialogOwner;
131,11 → 131,11
 
private MIOSStudioInternalFrame midiKeyboardControllerWindow;
 
private SysexSendReceiveDeviceManagerGUI sysexSendReceiveDeviceManagerGUI;
private SysexSendReceiveManagerGUI sysexSendReceiveDeviceManagerGUI;
 
private MIOSStudioInternalFrame sysexSendReceiveDeviceManagerWindow;
 
private HexFileUploadDeviceManagerGUI hexFileUploadDeviceManagerGUI;
private HexFileUploadManagerGUI hexFileUploadDeviceManagerGUI;
 
private MIOSStudioInternalFrame hexFileUploadDeviceManagerWindow;
 
238,21 → 238,21
 
createInternalFrames();
 
midiDeviceRoutingGUI.addMidiDeviceIcon(MidiRouterDevice.class,
midiDeviceRoutingGUI.addMidiDeviceIcon(VirtualMidiDevice.class,
ImageLoader.getImageIcon("virtualMidiDevice.png"));
 
midiDeviceRoutingGUI.addMidiDeviceIcon(MidiFilterDevice.class,
ImageLoader.getImageIcon("filter.png"));
midiDeviceRoutingGUI.addMidiDeviceIcon(MidiFilter.class, ImageLoader
.getImageIcon("filter.png"));
 
// start In/Out/Terminal thread
miosStudio.getMidiInPortMonitorDevice().getMidiMonitorFiltered()
.getMidiMonitor().deleteObserver(midiInPortMonitorGUI);
miosStudio.getMidiInPortMonitor().getMidiMonitor().deleteObserver(
midiInPortMonitorGUI);
 
miosStudio.getMidiOutPortMonitorDevice().getMidiMonitorFiltered()
.getMidiMonitor().deleteObserver(midiOutPortMonitorGUI);
miosStudio.getMidiOutPortMonitor().getMidiMonitor().deleteObserver(
midiOutPortMonitorGUI);
 
miosStudio.getMIOSTerminalDevice().getMidiMonitorFiltered()
.getMidiMonitor().deleteObserver(miosTerminalGUI);
miosStudio.getMIOSTerminal().getMidiMonitor().deleteObserver(
miosTerminalGUI);
 
Thread t = new Thread() {
 
324,7 → 324,7
 
// MIDI OUT Port
midiOutPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
.getMidiOutPortMonitorDevice().getMidiMonitorFiltered());
.getMidiOutPortMonitor());
 
icon = ImageLoader.getImageIcon("midiOut.png");
 
337,11 → 337,11
internalFrames.add(midiOutPortMonitorWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
.getMidiOutPortMonitorDevice(), icon);
.getMidiOutPortMonitor(), icon);
 
// MIDI IN Port
midiInPortMonitorGUI = new MidiMonitorFilteredGUI(miosStudio
.getMidiInPortMonitorDevice().getMidiMonitorFiltered());
.getMidiInPortMonitor());
 
icon = ImageLoader.getImageIcon("midiIn.png");
 
354,7 → 354,7
internalFrames.add(midiInPortMonitorWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
.getMidiInPortMonitorDevice(), icon);
.getMidiInPortMonitor(), icon);
 
// MIDI Keyboard Controller
 
361,7 → 361,7
icon = ImageLoader.getImageIcon("piano.png");
 
midiKeyboardControllerGUI = new MidiKeyboardControllerGUI(miosStudio
.getMidiKeyboardControllerDevice().getMidiKeyboardController());
.getMidiKeyboardController());
 
midiKeyboardControllerWindow = new MIOSStudioInternalFrame(
"MIDI Keyboard Controller", false, // resizable
373,13 → 373,13
 
internalFrames.add(midiKeyboardControllerWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(
MidiKeyboardControllerDevice.class, icon);
midiDeviceRoutingGUI.addMidiDeviceIcon(MidiKeyboardController.class,
icon);
 
// Sysex Send/Receive
 
sysexSendReceiveDeviceManagerGUI = new SysexSendReceiveDeviceManagerGUI(
miosStudio.getSysexSendReceiveDeviceManager());
sysexSendReceiveDeviceManagerGUI = new SysexSendReceiveManagerGUI(
miosStudio.getSysexSendReceiveManager());
 
icon = ImageLoader.getImageIcon("sysex.png");
 
391,13 → 391,12
 
internalFrames.add(sysexSendReceiveDeviceManagerWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(SysexSendReceiveDevice.class,
icon);
midiDeviceRoutingGUI.addMidiDeviceIcon(SysexSendReceive.class, icon);
 
// Hex Upload
 
hexFileUploadDeviceManagerGUI = new HexFileUploadDeviceManagerGUI(
miosStudio.getHexFileUploadDeviceManager());
hexFileUploadDeviceManagerGUI = new HexFileUploadManagerGUI(miosStudio
.getHexFileUploadManager());
 
icon = ImageLoader.getImageIcon("hex.png");
 
409,7 → 408,7
 
internalFrames.add(hexFileUploadDeviceManagerWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(HexFileUploadDevice.class, icon);
midiDeviceRoutingGUI.addMidiDeviceIcon(HexFileUpload.class, icon);
 
// Read/Write
/*
427,8 → 426,7
// LCD Message
icon = ImageLoader.getImageIcon("lcd.png");
 
lcdMessageGUI = new LCDMessageGUI(miosStudio.getLcdMessageDevice()
.getLCDMessage());
lcdMessageGUI = new LCDMessageGUI(miosStudio.getLcdMessage());
 
lcdMessageWindow = new MIOSStudioInternalFrame("MIOS LCD Message",
true, true, true, true, icon, lcdMessageGUI);
437,15 → 435,14
 
internalFrames.add(lcdMessageWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(
miosStudio.getLcdMessageDevice(), icon);
midiDeviceRoutingGUI
.addMidiDeviceIcon(miosStudio.getLcdMessage(), icon);
 
// MIOS Debug
 
icon = ImageLoader.getImageIcon("debug.png");
 
debugFunctionGUI = new DebugFunctionGUI(miosStudio
.getDebugFunctionDevice().getDebugFunction());
debugFunctionGUI = new DebugFunctionGUI(miosStudio.getDebugFunction());
 
debugFunctionWindow = new MIOSStudioInternalFrame(
"MIOS Debug Functions", true, true, true, true, icon,
455,12 → 452,12
 
internalFrames.add(debugFunctionWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
.getDebugFunctionDevice(), icon);
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio.getDebugFunction(),
icon);
 
// MIOS Terminal
miosTerminalGUI = new MidiMonitorFilteredGUI(miosStudio
.getMIOSTerminalDevice().getMidiMonitorFiltered());
.getMIOSTerminal());
 
icon = ImageLoader.getImageIcon("miosTerminal.png");
 
471,8 → 468,8
 
internalFrames.add(miosTerminalWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio
.getMIOSTerminalDevice(), icon);
midiDeviceRoutingGUI.addMidiDeviceIcon(miosStudio.getMIOSTerminal(),
icon);
}
 
public JMenuBar createMenuBar() {
657,11 → 654,11
toolBar.setVisible(true);
}
 
public SysexSendReceiveDeviceManagerGUI getSysexSendReceiveDeviceManagerGUI() {
public SysexSendReceiveManagerGUI getSysexSendReceiveDeviceManagerGUI() {
return sysexSendReceiveDeviceManagerGUI;
}
 
public HexFileUploadDeviceManagerGUI getHexFileUploadDeviceManagerGUI() {
public HexFileUploadManagerGUI getHexFileUploadDeviceManagerGUI() {
return hexFileUploadDeviceManagerGUI;
}
 
945,7 → 942,7
private void showMidiThruFilter() {
if (thruFilterProperties == null) {
final MidiFilterGUI midiFilterGUI = new MidiFilterGUI(miosStudio
.getMidiThruFilterDevice().getMidiFilter());
.getMidiThruFilter());
 
thruFilterProperties = new JDialog(DialogOwner.getFrame(),
"MIDI Thru Filter", false);
956,8 → 953,8
 
thruFilterProperties.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
miosStudio.getMidiThruFilterDevice().deleteObserver(
midiFilterGUI);
miosStudio.getMidiThruFilter()
.deleteObserver(midiFilterGUI);
thruFilterProperties = null;
}
});
1046,7 → 1043,7
 
private void showMidiFilterManagerDialog() {
if (midiFilterManagerDialog == null) {
final MidiFilterDeviceManagerGUI midiFilterManagerGUI = new MidiFilterDeviceManagerGUI(
final MidiFilterManagerGUI midiFilterManagerGUI = new MidiFilterManagerGUI(
miosStudio.getMidiFilterManager());
 
midiFilterManagerDialog = new JDialog(DialogOwner.getFrame(),
/trunk/java/org/midibox/apps/miosstudiosid/MIOSStudioSID.java
16,6 → 16,7
super.createDevices();
 
sidv2librarian = new SIDV2Editor(null, null);
 
}
 
protected void routeIndividualDevices() {
23,9 → 24,10
super.routeIndividualDevices();
 
midiDeviceRouting.addMidiWriteDevice(sidv2librarian
.getSysExControllerDevice());
.getSysexControllerDevice());
 
midiDeviceRouting.addMidiReadDevice(sidv2librarian
.getSysExControllerDevice());
.getSysexControllerDevice());
}
 
public void connectDevices() {
33,8 → 35,8
super.connectDevices();
 
midiDeviceRouting.connectDevices(miosStudioInPort, sidv2librarian
.getSysExControllerDevice());
.getSysexControllerDevice());
midiDeviceRouting.connectDevices(sidv2librarian
.getSysExControllerDevice(), miosStudioOutPort);
.getSysexControllerDevice(), miosStudioOutPort);
}
}
/trunk/java/org/midibox/apps/miosstudiosid/gui/MIOSStudioSIDGUI.java
49,12 → 49,12
sidv2librariangui.createMenu();
 
sidv2librarianWindow.pack();
 
internalFrames.add(sidv2librarianWindow);
 
midiDeviceRoutingGUI.addMidiDeviceIcon(
((org.midibox.apps.miosstudiosid.MIOSStudioSID) miosStudio)
.getSidv2librarian().getSysExControllerDevice(), icon);
.getSidv2librarian().getSysExController(), icon);
}
 
protected void createMIOSMenu() {
/trunk/java/org/midibox/apps/virtualkeyboard/xml/VirtualKeyboardXML.java
2,7 → 2,7
 
import org.midibox.apps.virtualkeyboard.VirtualKeyboard;
import org.midibox.midi.xml.MidiDeviceRoutingXML;
import org.midibox.midi.xml.MidiKeyboardControllerDeviceXML;
import org.midibox.midi.xml.MidiKeyboardControllerXML;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
21,7 → 21,7
this.virtualKeyboard = virtualKeyboard;
 
addTag(MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
addTag(MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
addTag(MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
}
 
protected void parseElement(Element element) {
40,13 → 40,13
 
midiDeviceRoutingXML.loadXML(element);
 
} else if (name == MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT) {
} else if (name == MidiKeyboardControllerXML.TAG_ROOT_ELEMENT) {
 
MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
virtualKeyboard.getMidiKeyboardControllerDevice(),
MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
MidiKeyboardControllerXML midiKeyboardControllerXML = new MidiKeyboardControllerXML(
virtualKeyboard.getMidiKeyboardController(),
MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
 
midiKeyboardControllerDeviceXML.loadXML(element);
midiKeyboardControllerXML.loadXML(element);
}
}
 
60,9 → 60,9
 
midiDeviceRoutingXML.saveXML(rootElement);
 
MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
virtualKeyboard.getMidiKeyboardControllerDevice(),
MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
MidiKeyboardControllerXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerXML(
virtualKeyboard.getMidiKeyboardController(),
MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
 
midiKeyboardControllerDeviceXML.saveXML(rootElement);
}
/trunk/java/org/midibox/apps/virtualkeyboard/gui/VirtualKeyboardGUI.java
36,7 → 36,7
import javax.swing.event.MenuListener;
 
import org.midibox.apps.virtualkeyboard.VirtualKeyboard;
import org.midibox.midi.MidiRouterDevice;
import org.midibox.midi.VirtualMidiDevice;
import org.midibox.midi.gui.MidiDeviceRoutingGUI;
import org.midibox.midi.gui.MidiKeyboardControllerGUI;
import org.midibox.utils.gui.ImageLoader;
56,7 → 56,7
private JMenu lookAndFeelMenu;
 
private String lookAndFeel;
 
protected VirtualKeyboard virtualKeyboard;
 
public VirtualKeyboardGUI(VirtualKeyboard virtualKeyboard) {
64,7 → 64,7
super(new GridBagLayout());
 
this.virtualKeyboard = virtualKeyboard;
 
lookAndFeel = UIManager.getLookAndFeel().getClass().getName();
 
GridBagConstraints gbc = new GridBagConstraints();
81,7 → 81,7
 
midiDeviceRoutingGUI.setBorder(BorderFactory.createEtchedBorder());
 
midiDeviceRoutingGUI.addMidiDeviceIcon(MidiRouterDevice.class,
midiDeviceRoutingGUI.addMidiDeviceIcon(VirtualMidiDevice.class,
ImageLoader.getImageIcon("virtualMidiDevice.png"));
 
add(midiDeviceRoutingGUI, gbc);
93,8 → 93,7
gbc.weighty = 0;
 
midiKeyboardControllerGUI = new MidiKeyboardControllerGUI(
virtualKeyboard.getMidiKeyboardControllerDevice()
.getMidiKeyboardController());
virtualKeyboard.getMidiKeyboardController());
 
midiKeyboardControllerGUI.setBorder(BorderFactory.createEtchedBorder());
 
160,10 → 159,10
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
 
setLookAndFeel(UIManager.getInstalledLookAndFeels()[l]
.getClassName());
 
} catch (Exception e) {
System.out.println(e.toString());
}
173,19 → 172,20
}
 
public void setLookAndFeel(String lookAndFeel) {
 
this.lookAndFeel = lookAndFeel;
if (!lookAndFeel.equals(UIManager.getLookAndFeel().getClass().getName())) {
 
if (!lookAndFeel
.equals(UIManager.getLookAndFeel().getClass().getName())) {
 
JOptionPane
.showMessageDialog(
VirtualKeyboardGUI.this,
"The selected Look & Feel will be applied the next time you restart Virtual Keyboard",
"ALERT", JOptionPane.ERROR_MESSAGE);
.showMessageDialog(
VirtualKeyboardGUI.this,
"The selected Look & Feel will be applied the next time you restart Virtual Keyboard",
"ALERT", JOptionPane.ERROR_MESSAGE);
}
}
 
public VirtualKeyboard getVirtualKeyboard() {
return virtualKeyboard;
}
/trunk/java/org/midibox/apps/virtualkeyboard/VirtualKeyboard.java
22,8 → 22,8
 
import org.midibox.midi.MidiDeviceManager;
import org.midibox.midi.MidiDeviceRouting;
import org.midibox.midi.MidiKeyboardControllerDevice;
import org.midibox.midi.MidiRouterDevice;
import org.midibox.midi.MidiKeyboardController;
import org.midibox.midi.VirtualMidiDevice;
 
public class VirtualKeyboard {
 
31,30 → 31,44
 
private MidiDeviceRouting midiDeviceRouting;
 
private MidiKeyboardControllerDevice midiKeyboardControllerDevice;
private MidiKeyboardController midiKeyboardController;
 
private MidiRouterDevice virtualKeyboardInPort;
private VirtualMidiDevice midiKeyboardControllerDevice;
 
private MidiRouterDevice virtualKeyboardThruPort;
private VirtualMidiDevice virtualKeyboardInPort;
 
private MidiRouterDevice virtualKeyboardOutPort;
private VirtualMidiDevice virtualKeyboardThruPort;
 
private VirtualMidiDevice virtualKeyboardOutPort;
 
public VirtualKeyboard() {
 
midiDeviceRouting = new MidiDeviceRouting();
 
midiKeyboardControllerDevice = new MidiKeyboardControllerDevice(
"Virtual MIDI Keyboard", 0);
midiKeyboardControllerDevice = new VirtualMidiDevice(
"Virtual MIDI Keyboard", -1, -1);
 
midiKeyboardController = new MidiKeyboardController(
midiKeyboardControllerDevice.getMidiOutReceiver(), 0);
 
midiDeviceManager = new MidiDeviceManager();
 
midiDeviceManager.rescanDevices();
 
virtualKeyboardInPort = new MidiRouterDevice("Virtual Keyboard In");
virtualKeyboardInPort = new VirtualMidiDevice("Virtual Keyboard In",
-1, -1);
virtualKeyboardInPort.setMidiInReceiver(virtualKeyboardInPort
.getMidiOutReceiver());
 
virtualKeyboardThruPort = new MidiRouterDevice("Virtual Keyboard Thru");
virtualKeyboardThruPort = new VirtualMidiDevice(
"Virtual Keyboard Thru", -1, -1);
virtualKeyboardThruPort.setMidiInReceiver(virtualKeyboardThruPort
.getMidiOutReceiver());
 
virtualKeyboardOutPort = new MidiRouterDevice("Virtual Keyboard Out");
virtualKeyboardOutPort = new VirtualMidiDevice("Virtual Keyboard Out",
-1, -1);
virtualKeyboardOutPort.setMidiInReceiver(virtualKeyboardOutPort
.getMidiOutReceiver());
 
midiDeviceRouting.connectDevices(virtualKeyboardInPort,
midiKeyboardControllerDevice);
82,7 → 96,7
return midiDeviceRouting;
}
 
public MidiKeyboardControllerDevice getMidiKeyboardControllerDevice() {
return midiKeyboardControllerDevice;
public MidiKeyboardController getMidiKeyboardController() {
return midiKeyboardController;
}
}
/trunk/java/org/midibox/apps/sidv2editor/gui/SIDV2EditorGUI.java
157,7 → 157,7
sidEditController.deleteObserver(this);
}
sidv2librarian.reconnectAllDevices(); // java.sound.midi SysEx bug
// workaround
// workaround
 
sidEditController = new SIDEditController(sidLibController
.getCurrentPatch());
/trunk/java/org/midibox/apps/sidv2editor/SIDV2Editor.java
24,13 → 24,15
 
import org.midibox.midi.MidiDeviceManager;
import org.midibox.midi.MidiDeviceRouting;
import org.midibox.midi.VirtualMidiDevice;
import org.midibox.sidlibr.SIDLibController;
import org.midibox.sidlibr.SysExControllerDevice;
import org.midibox.sidlibr.SysExController;
 
public class SIDV2Editor {
 
private MidiDeviceRouting midiDeviceRouting;
private SysExControllerDevice sysexControllerDevice;
private SysExController sysexController;
private VirtualMidiDevice sysexControllerDevice;
private SIDLibController sidLibController;
 
private MidiDevice localMidiDevice;
51,13 → 53,15
 
this.midiDeviceRouting = midiDeviceRouting;
 
sysexControllerDevice = new SysExControllerDevice(
"MidiBox SID V2 Editor");
sysexControllerDevice = new VirtualMidiDevice("MidiBox SID V2 Editor",
-1, -1);
sysexController = new SysExController(sysexControllerDevice
.getMidiOutReceiver());
sysexControllerDevice.setMidiInReceiver(sysexController);
 
this.localMidiDevice = sysexControllerDevice;
 
sidLibController = new SIDLibController(sysexControllerDevice
.getSysExController());
sidLibController = new SIDLibController(sysexController);
 
if (midiDeviceRouting != null) {
midiDeviceManager.rescanDevices();
76,7 → 80,11
return midiDeviceRouting;
}
 
public SysExControllerDevice getSysExControllerDevice() {
public SysExController getSysExController() {
return sysexController;
}
 
public VirtualMidiDevice getSysexControllerDevice() {
return sysexControllerDevice;
}
 
/trunk/java/org/midibox/sidedit/EngineSpecs.java
38,17 → 38,17
Vector engine = new Vector();
if (patch.isEnsemble()) {
engine.add(EnsembleSpecs.createENSSID(patch, 0)); // 1: Ensemble
// settings for
// SID1
// settings for
// SID1
engine.add(EnsembleSpecs.createENSSID(patch, 64)); // 2: Ensemble
// settings for
// SID2
// settings for
// SID2
engine.add(EnsembleSpecs.createENSSID(patch, 128)); // 3: Ensemble
// settings for
// SID3
// settings for
// SID3
engine.add(EnsembleSpecs.createENSSID(patch, 192)); // 4: Ensemble
// settings for
// SID4
// settings for
// SID4
} else {
if (patch.getEngine() == patch.LEAD) {
// Lead engine
71,12 → 71,12
engine.add(LeadSpecs.createMOD(patch)); // 14: Modulation paths
engine.add(LeadSpecs.createTRIG(patch)); // 15: Trigger matrix
engine.add(LeadSpecs.createWT(patch)); // 16: Wavetable
// sequencer
// sequencer
} else if (patch.getEngine() == patch.BASSLINE) {
// Bassline
engine.add(createGlobal(patch, SIDSysexInfo.basslineParams));// 0:
// Global
// parameters
// Global
// parameters
engine.add(createExt(patch)); // 1: External parameters
engine.add(createFilter(patch, 0)); // 2: Filter Left
engine.add(createFilter(patch, 6)); // 3: Filter right
83,22 → 83,22
engine.add(createVoice(patch, 0)); // 4: Left Oscillator
engine.add(createVoice(patch, 80)); // 5: Right Oscillator
engine.add(BasslineSpecs.createMSTRBOTH(patch));// 6: Right
// Oscillator
// Oscillator
engine.add(BasslineSpecs.createMSTR(patch, 0)); // 7: Left
// master set
// master set
engine.add(BasslineSpecs.createMSTR(patch, 80));// 8: Right
// master set
// master set
engine.add(BasslineSpecs.createLFO(patch, 0)); // 9: Left LFO's
engine.add(BasslineSpecs.createLFO(patch, 80)); // 10: Right
// LFO's
// LFO's
engine.add(BasslineSpecs.createENV(patch, 0)); // 11: Left
// Envelope
// Envelope
engine.add(BasslineSpecs.createENV(patch, 80)); // 12: Right
// Envelope
// Envelope
engine.add(BasslineSpecs.createSEQ(patch, 0)); // 13: Left
// Sequencer
// Sequencer
engine.add(BasslineSpecs.createSEQ(patch, 80)); // 14: Right
// Sequencer
// Sequencer
engine.add(BasslineSpecs.createSEQData(patch)); // 15: Sequencer
// data
} else if (patch.getEngine() == patch.DRUM) {
110,7 → 110,7
engine.add(createFilter(patch, 0)); // 2: Filter Left
engine.add(createFilter(patch, 6)); // 3: Filter right
engine.add(DrumSpecs.createDrumInstr(patch)); // 4: Drum
// Instruments
// Instruments
engine.add(DrumSpecs.createSEQ(patch)); // 5: Sequencer
engine.add(DrumSpecs.createSEQData(patch)); // 6: Sequencer data
} else if (patch.getEngine() == patch.MULTI) {
130,22 → 130,22
engine.add(MultiSpecs.createInstrument(patch, 0)); // 10: Inst.1
// Rest
engine.add(MultiSpecs.createInstrument(patch, 48)); // 11:
// Inst.2
// Inst.2
// Rest
engine.add(MultiSpecs.createInstrument(patch, 96)); // 12:
// Inst.3
// Inst.3
// Rest
engine.add(MultiSpecs.createInstrument(patch, 144)); // 13:
// Inst.4
// Inst.4
// Rest
engine.add(MultiSpecs.createInstrument(patch, 192)); // 14:
// Inst.5
// Inst.5
// Rest
engine.add(MultiSpecs.createInstrument(patch, 240)); // 15:
// Inst.6
// Inst.6
// Rest
engine.add(MultiSpecs.createWTdata(patch)); // 16: Wavetable
// data
// data
}
}
return engine;
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlGUI.java
177,8 → 177,8
midiParameter.snap = true;
if (Arrays.binarySearch(midiParameter.snapVals, midiParameter
.getMidiValue()) == -1) { // If current midi value is not
// part of the snap values reset
// to snapvals[0];
// part of the snap values reset
// to snapvals[0];
midiParameter.setMidiValue(midiParameter.snapVals[0], true);
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
/trunk/java/org/midibox/sidedit/SIDSysexInfo.java
23,291 → 23,291
 
// Patch/Ensemble Request commands
public static String hardPatchRequestSysex = "F000007E4B<device>0100<bank><patch>F7"; // Request
// a
// dump
// of
// <patch>
// in
// <bank>
// a
// dump
// of
// <patch>
// in
// <bank>
public static String editPatchRequestSysex = "F000007E4B<device>01080000F7"; // Request
// the
// current
// patch
// edit
// buffer
// (direct
// read
// from
// RAM)
// the
// current
// patch
// edit
// buffer
// (direct
// read
// from
// RAM)
public static String hardEnsembleRequestSysex = "F000007E4B<device>017000<ensemble>F7"; // Request
// a
// dump
// of
// <ensemble>
// a
// dump
// of
// <ensemble>
public static String editEnsembleRequestSysex = "F000007E4B<device>01780000F7"; // Request
// the
// current
// ensemble
// edit
// buffer
// (direct
// read
// from
// RAM)
// The
// locations
// of
// unavailable
// SID
// slaves
// will
// be
// read
// from
// EEPROM/BankStick,
// therefore
// the
// "default"
// <ensemble>
// number
// has
// to
// be
// specified
// as
// well.
// the
// current
// ensemble
// edit
// buffer
// (direct
// read
// from
// RAM)
// The
// locations
// of
// unavailable
// SID
// slaves
// will
// be
// read
// from
// EEPROM/BankStick,
// therefore
// the
// "default"
// <ensemble>
// number
// has
// to
// be
// specified
// as
// well.
// Patch/Ensemble Dump commands
public static String hardPatchDumpSysex = "F000007E4B<device>0200<bank><patch><data><checksum>F7"; // Write
// a
// dump
// to
// <patch>
// in
// <bank>.
// Checksum
// is
// 2s
// complement
// over
// the
// 1024
// bytes
// dump.
// The
// actual
// patch
// size
// is
// only
// 512
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 1024
// bytes
// have
// to
// be
// sent
// a
// dump
// to
// <patch>
// in
// <bank>.
// Checksum
// is
// 2s
// complement
// over
// the
// 1024
// bytes
// dump.
// The
// actual
// patch
// size
// is
// only
// 512
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 1024
// bytes
// have
// to
// be
// sent
public static String editPatchDumpSysex = "F000007E4B<device>02080000<data><checksum>F7"; // Write
// a
// patch
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
// a
// patch
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
public static String hardEnsembleDumpSysex = "F000007E4B<device>027000<ensemble><data><checksum>F7"; // Write
// a
// dump
// to
// <ensemble>.
// Checksum
// is
// 2s/
// complement
// over
// the
// 512
// bytes
// dump.
// The
// actual
// ensemble
// size
// is
// only
// 256
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 512
// bytes
// have
// to
// be
// sent
// a
// dump
// to
// <ensemble>.
// Checksum
// is
// 2s/
// complement
// over
// the
// 512
// bytes
// dump.
// The
// actual
// ensemble
// size
// is
// only
// 256
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 512
// bytes
// have
// to
// be
// sent
public static String editEnsembleDumpSysex = "F000007E4B<device>02780000<data><checksum>F7"; // Write
// an
// ensemble
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
// an
// ensemble
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
 
// Bank Request commands
public static String bankRequestSysex = "F000007E4B<device>0300<bank>F7"; // Request
// a
// dump
// of
// the
// whole
// patch
// <bank>
// (128
// patches).Only
// 64
// patches
// are
// sent
// when
// a
// 32k
// BankStick
// is
// accessed
// a
// dump
// of
// the
// whole
// patch
// <bank>
// (128
// patches).Only
// 64
// patches
// are
// sent
// when
// a
// 32k
// BankStick
// is
// accessed
public static String ensembleBankRequestSysex = "F000007E4B<device>037000F7"; // Request
// a
// dump
// of
// all
// ensembles
// (128
// ensembles)
// a
// dump
// of
// all
// ensembles
// (128
// ensembles)
 
// Parameter write
public static String editPatchParameterSysex = "F000007E4B<device>06<wopt><address><value>F7"; // Direct
// Write
// of
// parameter
// into
// patch
// buffer
// (<AH>
// =
// 0..3,
// <AL>
// =
// 0..7F).
// Patch
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
// Write
// of
// parameter
// into
// patch
// buffer
// (<AH>
// =
// 0..3,
// <AL>
// =
// 0..7F).
// Patch
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
public static String editEnsembleParameterSysex = "F000007E4B<device>0670<address><value>F7";// Direct
// Write
// of
// parameter
// into
// ensemble
// buffer
// (<AH>
// =
// 0..1,
// <AL>
// =
// 0..7F).
// Ensemble
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
// Write
// of
// parameter
// into
// ensemble
// buffer
// (<AH>
// =
// 0..1,
// <AL>
// =
// 0..7F).
// Ensemble
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
 
// Miscellaneous
public static String pingSysex = "F000007E4B<device>0FF7"; // Ping (just
// sends back
// the same
// SysEx string)
// sends back
// the same
// SysEx string)
public static String panicSysex = "F000007E4B<device>0C08F7"; // All
// notes/sequences
// off
// notes/sequences
// off
public static String forwardSysex = "F000007E4B<device>0C00<sids>F7"; // Sets
// SysEx
// forwarding
// from
// master
// to
// slaves
// SysEx
// forwarding
// from
// master
// to
// slaves
public static String playSysex = "F000007E4B<device>0C0900F7"; // Plays the
// current
// patch
// current
// patch
 
// Feedback from core
public static String acknowledgedSysex = "F000007E4B<device>0F"; // Acknowledged,
// TK:
// "<sids>F7"
// part
// removed
// for
// more
// flexibility
// TK:
// "<sids>F7"
// part
// removed
// for
// more
// flexibility
public static String error1Sysex = "F000007E4B<device>0E01F7"; // received
// less
// bytes
// then
// expected
// less
// bytes
// then
// expected
public static String error2Sysex = "F000007E4B<device>0E03F7"; // wrong
// checksum
// checksum
public static String error3Sysex = "F000007E4B<device>0E0AF7"; // bankstick
// or
// patch/drumset/ensemble
// not
// available
// or
// patch/drumset/ensemble
// not
// available
public static String error4Sysex = "F000007E4B<device>0E0BF7"; // parameter
// not
// available
// not
// available
public static String error5Sysex = "F000007E4B<device>0E10F7"; // RAM access
// not
// supported
// not
// supported
public static String error6Sysex = "F000007E4B<device>0E11F7"; // BankStick
// too small
// too small
 
public static String[] leadParams = { "===None===", "Volume", "Osc Phase",
"Osc Detune", "Filter Cutoff", "Filter Res.", "Filter Chan.",
/trunk/java/org/midibox/mios/MemoryReadWriteDevice.java
File deleted
/trunk/java/org/midibox/mios/HexFileUploadDeviceManager.java
File deleted
/trunk/java/org/midibox/mios/HexFileUploadDevice.java
File deleted
/trunk/java/org/midibox/mios/DebugFunctionDevice.java
File deleted
/trunk/java/org/midibox/mios/LCDMessageDevice.java
File deleted
/trunk/java/org/midibox/mios/MIOSSysexSendReceive.java
106,6 → 106,10
return receiver;
}
 
public void setReceiver(Receiver receiver) {
this.receiver = receiver;
}
 
public void addMessage(String message) {
 
messages.addLast(message);
/trunk/java/org/midibox/mios/xml/HexFileUploadDeviceManagerXML.java
File deleted
/trunk/java/org/midibox/mios/xml/LCDMessageDeviceXML.java
File deleted
/trunk/java/org/midibox/mios/xml/HexFileUploadDeviceXML.java
File deleted
/trunk/java/org/midibox/mios/xml/DebugFunctionDeviceXML.java
File deleted
/trunk/java/org/midibox/mios/xml/HexFileUploadManagerXML.java
New file
0,0 → 1,94
package org.midibox.mios.xml;
 
import java.util.Iterator;
import java.util.Vector;
 
import org.midibox.mios.HexFileUpload;
import org.midibox.mios.HexFileUploadManager;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
public class HexFileUploadManagerXML extends XMLUtils {
 
public final static String TAG_ROOT_ELEMENT = "hexFileUploadManager";
 
public final static String TAG_HEX_FILE_UPLOADS = "hexFileUploads";
 
public final static String ATTR_MIOS_32_MODE = "mios32Mode";
 
protected HexFileUploadManager hexFileUploadManager;
 
public HexFileUploadManagerXML(
HexFileUploadManager hexFileUploadDeviceManager,
String rootElementTag) {
 
super(rootElementTag);
 
this.hexFileUploadManager = hexFileUploadDeviceManager;
 
addTag(TAG_HEX_FILE_UPLOADS);
addTag(HexFileUploadXML.TAG_ROOT_ELEMENT);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
 
hexFileUploadManager.setMIOS32Mode(stringToBoolean(element
.getAttribute(ATTR_MIOS_32_MODE)));
 
} else if (name == TAG_HEX_FILE_UPLOADS) {
 
Iterator it = ((Vector) hexFileUploadManager.getHexFileUploads()
.clone()).iterator();
 
while (it.hasNext()) {
 
HexFileUpload hexFileUpload = (HexFileUpload) it.next();
 
hexFileUploadManager.removeHexFileUpload(hexFileUpload);
}
 
} else if (name == HexFileUploadXML.TAG_ROOT_ELEMENT) {
 
HexFileUpload hexFileUpload = new HexFileUpload(null);
 
HexFileUploadXML hexFileUploadXML = new HexFileUploadXML(
hexFileUpload, HexFileUploadXML.TAG_ROOT_ELEMENT);
 
hexFileUploadManager.addHexFileUpload(hexFileUpload);
 
hexFileUploadXML.loadXML(element);
}
}
 
public void saveXML(Node node) {
 
super.saveXML(node);
 
Element hexFileUploadDevicesElement = document
.createElement(TAG_HEX_FILE_UPLOADS);
 
rootElement.setAttribute(ATTR_MIOS_32_MODE,
booleanToString(hexFileUploadManager.isMIOS32Mode()));
 
rootElement.appendChild(hexFileUploadDevicesElement);
 
Iterator it = hexFileUploadManager.getHexFileUploads().iterator();
 
while (it.hasNext()) {
 
HexFileUpload hexFileUpload = (HexFileUpload) it.next();
 
HexFileUploadXML hexFileUploadXML = new HexFileUploadXML(
hexFileUpload, HexFileUploadXML.TAG_ROOT_ELEMENT);
 
hexFileUploadXML.saveXML(hexFileUploadDevicesElement);
}
}
}
/trunk/java/org/midibox/mios/HexFileUploadManager.java
New file
0,0 → 1,94
/*
* @(#)HexFileUploadDeviceManager.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.mios;
 
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
 
public class HexFileUploadManager extends Observable implements Observer {
 
private Vector hexFileUploads;
 
private boolean mios32Mode;
 
public HexFileUploadManager() {
 
hexFileUploads = new Vector();
 
mios32Mode = false;
}
 
public boolean isMIOS32Mode() {
 
return mios32Mode;
}
 
public void setMIOS32Mode(boolean mode) {
 
mios32Mode = mode;
}
 
public HexFileUpload newHexFileUpload() {
 
HexFileUpload hexFileUpload = new HexFileUpload(null);
 
hexFileUpload.setMIOS32Mode(mios32Mode);
 
addHexFileUpload(hexFileUpload);
 
return hexFileUpload;
}
 
public void addHexFileUpload(HexFileUpload hexFileUpload) {
 
hexFileUpload.addObserver(this);
 
hexFileUploads.add(hexFileUpload);
 
setChanged();
notifyObservers(hexFileUpload);
clearChanged();
}
 
public void removeHexFileUpload(HexFileUpload hexFileUpload) {
 
hexFileUploads.remove(hexFileUpload);
hexFileUpload.deleteObserver(this);
 
hexFileUploads.remove(hexFileUpload);
 
setChanged();
notifyObservers(hexFileUpload);
clearChanged();
}
 
public Vector getHexFileUploads() {
return hexFileUploads;
}
 
public void update(Observable observable, Object object) {
 
if (object == HexFileUpload.MIOS32_MODE) {
mios32Mode = ((HexFileUpload) observable).isMIOS32Mode();
}
}
}
/trunk/java/org/midibox/mios/gui/HexFileUploadDeviceManagerGUI.java
File deleted
/trunk/java/org/midibox/mios/gui/HexFileUploadManagerGUI.java
New file
0,0 → 1,203
/*
* @(#)HexFileUploadDeviceManagerGUI.java beta8 2006/04/23
*
* Copyright (C) 2008 Adam King (adamjking@optusnet.com.au)
*
* This application is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this application; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
package org.midibox.mios.gui;
 
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
 
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
 
import org.midibox.mios.HexFileUpload;
import org.midibox.mios.HexFileUploadManager;
import org.midibox.utils.gui.ImageLoader;
 
public class HexFileUploadManagerGUI extends JPanel implements ActionListener,
Observer {
 
private HexFileUploadManager hexFileUploadManager;
 
private JTabbedPane tabbedPane;
 
private Vector hexFileUploadGUIs;
 
public HexFileUploadManagerGUI(
HexFileUploadManager hexFileUploadDeviceManager) {
super(new BorderLayout());
 
this.hexFileUploadManager = hexFileUploadDeviceManager;
hexFileUploadDeviceManager.addObserver(this);
 
hexFileUploadGUIs = new Vector();
 
add(createButtonPanel(), BorderLayout.NORTH);
add(createTabPanel(), BorderLayout.CENTER);
 
createGUIs();
}
 
public JTabbedPane getTabbedPane() {
return tabbedPane;
}
 
private JPanel createButtonPanel() {
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 4));
 
JLabel label = new JLabel("MIOS Hex Upload:", JLabel.LEFT);
label.setOpaque(true);
buttonPanel.add(label);
buttonPanel.add(Box.createHorizontalStrut(10));
 
JButton button = new JButton("New Tab");
button.setActionCommand("newUpload");
button.setToolTipText("Open new upload tab");
button.addActionListener(this);
buttonPanel.add(button);
 
button = new JButton("Close Tab");
button.setActionCommand("closeUpload");
button.setToolTipText("Close current upload tab");
button.addActionListener(this);
buttonPanel.add(button);
 
return buttonPanel;
}
 
private JPanel createTabPanel() {
JPanel tabPanel = new JPanel(new BorderLayout());
tabbedPane = new JTabbedPane();
tabPanel.add(tabbedPane, BorderLayout.CENTER);
tabPanel.add(new JSeparator(JSeparator.HORIZONTAL), BorderLayout.NORTH);
return tabPanel;
}
 
private void createGUIs() {
 
Iterator it = hexFileUploadManager.getHexFileUploads().iterator();
 
while (it.hasNext()) {
 
HexFileUpload hexFileUpload = (HexFileUpload) it.next();
 
boolean hasGUI = false;
 
Iterator it2 = hexFileUploadGUIs.iterator();
 
while (it2.hasNext()) {
 
HexFileUploadGUI hexFileUploadGUI = (HexFileUploadGUI) it2
.next();
 
if (hexFileUploadGUI.getHexFileUpload() == hexFileUpload) {
hasGUI = true;
}
}
 
if (!hasGUI) {
 
HexFileUploadGUI hexFileUploadGUI = new HexFileUploadGUI(
hexFileUpload);
 
hexFileUploadGUIs.add(hexFileUploadGUI);
 
tabbedPane.addTab("", ImageLoader.getImageIcon("hex.png"),
hexFileUploadGUI);
}
}
 
it = ((Vector) hexFileUploadGUIs.clone()).iterator();
 
while (it.hasNext()) {
 
HexFileUploadGUI hexFileUploadGUI = (HexFileUploadGUI) it.next();
 
boolean hasDevice = false;
 
Iterator it2 = hexFileUploadManager.getHexFileUploads().iterator();
 
while (it2.hasNext()) {
 
HexFileUpload hexFileUpload = (HexFileUpload) it2.next();
 
if (hexFileUploadGUI.getHexFileUpload() == hexFileUpload) {
hasDevice = true;
}
}
 
if (!hasDevice) {
 
hexFileUploadGUIs.remove(hexFileUploadGUI);
 
tabbedPane.remove(hexFileUploadGUI);
}
}
 
for (int i = 0; i < hexFileUploadManager.getHexFileUploads().size(); i++) {
 
tabbedPane.setTitleAt(i, "Hex File Upload " + (i + 1));
}
}
 
public void addNewUploadTab() {
hexFileUploadManager.newHexFileUpload();
}
 
public void closeUploadTab() {
int selectedTab = tabbedPane.getSelectedIndex();
 
if (selectedTab > -1) {
hexFileUploadManager
.removeHexFileUpload((HexFileUpload) hexFileUploadManager
.getHexFileUploads().elementAt(selectedTab));
}
}
 
public void update(Observable observable, Object object) {
 
if (observable == hexFileUploadManager) {
 
createGUIs();
}
}
 
public void actionPerformed(ActionEvent ae) {
 
String command = ae.getActionCommand();
 
if (command.equals("newUpload")) {
addNewUploadTab();
}
 
if (command.equals("closeUpload")) {
closeUploadTab();
}
}
}
/trunk/java/org/midibox/mios/gui/HexFileUploadGUI.java
75,13 → 75,13
ChangeListener, Observer {
 
private JPopupMenu MRUPopupMenu;
 
private SplitButton openMRUButton;
 
private static int maxMRU = 10;
 
private static String currentDirectory = "";
 
private static Vector MRU = new Vector();
 
private static JFileChooser fc = null;
127,7 → 127,7
hexUploadTask.addObserver(this);
 
Insets insets = new Insets(2, 2, 2, 2);
 
browseButton = new JButton("Hex File", ImageLoader
.getImageIcon("open.png"));
browseButton.setActionCommand("browse");
134,7 → 134,6
browseButton.addActionListener(this);
browseButton.setMargin(insets);
browseButton.setToolTipText("Open Hex File");
 
fileName = new JTextField();
fileName.setEditable(false);
165,7 → 164,7
queryButton.setAlignmentX(Component.LEFT_ALIGNMENT);
 
JPanel fileButtonsPanel = new JPanel(new BorderLayout(2, 0));
 
MRUPopupMenu = new JPopupMenu();
MRUPopupMenu.addPopupMenuListener(new PopupMenuListener() {
 
186,7 → 185,7
 
openMRUButton = new SplitButton(browseButton, MRUPopupMenu);
openMRUButton.setRollover(true);
 
fileButtonsPanel.add(openMRUButton, BorderLayout.WEST);
fileButtonsPanel.add(fileName, BorderLayout.CENTER);
fileButtonsPanel.setBorder(BorderFactory.createEmptyBorder(7, 7, 5, 7));
338,7 → 337,7
 
updateUploadControls();
}
 
private void buildMRUMenu(JComponent menu) {
 
menu.removeAll();
362,7 → 361,7
menu.add(menuItem, 0);
}
}
 
public static void saveMRU(String file) {
 
MRU.remove(file);
406,28 → 405,27
 
if (nRetVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
 
openHexFile(file);
 
currentDirectory = fc.getCurrentDirectory().toString();
}
}
 
protected void openHexFile(File file) {
 
if (file.exists()) {
 
hexFileUpload.setFile(file);
 
saveMRU(file.getPath());
 
} else {
JOptionPane.showMessageDialog(this,
"Hex file no longer exists",
JOptionPane.showMessageDialog(this, "Hex file no longer exists",
"File does not exist", JOptionPane.ERROR_MESSAGE);
}
}
 
public static Vector getMRU() {
return MRU;
}
/trunk/java/org/midibox/sidlibr/SysExControllerDevice.java
File deleted
/trunk/java/org/midibox/sidlibr/SysExController.java
228,19 → 228,19
if (!(m.indexOf(SIDSysexInfo.acknowledgedSysex.replace("<device>",
"00")) == 0)) {
if (m.substring(0, 2).equalsIgnoreCase("F0")) { // select next
// array item
// with each F0
// array item
// with each F0
tempSyx = m;
} else {
if (m.substring(0, 2).equalsIgnoreCase("F7")) { // for
// windows
// (1024
// byte
// limit, F7
// added at
// beginning
// of next
// chunk)
// windows
// (1024
// byte
// limit, F7
// added at
// beginning
// of next
// chunk)
m = m.substring(2);
}
tempSyx += m;
/trunk/java/org/midibox/sidlibr/SIDLibController.java
36,8 → 36,8
private Bank[] patchBanks = new Bank[8];
private Boolean openEditor = false;
private int coresHardware = 15; // AND mask for selected cores --- we
// assume, that all cores are available by
// default
// assume, that all cores are available by
// default
private int coresSelected = 1;
 
private SysExController sysexController;