Browse Source

Misc fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
2037630bee
7 changed files with 25 additions and 14 deletions
  1. +2
    -2
      source/backend/engine/CarlaEngineBridge.cpp
  2. +1
    -1
      source/backend/plugin/BridgePlugin.cpp
  3. +2
    -2
      source/bridges/CarlaBridgeClient.cpp
  4. +2
    -2
      source/bridges/CarlaBridgeClient.hpp
  5. +9
    -5
      source/bridges/CarlaBridgePlugin.cpp
  6. +7
    -0
      source/utils/CarlaRingBuffer.hpp
  7. +2
    -2
      source/utils/CarlaShmUtils.hpp

+ 2
- 2
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -209,7 +209,7 @@ public:

opcode = fShmControl.readOpcode();
CARLA_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode);
pData->bufferSize = fShmControl.readInt();
pData->bufferSize = fShmControl.readUInt();
carla_stderr("BufferSize: %i", pData->bufferSize);

opcode = fShmControl.readOpcode();
@@ -301,7 +301,7 @@ public:

case kPluginBridgeOpcodeSetBufferSize:
{
const int bufferSize(fShmControl.readInt());
const uint32_t bufferSize(fShmControl.readUInt());
bufferSizeChanged(bufferSize);
break;
}


+ 1
- 1
source/backend/plugin/BridgePlugin.cpp View File

@@ -1665,7 +1665,7 @@ public:
if (name != nullptr && name[0] != '\0')
pData->name = pData->engine->getUniquePluginName(name);

pData->filename = filename;
pData->filename = carla_strdup(filename);
fBridgeBinary = bridgeBinary;

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


+ 2
- 2
source/bridges/CarlaBridgeClient.cpp View File

@@ -190,7 +190,7 @@ void CarlaBridgeClient::sendOscControl(const int32_t index, const float value) c
osc_send_control(fOscData, index, value);
}

void CarlaBridgeClient::sendOscProgram(const int32_t index) const
void CarlaBridgeClient::sendOscProgram(const uint32_t index) const
{
carla_debug("CarlaBridgeClient::sendOscProgram(%i)", index);

@@ -198,7 +198,7 @@ void CarlaBridgeClient::sendOscProgram(const int32_t index) const
osc_send_program(fOscData, index);
}

void CarlaBridgeClient::sendOscMidiProgram(const int32_t index) const
void CarlaBridgeClient::sendOscMidiProgram(const uint32_t index) const
{
carla_debug("CarlaBridgeClient::sendOscMidiProgram(%i)", index);



+ 2
- 2
source/bridges/CarlaBridgeClient.hpp View File

@@ -90,8 +90,8 @@ public:
protected:
void sendOscConfigure(const char* const key, const char* const value) const;
void sendOscControl(const int32_t index, const float value) const;
void sendOscProgram(const int32_t index) const;
void sendOscMidiProgram(const int32_t index) const;
void sendOscProgram(const uint32_t index) const;
void sendOscMidiProgram(const uint32_t index) const;
void sendOscMidi(const uint8_t midiBuf[4]) const;
void sendOscExiting() const;



+ 9
- 5
source/bridges/CarlaBridgePlugin.cpp View File

@@ -194,7 +194,7 @@ public:

void exec()
{
while (! gCloseNow)
for (; ! gCloseNow;)
{
idle();
carla_msleep(30);
@@ -251,7 +251,7 @@ public:
fEngine->oscSend_bridge_configure(CARLA_BRIDGE_MSG_SAVED, "");
}

void setParameterMidiChannel(const int32_t index, const uint8_t channel)
void setParameterMidiChannel(const uint32_t index, const uint8_t channel)
{
CARLA_SAFE_ASSERT_RETURN(fPlugin != nullptr,);
carla_debug("CarlaPluginClient::setParameterMidiChannel(%i, %i)", index, channel);
@@ -259,7 +259,7 @@ public:
fPlugin->setParameterMidiChannel(index, channel, false, false);
}

void setParameterMidiCC(const int32_t index, const int16_t cc)
void setParameterMidiCC(const uint32_t index, const int16_t cc)
{
CARLA_SAFE_ASSERT_RETURN(fPlugin != nullptr,);
carla_debug("CarlaPluginClient::setParameterMidiCC(%i, %i)", index, cc);
@@ -366,7 +366,9 @@ int CarlaBridgeOsc::handleMsgShow()
{
carla_debug("CarlaBridgeOsc::handleMsgShow()");

carla_show_custom_ui(0, true);
if (carla_get_plugin_info(0)->hints & CarlaBackend::PLUGIN_HAS_CUSTOM_UI)
carla_show_custom_ui(0, true);

return 0;
}

@@ -374,7 +376,9 @@ int CarlaBridgeOsc::handleMsgHide()
{
carla_debug("CarlaBridgeOsc::handleMsgHide()");

carla_show_custom_ui(0, false);
if (carla_get_plugin_info(0)->hints & CarlaBackend::PLUGIN_HAS_CUSTOM_UI)
carla_show_custom_ui(0, false);

return 0;
}



+ 7
- 0
source/utils/CarlaRingBuffer.hpp View File

@@ -139,6 +139,13 @@ public:
return i;
}

uint32_t readUInt() noexcept
{
int32_t i = -1;
tryRead(&i, sizeof(int32_t));
return (i >= 0) ? static_cast<uint32_t>(i) : 0;
}

int64_t readLong() noexcept
{
int64_t l = 0;


+ 2
- 2
source/utils/CarlaShmUtils.hpp View File

@@ -102,7 +102,7 @@ shm_t carla_shm_attach_linux(const char* const name)
static inline
shm_t carla_shm_create(const char* const name)
{
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', -1);
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', gNullCarlaShm);

return shm_open(name, O_RDWR|O_CREAT|O_EXCL, 0600);
}
@@ -110,7 +110,7 @@ shm_t carla_shm_create(const char* const name)
static inline
shm_t carla_shm_attach(const char* const name)
{
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', -1);
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', gNullCarlaShm);

return shm_open(name, O_RDWR, 0);
}


Loading…
Cancel
Save