Browse Source

Misc fixing

tags/1.9.4
falkTX 10 years ago
parent
commit
ae8aac3c5e
2 changed files with 8 additions and 4 deletions
  1. +2
    -1
      source/backend/CarlaStandalone.cpp
  2. +6
    -3
      source/utils/CarlaStateUtils.cpp

+ 2
- 1
source/backend/CarlaStandalone.cpp View File

@@ -2148,6 +2148,7 @@ void carla_set_panning(uint pluginId, float value)
void carla_set_ctrl_channel(uint pluginId, int8_t channel) void carla_set_ctrl_channel(uint pluginId, int8_t channel)
{ {
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,);
CARLA_SAFE_ASSERT_RETURN(channel >= -1 && channel < MAX_MIDI_CHANNELS,);
carla_debug("carla_set_ctrl_channel(%i, %i)", pluginId, channel); carla_debug("carla_set_ctrl_channel(%i, %i)", pluginId, channel);


if (CarlaPlugin* const plugin = gStandalone.engine->getPlugin(pluginId)) if (CarlaPlugin* const plugin = gStandalone.engine->getPlugin(pluginId))
@@ -2179,7 +2180,7 @@ void carla_set_parameter_value(uint pluginId, uint32_t parameterId, float value)
void carla_set_parameter_midi_channel(uint pluginId, uint32_t parameterId, uint8_t channel) void carla_set_parameter_midi_channel(uint pluginId, uint32_t parameterId, uint8_t channel)
{ {
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,);
CARLA_SAFE_ASSERT_RETURN(channel >= MAX_MIDI_CHANNELS,);
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,);
carla_debug("carla_set_parameter_midi_channel(%i, %i, %i)", pluginId, parameterId, channel); carla_debug("carla_set_parameter_midi_channel(%i, %i, %i)", pluginId, parameterId, channel);


if (CarlaPlugin* const plugin = gStandalone.engine->getPlugin(pluginId)) if (CarlaPlugin* const plugin = gStandalone.engine->getPlugin(pluginId))


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

@@ -264,9 +264,12 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement)
} }
else if (tag.equalsIgnoreCase("controlchannel") || tag.equalsIgnoreCase("control-channel")) else if (tag.equalsIgnoreCase("controlchannel") || tag.equalsIgnoreCase("control-channel"))
{ {
const int value(text.getIntValue());
if (value >= 1 && value <= MAX_MIDI_CHANNELS)
ctrlChannel = static_cast<int8_t>(value-1);
if (! text.startsWithIgnoreCase("n"))
{
const int value(text.getIntValue());
if (value >= 1 && value <= MAX_MIDI_CHANNELS)
ctrlChannel = static_cast<int8_t>(value-1);
}
} }


// ------------------------------------------------------- // -------------------------------------------------------


Loading…
Cancel
Save