Browse Source

More tweaking, working better now

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.0
falkTX 3 years ago
parent
commit
807ef4e454
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 106 additions and 26 deletions
  1. +13
    -1
      Makefile
  2. +5
    -2
      README.md
  3. +1
    -1
      carla
  4. +6
    -1
      plugins/Common/IldaeilPlugin.cpp
  5. +81
    -21
      plugins/Common/IldaeilUI.cpp

+ 13
- 1
Makefile View File

@@ -11,7 +11,19 @@ all: carla dgl plugins gen
# --------------------------------------------------------------

carla:
$(MAKE) -C carla plugin HAVE_ALSA=false HAVE_DGL=false HAVE_HYLIA=false HAVE_JACK=false HAVE_LIBLO=false HAVE_PYQT=false HAVE_QT4=false HAVE_QT5=false HAVE_QT5PKG=false HAVE_PULSEAUDIO=false USING_JUCE_AUDIO_DEVICES=false
$(MAKE) -C carla plugin \
HAVE_ALSA=false \
HAVE_DGL=false \
HAVE_HYLIA=false \
HAVE_JACK=false \
HAVE_LIBLO=false \
HAVE_PYQT=false \
HAVE_QT4=false \
HAVE_QT5=false \
HAVE_QT5PKG=false \
HAVE_PULSEAUDIO=false \
USING_JUCE_AUDIO_DEVICES=false \
CAN_GENERATE_LV2_TTL=false

dgl:
$(MAKE) -C dpf/dgl opengl


+ 5
- 2
README.md View File

@@ -21,7 +21,10 @@ The current formats Ildaeil can work as are:
- VST2
- VST3

And it can (in theory, later on) load the following plugin formats:
And it can load the following plugin formats:
- LV2

Later on, in theory, should be able to load the following plugin formats:

- JACK (applications as plugins, Linux only)
- LADSPA
@@ -31,7 +34,7 @@ And it can (in theory, later on) load the following plugin formats:
- VST3
- AU (macOS only)

Additionally the following files can be loaded:
Additionally the following files could eventually be loaded:

- Audio files (synced to host transport)
- MIDI files (aligned to real/wall-clock time, synced to host transport)


+ 1
- 1
carla

@@ -1 +1 @@
Subproject commit db46099c084af7a90a1a5df31a7d5b11ed0a4dd8
Subproject commit ae6e2c575cb438a664ae63579fab260c92a8c845

+ 6
- 1
plugins/Common/IldaeilPlugin.cpp View File

@@ -24,6 +24,8 @@ START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------------------------------------------
using namespace CarlaBackend;
static uint32_t host_get_buffer_size(NativeHostHandle);
static double host_get_sample_rate(NativeHostHandle);
static bool host_is_offline(NativeHostHandle);
@@ -65,7 +67,7 @@ public:
memset(&fCarlaTimeInfo, 0, sizeof(fCarlaTimeInfo));
fCarlaHostDescriptor.handle = this;
fCarlaHostDescriptor.resourceDir = "/Users/falktx/Source/Ildaeil"; // carla_get_library_folder();
fCarlaHostDescriptor.resourceDir = carla_get_library_folder();
fCarlaHostDescriptor.uiName = "Ildaeil";
fCarlaHostDescriptor.uiParentId = 0;
@@ -87,6 +89,9 @@ public:
DISTRHO_SAFE_ASSERT_RETURN(fCarlaPluginHandle != nullptr,);
fCarlaHostHandle = carla_create_native_plugin_host_handle(fCarlaPluginDescriptor, fCarlaPluginHandle);
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_BINARIES, 0, "/usr/lib/carla");
carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/carla/resources");
}
~IldaeilPlugin() override


+ 81
- 21
plugins/Common/IldaeilUI.cpp View File

@@ -131,19 +131,21 @@ public:
{
const CarlaPluginInfo* const info = carla_get_plugin_info(handle, 0);

if (info->hints & PLUGIN_HAS_CUSTOM_UI) // FIXME use PLUGIN_HAS_CUSTOM_EMBED_UI
if (info->hints & PLUGIN_HAS_CUSTOM_EMBED_UI)
{
// carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr);
carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_UI_SCALE, getScaleFactor()*1000, nullptr);

carla_embed_custom_ui(handle, 0, (void*)fOurWindowId);

tryResizingToChildWindowContent();
fDrawingState = kDrawingPluginCustomUI;
fInitialSizeHasBeenSet = false;
tryResizingToChildWindowContent();
}
else
{
// TODO query parameter information and store it
setSize(600, 400);
fDrawingState = kDrawingPluginGenericUI;
}

@@ -155,21 +157,24 @@ protected:
{
switch (fDrawingState)
{
case kDrawingPluginCustomUI:
break;
case kDrawingInit:
fDrawingState = kDrawingLoading;
startThread();
repaint();
return;
default:
return;
}
break;

fPlugin->fCarlaPluginDescriptor->ui_idle(fPlugin->fCarlaPluginHandle);
case kDrawingPluginCustomUI:
if (! fInitialSizeHasBeenSet)
tryResizingToChildWindowContent();
// fall-through

if (! fInitialSizeHasBeenSet)
tryResizingToChildWindowContent();
case kDrawingPluginGenericUI:
fPlugin->fCarlaPluginDescriptor->ui_idle(fPlugin->fCarlaPluginHandle);
break;

default:
break;
}
}

void run() override
@@ -206,10 +211,12 @@ protected:
// TODO display error message
break;
case kDrawingLoading:
// TODO display loading message
drawLoading();
break;
case kDrawingPluginCustomUI:
case kDrawingPluginGenericUI:
drawGenericUI();
// fall-through
case kDrawingPluginCustomUI:
drawBottomBar();
break;
}
@@ -224,26 +231,72 @@ protected:
{
if (ImGui::Button("Pick Another..."))
{
if (fDrawingState == kDrawingPluginCustomUI)
if (fDrawingState == kDrawingPluginGenericUI || fDrawingState == kDrawingPluginCustomUI)
carla_show_custom_ui(fPlugin->fCarlaHostHandle, 0, false);

fDrawingState = kDrawingPluginList;
setSize(kInitialWidth, kInitialHeight);
return ImGui::End();
}

if (fDrawingState == kDrawingPluginGenericUI)
{
ImGui::SameLine();

if (ImGui::Button("Show Custom GUI"))
{
carla_show_custom_ui(fPlugin->fCarlaHostHandle, 0, true);
return ImGui::End();
}
}
}

ImGui::End();
}

void drawPluginList()
void setupMainWindowPos()
{
const CarlaHostHandle handle = fPlugin->fCarlaHostHandle;
const bool pluginIsRunning = carla_get_current_plugin_count(handle) != 0;

float width = getWidth();
float height = getHeight();
float margin = 20.0f;

if (fDrawingState == kDrawingPluginGenericUI)
height -= kBottomHeight * getScaleFactor();

ImGui::SetNextWindowPos(ImVec2(margin, margin));
ImGui::SetNextWindowSize(ImVec2(width - 2 * margin, height - 2 * margin));
}

void drawGenericUI()
{
setupMainWindowPos();

if (ImGui::Begin("Plugin Parameters", nullptr, ImGuiWindowFlags_NoResize))
{
ImGui::TextUnformatted("TODO :: here will go plugin parameters", nullptr);
}

ImGui::End();
}

void drawLoading()
{
setupMainWindowPos();

if (ImGui::Begin("Plugin List", nullptr, ImGuiWindowFlags_NoResize))
{
ImGui::TextUnformatted("Loading...", nullptr);
}

ImGui::End();
}

void drawPluginList()
{
setupMainWindowPos();

const CarlaHostHandle handle = fPlugin->fCarlaHostHandle;
const bool pluginIsRunning = carla_get_current_plugin_count(handle) != 0;

if (ImGui::Begin("Plugin List", nullptr, ImGuiWindowFlags_NoResize))
{
@@ -273,15 +326,22 @@ protected:
fPlugins = nullptr;
fPluginCount = 0;
*/

return ImGui::End();
}

} while (false);
}

if (pluginIsRunning && ImGui::Button("Cancel"))
if (pluginIsRunning)
{
showPluginUI(handle);
return;
ImGui::SameLine();

if (ImGui::Button("Cancel"))
{
showPluginUI(handle);
return ImGui::End();
}
}

if (ImGui::BeginChild("pluginlistwindow"))


Loading…
Cancel
Save