@@ -278,6 +278,11 @@ def receive_midi(self, status, message):
278278 'self._change_mode_transport(%d & 0x01)' ,
279279 }
280280
281+ # make sure that no submenu disturbs toggling the "Global
282+ # View" mode
283+ if self ._mode_other == self ._MODE_OTHER_GLOBAL_VIEW :
284+ del cc_selector [self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1 ]
285+
281286 if status == (MidiConnection .CONTROL_CHANGE + \
282287 self ._MIDI_DEVICE_CHANNEL ):
283288 cc_number = message [1 ]
@@ -602,7 +607,7 @@ def _change_mode_edit(self, status):
602607
603608 menu_strings = \
604609 ('Track' , 'Send' , 'Panning' , 'EQ' , \
605- 'Plug-In' , 'Instrum.' , 'Switch 1 ' , 'Switch 2 ' )
610+ 'Plug-In' , 'Instrum.' , 'Switch A ' , 'Switch B ' )
606611 self ._set_menu_string (menu_strings )
607612
608613 self .register_control ( \
@@ -754,6 +759,9 @@ def _change_mode_bank(self, status):
754759 # leave other modes as is in order to return to the old one!
755760
756761 if status == 1 :
762+ if self ._mode_other != self ._MODE_OTHER_OFF :
763+ return
764+
757765 self ._mode_other = self ._MODE_OTHER_BANK
758766 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM , 1 )
759767
@@ -780,6 +788,9 @@ def _change_mode_bank(self, status):
780788 self .withdraw_control (self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6 )
781789 self .withdraw_control (self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7 )
782790 else :
791+ if self ._mode_other != self ._MODE_OTHER_BANK :
792+ return
793+
783794 self ._mode_other = self ._MODE_OTHER_OFF
784795 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM , 0 )
785796
@@ -791,12 +802,15 @@ def _change_mode_automation(self, status):
791802 # leave other modes as is in order to return to the old one!
792803
793804 if status == 1 :
805+ if self ._mode_other != self ._MODE_OTHER_OFF :
806+ return
807+
794808 self ._mode_other = self ._MODE_OTHER_AUTOMATION
795809 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1 , 1 )
796810
797811 menu_strings = \
798812 ('Read/Off' , 'Write' , 'Trim' , 'Touch' , \
799- 'Latch' , '' , 'Global ' , 'Group' )
813+ 'Latch' , '' , '' , 'Group' )
800814 self ._set_menu_string (menu_strings )
801815
802816 self .register_control ( \
@@ -811,13 +825,14 @@ def _change_mode_automation(self, status):
811825 'automation_latch' , self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 4 )
812826
813827 self .withdraw_control (self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 5 )
828+ self .withdraw_control (self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6 )
814829
815- self .register_control ( \
816- 'global_view' , self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6 , \
817- self ._MIDI_CC_LED_AUTOMAP_LEARN )
818830 self .register_control ( \
819831 'group' , self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7 )
820832 else :
833+ if self ._mode_other != self ._MODE_OTHER_AUTOMATION :
834+ return
835+
821836 self ._mode_other = self ._MODE_OTHER_OFF
822837 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1 , 0 )
823838
@@ -829,6 +844,9 @@ def _change_mode_global_view(self, status):
829844 # leave other modes as is in order to return to the old one!
830845
831846 if status == 1 :
847+ if self ._mode_other != self ._MODE_OTHER_OFF :
848+ return
849+
832850 self ._mode_other = self ._MODE_OTHER_GLOBAL_VIEW
833851 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 2 , 1 )
834852
@@ -861,10 +879,19 @@ def _change_mode_global_view(self, status):
861879 self .register_control ( \
862880 'global_view_user' , \
863881 self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7 )
882+
883+ self .register_control ( \
884+ 'global_view' , self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1 , \
885+ self ._MIDI_CC_LED_AUTOMAP_LEARN )
864886 else :
887+ if self ._mode_other != self ._MODE_OTHER_GLOBAL_VIEW :
888+ return
889+
865890 self ._mode_other = self ._MODE_OTHER_OFF
866891 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 2 , 0 )
867892
893+ self .withdraw_control (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1 )
894+
868895 self ._clear_menu_string ()
869896 self ._restore_previous_mode ()
870897
@@ -873,6 +900,9 @@ def _change_mode_utility(self, status):
873900 # leave other modes as is in order to return to the old one!
874901
875902 if status == 1 :
903+ if self ._mode_other != self ._MODE_OTHER_OFF :
904+ return
905+
876906 self ._mode_other = self ._MODE_OTHER_UTILITY
877907 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 3 , 1 )
878908
@@ -898,6 +928,9 @@ def _change_mode_utility(self, status):
898928 self .register_control ( \
899929 'utilities_save' , self ._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7 )
900930 else :
931+ if self ._mode_other != self ._MODE_OTHER_UTILITY :
932+ return
933+
901934 self ._mode_other = self ._MODE_OTHER_OFF
902935 self ._set_led (self ._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 3 , 0 )
903936
0 commit comments