Skip to content

Commit

Permalink
better plugin loading on alana
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaji Khan committed Aug 23, 2024
1 parent b76f411 commit 75eb6f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/src/main/cpp/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void Plugin::load () {
HERE
//~ LOGD("Creating plugin: %s from %s @ %s\n", lv2Descriptor->URI, sharedLibrary->LIBRARY_PATH.c_str(), sharedLibrary->so_file.c_str());
std::string lib_path = sharedLibrary->LIBRARY_PATH + "/" + sharedLibrary -> so_file + ".lv2/" ;
//~ LOGD("[LV2] library path: %s\n", lib_path.c_str());
LOGD("[LV2] library path: %s\n", lib_path.c_str());

if (lv2Descriptor == NULL) {
HERE LOGF("[LV2] lv2Descriptor is NULL, we will probably crash ...!\nplugin: %s\n", sharedLibrary->so_file.c_str());
Expand Down Expand Up @@ -500,6 +500,7 @@ void Plugin::setFilePortValue1 (std::string filename) {

#ifndef __ANDROID__
std::string Plugin::getLV2JSON_PC (std::string pluginName) {
IN
//~ HERE LOGD ("[%s] plugin: %s\n", sharedLibrary->so_file.c_str (), pluginName.c_str ());
// todo:
// file name here, load and return this json file
Expand All @@ -514,10 +515,13 @@ std::string Plugin::getLV2JSON_PC (std::string pluginName) {
lib = lib.substr (lib.find_last_of ("/") + 1, lib.size ());
std::string path = sharedLibrary->lv2_config_path ;
path.append ("/").append (lib).append ("/").append (stub).append (".json");
//~ LOGD ("[LV2] config for %s: %s\n", pluginName.c_str (), path.c_str ());
std::replace(path.begin(), path.end(), ':', '_');

LOGD ("[LV2 %s] config for %s: %s\n", stub.c_str (), pluginName.c_str (), path.c_str ());
std::ifstream fJson(path.c_str ());
std::stringstream buffer;
buffer << fJson.rdbuf();
OUT
return buffer.str () ;

/*
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "SharedLibrary.h"
#include "json.hpp"
#include "lv2_ext.h"
#include "lv2/atom/forge.h"
//~ #include "lv2/atom/forge.h"

class Plugin {
LADSPA_Data ** portControls ;
Expand Down

0 comments on commit 75eb6f6

Please sign in to comment.