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) { |