~CarlaNSM()
    {
        CARLA_SAFE_ASSERT(fReadyActionOpen);
        CARLA_SAFE_ASSERT(fReadyActionSave);

        if (fServerThread != nullptr)
        {
            lo_server_thread_stop(fServerThread);
            lo_server_thread_free(fServerThread);
            fServerThread = nullptr;
            fServer = nullptr;
        }

        if (fServerURL != nullptr)
        {
            std::free(fServerURL);
            fServerURL = nullptr;
        }

        if (fReplyAddress != nullptr)
        {
            lo_address_free(fReplyAddress);
            fReplyAddress = nullptr;
        }
    }
void CarlaEngine::ProtectedData::close()
{
    CARLA_SAFE_ASSERT(name.isNotEmpty());
    CARLA_SAFE_ASSERT(plugins != nullptr);
    CARLA_SAFE_ASSERT(nextPluginId == maxPluginNumber);
    CARLA_SAFE_ASSERT(nextAction.opcode == kEnginePostActionNull);

    aboutToClose = true;

    thread.stopThread(500);
    nextAction.ready();

#ifdef HAVE_LIBLO
    osc.close();
    oscData = nullptr;
#endif

    aboutToClose    = false;
    curPluginCount  = 0;
    maxPluginNumber = 0;
    nextPluginId    = 0;

#ifndef BUILD_BRIDGE
    if (plugins != nullptr)
    {
        delete[] plugins;
        plugins = nullptr;
    }
#endif

    events.clear();
    name.clear();
}
CarlaEngine::ProtectedData::~ProtectedData() noexcept
{
    CARLA_SAFE_ASSERT(curPluginCount == 0);
    CARLA_SAFE_ASSERT(maxPluginNumber == 0);
    CARLA_SAFE_ASSERT(nextPluginId == 0);
    CARLA_SAFE_ASSERT(isIdling == 0);
#ifndef BUILD_BRIDGE
    CARLA_SAFE_ASSERT(plugins == nullptr);
#endif
}
Exemple #4
0
        void resize(const std::size_t minPreallocated, const std::size_t maxPreallocated) noexcept
        {
            if (fHandle != nullptr)
            {
                rtsafe_memory_pool_destroy(fHandle);
                fHandle = nullptr;
            }

            rtsafe_memory_pool_create(&fHandle, nullptr, kDataSize, minPreallocated, maxPreallocated);
            CARLA_SAFE_ASSERT(fHandle != nullptr);
        }
CARLA_BACKEND_START_NAMESPACE

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

CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) noexcept
    : CarlaThread("CarlaEngineThread"),
      kEngine(engine)
{
    CARLA_SAFE_ASSERT(engine != nullptr);
    carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine);
}
Exemple #6
0
static void test_CarlaDssiUtils() noexcept
{
    const char* const ui = find_dssi_ui("/usr/lib/dssi/trivial_sampler.so", "aa");

    CARLA_SAFE_ASSERT(ui != nullptr);

    if (ui != nullptr)
    {
        carla_stdout("%s", ui);
        assert(std::strcmp(ui, "/usr/lib/dssi/trivial_sampler/trivial_sampler_qt") == 0);
        delete[] ui;
    }
}
Exemple #7
0
static void test_CarlaLv2Utils()
{
    Lv2WorldClass& lv2World(Lv2WorldClass::getInstance());
    lv2World.initIfNeeded(std::getenv("LV2_PATH"));

    // getPlugin
    const LilvPlugin* const plugin(lv2World.getPluginFromURI("urn:juced:DrumSynth"));
    CARLA_SAFE_ASSERT(plugin != nullptr);

    // getState
    LV2_URID_Map uridMap = { nullptr, test_lv2_uridMap };
    LilvState* const state(lv2World.getStateFromURI("http://arcticanaudio.com/plugins/thefunction#preset001", &uridMap));
    CARLA_SAFE_ASSERT(state != nullptr);
    if (state != nullptr) lilv_state_free(state);

    // load a bunch of plugins to stress test lilv
    delete lv2_rdf_new("http://arcticanaudio.com/plugins/thefunction", true);
    delete lv2_rdf_new("http://kunz.corrupt.ch/products/tal-noisemaker", true);
    delete lv2_rdf_new("http://calf.sourceforge.net/plugins/Reverb", true);
    delete lv2_rdf_new("http://www.openavproductions.com/fabla", true);
    delete lv2_rdf_new("http://invadarecords.com/plugins/lv2/meter", true);
    delete lv2_rdf_new("http://gareus.org/oss/lv2/meters#spectr30stereo", true);
    delete lv2_rdf_new("http://plugin.org.uk/swh-plugins/revdelay", true);
    delete lv2_rdf_new("http://lv2plug.in/plugins/eg-scope#Stereo", true);
    delete lv2_rdf_new("http://kxstudio.sf.net/carla/plugins/carlarack", true);
    delete lv2_rdf_new("http://guitarix.sourceforge.net/plugins/gxautowah#autowah", true);
    delete lv2_rdf_new("http://github.com/blablack/ams-lv2/mixer_4ch", true);
    delete lv2_rdf_new("http://drumgizmo.org/lv2", true);
    delete lv2_rdf_new("http://synthv1.sourceforge.net/lv2", true);
    delete lv2_rdf_new("urn:juced:DrumSynth", true);

    // misc
    is_lv2_port_supported(0x0);
    is_lv2_feature_supported("test1");
    is_lv2_ui_feature_supported("test2");
}
EngineNextAction::~EngineNextAction() noexcept
{
    CARLA_SAFE_ASSERT(opcode == kEnginePostActionNull);
}
EngineInternalEvents::~EngineInternalEvents() noexcept
{
    CARLA_SAFE_ASSERT(in == nullptr);
    CARLA_SAFE_ASSERT(out == nullptr);
}
Exemple #10
0
 NativePluginClass(const NativeHostDescriptor* const host)
     : pHost(host)
 {
     CARLA_SAFE_ASSERT(host != nullptr);
 }