@@ -209,7 +209,7 @@ public: | |||||
opcode = fShmControl.readOpcode(); | opcode = fShmControl.readOpcode(); | ||||
CARLA_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode); | CARLA_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode); | ||||
pData->bufferSize = fShmControl.readInt(); | |||||
pData->bufferSize = fShmControl.readUInt(); | |||||
carla_stderr("BufferSize: %i", pData->bufferSize); | carla_stderr("BufferSize: %i", pData->bufferSize); | ||||
opcode = fShmControl.readOpcode(); | opcode = fShmControl.readOpcode(); | ||||
@@ -301,7 +301,7 @@ public: | |||||
case kPluginBridgeOpcodeSetBufferSize: | case kPluginBridgeOpcodeSetBufferSize: | ||||
{ | { | ||||
const int bufferSize(fShmControl.readInt()); | |||||
const uint32_t bufferSize(fShmControl.readUInt()); | |||||
bufferSizeChanged(bufferSize); | bufferSizeChanged(bufferSize); | ||||
break; | break; | ||||
} | } | ||||
@@ -1665,7 +1665,7 @@ public: | |||||
if (name != nullptr && name[0] != '\0') | if (name != nullptr && name[0] != '\0') | ||||
pData->name = pData->engine->getUniquePluginName(name); | pData->name = pData->engine->getUniquePluginName(name); | ||||
pData->filename = filename; | |||||
pData->filename = carla_strdup(filename); | |||||
fBridgeBinary = bridgeBinary; | fBridgeBinary = bridgeBinary; | ||||
// --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
@@ -190,7 +190,7 @@ void CarlaBridgeClient::sendOscControl(const int32_t index, const float value) c | |||||
osc_send_control(fOscData, index, value); | 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); | carla_debug("CarlaBridgeClient::sendOscProgram(%i)", index); | ||||
@@ -198,7 +198,7 @@ void CarlaBridgeClient::sendOscProgram(const int32_t index) const | |||||
osc_send_program(fOscData, index); | 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); | carla_debug("CarlaBridgeClient::sendOscMidiProgram(%i)", index); | ||||
@@ -90,8 +90,8 @@ public: | |||||
protected: | protected: | ||||
void sendOscConfigure(const char* const key, const char* const value) const; | void sendOscConfigure(const char* const key, const char* const value) const; | ||||
void sendOscControl(const int32_t index, const float 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 sendOscMidi(const uint8_t midiBuf[4]) const; | ||||
void sendOscExiting() const; | void sendOscExiting() const; | ||||
@@ -194,7 +194,7 @@ public: | |||||
void exec() | void exec() | ||||
{ | { | ||||
while (! gCloseNow) | |||||
for (; ! gCloseNow;) | |||||
{ | { | ||||
idle(); | idle(); | ||||
carla_msleep(30); | carla_msleep(30); | ||||
@@ -251,7 +251,7 @@ public: | |||||
fEngine->oscSend_bridge_configure(CARLA_BRIDGE_MSG_SAVED, ""); | 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_SAFE_ASSERT_RETURN(fPlugin != nullptr,); | ||||
carla_debug("CarlaPluginClient::setParameterMidiChannel(%i, %i)", index, channel); | carla_debug("CarlaPluginClient::setParameterMidiChannel(%i, %i)", index, channel); | ||||
@@ -259,7 +259,7 @@ public: | |||||
fPlugin->setParameterMidiChannel(index, channel, false, false); | 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_SAFE_ASSERT_RETURN(fPlugin != nullptr,); | ||||
carla_debug("CarlaPluginClient::setParameterMidiCC(%i, %i)", index, cc); | carla_debug("CarlaPluginClient::setParameterMidiCC(%i, %i)", index, cc); | ||||
@@ -366,7 +366,9 @@ int CarlaBridgeOsc::handleMsgShow() | |||||
{ | { | ||||
carla_debug("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; | return 0; | ||||
} | } | ||||
@@ -374,7 +376,9 @@ int CarlaBridgeOsc::handleMsgHide() | |||||
{ | { | ||||
carla_debug("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; | return 0; | ||||
} | } | ||||
@@ -139,6 +139,13 @@ public: | |||||
return i; | 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 readLong() noexcept | ||||
{ | { | ||||
int64_t l = 0; | int64_t l = 0; | ||||
@@ -102,7 +102,7 @@ shm_t carla_shm_attach_linux(const char* const name) | |||||
static inline | static inline | ||||
shm_t carla_shm_create(const char* const name) | 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); | 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 | static inline | ||||
shm_t carla_shm_attach(const char* const name) | 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); | return shm_open(name, O_RDWR, 0); | ||||
} | } | ||||