int cSemaineEmmaSender::processComponentMessage( cComponentMessage *_msg ) { if (isMessageType(_msg,"classificationResult")) { // determine origin by message's user-defined name, which can be set in the config file SMILE_IDBG(3,"received 'classificationResult' message"); if (!strcmp(_msg->msgname,"arousal")) sendArousalC(_msg); else if (!strcmp(_msg->msgname,"valence")) sendValenceC(_msg); else if (!strcmp(_msg->msgname,"interest")) sendInterestC(_msg); else if (!strcmp(_msg->msgname,"gender")) sendGender(_msg); else if (!strcmp(_msg->msgname,"power")) sendPowerC(_msg); else if (!strcmp(_msg->msgname,"intensity")) sendIntensityC(_msg); else if (!strcmp(_msg->msgname,"anticipation")) sendAnticipationC(_msg); return 1; // message was processed } else if (isMessageType(_msg,"pitchDirection")) { SMILE_IDBG(3,"received 'pitchDirection' message"); sendPitchDirection(_msg); return 1; // message was processed } else if (isMessageType(_msg,"asrKeywordOutput")) { SMILE_IDBG(3,"received 'asrKeywordOutput' message"); sendKeywords(_msg); return 1; // message was processed } else if (isMessageType(_msg,"turnSpeakingStatus")) { SMILE_IDBG(2,"received 'turnSpeakingStatus' message: %i",_msg->intData[0]); sendSpeakingStatus(_msg, _msg->intData[0]); return 1; // message was processed } return 0; // if message was not processed }
int cSemaineEmotionSender::processComponentMessage( cComponentMessage *_msg ) { if (isMessageType(_msg,"classificationResult")) { // determine origin by message's user-defined name, which can be set in the config file SMILE_IDBG(3,"received 'classificationResult' message"); if (!strcmp(_msg->msgname,"arousal")) { // convert to EmotionML standard range: (SEMAINE uses -1 to +1, EmotionML 0 .. 1) _msg->floatData[0] = (_msg->floatData[0] + 1.0)/2.0; sendDimensionFSRE(_msg,EmotionML::VOC_FSRE_DIMENSION_AROUSAL); } else if (!strcmp(_msg->msgname,"valence")) { // convert to EmotionML standard range: (SEMAINE uses -1 to +1, EmotionML 0 .. 1) _msg->floatData[0] = (_msg->floatData[0] + 1.0)/2.0; sendDimensionFSRE(_msg,EmotionML::VOC_FSRE_DIMENSION_VALENCE); } else if (!strcmp(_msg->msgname,"interest")) sendInterestC(_msg); //else if (!strcmp(_msg->msgname,"gender")) sendGender(_msg); else if (!strcmp(_msg->msgname,"power")) { // convert to EmotionML standard range: (SEMAINE uses -1 to +1, EmotionML 0 .. 1) _msg->floatData[0] = (_msg->floatData[0] + 1.0)/2.0; sendDimensionFSRE(_msg,EmotionML::VOC_FSRE_DIMENSION_POTENCY); } else if (!strcmp(_msg->msgname,"intensity")) { // convert to EmotionML standard range: (SEMAINE uses -1 to +1, EmotionML 0 .. 1) _msg->floatData[0] = (_msg->floatData[0] + 1.0)/2.0; sendDimension(_msg,EmotionML::VOC_SEMAINE_INTENSITY_DIMENSION_INTENSITY, EmotionML::VOC_SEMAINE_INTENSITY_DIMENSION_DEFINITON); } else if (!strcmp(_msg->msgname,"anticipation")) { // invert values and map to EmotionML range: _msg->floatData[0] = (1.0 - _msg->floatData[0])/2.0; sendDimensionFSRE(_msg,EmotionML::VOC_FSRE_DIMENSION_UNPREDICTABILITY); } return 1; // message was processed } if (isMessageType(_msg,"classificationResults")) { sendDimensionsFSRE_I(_msg); //TODO: sendDimensions(_msg,EmotionML::VOC_SEMAINE_INTENSITY_DIMENSION_INTENSITY); } return 0; // if message was not processed }