Skip to content

Commit

Permalink
Cleanup and fixing
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Oct 11, 2023
1 parent 39a8095 commit d29c882
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 29 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,26 @@ export USER_DSSI_DIR USER_LADSPA_DIR USER_LV2_DIR USER_VST2_DIR USER_VST3_DIR US
# --------------------------------------------------------------
# Targets

ifneq ($(MOD_BUILD),true)
all: libs plugins gen

mod: MOD
else
all: MOD
endif

# --------------------------------------------------------------

submodules:
git submodule update --init --recursive

libs:
$(MAKE) -C dpf/dgl ../build/libdgl-cairo.a
ifeq ($(HAVE_CAIRO),true)
$(MAKE) -C dpf/dgl cairo
endif

plugins: libs
$(MAKE) all -C plugins/NeuralRecord

MOD: clean
MOD:
$(MAKE) mod -C plugins/NeuralRecord

ifneq ($(CROSS_COMPILING),true)
Expand Down
2 changes: 1 addition & 1 deletion dpf
2 changes: 1 addition & 1 deletion plugins/NeuralRecord/MOD/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<urn:brummer10:neuralrecord#preset001>
a pset:Preset ;
lv2:appliesTo <urn:brummer10:neuralrecord> ;
rdfs:label "" ;
rdfs:label "Default" ;
rdfs:seeAlso <presets.ttl> .

13 changes: 5 additions & 8 deletions plugins/NeuralRecord/MOD/modgui/icon-profiler.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<div class="mod-pedal profiler{{{cns}}}">
<div class="popup" mod-role="POPUP"></div>
<div class="popup"></div>
<div class="background">

<div mod-role="drag-handle" class="mod-drag-handle"></div>
<div class="mod-plugin-name"><h1>{{label}}</h1></div>
<div class="mod-control-group clearfix">
{{#controls.0}}
<div id="js-toggle" class="button" mod-role="input-control-port" mod-port-symbol="{{symbol}}" mod-widget="switch"></div>
{{/controls.0}}
<div id="js-toggle" class="button" mod-role="input-control-port" mod-port-symbol="PROFILE" mod-widget="switch"></div>
</div>
<div class="meterbar">
<div class="meter" mod-role="METER" mod-port-symbol="{{symbol}}"></div>
<div class="meter" mod-port-symbol="METER"></div>
</div>
<div class="progressbar" title="{{comment}}">
<div class="progress" mod-role="STATE" mod-port-symbol="{{symbol}}"></div>
<div class="progressbar">
<div class="progress" mod-port-symbol="STATE"></div>
</div>
<div class="mod-pedal-input">
{{#effect.ports.audio.input}}
Expand Down
6 changes: 3 additions & 3 deletions plugins/NeuralRecord/MOD/modgui/script-profiler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function (event) {

const meter = event.icon.find ('[mod-role=METER]');
const state = event.icon.find ('[mod-role=STATE]');
const popup = event.icon.find ('[mod-role=POPUP]');
const meter = event.icon.find ('[mod-port-symbol=METER]');
const state = event.icon.find ('[mod-port-symbol=STATE]');
const popup = event.icon.find ('.popup');

var position = "0";

Expand Down
3 changes: 2 additions & 1 deletion plugins/NeuralRecord/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ FILES_UI = \
UI_TYPE = cairo
include ../../dpf/Makefile.plugins.mk

BUILD_CXX_FLAGS += -pthread `pkg-config --cflags sndfile` `pkg-config --libs sndfile`
BUILD_CXX_FLAGS += -pthread $(shell $(PKG_CONFIG) --cflags sndfile)
LINK_FLAGS += -pthread $(shell $(PKG_CONFIG) --libs sndfile)

# --------------------------------------------------------------
# Enable all selected plugin types
Expand Down
2 changes: 2 additions & 0 deletions plugins/NeuralRecord/PluginNeuralCapture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ struct Preset {

const Preset factoryPresets[] = {
{
"Default",
{ 0.f, 0.f, 0.f, 0.f }
}
//,{
// "Another preset", // preset name
Expand Down
20 changes: 9 additions & 11 deletions plugins/NeuralRecord/profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ inline std::string Profil::get_path() {
std::string pPath;

#ifndef __MOD_DEVICES__
#if defined(WIN32) || defined(_WIN32)
#ifdef _WIN32
pPath = getenv("USERPROFILE");
if (pPath.empty()) {
pPath = getenv("HOMEDRIVE");
Expand All @@ -254,15 +254,16 @@ inline std::string Profil::get_path() {
#else
pPath = getenv("HOME");
#endif
pPath +=PATH_SEPARATOR;
pPath +="profiles";
pPath +=PATH_SEPARATOR;

pPath += PATH_SEPARATOR "profiles" PATH_SEPARATOR;
#else
pPath = "/data/user-files/Audio Recordings/profiles/";
if (const char* const userFilesDir = std::getenv("MOD_USER_FILES_DIR"))
pPath = userFilesDir;
else
pPath = "/data/user-files";
pPath += PATH_SEPARATOR "Audio Recordings" PATH_SEPARATOR "profiles" PATH_SEPARATOR;
#endif
if (!(stat(pPath.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode))) {
#if defined(WIN32) || defined(_WIN32)
#ifdef _WIN32
mkdir(pPath.c_str());
#else
mkdir(pPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
Expand All @@ -282,10 +283,7 @@ inline std::string Profil::get_ifilename() {
struct stat sb;
char * path = strdup(get_profile_library_path().data());
std::string iname = dirname(path);
iname += PATH_SEPARATOR;
iname += "resources";
iname += PATH_SEPARATOR;
iname += "input.wav";
iname += PATH_SEPARATOR "resources" PATH_SEPARATOR "input.wav";
std::string oname = get_path() + "input.wav";
if (stat (oname.c_str(), &sb) != 0 && stat (iname.c_str(), &sb) == 0) {
std::ifstream src(iname.c_str(), std::ios::binary);
Expand Down

0 comments on commit d29c882

Please sign in to comment.