Browse Source

Carla: Fix chunk restore on plugin-bridges

tags/v0.9.0
falkTX 12 years ago
parent
commit
269f22774a
2 changed files with 21 additions and 30 deletions
  1. +1
    -1
      c++/carla-backend/vst.cpp
  2. +20
    -29
      c++/carla-bridge/carla_bridge_plugin.cpp

+ 1
- 1
c++/carla-backend/vst.cpp View File

@@ -1424,7 +1424,7 @@ public:
void handleAudioMasterAutomate(const uint32_t index, const double value)
{
//CARLA_ASSERT(m_enabled);
//CARLA_ASSERT(index < param.count);
CARLA_ASSERT(index < param.count);

if (index >= param.count /*|| ! m_enabled*/)
return;


+ 20
- 29
c++/carla-bridge/carla_bridge_plugin.cpp View File

@@ -509,10 +509,27 @@ public:
if (! plugin)
return;

nextChunkFilePath = QString(filePath);
QString chunkFilePath(filePath);

while (! nextChunkFilePath.isEmpty())
carla_msleep(25);
#ifdef Q_OS_WIN
if (chunkFilePath.startsWith("/"))
{
// running under Wine, posix host
chunkFilePath = chunkFilePath.replace(0, 1, "Z:/");
chunkFilePath = QDir::toNativeSeparators(chunkFilePath);
}
#endif
QFile chunkFile(chunkFilePath);

if (plugin && chunkFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream in(&chunkFile);
QString stringData(in.readAll());
chunkFile.close();
chunkFile.remove();

plugin->setChunkData(stringData.toUtf8().constData());
}
}

// ---------------------------------------------------------------------
@@ -618,31 +635,6 @@ protected:

if (event->timerId() == msgTimer)
{
if (! nextChunkFilePath.isEmpty())
{
#ifdef Q_OS_WIN
if (nextChunkFilePath.startsWith("/"))
{
// running under Wine, posix host
nextChunkFilePath = nextChunkFilePath.replace(0, 1, "Z:/");
nextChunkFilePath = QDir::toNativeSeparators(nextChunkFilePath);
}
#endif
QFile chunkFile(nextChunkFilePath);

if (plugin && chunkFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream in(&chunkFile);
QString stringData(in.readAll());
chunkFile.close();
chunkFile.remove();

plugin->setChunkData(stringData.toUtf8().constData());
}

nextChunkFilePath.clear();
}

if (nextWidth > 0 && nextHeight > 0 && pluginGui)
{
pluginGui->setNewSize(nextWidth, nextHeight);
@@ -670,7 +662,6 @@ private:
bool hasUI;
int msgTimer;
int nextWidth, nextHeight;
QString nextChunkFilePath;

CarlaBackend::CarlaEngine* engine;
CarlaBackend::CarlaPlugin* plugin;


Loading…
Cancel
Save