From 2d8da87ea76673c3f17629f6b64a3853e5cd4533 Mon Sep 17 00:00:00 2001 From: brummer10 Date: Sat, 19 Dec 2020 06:50:38 +0100 Subject: [PATCH] Add 'Normal' key-size select option, push version to 2.0 --- src/Makefile | 2 +- src/Mamba.cpp | 2 +- src/MidiKeyBoard.cpp | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index f67c757..0d681a1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,7 +28,7 @@ NAME = Mamba EXEC_NAME = $(shell echo $(NAME) | tr A-Z a-z) BUILD_DIR = build - VER = 1.9 + VER = 2.0 LIB_DIR := ../libxputty/libxputty/ HEADER_DIR := $(LIB_DIR)include/ diff --git a/src/Mamba.cpp b/src/Mamba.cpp index 771713f..00cdf9a 100644 --- a/src/Mamba.cpp +++ b/src/Mamba.cpp @@ -332,7 +332,7 @@ void MidiRecord::start() { // push recorded vector to play vector for (unsigned int i=0; isize(); i++) - play[channel].push_back((*st)[i]); + play[channel].push_back((*st)[i]); st->clear(); // sort vector ascending to absolute time in loop diff --git a/src/MidiKeyBoard.cpp b/src/MidiKeyBoard.cpp index 457970a..34ae060 100644 --- a/src/MidiKeyBoard.cpp +++ b/src/MidiKeyBoard.cpp @@ -849,6 +849,7 @@ void XKeyBoard::init_ui(Xputty *app) { view_proc = menu_add_check_entry(view_menu, _("Channel/Bank/Instrument")); view_controller = menu_add_check_entry(view_menu, _("Controls")); key_size_menu = menu_add_submenu(view_menu,_("Keysize")); + menu_add_radio_entry(key_size_menu,_("Big")); menu_add_radio_entry(key_size_menu,_("Normal")); menu_add_radio_entry(key_size_menu,_("Small")); @@ -1299,6 +1300,8 @@ void XKeyBoard::view_callback(void *w_, void* user_data) { widget_show_all(xjmkb->proc_box); } if (xjmkb->key_size == 1) { + h1 -= 20; + } else if (xjmkb->key_size == 2) { h1 -= 40; } @@ -1306,9 +1309,9 @@ void XKeyBoard::view_callback(void *w_, void* user_data) { XSizeHints* win_size_hints; win_size_hints = XAllocSizeHints(); win_size_hints->flags = PMinSize|PBaseSize|PMaxSize|PWinGravity|PResizeInc; - win_size_hints->min_width = 700; + win_size_hints->min_width = 28*xjmkb->width_inc; win_size_hints->min_height = h1; - win_size_hints->base_width = 700; + win_size_hints->base_width = 28*xjmkb->width_inc; win_size_hints->base_height = h1; win_size_hints->max_width = 1875; win_size_hints->max_height = h1+1; //need to be 1 more then min to avoid flicker in the UI!! @@ -1331,6 +1334,10 @@ void XKeyBoard::key_size_callback(void *w_, void* user_data) { keys->key_offset = 15; xjmkb->width_inc = 25; } else if (xjmkb->key_size == 1) { + keys->key_size = 21; + keys->key_offset = 13; + xjmkb->width_inc = 22; + } else if (xjmkb->key_size == 2) { keys->key_size = 18; keys->key_offset = 12; xjmkb->width_inc = 19;