ERIS CORE

◆ messageHandler()

void FASTRUN AppAudioToPolyphonic::messageHandler ( AppBaseClass sender,
const char *  message 
)
inlinevirtual

receiver method for inter-app string based communication

Parameters
uval
fval

Reimplemented from AppBaseClass.

Definition at line 237 of file AppAudioToPolyphonic.h.

237  {
238  if (am == NULL) return;
239  if (sender->isName("SLIDER")){
240  //erisAudioFilterBiquad* filter = (erisAudioFilterBiquad*) (ad->getAudioStreamObjByName("biquad:3"));
241  //filter->setLowpass(0,100.0 + (8000.0 * (slider->value/100.0)));
242  }
243  else if(sender->isName("SIN")){ //...or, can detect sender by name
244  changeVoice(WAVEFORM_SINE);
245  }
246  else if(sender->isName("TRI")){
247  changeVoice(WAVEFORM_TRIANGLE);
248  }
249  else if(sender->isName("SAW")){
250  changeVoice(WAVEFORM_SAWTOOTH);
251  }
252  else if(sender->isName("REVSAW")){
253  changeVoice(WAVEFORM_SAWTOOTH_REVERSE);
254  }
255  else if(sender->isName("SQUARE")){
256  changeVoice(WAVEFORM_SQUARE);
257  }
258  else if(sender->isName("SCI")){
260  if (wav!=NULL){
261  wav->frequency(atoi(message));
262  wav->amplitude(0.01);
263  }
264  }
265  else if(sender->isName("BACK")){
266  am->sendMessage(this,"AppWren","demo");
267  }
268  }
void FASTRUN changeVoice(uint16_t voice_type)
AppManager * am
Definition: AppBaseClass.h:38
bool isName(const char *name_string)
Compares the name_string to the app class instance name (string)
Definition: AppBaseClass.h:93
AudioDirector * ad
Definition: AppBaseClass.h:37
bool sendMessage(AppBaseClass *sender, const char *to_app, const char *message)
provides an interface for apps to send messages to other apps
Definition: AppManager.cpp:469
AudioStream * getAudioStreamObjByName(const char *AudioStreamObjName)
void frequency(float freq)

References AppBaseClass::ad, AppBaseClass::am, AudioSynthWaveformhd::amplitude(), changeVoice(), AudioSynthWaveformhd::frequency(), AudioDirector::getAudioStreamObjByName(), AppBaseClass::isName(), and AppManager::sendMessage().

+ Here is the call graph for this function: