ERIS CORE

◆ publish()

void SvcMIDI::publish ( const char *  message)

public interface for the midi callback functions to publish messages to subscribers through their message handlers

Parameters
message

Definition at line 166 of file SvcMIDI.cpp.

166  {
167  for(uint16_t i = 0; i < MAX_MIDI_MESSAGE_APP_SUBSCRIPTIONS; i ++){
168  if (subscriptions[i] == 0) return;
169  am->sendMessage(this,am->getApp(subscriptions[i])->name,message);
170  am->data->increment("MIDI_MSGS_PUB");
171  }
172 }
AppManager * am
Definition: AppBaseClass.h:38
char name[MAX_NAME_LENGTH]
Definition: AppBaseClass.h:74
SvcDataDictionary * data
Definition: AppManager.h:63
AppBaseClass * getApp(uint16_t id)
provides an interface for apps to request another app object by id
Definition: AppManager.cpp:376
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
bool increment(const char *key)
increments the value of a global record creates a new record if one does not exist and initializes ...
uint16_t subscriptions[MAX_MIDI_MESSAGE_APP_SUBSCRIPTIONS]
Definition: SvcMidi.h:54

References AppBaseClass::am, AppManager::data, AppManager::getApp(), SvcDataDictionary::increment(), AppBaseClass::name, AppManager::sendMessage(), and subscriptions.

Referenced by handleControlChangeCallback(), handleNoteOffCallback(), handleNoteOnCallback(), and handleProgramChangeCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: