| 340 | } |
| 341 | |
| 342 | smileres_t smile_extaudiosource_write_data(smileobj_t *smileobj, const char *componentName, const void *data, int length) |
| 343 | { |
| 344 | if (smileobj == NULL) |
| 345 | SMILE_FAIL_WITH(SMILE_INVALID_ARG, "smileobj argument must not be null"); |
| 346 | if (componentName == NULL) |
| 347 | SMILE_FAIL_WITH(SMILE_INVALID_ARG, "componentName argument must not be null"); |
| 348 | if (data == NULL) |
| 349 | SMILE_FAIL_WITH(SMILE_INVALID_ARG, "data argument must not be null"); |
| 350 | if (smileobj->state == SMILE_UNINITIALIZED) |
| 351 | SMILE_FAIL_WITH(SMILE_INVALID_STATE, "openSMILE must be initialized first"); |
| 352 | |
| 353 | cSmileComponent *component = smileobj->cMan->getComponentInstance(componentName); |
| 354 | |
| 355 | if (component == NULL) |
| 356 | SMILE_FAIL_WITH(SMILE_COMP_NOT_FOUND, "specified component does not exist"); |
| 357 | |
| 358 | cExternalAudioSource *externalAudioSource = dynamic_cast<cExternalAudioSource*>(component); |
| 359 | |
| 360 | if (externalAudioSource == NULL) |
| 361 | SMILE_FAIL_WITH(SMILE_COMP_NOT_FOUND, "specified component is not of type cExternalAudioSource"); |
| 362 | |
| 363 | return externalAudioSource->writeData(data, length) ? SMILE_SUCCESS : SMILE_NOT_WRITTEN; |
| 364 | } |
| 365 | |
| 366 | smileres_t smile_extaudiosource_set_external_eoi(smileobj_t *smileobj, const char *componentName) |
| 367 | { |
nothing calls this directly
no test coverage detected