Skip to content

Commit

Permalink
Rework GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
brummer10 committed Apr 19, 2024
1 parent 09ad744 commit fb0cf12
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 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.
8 changes: 4 additions & 4 deletions Ratatouille/Ratatouille.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,22 +343,22 @@ void plugin_create_controller_widgets(X11_UI *ui, const char * plugin_uri) {
ps->ir1.filebutton->parent_struct = (void*)&ps->ir1;
ps->ir1.filebutton->func.user_callback = file_load_response;

ui->widget[0] = add_lv2_knob (ui->widget[0], ui->win, 2, "Input", ui, 30, 80, 100, 120);
ui->widget[0] = add_lv2_knob (ui->widget[0], ui->win, 2, "Input", ui, 35, 85, 100, 120);
set_adjustment(ui->widget[0]->adj, 0.0, 0.0, -20.0, 20.0, 0.2, CL_CONTINUOS);
set_widget_color(ui->widget[0], 0, 0, 0.3, 0.55, 0.91, 1.0);
set_widget_color(ui->widget[0], 0, 3, 0.682, 0.686, 0.686, 1.0);

ui->widget[2] = add_lv2_knob (ui->widget[2], ui->win, 4, "Blend", ui, 143, 80, 100, 120);
ui->widget[2] = add_lv2_knob (ui->widget[2], ui->win, 4, "Blend", ui, 145, 85, 100, 120);
set_adjustment(ui->widget[2]->adj, 0.5, 0.5, 0.0, 1.0, 0.01, CL_CONTINUOS);
set_widget_color(ui->widget[2], 0, 0, 0.3, 0.55, 0.91, 1.0);
set_widget_color(ui->widget[2], 0, 3, 0.682, 0.686, 0.686, 1.0);

ui->widget[3] = add_lv2_knob (ui->widget[3], ui->win, 7, "Mix (IR)", ui, 257, 80, 100, 120);
ui->widget[3] = add_lv2_knob (ui->widget[3], ui->win, 7, "Mix (IR)", ui, 255, 85, 100, 120);
set_adjustment(ui->widget[3]->adj, 0.5, 0.5, 0.0, 1.0, 0.01, CL_CONTINUOS);
set_widget_color(ui->widget[3], 0, 0, 0.3, 0.55, 0.91, 1.0);
set_widget_color(ui->widget[3], 0, 3, 0.682, 0.686, 0.686, 1.0);

ui->widget[1] = add_lv2_knob (ui->widget[1], ui->win, 3, "Output ", ui, 370, 80, 100, 120);
ui->widget[1] = add_lv2_knob (ui->widget[1], ui->win, 3, "Output ", ui, 365, 85, 100, 120);
set_adjustment(ui->widget[1]->adj, 0.0, 0.0, -20.0, 20.0, 0.2, CL_CONTINUOS);
set_widget_color(ui->widget[1], 0, 0, 0.3, 0.55, 0.91, 1.0);
set_widget_color(ui->widget[1], 0, 3, 0.682, 0.686, 0.686, 1.0);
Expand Down
19 changes: 14 additions & 5 deletions Ratatouille/lv2_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,17 @@ static void draw_window(void *w_, void* user_data) {
#endif

widget_set_scale(w);
cairo_move_to (w->crb, 50 * w->app->hdpi,244 * w->app->hdpi );
cairo_line_to (w->crb, 450 * w->app->hdpi, 244 * w->app->hdpi );

cairo_set_source_rgba(w->crb, 0.1, 0.1, 0.1, 0.333);
round_rectangle(w->crb, 25 * w->app->hdpi, 70 * w->app->hdpi,
450 * w->app->hdpi, 154 * w->app->hdpi, 0.08);
cairo_fill_preserve (w->crb);
boxShadowInset(w->crb,25 * w->app->hdpi,70 * w->app->hdpi,
450 * w->app->hdpi,154 * w->app->hdpi, true);
cairo_stroke (w->crb);

cairo_move_to (w->crb, 50 * w->app->hdpi,242 * w->app->hdpi );
cairo_line_to (w->crb, 450 * w->app->hdpi, 242 * w->app->hdpi );
use_text_color_scheme(w, NORMAL_);
cairo_stroke (w->crb);
cairo_set_source_rgba(w->crb, 0.1, 0.1, 0.1, 1);
Expand Down Expand Up @@ -272,7 +281,7 @@ static void draw_window(void *w_, void* user_data) {
#endif
#ifndef HIDE_NAME
cairo_set_font_size (w->crb, w->app->big_font+8);
cairo_move_to (w->crb, (w->scale.init_width*0.5)-tw, w->scale.init_y+50 * w->app->hdpi);
cairo_move_to (w->crb, (w->scale.init_width*0.5)-tw, w->scale.init_y+42 * w->app->hdpi);
cairo_show_text(w->crb, w->label);
cairo_move_to (w->crb, 50 * w->app->hdpi, w->scale.init_y+55 * w->app->hdpi);
cairo_line_to (w->crb, 450 * w->app->hdpi, w->scale.init_y+55 * w->app->hdpi);
Expand Down Expand Up @@ -399,7 +408,7 @@ static void draw_my_knob(void *w_, void* user_data) {
cairo_text_extents_t extents;
cairo_select_font_face (w->crb, "Sans", CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (w->crb, w->app->normal_font);
cairo_set_font_size (w->crb, w->app->normal_font/w->scale.ascale);
char s[17];
char sa[17];
float value = adj_get_value(w->adj);
Expand All @@ -416,7 +425,7 @@ static void draw_my_knob(void *w_, void* user_data) {

/** show label below the knob**/
use_text_color_scheme(w, get_color_state(w));
cairo_set_font_size (w->crb, w->app->normal_font+4);
cairo_set_font_size (w->crb, (w->app->normal_font+4)/w->scale.ascale);
cairo_text_extents(w->crb,w->label , &extents);
cairo_move_to (w->crb, (width*0.5)-(extents.width/2), height + (height * 0.15)-(extents.height*0.1));
cairo_show_text(w->crb, w->label);
Expand Down

0 comments on commit fb0cf12

Please sign in to comment.