MCPcopy Create free account
hub / github.com/audeering/opensmile / smile_extmsginterface_set_msg_callback

Function smile_extmsginterface_set_msg_callback

progsrc/smileapi/SMILEapi.cpp:491–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491smileres_t smile_extmsginterface_set_msg_callback(smileobj_t *smileobj, const char *componentName, ExternalMessageInterfaceCallback callback, void *param)
492{
493 if (smileobj == NULL)
494 SMILE_FAIL_WITH(SMILE_INVALID_ARG, "smileobj argument must not be null");
495 if (componentName == NULL)
496 SMILE_FAIL_WITH(SMILE_INVALID_ARG, "componentName argument must not be null");
497 if (smileobj->state == SMILE_UNINITIALIZED)
498 SMILE_FAIL_WITH(SMILE_INVALID_STATE, "openSMILE must be initialized first");
499
500 cSmileComponent *component = smileobj->cMan->getComponentInstance(componentName);
501
502 if (component == NULL)
503 SMILE_FAIL_WITH(SMILE_COMP_NOT_FOUND, "specified component does not exist");
504
505 cExternalMessageInterface *externalMsgInterface = dynamic_cast<cExternalMessageInterface*>(component);
506
507 if (externalMsgInterface == NULL)
508 SMILE_FAIL_WITH(SMILE_COMP_NOT_FOUND, "specified component is not of type cExternalMessageInterface");
509
510 externalMsgInterface->setMessageCallback(callback, param);
511
512 return SMILE_SUCCESS;
513}
514
515smileres_t smile_extmsginterface_set_json_msg_callback(smileobj_t *smileobj, const char *componentName, ExternalMessageInterfaceJsonCallback callback, void *param)
516{

Callers

nothing calls this directly

Calls 2

setMessageCallbackMethod · 0.80
getComponentInstanceMethod · 0.45

Tested by

no test coverage detected