/*
 * DISTRHO Ildaeil Plugin
 * Copyright (C) 2021-2025 Filipe Coelho <falktx@falktx.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * For a full copy of the GNU General Public License see the LICENSE file.
 */

#pragma once

#include "CarlaNativePlugin.h"
#include "DistrhoPlugin.hpp"
#include "extra/Mutex.hpp"
#include "extra/String.hpp"

// generates a warning if this is defined as anything else
#define CARLA_API

START_NAMESPACE_DISTRHO

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

class IldaeilBasePlugin : public Plugin
{
public:
    static Mutex sPluginInfoLoadMutex;
    static const char* getPluginPath(PluginType ptype);

    const NativePluginDescriptor* fCarlaPluginDescriptor = nullptr;
    NativePluginHandle fCarlaPluginHandle = nullptr;

    NativeHostDescriptor fCarlaHostDescriptor{};
    CarlaHostHandle fCarlaHostHandle = nullptr;

    String fBinaryPath;

    void* fUI = nullptr;

    IldaeilBasePlugin() : Plugin(0, 0, 1) {}
};

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

void ildaeilProjectLoadedFromDSP(void* ui);
void ildaeilParameterChangeForUI(void* ui, uint32_t index, float value);
void ildaeilResizeUI(void* ui, uint32_t width, uint32_t height);
void ildaeilCloseUI(void* ui);
const char* ildaeilOpenFileForUI(void* ui, bool isDir, const char* title, const char* filter);

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

END_NAMESPACE_DISTRHO
