ERIS CORE

◆ messageHandler()

void AppCQT::messageHandler ( AppBaseClass sender,
const char *  message 
)
inlineprotectedvirtual

receiver method for inter-app string based communication

Parameters
uval
fval

Reimplemented from AppBaseClass.

Definition at line 447 of file appCQT.h.

447  {
448  if(strcmp(message,ENABLE)==0){
449  onFocus();//reusing the onFocus function to ENABLE processing
450  }else if(strcmp(message,DISABLE)==0){
451  onFocusLost();//reusing the onFocusLost function to DISABLE processing
452  }
453 
454  if(sender->isName("SCI")){
455  Serial.print(F("M appCQT::MessageHandler SCI param: "));
456  Serial.println(message);
457  if (strcmp(message,CQT_INFO)==0){
458  //sort the bins to transmit them in order
461  for (uint16_t i=1;i< NOTE_ARRAY_LENGTH - 1;i++){
463  sci->printf(F("M L %d,%f,%f,%d,%d,%d\t\t\t"),fftLowRR[i].cqtBin,fftLowRR[i].startFrequency,fftLowRR[i].stopFrequency,fftLowRR[i].startBin,fftLowRR[i].stopBin,fftLowRR[i].stopBin-fftLowRR[i].startBin);
465  sci->sendLZ4Message();
466  }
467  }
468  }
469  }
470  }
SvcSerialCommandInterface * sci
Definition: AppBaseClass.h:39
bool isName(const char *name_string)
Compares the name_string to the app class instance name (string)
Definition: AppBaseClass.h:93
void FLASHMEM onFocus()
Event handler called when the app gains focus.
Definition: appCQT.h:297
void FLASHMEM onFocusLost()
Event handler called when the app loses focus.
Definition: appCQT.h:304
FFTReadRange fftLowRR[NOTE_ARRAY_LENGTH]
Definition: appCQT.h:83
FFTReadRange fftHighRR[NOTE_ARRAY_LENGTH]
Definition: appCQT.h:82
bool requestStartLZ4Message()
request to start a lz4 compressed message starts the message and returns true if available returns f...
void sendLZ4Message()
Calling this function signals the end of a compressed message. The txBuffer contents are lz4 compres...
static void sort_fftrr_by_cqt_bin(FFTReadRange *a, size_t n)
float startFrequency
float stopFrequency
uint16_t stopBin
uint16_t cqtBin
uint16_t startBin

References cqtBin, fftHighRR, fftLowRR, AppBaseClass::isName(), onFocus(), onFocusLost(), SvcSerialCommandInterface::requestStartLZ4Message(), AppBaseClass::sci, SvcSerialCommandInterface::sendLZ4Message(), erisAudioAnalyzeFFT1024::sort_fftrr_by_cqt_bin(), startBin, startFrequency, stopBin, and stopFrequency.

+ Here is the call graph for this function: