Browse Source

Misc fixes

tags/1.9.4
falkTX 11 years ago
parent
commit
84043e8ce6
8 changed files with 29 additions and 16 deletions
  1. +3
    -0
      source/backend/engine/CarlaEngine.cpp
  2. +6
    -7
      source/backend/engine/CarlaEngineJack.cpp
  3. +5
    -0
      source/backend/engine/CarlaEngineOsc.cpp
  4. +2
    -2
      source/backend/plugin/DssiPlugin.cpp
  5. +1
    -1
      source/backend/plugin/LadspaPlugin.cpp
  6. +7
    -6
      source/backend/plugin/NativePlugin.cpp
  7. +3
    -0
      source/bridges/qtcreator/carla-bridge-plugin.pro
  8. +2
    -0
      source/utils/CarlaThread.hpp

+ 3
- 0
source/backend/engine/CarlaEngine.cpp View File

@@ -904,6 +904,9 @@ const char* CarlaEngine::getNewUniquePluginName(const char* const name)
{
CARLA_ASSERT(kData->plugins[i].plugin);

if (kData->plugins[i].plugin == nullptr)
continue;

// Check if unique name doesn't exist
if (const char* const pluginName = kData->plugins[i].plugin->name())
{


+ 6
- 7
source/backend/engine/CarlaEngineJack.cpp View File

@@ -491,14 +491,14 @@ class CarlaEngineJack : public CarlaEngine
public:
CarlaEngineJack()
: CarlaEngine(),
#ifdef BUILD_BRIDGE
fHasQuit(false),
#else
fClient(nullptr),
fTransportState(JackTransportStopped),
fRackPorts{nullptr},
fFreewheel(false),
#ifdef BUILD_BRIDGE
fHasQuit(false)
#else
fRackPorts{nullptr}
#endif
fFreewheel(false)
{
carla_debug("CarlaEngineJack::CarlaEngineJack()");

@@ -1007,6 +1007,7 @@ private:
jack_client_t* fClient;
jack_position_t fTransportPos;
jack_transport_state_t fTransportState;
bool fFreewheel;

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

@@ -1026,8 +1027,6 @@ private:
jack_port_t* fRackPorts[rackPortCount];
#endif

bool fFreewheel;

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

void processPlugin(CarlaPlugin* const plugin, const uint32_t nframes)


+ 5
- 0
source/backend/engine/CarlaEngineOsc.cpp View File

@@ -243,6 +243,11 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons
pluginId += path[nameSize+2]-'0';
}
}
else
{
carla_stderr("CarlaEngineOsc::handleMessage() - invalid message '%s'", path);
return 1;
}

if (pluginId > kEngine->currentPluginCount())
{


+ 2
- 2
source/backend/plugin/DssiPlugin.cpp View File

@@ -916,7 +916,7 @@ public:
// --------------------------------------------------------------------------------------------------------
// Event Input and Processing

else if (kData->event.portIn != nullptr)
if (kData->event.portIn != nullptr && kData->activeBefore)
{
// ----------------------------------------------------------------------------------------------------
// MIDI Input (External)
@@ -1271,7 +1271,7 @@ public:

else
{
processSingle(inBuffer, outBuffer, frames, 0, 0);
processSingle(inBuffer, outBuffer, frames, 0, midiEventCount);

} // End of Plugin processing (no events)



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

@@ -792,7 +792,7 @@ public:
// --------------------------------------------------------------------------------------------------------
// Event Input and Processing

else if (kData->event.portIn != nullptr)
if (kData->event.portIn != nullptr && kData->activeBefore)
{
// ----------------------------------------------------------------------------------------------------
// Event Input (System)


+ 7
- 6
source/backend/plugin/NativePlugin.cpp View File

@@ -494,7 +494,6 @@ public:
const double sampleRate = kData->engine->getSampleRate();

uint32_t aIns, aOuts, mIns, mOuts, params, j;
aIns = aOuts = mIns = mOuts = params = 0;

bool forcedStereoIn, forcedStereoOut;
forcedStereoIn = forcedStereoOut = false;
@@ -988,7 +987,7 @@ public:
// --------------------------------------------------------------------------------------------------------
// Event Input and Processing

else if (kData->event.portIn != nullptr)
if (kData->event.portIn != nullptr && kData->activeBefore)
{
// ----------------------------------------------------------------------------------------------------
// MIDI Input (External)
@@ -1358,7 +1357,7 @@ public:
if (fMidiOut.count > 0)
{
// reverse lookup
for (uint32_t i=fMidiEventCount-1; i >= fMidiEventCount; i--)
for (uint32_t i = (MAX_MIDI_EVENTS*2)-1; i >= fMidiEventCount; i--)
{
if (fMidiEvents[i].data[0] == 0)
break;
@@ -1412,10 +1411,10 @@ public:

fIsProcessing = true;

fDescriptor->process(fHandle, fAudioInBuffers, fAudioOutBuffers, frames, 0, nullptr);
fDescriptor->process(fHandle, fAudioInBuffers, fAudioOutBuffers, frames, fMidiEventCount, fMidiEvents);

if (fHandle2 != nullptr)
fDescriptor->process(fHandle2, fAudioInBuffers, fAudioOutBuffers, frames, 0, nullptr);
fDescriptor->process(fHandle2, fAudioInBuffers, fAudioOutBuffers, frames, fMidiEventCount, fMidiEvents);

fIsProcessing = false;

@@ -1519,13 +1518,15 @@ protected:
{
CARLA_ASSERT(fEnabled);
CARLA_ASSERT(fMidiOut.count > 0);
CARLA_ASSERT(fIsProcessing);
CARLA_ASSERT(event != nullptr);
CARLA_ASSERT(fIsProcessing);

if (! fEnabled)
return false;
if (fMidiOut.count == 0)
return false;
if (event == nullptr)
return false;
if (! fIsProcessing)
{
carla_stderr2("NativePlugin::handleWriteMidiEvent(%p) - received MIDI out events outside audio thread, ignoring", event);


+ 3
- 0
source/bridges/qtcreator/carla-bridge-plugin.pro View File

@@ -89,6 +89,9 @@ HEADERS += \
../../utils/CarlaStateUtils.hpp \
../../utils/CarlaVstUtils.hpp \
../../utils/CarlaUtils.hpp \
../../utils/CarlaMutex.hpp \
../../utils/CarlaString.hpp \
../../utils/CarlaThread.hpp \
../../utils/lv2_atom_queue.hpp \
../../utils/RtList.hpp



+ 2
- 0
source/utils/CarlaThread.hpp View File

@@ -179,10 +179,12 @@ public:
#ifdef CPP11_THREAD
if (cthread != nullptr)
{
cthread->join();
delete cthread;
cthread = nullptr;
}
#else
pthread_join(pthreadId, nullptr);
_zero();
#endif
return false;


Loading…
Cancel
Save