commit 7ee40d85be453300a5aae39cee45995d57c825a8
parent ed8cae3ca02ec80c64223aa51376938e8a68ac76
Author: paulnasca <paulnasca>
Date: Mon, 20 Dec 2004 22:09:56 +0000
*** empty log message ***
Diffstat:
5 files changed, 46 insertions(+), 54 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -744,5 +744,5 @@
- Corectata o eroare care returna gresit la canDo in vst (netestat)
17 Dec 2004 - Inceput sa folosesc Dvorak pt. VK
18 Dec 2004 - Continuat putin la VK
-
+20 Dec 2004 - Se poate selecta la VK dintre "qwerty" si "Dvorak"
diff --git a/src/Misc/Config.C b/src/Misc/Config.C
@@ -61,7 +61,7 @@ Config::Config(){
cfg.CheckPADsynth=1;
cfg.UserInterfaceMode=0;
-
+ cfg.VirKeybLayout=1;
winwavemax=1;winmidimax=1;
//try to find out how many input midi devices are there
#ifdef WINMIDIIN
@@ -218,6 +218,7 @@ void Config::readConfig(char *filename){
cfg.UserInterfaceMode=xmlcfg->getpar("user_interface_mode",cfg.UserInterfaceMode,0,2);
+ cfg.VirKeybLayout=xmlcfg->getpar("virtual_keyboard_layout",cfg.VirKeybLayout,0,10);
//get bankroot dirs
for (int i=0;i<MAX_BANK_ROOT_DIRS;i++){
@@ -277,6 +278,9 @@ void Config::saveConfig(char *filename){
xmlcfg->addparstr("bank_current",cfg.currentBankDir);
xmlcfg->addpar("user_interface_mode",cfg.UserInterfaceMode);
+ xmlcfg->addpar("virtual_keyboard_layout",cfg.VirKeybLayout);
+
+
for (int i=0;i<MAX_BANK_ROOT_DIRS;i++) if (cfg.bankRootDirList[i]!=NULL) {
xmlcfg->beginbranch("BANKROOT",i);
xmlcfg->addparstr("bank_root",cfg.bankRootDirList[i]);
diff --git a/src/Misc/Config.h b/src/Misc/Config.h
@@ -43,6 +43,7 @@ class Config{
char *presetsDirList[MAX_BANK_ROOT_DIRS];
int CheckPADsynth;
int UserInterfaceMode;
+ int VirKeybLayout;
} cfg;
int winwavemax,winmidimax;//number of wave/midi devices on Windows
int maxstringsize;
diff --git a/src/UI/ConfigUI.fl b/src/UI/ConfigUI.fl
@@ -1,5 +1,5 @@
# data file for the Fltk User Interface Designer (fluid)
-version 1.0105
+version 1.0106
header_name {.h}
code_name {.cc}
decl {//Copyright (c) 2002-2004 Nasca Octavian Paul} {}
@@ -42,7 +42,7 @@ o->hide();}
xywh {5 5 500 305}
} {
Fl_Group {} {
- label {Main settings} selected
+ label {Main settings}
xywh {5 25 500 285}
} {
Fl_Group {} {
@@ -153,11 +153,11 @@ config.cfg.SoundBufferSize=strtoul(o->value(),&tmp,10);}
}
Fl_Box {} {
label {Most settings has effect only after ZynAddSubFX is restarted.}
- xywh {15 270 235 30} labelfont 1 labelsize 12 align 128
+ xywh {15 275 235 30} labelfont 1 labelsize 12 align 128
}
Fl_Box {} {
label {Read the Readme.txt for other settings}
- xywh {10 250 240 20} labelfont 1 labelsize 12 align 128
+ xywh {10 255 240 20} labelfont 1 labelsize 12 align 128
}
Fl_Group {} {
xywh {15 125 230 85} box ENGRAVED_BOX
@@ -246,6 +246,25 @@ midiinputnamebox->label(config.winmididevices[config.cfg.WindowsMidiInId].name);
xywh {10 10 100 20} labelfont 1 labelsize 10
}
}
+ Fl_Choice {} {
+ label {Virtual Keyboard Layout}
+ callback {config.cfg.VirKeybLayout=(int) o->value();;} open selected
+ xywh {155 235 85 20} down_box BORDER_BOX labelsize 13 textfont 1 textsize 12
+ code0 {o->value(config.cfg.VirKeybLayout);}
+ } {
+ menuitem {} {
+ label { }
+ xywh {5 5 100 20} labelfont 1 labelsize 13 deactivate
+ }
+ menuitem {} {
+ label QWERTY
+ xywh {15 15 100 20} labelfont 1 labelsize 13
+ }
+ menuitem {} {
+ label Dvorak
+ xywh {25 25 100 20} labelfont 1 labelsize 13
+ }
+ }
}
Fl_Group {} {
label {Bank root dirs}
diff --git a/src/UI/VirKeyboard.fl b/src/UI/VirKeyboard.fl
@@ -37,7 +37,7 @@ decl {const int keysoct1dw[]={'\\'','2',',','3','.','p','5','y','6','f','7','g',
decl {const int keysoct2dw[]={';','o','q','e','j','k','i','x','d','b','h','m','w','n','v','s','z',0};} {}
-class VirKeys {: {public Fl_Box}
+class VirKeys {open : {public Fl_Box}
} {
decl {static const int N_OCT=6;} {}
decl {static const int SIZE_WHITE=14;} {}
@@ -145,8 +145,14 @@ if ((event==FL_PUSH)||(event==FL_DRAG)||(event==FL_RELEASE)){
};
-const int *keysoct1=keysoct1dw;
-const int *keysoct2=keysoct2dw;
+const int *keysoct1=keysoct1qw;
+const int *keysoct2=keysoct2qw;
+
+if (config.cfg.VirKeybLayout==2) {
+ keysoct1=keysoct1dw;
+ keysoct2=keysoct2dw;
+};
+
if ((event==FL_KEYDOWN)||(event==FL_KEYUP)){
int key=Fl::event_key();
int kpos=-1;
@@ -158,7 +164,8 @@ if ((event==FL_KEYDOWN)||(event==FL_KEYUP)){
else relasekey(kpos,2);
};
-return(1);} {}
+return(1);} {selected
+ }
}
Function {presskey(int nk,int exclusive,int type)} {} {
code {if (nk>=N_OCT*12) return;
@@ -210,15 +217,13 @@ pthread_mutex_unlock(&master->mutex);} {}
}
}
-class VirKeyboard {open
-} {
- Function {make_window()} {open
- } {
+class VirKeyboard {} {
+ Function {make_window()} {} {
Fl_Window virkeyboardwindow {
label {Virtual Keyboard - ZynAddSubFX}
callback {relaseallkeys();
virkeyboardwindow->hide();}
- xywh {40 499 650 130} type Double visible
+ xywh {95 563 650 130} type Double hide
} {
Fl_Box virkeys {
label Keyboard
@@ -246,7 +251,7 @@ virkeys->take_focus();}
label Vel
callback {virkeys->midivel=(int) o->value();
virkeys->take_focus();}
- tooltip Velocity xywh {100 105 95 15} type {Horz Knob} box FLAT_BOX labelsize 10 align 5 minimum 1 maximum 127 step 1
+ tooltip Velocity xywh {95 105 100 15} type {Horz Knob} box FLAT_BOX labelsize 10 align 5 minimum 1 maximum 127 step 1
code0 {o->value(virkeys->midivel);}
}
Fl_Counter {} {
@@ -373,47 +378,10 @@ pitchwheelroller->do_callback();}
callback {relaseallkeys();
virkeys->midich=(int) o->value();
virkeys->take_focus();} open
- tooltip {Send to Midi Channel} xywh {35 105 65 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
+ tooltip {Send to Midi Channel} xywh {20 105 65 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Chn%d",i+1);if (i!=9) o->add(nrstr); else o->add("Drum10");};}
code1 {o->value(virkeys->midich);}
} {}
- Fl_Button {} {
- label KL
- callback {relaseallkeys();
-klwindow->show();}
- xywh {10 105 20 20} box THIN_UP_BOX labelsize 11
- }
- }
- Fl_Window klwindow {
- label {Keyboard Layout} open
- xywh {202 296 210 180} type Double modal visible
- } {
- Fl_Choice {} {
- label Keys open
- xywh {50 15 85 20} down_box BORDER_BOX labelsize 13 textfont 1 textsize 12
- } {
- menuitem {} {
- label { }
- xywh {0 0 100 20} labelfont 1 labelsize 13 deactivate
- }
- menuitem {} {
- label QWERTY
- xywh {10 10 100 20} labelfont 1 labelsize 13
- }
- menuitem {} {
- label Dvorak
- xywh {20 20 100 20} labelfont 1 labelsize 13
- }
- }
- Fl_Button {} {
- label Close
- callback {klwindow->hide();}
- xywh {50 50 85 20} box THIN_UP_BOX
- }
- Fl_Box {} {
- label {sa pun si in begginer mode} selected
- xywh {25 130 175 25}
- }
}
}
Function {VirKeyboard(Master *master_)} {} {