Browse Source

Misc fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
7b1fec1ee3
4 changed files with 18 additions and 13 deletions
  1. +8
    -2
      source/backend/plugin/Lv2Plugin.cpp
  2. +4
    -3
      source/backend/plugin/VstPlugin.cpp
  3. +1
    -1
      source/backend/standalone/CarlaStandalone.cpp
  4. +5
    -7
      source/modules/native-plugins/juce-patchbay.cpp

+ 8
- 2
source/backend/plugin/Lv2Plugin.cpp View File

@@ -2533,10 +2533,15 @@ public:
lv2_atom_forge_float(&fAtomForge, static_cast<float>(timeInfo.bbt.beatsPerMinute));
}

lv2_atom_forge_pop(&fAtomForge, &forgeFrame);

LV2_Atom* const atom((LV2_Atom*)timeInfoBuf);
CARLA_SAFE_ASSERT_BREAK(atom->size < 256);

lv2_atom_buffer_write(&evInAtomIters[i], 0, 0, atom->type, atom->size, LV2_ATOM_BODY_CONST(atom));

CARLA_ASSERT(atom->size < 256);
// send deprecated blank object as well
lv2_atom_buffer_write(&evInAtomIters[i], 0, 0, CARLA_URI_MAP_ID_ATOM_BLANK, atom->size, LV2_ATOM_BODY_CONST(atom));
}

pData->postRtEvents.trySplice();
@@ -4123,7 +4128,8 @@ public:

case CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM:
case CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT:
CARLA_SAFE_ASSERT_RETURN(((const LV2_Atom*)buffer)->size == bufferSize,);
// plugins sometimes fails on this, not good...
CARLA_SAFE_ASSERT_INT2(((const LV2_Atom*)buffer)->size == bufferSize, ((const LV2_Atom*)buffer)->size, bufferSize);

fAtomQueueIn.put((const LV2_Atom*)buffer, rindex);
break;


+ 4
- 3
source/backend/plugin/VstPlugin.cpp View File

@@ -1434,11 +1434,12 @@ public:
{
if (fMidiEvents[k].type == 0)
break;
CARLA_SAFE_ASSERT_CONTINUE(fMidiEvents[k].deltaFrames > 0);
CARLA_SAFE_ASSERT_CONTINUE(fMidiEvents[k].midiData[0] > 0);

CARLA_SAFE_ASSERT_CONTINUE(fMidiEvents[k].deltaFrames >= 0);
CARLA_SAFE_ASSERT_CONTINUE(fMidiEvents[k].midiData[0] != 0);

const uint8_t status(static_cast<uint8_t>(fMidiEvents[k].midiData[0]));
const uint8_t channel(static_cast<uint8_t>(status < MIDI_STATUS_BIT ? status & MIDI_STATUS_BIT : 0));
const uint8_t channel(static_cast<uint8_t>(status < MIDI_STATUS_BIT ? status & MIDI_CHANNEL_BIT : 0));

uint8_t midiData[3];
midiData[0] = static_cast<uint8_t>(fMidiEvents[k].midiData[0]);


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

@@ -73,7 +73,7 @@ public:
startThread();

while (! fInitialised)
carla_msleep(1);
Thread::sleep(1);
}

void stop()


+ 5
- 7
source/modules/native-plugins/juce-patchbay.cpp View File

@@ -90,9 +90,6 @@ protected:

void process(float** inBuffer, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
{
fAudioBuffer.copyFrom(0, 0, inBuffer[0], static_cast<int>(frames));
fAudioBuffer.copyFrom(1, 0, inBuffer[1], static_cast<int>(frames));

fMidiBuffer.clear();

for (uint32_t i=0; i < midiEventCount; ++i)
@@ -108,7 +105,11 @@ protected:
fMidiKeyState->processNextMidiBuffer(fMidiBuffer, 0, static_cast<int>(frames), true);
}

fGraph.getGraph().processBlock(fAudioBuffer, fMidiBuffer);
FloatVectorOperations::copy(outBuffer[0], inBuffer[0], static_cast<int>(frames));
FloatVectorOperations::copy(outBuffer[1], inBuffer[1], static_cast<int>(frames));
AudioSampleBuffer audioBuf(outBuffer, 2, static_cast<int>(frames));

fGraph.getGraph().processBlock(audioBuf, fMidiBuffer);

MidiBuffer::Iterator outBufferIterator(fMidiBuffer);
const uint8_t* midiData;
@@ -129,9 +130,6 @@ protected:
std::memcpy(tmpEvent.data, midiData, sizeof(uint8_t)*tmpEvent.size);
writeMidiEvent(&tmpEvent);
}

FloatVectorOperations::copy(outBuffer[0], fAudioBuffer.getSampleData(0), static_cast<int>(frames));
FloatVectorOperations::copy(outBuffer[1], fAudioBuffer.getSampleData(1), static_cast<int>(frames));
}

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


Loading…
Cancel
Save