Skip to content

Commit

Permalink
Add 'Normal' key-size select option, push version to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brummer10 committed Dec 19, 2020
1 parent 37fe80d commit 2d8da87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion src/Mamba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void MidiRecord::start() {

// push recorded vector to play vector
for (unsigned int i=0; i<st->size(); i++)
play[channel].push_back((*st)[i]);
play[channel].push_back((*st)[i]);
st->clear();

// sort vector ascending to absolute time in loop
Expand Down
11 changes: 9 additions & 2 deletions src/MidiKeyBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down Expand Up @@ -1299,16 +1300,18 @@ 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;
}

xjmkb->win->scale.init_height = h;
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!!
Expand All @@ -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;
Expand Down

0 comments on commit 2d8da87

Please sign in to comment.