@@ -867,38 +867,41 @@ HUM.DHC = class {
867
867
// Search the FT number in the playQueue array
868
868
let position = this . playQueue . ft . findIndex ( qt => qt . xtNum === dhcMsg . xtNum ) ;
869
869
// If the FTn exist
870
- if ( position > - 1 ) {
870
+ if ( position !== - 1 ) {
871
871
// Remove the FTn from the playQueue array
872
872
this . playQueue . ft . splice ( position , 1 ) ;
873
- // If the FTn does not exist
874
- } else {
875
- if ( dhcMsg . panic === false ) {
876
- console . log ( "STRANGE: there is NOT a FT pressed key #:" , dhcMsg . xtNum ) ;
877
- }
878
- }
879
873
880
- this . sendMessageToApps ( dhcMsg ) ;
881
-
882
- // If there are other notes, read and play the next note on the playQueue array
883
- if ( this . playQueue . ft . length > 0 ) {
884
- // Read the next FT
885
- let nextIndex = this . playQueue . ft . length - 1 ;
886
- let nextTone = this . playQueue . ft [ nextIndex ] ;
887
- // If the next tone is NOT the active one
888
- if ( nextTone . xtNum !== this . settings . ht . curr_ft ) {
889
-
890
- // Recalculate the ht table passing the frequency (Hz)
891
- this . createHTtable ( this . tables . ft [ nextTone . xtNum ] . hz ) ;
892
- // Store the current FT into the global slot for future HT table re-computations and UI monitor updates
893
- this . settings . ht . curr_ft = nextTone . xtNum ;
894
-
895
- this . sendMessageToApps ( nextTone ) ;
896
-
897
- // Update the UI
898
- this . dhcMonitor ( "ft" , nextTone . xtNum ) ;
874
+ this . sendMessageToApps ( dhcMsg ) ;
875
+
876
+ // If there are other notes, read and play the next note on the playQueue array
877
+ if ( this . playQueue . ft . length > 0 ) {
878
+ // Read the next FT
879
+ let nextIndex = this . playQueue . ft . length - 1 ;
880
+ let nextTone = this . playQueue . ft [ nextIndex ] ;
881
+ // If the next tone is NOT the active one
882
+ if ( nextTone . xtNum !== this . settings . ht . curr_ft ) {
883
+
884
+ // Recalculate the ht table passing the frequency (Hz)
885
+ this . createHTtable ( this . tables . ft [ nextTone . xtNum ] . hz ) ;
886
+ // Store the current FT into the global slot for future HT table re-computations and UI monitor updates
887
+ this . settings . ht . curr_ft = nextTone . xtNum ;
888
+
889
+ this . sendMessageToApps ( nextTone ) ;
890
+
891
+ // Update the UI
892
+ this . dhcMonitor ( "ft" , nextTone . xtNum ) ;
899
893
894
+ }
900
895
}
896
+
897
+ // If the FTn does not exist
901
898
}
899
+ // else {
900
+ // // if (dhcMsg.panic === false) {
901
+ // // console.log("STRANGE: there is NOT a FT pressed key #:", dhcMsg.xtNum);
902
+ // // }
903
+ // }
904
+
902
905
}
903
906
904
907
/**
@@ -981,27 +984,30 @@ HUM.DHC = class {
981
984
// Search the HT number in the queue array
982
985
let position = this . playQueue . ht . findIndex ( qt => qt . xtNum === dhcMsg . xtNum ) ;
983
986
// If the HTn exist
984
- if ( position > - 1 ) {
987
+ if ( position !== - 1 ) {
985
988
// Remove the HTn from the queue array
986
989
this . playQueue . ht . splice ( position , 1 ) ;
987
990
// Update the curr_ht
988
991
if ( this . playQueue . ht . length > 0 ) {
989
992
this . settings . ht . curr_ht = this . playQueue . ht [ this . playQueue . ht . length - 1 ] . xtNum ;
990
993
}
994
+
995
+ this . sendMessageToApps ( dhcMsg ) ;
996
+
991
997
// If the FTn does not exist
992
- } else {
993
- if ( dhcMsg . panic === false ) {
994
- console . log ( "STRANGE: there is NOT a HT pressed key #:" , dhcMsg . xtNum ) ;
995
- }
996
- }
998
+ }
999
+ // else {
1000
+ // // if (dhcMsg.panic === false) {
1001
+ // // console.log("STRANGE: there is NOT a HT pressed key #:", dhcMsg.xtNum);
1002
+ // // }
1003
+ // }
997
1004
998
1005
// If HT0 is pressed, it's the Piper feature
999
1006
} else if ( dhcMsg . xtNum === 0 && dhcMsg . panic === false ) {
1000
1007
// Note OFF the active piped HT
1001
1008
this . piping ( 0 ) ;
1009
+ this . sendMessageToApps ( dhcMsg ) ;
1002
1010
}
1003
-
1004
- this . sendMessageToApps ( dhcMsg ) ;
1005
1011
1006
1012
}
1007
1013
0 commit comments