Browse Source

Misc

tags/1.9.4
falkTX 10 years ago
parent
commit
5c4a2f5e17
8 changed files with 11 additions and 19 deletions
  1. +2
    -0
      source/backend/engine/CarlaEngineGraph.cpp
  2. +1
    -1
      source/utils/CarlaBase64Utils.hpp
  3. +2
    -8
      source/utils/CarlaBinaryUtils.hpp
  4. +2
    -3
      source/utils/CarlaEngineUtils.hpp
  5. +1
    -1
      source/utils/CarlaLibUtils.hpp
  6. +1
    -1
      source/utils/CarlaMathUtils.hpp
  7. +1
    -1
      source/utils/CarlaRingBuffer.hpp
  8. +1
    -4
      source/utils/CarlaUtils.hpp

+ 2
- 0
source/backend/engine/CarlaEngineGraph.cpp View File

@@ -829,6 +829,7 @@ public:
carla_zeroStruct<EngineEvent>(engineEvents, kMaxEngineEventInternalCount);
fillEngineEventsFromJuceMidiBuffer(engineEvents, midi);
}
midi.clear();

const uint32_t bufferSize(static_cast<uint32_t>(audio.getNumSamples()));

@@ -1069,6 +1070,7 @@ void PatchbayGraph::process(CarlaEngine::ProtectedData* const data, const float*
{
carla_zeroStruct<EngineEvent>(data->events.out, kMaxEngineEventInternalCount);
fillEngineEventsFromJuceMidiBuffer(data->events.out, midiBuffer);
midiBuffer.clear();
}
}
#endif


+ 1
- 1
source/utils/CarlaBase64Utils.hpp View File

@@ -54,7 +54,7 @@ bool isBase64Char(const char c)
return (std::isalnum(c) || (c == '+') || (c == '/'));
}

}
} // namespace CarlaBase64Helpers

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



+ 2
- 8
source/utils/CarlaBinaryUtils.hpp View File

@@ -60,12 +60,6 @@ private:
CARLA_PREVENT_HEAP_ALLOCATION
CARLA_DECLARE_NON_COPY_STRUCT(CarlaMagic)
};

static const CarlaMagic& getCarlaMagicInstance()
{
static CarlaMagic magic;
return magic;
}
#endif

// -----------------------------------------------------------------------
@@ -79,7 +73,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
if (filename == nullptr || filename[0] == '\0')
return BINARY_NATIVE;

const CarlaMagic& magic(getCarlaMagicInstance());
static const CarlaMagic magic;

const char* const output(magic.getFileDescription(filename));

@@ -87,7 +81,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
return BINARY_NATIVE;

if (std::strstr(output, "PE32 executable") != nullptr && std::strstr(output, "MS Windows") != nullptr)
return std::strstr(output, "x86-64") != nullptr ? BINARY_WIN64 : BINARY_WIN32;
return (std::strstr(output, "x86-64") != nullptr) ? BINARY_WIN64 : BINARY_WIN32;

if (std::strstr(output, "ELF") != nullptr)
return (std::strstr(output, "x86-64") != nullptr || std::strstr(output, "aarch64") != nullptr) ? BINARY_POSIX64 : BINARY_POSIX32;


+ 2
- 3
source/utils/CarlaEngineUtils.hpp View File

@@ -163,9 +163,9 @@ void fillJuceMidiBufferFromEngineEvents(juce::MidiBuffer& midiBuffer, const Engi
const EngineEvent& engineEvent(engineEvents[i]);

if (engineEvent.type == kEngineEventTypeNull)
{
break;

#ifndef BUILD_BRIDGE
}
else if (engineEvent.type == kEngineEventTypeControl)
{
const EngineControlEvent& ctrlEvent(engineEvent.ctrl);
@@ -173,7 +173,6 @@ void fillJuceMidiBufferFromEngineEvents(juce::MidiBuffer& midiBuffer, const Engi
ctrlEvent.convertToMidiData(engineEvent.channel, size, mdata);
mdataPtr = mdata;
}
#endif
else if (engineEvent.type == kEngineEventTypeMidi)
{
const EngineMidiEvent& midiEvent(engineEvent.midi);


+ 1
- 1
source/utils/CarlaLibUtils.hpp View File

@@ -65,7 +65,7 @@ bool lib_close(void* const lib) noexcept

/*
* Get a library symbol (must not be null).
* May return null if the symbol is not found.
* Returns null if the symbol is not found.
*/
static inline
void* lib_symbol(void* const lib, const char* const symbol) noexcept


+ 1
- 1
source/utils/CarlaMathUtils.hpp View File

@@ -52,7 +52,7 @@ T carla_minPositive(const T& v1, const T& v2) noexcept
return (v2 > 0) ? v2 : 0;
if (v2 < 0)
return (v1 > 0) ? v1 : 0;
return (v1 < v2 ? v1 : v2);
return (v1 < v2) ? v1 : v2;
}

/*


+ 1
- 1
source/utils/CarlaRingBuffer.hpp View File

@@ -284,7 +284,7 @@ public:
protected:
void setRingBuffer(BufferStruct* const ringBuf, const bool reset) noexcept
{
CARLA_SAFE_ASSERT_RETURN(ringBuf != fBuffer,);
CARLA_SAFE_ASSERT_RETURN(fBuffer != ringBuf,);

fBuffer = ringBuf;



+ 1
- 4
source/utils/CarlaUtils.hpp View File

@@ -298,10 +298,7 @@ const char* carla_strdup_safe(const char* const strBuf) noexcept

try {
buffer = new char[bufferLen+1];
}
catch(...) {
return nullptr;
}
} CARLA_SAFE_EXCEPTION_RETURN("carla_strdup_safe", nullptr);

if (strBuf != nullptr && bufferLen > 0)
std::strncpy(buffer, strBuf, bufferLen);


Loading…
Cancel
Save