diff options
Diffstat (limited to 'plugins/alsa/alsa-api-sink.c')
-rw-r--r-- | plugins/alsa/alsa-api-sink.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/alsa/alsa-api-sink.c b/plugins/alsa/alsa-api-sink.c index a1137c5..e00f9d1 100644 --- a/plugins/alsa/alsa-api-sink.c +++ b/plugins/alsa/alsa-api-sink.c @@ -26,11 +26,11 @@ PUBLIC AlsaPcmHwInfoT *ApiSinkGetParamsByZone(SoftMixerT *mixer, const char *tar AlsaSndZoneT *zone = ApiZoneGetByUid(mixer, target); if (!zone) { - AFB_ApiError(mixer->api, "%s: Unable to find zone %s", __func__, target); + AFB_API_ERROR(mixer->api, "%s: Unable to find zone %s", __func__, target); goto fail; } if (zone->nbSinks == 0) { - AFB_ApiError(mixer->api, "%s: Zone %s has no sinks", __func__, target); + AFB_API_ERROR(mixer->api, "%s: Zone %s has no sinks", __func__, target); goto fail; } @@ -38,7 +38,7 @@ PUBLIC AlsaPcmHwInfoT *ApiSinkGetParamsByZone(SoftMixerT *mixer, const char *tar AlsaPcmChannelT * pcmChannel = cds_list_first_entry(&zone->sinks.list, AlsaPcmChannelT , list); const char *channel = pcmChannel->uid; - AFB_ApiDebug(mixer->api, "%s: first channel uid is %s, zone has %d sinks", __func__, channel, zone->nbSinks); + AFB_API_DEBUG(mixer->api, "%s: first channel uid is %s, zone has %d sinks", __func__, channel, zone->nbSinks); AlsaSndPcmT * sink = NULL; @@ -46,7 +46,7 @@ PUBLIC AlsaPcmHwInfoT *ApiSinkGetParamsByZone(SoftMixerT *mixer, const char *tar AlsaPcmChannelT * pcmChannel; cds_list_for_each_entry(pcmChannel, &sink->channels.list, list) { if (pcmChannel->uid && !strcasecmp(channel, pcmChannel->uid)) { - AFB_ApiDebug(mixer->api, "%s: found %s, return", __func__, pcmChannel->uid); + AFB_API_DEBUG(mixer->api, "%s: found %s, return", __func__, pcmChannel->uid); return sink->sndcard->params; } } @@ -69,14 +69,14 @@ PUBLIC AlsaSndPcmT *ApiSinkGetByUid(SoftMixerT *mixer, const char *target) { static void sinkDestroy(SoftMixerT* mixer, void * arg) { AlsaSndPcmT * sink = (AlsaSndPcmT*) arg; - AFB_ApiDebug(mixer->api, "%s... %s", __func__, sink->uid); + AFB_API_DEBUG(mixer->api, "%s... %s", __func__, sink->uid); cds_list_del(&sink->list); mixer->nbSinks--; ApiPcmDelete(mixer, sink); } -AlsaSndPcmT * sinkCreate(SoftMixerT * mixer, AFB_ReqT request, const char * uid, json_object * argsJ) { +AlsaSndPcmT * sinkCreate(SoftMixerT * mixer, afb_req_t request, const char * uid, json_object * argsJ) { AlsaPcmCtlT* dmixConfig = NULL; char *dmixUid = NULL; AlsaSndPcmT * newSink = ApiPcmAttachOne(mixer, uid, SND_PCM_STREAM_PLAYBACK, argsJ); @@ -92,7 +92,7 @@ AlsaSndPcmT * sinkCreate(SoftMixerT * mixer, AFB_ReqT request, const char * uid, } dmixConfig = AlsaCreateDmix(mixer, dmixUid, newSink, 0); if (!dmixConfig) { - AFB_ReqFailF(request, "internal-error", "mixer=%s sink=%s fail to create DMIX config", mixer->uid, newSink->uid); + afb_req_fail_f(request, "internal-error", "mixer=%s sink=%s fail to create DMIX config", mixer->uid, newSink->uid); goto fail_dmix; } } @@ -111,10 +111,10 @@ fail_dmix: } -PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, json_object * argsJ) { +PUBLIC int ApiSinkAttach(SoftMixerT *mixer, afb_req_t request, const char * uid, json_object * argsJ) { if (mixer->nbSinks >= mixer->max.sinks) { - AFB_ReqFailF(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); + afb_req_fail_f(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); goto fail; } @@ -124,7 +124,7 @@ PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, case json_type_object: { AlsaSndPcmT * newSink = sinkCreate(mixer, request, uid, argsJ); if (!newSink) { - AFB_ReqFailF(request, "bad-pcm", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(argsJ)); + afb_req_fail_f(request, "bad-pcm", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(argsJ)); goto fail; } break; @@ -132,7 +132,7 @@ PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, case json_type_array: { count = json_object_array_length(argsJ); if (count > (mixer->max.sinks - mixer->nbSinks)) { - AFB_ReqFailF(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); + afb_req_fail_f(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); goto fail; } @@ -140,14 +140,14 @@ PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, json_object *sinkJ = json_object_array_get_idx(argsJ, idx); AlsaSndPcmT * newSink = sinkCreate(mixer, request, uid, sinkJ); if (!newSink) { - AFB_ReqFailF(request, "bad-pcm", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(sinkJ)); + afb_req_fail_f(request, "bad-pcm", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(sinkJ)); goto fail; } } break; } default: - AFB_ReqFailF(request, "invalid-syntax", "mixer=%s sinks invalid argsJ= %s", mixer->uid, json_object_get_string(argsJ)); + afb_req_fail_f(request, "invalid-syntax", "mixer=%s sinks invalid argsJ= %s", mixer->uid, json_object_get_string(argsJ)); goto fail; } |