Name length fix

pull/1/head
asb2m10 11 years ago
parent 18024bc21d
commit 453bd181e5
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 7
      Source/PluginData.cpp
  3. 4
      Source/PluginEditor.cpp

@ -107,18 +107,19 @@ void packProgram(uint8_t *dest, uint8_t *src, int idx, String name) {
memcpy(bulk + 112, src + 137, 4); // lfo memcpy(bulk + 112, src + 137, 4); // lfo
bulk[116] = (src[141]&0x01) | (((src[142]&0x07) << 1) | ((src[143]&0x07) << 4)); bulk[116] = (src[141]&0x01) | (((src[142]&0x07) << 1) | ((src[143]&0x07) << 4));
bulk[117] = src[144]; bulk[117] = src[144];
int eos = 0; int eos = 0;
for(int i=0; i < 10; i++) { for(int i=0; i < 10; i++) {
char c = name[i]; char c = (char) name[i];
if ( c == 0 ) if ( c == 0 )
eos = 1; eos = 1;
if ( eos ) { if ( eos ) {
bulk[117+i] = ' '; bulk[118+i] = ' ';
continue; continue;
} }
c = c < 32 ? ' ' : c; c = c < 32 ? ' ' : c;
c = c > 127 ? ' ' : c; c = c > 127 ? ' ' : c;
bulk[117+i] = c; bulk[118+i] = c;
} }
} }

@ -305,10 +305,10 @@ void DexedAudioProcessorEditor::storeProgram() {
ComboBox *dest = dialog.getComboBoxComponent(String("Dest")); ComboBox *dest = dialog.getComboBoxComponent(String("Dest"));
int programNum = dest->getSelectedItemIndex(); int programNum = dest->getSelectedItemIndex();
String programName = name->getText(); String programName(name->getText());
if ( programName.length() > 10 ) { if ( programName.length() > 10 ) {
int toStrip = programName.length() - 10; int toStrip = programName.length() - 10;
programName.dropLastCharacters(toStrip); programName = programName.dropLastCharacters(toStrip);
} }
if ( externalFile == NULL ) { if ( externalFile == NULL ) {

Loading…
Cancel
Save