wasm related tweaks, still WIP
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
f4c2c03003
commit
d03e73119d
5 changed files with 24 additions and 4 deletions
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
// these are missing from HaikuOS
|
||||||
#define pthread_setname_np(...)
|
#define pthread_setname_np(...)
|
||||||
|
|
||||||
static int pthread_getcpuclockid(pthread_t, clockid_t* const clock_id)
|
static int pthread_getcpuclockid(pthread_t, clockid_t* const clock_id)
|
||||||
|
@ -24,6 +26,7 @@ static int pthread_getcpuclockid(pthread_t, clockid_t* const clock_id)
|
||||||
*clock_id = CLOCK_REALTIME;
|
*clock_id = CLOCK_REALTIME;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int backtrace(void**, int)
|
static int backtrace(void**, int)
|
||||||
{
|
{
|
|
@ -47,7 +47,10 @@
|
||||||
#include "DistrhoPluginUtils.hpp"
|
#include "DistrhoPluginUtils.hpp"
|
||||||
#include "PluginContext.hpp"
|
#include "PluginContext.hpp"
|
||||||
#include "extra/Base64.hpp"
|
#include "extra/Base64.hpp"
|
||||||
#include "extra/SharedResourcePointer.hpp"
|
|
||||||
|
#ifndef DISTRHO_OS_WASM
|
||||||
|
# include "extra/SharedResourcePointer.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
static const constexpr uint kCardinalStateBaseCount = 3; // patch, screenshot, comment
|
static const constexpr uint kCardinalStateBaseCount = 3; // patch, screenshot, comment
|
||||||
|
|
||||||
|
@ -173,7 +176,9 @@ struct Initializer
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if defined(ARCH_MAC)
|
#if defined(DISTRHO_OS_WASM)
|
||||||
|
asset::systemDir = "/resources";
|
||||||
|
#elif defined(ARCH_MAC)
|
||||||
asset::systemDir = "/Library/Application Support/Cardinal";
|
asset::systemDir = "/Library/Application Support/Cardinal";
|
||||||
#elif defined(ARCH_WIN)
|
#elif defined(ARCH_WIN)
|
||||||
const std::string commonprogfiles = getSpecialPath(kSpecialPathCommonProgramFiles);
|
const std::string commonprogfiles = getSpecialPath(kSpecialPathCommonProgramFiles);
|
||||||
|
@ -452,7 +457,11 @@ struct ScopedContext {
|
||||||
|
|
||||||
class CardinalPlugin : public CardinalBasePlugin
|
class CardinalPlugin : public CardinalBasePlugin
|
||||||
{
|
{
|
||||||
|
#ifdef DISTRHO_OS_WASM
|
||||||
|
ScopedPointer<Initializer> fInitializer;
|
||||||
|
#else
|
||||||
SharedResourcePointer<Initializer> fInitializer;
|
SharedResourcePointer<Initializer> fInitializer;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||||
/* If host audio ins == outs we can get issues for inplace processing.
|
/* If host audio ins == outs we can get issues for inplace processing.
|
||||||
|
@ -484,7 +493,11 @@ class CardinalPlugin : public CardinalBasePlugin
|
||||||
public:
|
public:
|
||||||
CardinalPlugin()
|
CardinalPlugin()
|
||||||
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount + 1, 0, kCardinalStateCount),
|
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount + 1, 0, kCardinalStateCount),
|
||||||
|
#ifdef DISTRHO_OS_WASM
|
||||||
|
fInitializer(new Initializer(this)),
|
||||||
|
#else
|
||||||
fInitializer(this),
|
fInitializer(this),
|
||||||
|
#endif
|
||||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||||
fAudioBufferCopy(nullptr),
|
fAudioBufferCopy(nullptr),
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,7 +35,9 @@ BASE_FLAGS += -DARCH_LIN
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAIKU),true)
|
ifeq ($(HAIKU),true)
|
||||||
BASE_FLAGS += -I../include/haiku-compat
|
BASE_FLAGS += -I../include/linux-compat
|
||||||
|
else ifeq ($(WASM),true)
|
||||||
|
BASE_FLAGS += -I../include/linux-compat
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BASE_FLAGS += -DPRIVATE=
|
BASE_FLAGS += -DPRIVATE=
|
||||||
|
|
|
@ -204,7 +204,9 @@ BASE_FLAGS += -Wno-unused-variable
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
# extra linker flags
|
# extra linker flags
|
||||||
|
|
||||||
ifeq ($(HAIKU),true)
|
ifeq ($(WASM),true)
|
||||||
|
LINK_FLAGS += --preload-file=./resources -sALLOW_MEMORY_GROWTH
|
||||||
|
else ifeq ($(HAIKU),true)
|
||||||
LINK_FLAGS += -lpthread
|
LINK_FLAGS += -lpthread
|
||||||
else
|
else
|
||||||
LINK_FLAGS += -pthread
|
LINK_FLAGS += -pthread
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue