Subversion Repositories svn.mios

Compare Revisions

Ignore whitespace Rev 213 → Rev 214

/trunk/java/org/midibox/sidlibr/SysExController.java
124,15 → 124,15
private void startRequest(Object type, String message) {
tempSyxType = type;
tempCount = 0;
tempCount = -1; // will be incremented with each F0
if (tempSyxType==PATCHBANK) {
tempSyx = new String[256];
tempSyx = new String[128];
} else if (tempSyxType==PATCH) {
tempSyx = new String[2];
tempSyx = new String[1];
} else if (tempSyxType==ENSEMBLE) {
tempSyx = new String[0];
tempSyx = new String[1];
} else if (tempSyxType==ENSEMBLEBANK) {
tempSyx = new String[0];
tempSyx = new String[128];
}
progress = new ProgressMonitor(null, "", "Receiving SysEx data...", 0, tempSyx.length);
timer = new Timer(timeOut, this);
171,12 → 171,20
if (progress.isCanceled()) {
stopRequest();
} else {
tempSyx[tempCount] = m;
tempCount++;
// select next array item with each F0
if( m.substring(0, 2).equalsIgnoreCase("F0") ) {
tempSyx[++tempCount] = m;
} else {
if( m.substring(0, 2).equalsIgnoreCase("F7") ) { // for windows (1024 byte limit, F7 added at beginning of next chunk)
m = m.substring(2);
}
tempSyx[tempCount] += m;
}
 
timer.restart();
progress.setProgress(tempCount);
if ((tempSyx.length==tempCount)) {
if( (m.substring(m.length() - 2).equalsIgnoreCase("F7")) && (tempCount == tempSyx.length-1) ) {
stopRequest();
parseSysex();
}
187,9 → 195,9
if (tempSyxType==PATCHBANK) {
Bank tempBank = new Bank(receiver);
String s = "";
for (int c=0;c<(tempSyx.length/2);c++) {
if ((tempSyx[c*2] != null) && (tempSyx[(c*2)+1] != null)) {
s = s + tempSyx[c*2] + tempSyx[(c*2)+1].substring(2);
for (int c=0;c<tempSyx.length;c++) {
if (tempSyx[c] != null) {
s = s + tempSyx[c];
} else {break;}
}
String status = tempBank.parseBankSyx(s);
201,7 → 209,7
}
} else if (tempSyxType==PATCH) {
Patch tempPatch = new Patch(receiver);
String status = tempPatch.parsePatch(tempSyx[0]+tempSyx[1].substring(2, tempSyx[1].length()));
String status = tempPatch.parsePatch(tempSyx[0]);
if (statusCheck(status)) {
pickMeUp = tempPatch;
setChanged();