Browse Source

More plugin state fixes, closes #59

tags/1.9.4
falkTX 11 years ago
parent
commit
8881ec1a94
4 changed files with 14 additions and 13 deletions
  1. +2
    -4
      source/backend/plugin/CarlaPlugin.cpp
  2. +5
    -5
      source/carla_shared.py
  3. +1
    -1
      source/utils/CarlaLv2Utils.hpp
  4. +6
    -3
      source/utils/CarlaStateUtils.hpp

+ 2
- 4
source/backend/plugin/CarlaPlugin.cpp View File

@@ -675,9 +675,7 @@ const SaveState& CarlaPlugin::getSaveState()

if (data != nullptr && dataSize > 0)
{
QByteArray chunk(QByteArray((char*)data, dataSize).toBase64());

saveState.chunk = carla_strdup(chunk.constData());
saveState.chunk = carla_strdup(QByteArray((char*)data, dataSize).toBase64().constData());

// Don't save anything else if using chunks
return saveState;
@@ -720,7 +718,7 @@ const SaveState& CarlaPlugin::getSaveState()

stateParameter->index = paramData.index;
stateParameter->midiCC = paramData.midiCC;
stateParameter->midiChannel = paramData.midiChannel + 1;
stateParameter->midiChannel = paramData.midiChannel;

getParameterName(i, strBuf);
stateParameter->name = carla_strdup(strBuf);


+ 5
- 5
source/carla_shared.py View File

@@ -963,7 +963,7 @@ class PluginParameter(QWidget):
self.ui.widget.updateAll()

self.setMidiControl(pInfo['midiCC'])
self.setMidiChannel(pInfo['midiChannel']+1)
self.setMidiChannel(pInfo['midiChannel'])

# -------------------------------------------------------------
# Set-up connections
@@ -1331,7 +1331,7 @@ class PluginEdit(QDialog):
'stepSmall': paramRanges['stepSmall'],
'stepLarge': paramRanges['stepLarge'],
'midiCC': paramData['midiCC'],
'midiChannel': paramData['midiChannel'],
'midiChannel': paramData['midiChannel']+1,

'current': paramValue
}
@@ -1412,7 +1412,7 @@ class PluginEdit(QDialog):
'stepSmall': 0.0,
'stepLarge': 0.0,
'midiCC': -1,
'midiChannel': 0,
'midiChannel': 1,

'current': 0.0
}
@@ -1532,7 +1532,7 @@ class PluginEdit(QDialog):
def setParameterMidiChannel(self, parameterId, channel):
for paramType, paramId, paramWidget in self.fParameterList:
if paramId == parameterId:
paramWidget.setMidiChannel(channel)
paramWidget.setMidiChannel(channel+1)
break

def setProgram(self, index):
@@ -1937,7 +1937,7 @@ class PluginEdit(QDialog):
elif not self.fPluginInfo['hints'] & PLUGIN_IS_SYNTH:
return

if self.fControlChannel == -1:
if self.fControlChannel < 0:
self.ui.cb_midi_programs.setEnabled(False)
return



+ 1
- 1
source/utils/CarlaLv2Utils.hpp View File

@@ -1315,7 +1315,7 @@ bool is_lv2_feature_supported(const LV2_URI uri)
if (std::strcmp(uri, LV2_URID__unmap) == 0)
return true;
if (std::strcmp(uri, LV2_WORKER__schedule) == 0)
return true;
return false; // TODO
return false;
}



+ 6
- 3
source/utils/CarlaStateUtils.hpp View File

@@ -135,7 +135,7 @@ struct SaveState {
balanceLeft(-1.0f),
balanceRight(1.0f),
panning(0.0f),
ctrlChannel(0),
ctrlChannel(-1),
currentProgramIndex(-1),
currentProgramName(nullptr),
currentMidiBank(-1),
@@ -187,7 +187,7 @@ struct SaveState {
balanceLeft = -1.0f;
balanceRight = 1.0f;
panning = 0.0f;
ctrlChannel = 0;
ctrlChannel = -1;
currentProgramIndex = -1;
currentMidiBank = -1;
currentMidiProgram = -1;
@@ -541,7 +541,10 @@ const QString& getXMLFromSaveState(const SaveState& saveState)
if (saveState.panning != 0.0f)
data += QString(" <Panning>%1</Panning>\n").arg(saveState.panning);

data += QString(" <ControlChannel>%1</ControlChannel>\n").arg(saveState.ctrlChannel+1);
if (saveState.ctrlChannel < 0)
data += QString(" <ControlChannel>N</ControlChannel>\n");
else
data += QString(" <ControlChannel>%1</ControlChannel>\n").arg(saveState.ctrlChannel+1);

content += data;
}


Loading…
Cancel
Save