Browse Source

Merge branch '1.0.x'

tags/1.9.4
falkTX 12 years ago
parent
commit
a56f6c8eef
3 changed files with 32 additions and 17 deletions
  1. +1
    -0
      Makefile
  2. +11
    -17
      source/backend/engine/CarlaEngineJack.cpp
  3. +20
    -0
      source/utils/CarlaString.hpp

+ 1
- 0
Makefile View File

@@ -234,6 +234,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla-control.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla-control.svg
rm -f $(DESTDIR)$(PREFIX)/share/mime/packages/carla.xml
rm -f $(DESTDIR)$(PREFIX)/lib/dssi/carla-dssi.so
rm -f $(DESTDIR)$(PREFIX)/lib/vst/carla-vst.so
rm -rf $(DESTDIR)$(PREFIX)/lib/carla/


+ 11
- 17
source/backend/engine/CarlaEngineJack.cpp View File

@@ -1487,11 +1487,8 @@ protected:
if (fullPortName == nullptr)
return;

const size_t groupNameSize(std::strstr(fullPortName, portName) - fullPortName - 1);
char groupName[groupNameSize+1];

carla_copy<char>(groupName, fullPortName, groupNameSize);
groupName[groupNameSize] = '\0';
CarlaString groupName(fullPortName);
groupName.truncate(groupName.rfind(portName)-1);

int groupId = getGroupId(groupName);

@@ -1628,11 +1625,8 @@ protected:
if (portName == nullptr)
return;

const size_t groupNameSize(std::strstr(newName, portName) - newName - 1);
char groupName[groupNameSize+1];

carla_copy<char>(groupName, newName, groupNameSize);
groupName[groupNameSize] = '\0';
CarlaString groupName(newName);
groupName.truncate(groupName.rfind(portName)-1);

const int groupId(getGroupId(groupName));

@@ -1918,14 +1912,14 @@ private:

const int jackPortFlags(jackbridge_port_flags(jackPort));

const size_t groupNameSize(std::strstr(fullPortName, portName) - fullPortName - 1);
char groupName[groupNameSize+1];
int groupId = -1;
int groupId = -1;

CarlaString groupName(fullPortName);
groupName.truncate(groupName.rfind(portName)-1);

carla_copy<char>(groupName, fullPortName, groupNameSize);
groupName[groupNameSize] = '\0';
QString qGroupName(groupName);

if (parsedGroups.contains(QString(groupName)))
if (parsedGroups.contains(qGroupName))
{
groupId = getGroupId(groupName);
CARLA_ASSERT(groupId != -1);
@@ -1933,7 +1927,7 @@ private:
else
{
groupId = fLastGroupId++;
parsedGroups.append(groupName);
parsedGroups.append(qGroupName);

GroupNameToId groupNameToId(groupId, groupName);
fUsedGroupNames.append(groupNameToId);


+ 20
- 0
source/utils/CarlaString.hpp View File

@@ -231,6 +231,26 @@ public:
return 0;
}

size_t rfind(const char* const strBuf) const
{
if (strBuf == nullptr || strBuf[0] == '\0')
return bufferLen;

size_t ret = bufferLen+1;
const char* tmpBuf = buffer;

for (size_t i=0; i < bufferLen; ++i)
{
if (std::strstr(tmpBuf, strBuf) == nullptr)
break;

--ret;
++tmpBuf;
}

return (ret > bufferLen) ? bufferLen : bufferLen-ret;
}

void replace(const char before, const char after)
{
if (after == '\0')


Loading…
Cancel
Save