@@ -179,7 +179,14 @@ class NiMidiSurface: public BaseSurface {
179
179
virtual const char * GetDescString () override {
180
180
return " Komplete Kontrol S-series Mk2/A-series/M-series" ;
181
181
}
182
-
182
+
183
+ virtual void Run () override {
184
+ // Moved from main to deal with activities specific to S-Mk2/A/M series and not applicable to S-Mk1 keyboards
185
+ this ->_peakMixerUpdate ();
186
+ // --------------------------------------------------------------------------------
187
+ BaseSurface::Run ();
188
+ }
189
+
183
190
virtual void SetPlayState (bool play, bool pause, bool rec) override {
184
191
#ifdef CALLBACK_DIAGNOSTICS
185
192
ostringstream s;
@@ -476,6 +483,8 @@ class NiMidiSurface: public BaseSurface {
476
483
return 1 ;
477
484
}
478
485
486
+ // ===============================================================================================================================
487
+
479
488
protected:
480
489
void _onMidiEvent (MIDI_event_t* event) override {
481
490
if (event->midi_message [0 ] != MIDI_CC) {
@@ -621,20 +630,27 @@ class NiMidiSurface: public BaseSurface {
621
630
}
622
631
}
623
632
624
- void _peakMixerUpdate () override {
633
+ // ===============================================================================================================================
634
+
635
+ private:
636
+ int _protocolVersion = 0 ;
637
+ int _bankStart = 0 ;
638
+ int _bankEnd = 0 ;
639
+
640
+ void _peakMixerUpdate () {
625
641
// Peak meters. Note: Reaper reports peak, NOT VU
626
642
627
643
// ToDo: Peak Hold in KK display shall be erased immediately when changing bank
628
644
// ToDo: Peak Hold in KK display shall be erased after decay time t when track muted or no signal.
629
645
// ToDo: Explore the effect of sending CMD_SEL_TRACK_PARAMS_CHANGED after sending CMD_TRACK_VU
630
646
// ToDo: Consider caching and not sending anything via SysEx if no values have changed.
631
-
647
+
632
648
// Meter information is sent to KK as array (string of chars) for all 16 channels (8 x stereo) of one bank.
633
649
// A value of 0 will result in stopping to refresh meters further to right as it is interpretated as "end of string".
634
650
// peakBank[0]..peakBank[31] are used for data. The array needs one additional last char peakBank[32] set as "end of string" marker.
635
651
static char peakBank[(BANK_NUM_TRACKS * 2 ) + 1 ];
636
652
int j = 0 ;
637
- double peakValue = 0 ;
653
+ double peakValue = 0 ;
638
654
int numInBank = 0 ;
639
655
for (int id = this ->_bankStart ; id <= this ->_bankEnd ; ++id, ++numInBank) {
640
656
MediaTrack* track = CSurf_TrackFromID (id, false );
@@ -688,11 +704,6 @@ class NiMidiSurface: public BaseSurface {
688
704
this ->_sendSysex (CMD_TRACK_VU, 2 , 0 , peakBank);
689
705
}
690
706
691
- private:
692
- int _protocolVersion = 0 ;
693
- int _bankStart = 0 ;
694
- int _bankEnd = 0 ;
695
-
696
707
void _allMixerUpdate () {
697
708
#ifdef CALLBACK_DIAGNOSTICS
698
709
ostringstream s;
0 commit comments