zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 20d47c87f804ef1de1d90e73e34cd603f3a8d2d0
parent c7737363555427128b206b6c13a024730fb654c5
Author: Christopher A. Oliver <[email protected]>
Date:   Mon, 16 Nov 2015 11:07:28 -0500

Simple key (ctrl+shift+p) to raise the mixer panel.

Diffstat:
Msrc/UI/Connection.cpp | 9++++++---
Msrc/UI/guimain.cpp | 8++++++--
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/UI/Connection.cpp b/src/UI/Connection.cpp @@ -30,12 +30,14 @@ class MasterUI *ui; static Fl_Tiled_Image *module_backdrop; #endif -int undo_redo_show_handler(int) +int kb_shortcut_handler(int) { const bool undo_ = Fl::event_ctrl() && Fl::event_key() == 'z'; const bool redo = Fl::event_ctrl() && Fl::event_key() == 'r'; const bool show = Fl::event_ctrl() && Fl::event_shift() && Fl::event_key() == 's'; + const bool panel = Fl::event_ctrl() && Fl::event_shift() && + Fl::event_key() == 'p'; if(undo_) ui->osc->write("/undo", ""); else if(redo) @@ -43,7 +45,8 @@ int undo_redo_show_handler(int) else if (show) { ui->simplemasterwindow->hide(); ui->masterwindow->show(); - } + } else if (panel) + ui->panelwindow->show(); return undo_ || redo || show; } @@ -123,7 +126,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit) //tree->osc = osc; //midi_win->show(); - Fl::add_handler(undo_redo_show_handler); + Fl::add_handler(kb_shortcut_handler); return (void*) (ui = new MasterUI((int*)exit, osc)); } void GUI::destroyUi(ui_handle_t ui) diff --git a/src/UI/guimain.cpp b/src/UI/guimain.cpp @@ -89,12 +89,14 @@ class MasterUI *ui=0; static Fl_Tiled_Image *module_backdrop; #endif -int undo_redo_show_handler(int) +int kb_shortcut_handler(int) { const bool undo_ = Fl::event_ctrl() && Fl::event_key() == 'z'; const bool redo = Fl::event_ctrl() && Fl::event_key() == 'r'; const bool show = Fl::event_ctrl() && Fl::event_shift() && Fl::event_key() == 's'; + const bool panel = Fl::event_ctrl() && Fl::event_shift() && + Fl::event_key() == 'p'; if(undo_) ui->osc->write("/undo", ""); else if(redo) @@ -103,6 +105,8 @@ int undo_redo_show_handler(int) ui->simplemasterwindow->hide(); ui->masterwindow->show(); } + else if (panel) + ui->panelwindow->show(); return undo_ || redo || show; } @@ -182,7 +186,7 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit) //tree->osc = osc; //midi_win->show(); - Fl::add_handler(undo_redo_show_handler); + Fl::add_handler(kb_shortcut_handler); return (void*) (ui = new MasterUI((int*)exit, osc)); } void GUI::destroyUi(ui_handle_t ui)