1 |
/* |
/* |
2 |
* Copyright (C) 2006-2008 Andreas Persson |
* Copyright (C) 2006-2009 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
82 |
cursor_is_resize = false; |
cursor_is_resize = false; |
83 |
h1 = REGION_BLOCK_HEIGHT; |
h1 = REGION_BLOCK_HEIGHT; |
84 |
|
|
85 |
// properties of the virtual keyboard |
// properties of the virtual keyboard |
86 |
{ |
{ |
87 |
const char* choices[] = { "normal", "chord", NULL }; |
const char* choices[] = { _("normal"), _("chord"), NULL }; |
88 |
static const virt_keyboard_mode_t values[] = { |
static const virt_keyboard_mode_t values[] = { |
89 |
VIRT_KEYBOARD_MODE_NORMAL, |
VIRT_KEYBOARD_MODE_NORMAL, |
90 |
VIRT_KEYBOARD_MODE_CHORD |
VIRT_KEYBOARD_MODE_CHORD |
175 |
} |
} |
176 |
|
|
177 |
void RegionChooser::on_note_off_event(int key, int velocity) { |
void RegionChooser::on_note_off_event(int key, int velocity) { |
178 |
if (is_black_key(key)) |
if (is_black_key(key)) { |
179 |
draw_region(key, key+1, black); |
draw_region(key, key+1, black); |
180 |
else |
} else { |
181 |
draw_region(key, key+1, white); |
draw_region(key, key+1, key >= 21 && key <= 108 ? white : grey1); |
182 |
|
} |
183 |
m_VirtKeybOffVelocityLabel.set_text(ToString(velocity)); |
m_VirtKeybOffVelocityLabel.set_text(ToString(velocity)); |
184 |
} |
} |
185 |
|
|
678 |
event->y < REGION_BLOCK_HEIGHT + KEYBOARD_HEIGHT) |
event->y < REGION_BLOCK_HEIGHT + KEYBOARD_HEIGHT) |
679 |
{ |
{ |
680 |
const int k = int(event->x / (get_width() - 1) * 128.0); |
const int k = int(event->x / (get_width() - 1) * 128.0); |
681 |
int velocity = (event->y >= REGION_BLOCK_HEIGHT + KEYBOARD_HEIGHT - 1) ? 127 : |
if (k != currentActiveKey) { |
682 |
int(float(event->y - REGION_BLOCK_HEIGHT) / float(KEYBOARD_HEIGHT) * 128.0f) + 1; |
int velocity = |
683 |
if (velocity <= 0) velocity = 1; |
(event->y >= REGION_BLOCK_HEIGHT + KEYBOARD_HEIGHT - 1) ? 127 : |
684 |
keyboard_key_released_signal.emit(currentActiveKey, velocity); |
int(float(event->y - REGION_BLOCK_HEIGHT) / |
685 |
currentActiveKey = k; |
float(KEYBOARD_HEIGHT) * 128.0f) + 1; |
686 |
keyboard_key_hit_signal.emit(k, velocity); |
if (velocity <= 0) velocity = 1; |
687 |
|
keyboard_key_released_signal.emit(currentActiveKey, velocity); |
688 |
|
currentActiveKey = k; |
689 |
|
keyboard_key_hit_signal.emit(k, velocity); |
690 |
|
} |
691 |
} |
} |
692 |
|
|
693 |
if (resize.active) { |
if (resize.active) { |
772 |
void RegionChooser::show_region_properties() |
void RegionChooser::show_region_properties() |
773 |
{ |
{ |
774 |
if (!region) return; |
if (!region) return; |
775 |
Gtk::Dialog dialog("Region Properties", true /*modal*/); |
Gtk::Dialog dialog(_("Region Properties"), true /*modal*/); |
776 |
// add "Keygroup" checkbox |
// add "Keygroup" checkbox |
777 |
Gtk::CheckButton checkBoxKeygroup("Member of a Keygroup (Exclusive Group)"); |
Gtk::CheckButton checkBoxKeygroup(_("Member of a Keygroup (Exclusive Group)")); |
778 |
checkBoxKeygroup.set_active(region->KeyGroup); |
checkBoxKeygroup.set_active(region->KeyGroup); |
779 |
dialog.get_vbox()->pack_start(checkBoxKeygroup); |
dialog.get_vbox()->pack_start(checkBoxKeygroup); |
780 |
checkBoxKeygroup.show(); |
checkBoxKeygroup.show(); |