Skip to content

Commit

Permalink
Update to version v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
brummer10 committed Jun 2, 2024
1 parent 6ca0d2e commit 4fb49be
Show file tree
Hide file tree
Showing 6 changed files with 663 additions and 19 deletions.
Binary file modified Ratatouille.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions Ratatouille/Ratatouille.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static void rebuild_file_menu(ModelPicker *m) {
}
combobox_add_entry(m->fbutton, "None");
adj_set_value(m->fbutton->adj, active_entry);
combobox_set_menu_size(m->fbutton, min(14, m->filepicker->file_counter));
combobox_set_menu_size(m->fbutton, min(14, m->filepicker->file_counter+1));
m->fbutton->func.value_changed_callback = store;
}

Expand Down Expand Up @@ -333,19 +333,19 @@ void plugin_create_controller_widgets(X11_UI *ui, const char * plugin_uri) {
asprintf(&ps->ir1.filepicker->filter ,"%s", ".wav");
ps->ir1.filepicker->use_filter = 1;

ps->ma.filebutton = add_lv2_file_button (ps->ma.filebutton, ui->win, -1, "Neural Model", ui, 30, 254, 60, 30);
ps->ma.filebutton = add_lv2_file_button (ps->ma.filebutton, ui->win, -1, "Neural Model", ui, 25, 254, 60, 30);
ps->ma.filebutton->parent_struct = (void*)&ps->ma;
ps->ma.filebutton->func.user_callback = file_load_response;

ps->mb.filebutton = add_lv2_file_button (ps->mb.filebutton, ui->win, -2, "Neural Model", ui, 30, 294, 60, 30);
ps->mb.filebutton = add_lv2_file_button (ps->mb.filebutton, ui->win, -2, "Neural Model", ui, 25, 294, 60, 30);
ps->mb.filebutton->parent_struct = (void*)&ps->mb;
ps->mb.filebutton->func.user_callback = file_load_response;

ps->ir.filebutton = add_lv2_irfile_button (ps->ir.filebutton, ui->win, -3, "IR File", ui, 30, 334, 60, 30);
ps->ir.filebutton = add_lv2_irfile_button (ps->ir.filebutton, ui->win, -3, "IR File", ui, 25, 334, 60, 30);
ps->ir.filebutton->parent_struct = (void*)&ps->ir;
ps->ir.filebutton->func.user_callback = file_load_response;

ps->ir1.filebutton = add_lv2_irfile_button (ps->ir1.filebutton, ui->win, -4, "IR File", ui, 30, 374, 60, 30);
ps->ir1.filebutton = add_lv2_irfile_button (ps->ir1.filebutton, ui->win, -4, "IR File", ui, 25, 374, 60, 30);
ps->ir1.filebutton->parent_struct = (void*)&ps->ir1;
ps->ir1.filebutton->func.user_callback = file_load_response;

Expand Down
7 changes: 4 additions & 3 deletions Ratatouille/Ratatouille.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ rata:irfile1
doap:license <https://spdx.org/licenses/BSD-3-Clause> ;
lv2:project <urn:brummer:ratatouille> ;
lv2:requiredFeature urid:map ;
lv2:optionalFeature lv2:hardRTCapable ;
lv2:optionalFeature lv2:hardRTCapable ,
opts:options ;
lv2:requiredFeature urid:map ,
bufsz:boundedBlockLength ,
work:schedule ;
lv2:extensionData work:interface ,
state:interface ;
lv2:minorVersion 1 ;
lv2:minorVersion 3 ;
lv2:microVersion 0 ;

guiext:ui <urn:brummer:ratatouille_ui> ;
Expand All @@ -88,7 +89,7 @@ patch:writable rata:irfile ;
patch:writable rata:irfile1 ;

rdfs:comment """
...
A Neural Model loader and mixer
""";


Expand Down
22 changes: 16 additions & 6 deletions Ratatouille/lv2_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#include "lv2_plugin.h"
#include "texture.c"

/*---------------------------------------------------------------------
-----------------------------------------------------------------------
Expand Down Expand Up @@ -116,13 +117,22 @@ char* utf8crop(char* dst, const char* src, size_t sizeDest ) {
// draw the window
static void draw_window(void *w_, void* user_data) {
Widget_t *w = (Widget_t*)w_;

set_pattern(w,&w->color_scheme->selected,&w->color_scheme->normal,BACKGROUND_);
cairo_paint (w->crb);

round_rectangle(w->crb, 10 * w->app->hdpi, 10 * w->app->hdpi,
w->width-20 * w->app->hdpi, w->height-20 * w->app->hdpi, 0.08);

cairo_pattern_t *pat = cairo_pattern_create_for_surface(w->image);
cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT);
cairo_set_source(w->crb, pat);
cairo_fill_preserve (w->crb);

boxShadowOutset(w->crb,10 * w->app->hdpi,10 * w->app->hdpi,
w->width-20 * w->app->hdpi,w->height-20 * w->app->hdpi, true);
cairo_stroke (w->crb);
cairo_pattern_destroy (pat);

#ifndef HIDE_NAME
cairo_text_extents_t extents;
Expand Down Expand Up @@ -178,11 +188,7 @@ static void draw_window(void *w_, void* user_data) {
350 * w->app->hdpi, 30 * w->app->hdpi, true);
cairo_fill (w->crb);

if (w->image) {
cairo_set_source_surface (w->crb, w->image, 0, 0);
cairo_paint (w->crb);
}
use_text_color_scheme(w, get_color_state(w));
use_text_color_scheme(w, NORMAL_);
#ifdef USE_ATOM
X11_UI* ui = (X11_UI*)w->parent_struct;
X11_UI_Private_t *ps = (X11_UI_Private_t*)ui->private_ptr;
Expand Down Expand Up @@ -417,7 +423,10 @@ static void draw_my_knob(void *w_, void* user_data) {
value = copysign(value, v);
if (fabs(w->adj->step)>0.99) {
snprintf(s, 16,"%d", (int) value);
o = 5;
o = 4;
} else if (fabs(w->adj->step)<0.09) {
snprintf(s, 16, "%.2f", value);
o = 1;
} else {
snprintf(s, 16, "%.1f", value);
}
Expand Down Expand Up @@ -786,6 +795,7 @@ static LV2UI_Handle instantiate(const LV2UI_Descriptor * descriptor,
ui->win = create_window(&ui->main, (Window)ui->parentXwindow, 0, 0, w, h);
ui->win->parent_struct = ui;
ui->win->label = plugin_set_name();
widget_get_png(ui->win, LDVAR(texture));
// connect the expose func
ui->win->func.expose_callback = draw_window;
// create controller widgets
Expand Down
9 changes: 4 additions & 5 deletions Ratatouille/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ ifeq ($(TARGET), Linux)
CXXFLAGS += -MMD -std=c++17 -flto=auto -fPIC -DPIC -Ofast -Wall -funroll-loops $(SSE_CFLAGS) \
-Wno-sign-compare -Wno-reorder -Wno-infinite-recursion -DUSE_ATOM \
-fomit-frame-pointer -fstack-protector -fvisibility=hidden \
-fdata-sections -I./zita-resampler-1.1.0 \
-I. -I./ -I./zita-convolver -I./zita-resampler-1.1.0 \
-fdata-sections -I. -I./ -I./zita-convolver -I./zita-resampler-1.1.0 \
-DRTNEURAL_DEFAULT_ALIGNMENT=32 -DRTNEURAL_USE_EIGEN=1 -DRTNEURAL_NAMESPACE=RTNeural \
-DDSP_SAMPLE_FLOAT -DNAM_SAMPLE_FLOAT -Dneural_amp_modeler_EXPORTS

Expand All @@ -138,10 +137,10 @@ ifeq ($(TARGET), Linux)
CFLAGS := -O2 -D_FORTIFY_SOURCE=2 -Wall -fstack-protector -fvisibility=hidden \
-fdata-sections -Wl,--gc-sections -Wl,-z,relro,-z,now -Wl,--exclude-libs,ALL -DUSE_ATOM

TTLUPDATEMODGUI = sed -i -e '164,179d' -e 's/guiext:ui <urn:brummer:ratatouille_ui> ;//' \
TTLUPDATEMODGUI = sed -i -e '174,189d' -e 's/guiext:ui <urn:brummer:ratatouille_ui> ;//' \
-e '7d' ../bin/$(BUNDLE)/$(NAME).ttl
else ifeq ($(TARGET), Windows)
CXXFLAGS += -std=c++17 -D_FORTIFY_SOURCE=2 -I. -I./dsp -I./plugin -fPIC -DPIC -O2 -Wall -funroll-loops \
CXXFLAGS += -std=c++17 -D_FORTIFY_SOURCE=2 -I. -fPIC -DPIC -O2 -Wall -funroll-loops \
-ffast-math -fomit-frame-pointer -fstrength-reduce \
-Wno-sign-compare -Wno-reorder -Wno-infinite-recursion -DUSE_ATOM \
$(SSE_CFLAGS) -fdata-sections -I./ -I./zita-convolver -I./zita-resampler-1.1.0 \
Expand All @@ -160,7 +159,7 @@ else ifeq ($(TARGET), Windows)

TTLUPDATE = sed -i '/lv2:binary/ s/\.so/\.dll/ ' ../bin/$(BUNDLE)/manifest.ttl
TTLUPDATEGUI = sed -i '/a guiext:X11UI/ s/X11UI/WindowsUI/ ; /guiext:binary/ s/\.so/\.dll/ ' ../bin/$(BUNDLE)/$(NAME).ttl
TTLUPDATEMODGUI = sed -i -e '164,179d' -e 's/guiext:ui <urn:brummer:ratatouille_ui> ;//' \
TTLUPDATEMODGUI = sed -i -e '174,189d' -e 's/guiext:ui <urn:brummer:ratatouille_ui> ;//' \
-e '7d' ../bin/$(BUNDLE)/$(NAME).ttl
endif

Expand Down
Loading

0 comments on commit 4fb49be

Please sign in to comment.