summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-api-zones.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/alsa/alsa-api-zones.c')
-rw-r--r--plugins/alsa/alsa-api-zones.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/plugins/alsa/alsa-api-zones.c b/plugins/alsa/alsa-api-zones.c
index bf3bece..522058d 100644
--- a/plugins/alsa/alsa-api-zones.c
+++ b/plugins/alsa/alsa-api-zones.c
@@ -28,7 +28,7 @@ PUBLIC AlsaSndZoneT *ApiZoneGetByUid(SoftMixerT *mixer, const char *target) {
AlsaSndZoneT * zone = NULL;
if (mixer->nbZones == 0) {
- AFB_ApiError(mixer->api, "%s mixer=%s does not have any zone", __func__, mixer->uid);
+ AFB_API_ERROR(mixer->api, "%s mixer=%s does not have any zone", __func__, mixer->uid);
goto fail;
}
@@ -39,7 +39,7 @@ PUBLIC AlsaSndZoneT *ApiZoneGetByUid(SoftMixerT *mixer, const char *target) {
}
}
fail:
- AFB_ApiError(mixer->api, "%s mixer=%s fail to find zone=%s", __func__, mixer->uid, target);
+ AFB_API_ERROR(mixer->api, "%s mixer=%s fail to find zone=%s", __func__, mixer->uid, target);
return NULL;
}
@@ -69,7 +69,7 @@ STATIC AlsaPcmChannelT* ProcessOneChannel(SoftMixerT *mixer, const char* uid, js
goto fail_channel;
}
- AFB_ApiDebug(mixer->api, "%s: uid %s, channel uid %s, port %d, volume %f",
+ AFB_API_DEBUG(mixer->api, "%s: uid %s, channel uid %s, port %d, volume %f",
__func__, uid, channel->uid, channel->port, channel->volume);
return channel;
@@ -77,13 +77,13 @@ STATIC AlsaPcmChannelT* ProcessOneChannel(SoftMixerT *mixer, const char* uid, js
fail_channel:
free(channel);
fail:
- AFB_ApiError(mixer->api, "%s: zone=%s channel: missing (target|channel) json=%s", __func__, uid, json_object_get_string(channelJ));
+ AFB_API_ERROR(mixer->api, "%s: zone=%s channel: missing (target|channel) json=%s", __func__, uid, json_object_get_string(channelJ));
return NULL;
}
STATIC AlsaSndZoneT *AttachOneZone(SoftMixerT *mixer, const char *uid, json_object *zoneJ) {
- AFB_ApiDebug(mixer->api, "%s uid %s", __func__, uid);
+ AFB_API_DEBUG(mixer->api, "%s uid %s", __func__, uid);
json_object *sinkJ = NULL, *sourceJ = NULL;
size_t count;
@@ -105,7 +105,7 @@ STATIC AlsaSndZoneT *AttachOneZone(SoftMixerT *mixer, const char *uid, json_obje
, "source", &sourceJ
);
if (error || (!sinkJ && sourceJ)) {
- AFB_ApiNotice(mixer->api, "%s missing 'uid|sink|source' error=%s zone=%s", __func__, wrap_json_get_error_string(error), json_object_get_string(zoneJ));
+ AFB_API_NOTICE(mixer->api, "%s missing 'uid|sink|source' error=%s zone=%s", __func__, wrap_json_get_error_string(error), json_object_get_string(zoneJ));
goto fail_zone;
}
@@ -147,7 +147,7 @@ STATIC AlsaSndZoneT *AttachOneZone(SoftMixerT *mixer, const char *uid, json_obje
}
break;
default:
- AFB_ApiError(mixer->api, "%s: Mixer=%s Hal=%s zone=%s invalid mapping=%s", __func__, mixer->uid, uid, zone->uid, json_object_get_string(sinkJ));
+ AFB_API_ERROR(mixer->api, "%s: Mixer=%s Hal=%s zone=%s invalid mapping=%s", __func__, mixer->uid, uid, zone->uid, json_object_get_string(sinkJ));
goto fail;
}
@@ -177,13 +177,13 @@ STATIC AlsaSndZoneT *AttachOneZone(SoftMixerT *mixer, const char *uid, json_obje
}
break;
default:
- AFB_ApiError(mixer->api, "%s: Mixer=%s Hal=%s zone=%s mapping=%s",
+ AFB_API_ERROR(mixer->api, "%s: Mixer=%s Hal=%s zone=%s mapping=%s",
__func__, mixer->uid, uid, zone->uid, json_object_get_string(sourceJ));
goto fail;
}
}
- AFB_ApiDebug(mixer->api, "%s uid %s DONE", __func__, uid);
+ AFB_API_DEBUG(mixer->api, "%s uid %s DONE", __func__, uid);
return zone;
fail_uid:
@@ -197,10 +197,10 @@ fail:
static void zoneDestroy(SoftMixerT* mixer, void * arg) {
AlsaSndZoneT * zone = (AlsaSndZoneT*) arg;
- AFB_ApiDebug(mixer->api, "%s... %s (%d sinks, %d sources)", __func__, zone->uid, zone->nbSinks, zone->nbSources);
+ AFB_API_DEBUG(mixer->api, "%s... %s (%d sinks, %d sources)", __func__, zone->uid, zone->nbSinks, zone->nbSources);
if (zone->routeConfig) {
- AFB_ApiDebug(mixer->api, "%s... %s delete route config", __func__, zone->uid);
+ AFB_API_DEBUG(mixer->api, "%s... %s delete route config", __func__, zone->uid);
snd_config_delete(zone->routeConfig);
snd_config_update();
zone->routeConfig = NULL;
@@ -218,7 +218,7 @@ static void zoneDestroy(SoftMixerT* mixer, void * arg) {
free((char*) zone->uid);
free(zone);
- AFB_ApiDebug(mixer->api, "%s... DONE !", __func__);
+ AFB_API_DEBUG(mixer->api, "%s... DONE !", __func__);
}
PUBLIC AlsaSndZoneT * zoneCreate(SoftMixerT* mixer, const char * uid, json_object * argsJ) {
@@ -234,7 +234,7 @@ PUBLIC AlsaSndZoneT * zoneCreate(SoftMixerT* mixer, const char * uid, json_objec
AlsaPcmCtlT *routeConfig = AlsaCreateRoute(mixer, zone, 0);
if (!routeConfig) {
- AFB_ApiError(mixer->api,
+ AFB_API_ERROR(mixer->api,
"%s: Mixer=%s Hal=%s zone=%s Fail to attach PCM Route",
__func__, mixer->uid, uid, zone->uid);
goto fail;
@@ -246,12 +246,12 @@ fail:
return zone;
}
-PUBLIC int ApiZoneAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, json_object * argsJ) {
+PUBLIC int ApiZoneAttach(SoftMixerT *mixer, afb_req_t request, const char * uid, json_object * argsJ) {
- AFB_ApiDebug(mixer->api, "%s uid %s", __func__, uid);
+ AFB_API_DEBUG(mixer->api, "%s uid %s", __func__, uid);
if (mixer->nbZones >= mixer->max.zones) {
- AFB_ReqFailF(request, "too-small", "mixer=%s max zone=%d", mixer->uid, mixer->max.zones);
+ afb_req_fail_f(request, "too-small", "mixer=%s max zone=%d", mixer->uid, mixer->max.zones);
goto OnErrorExit;
}
@@ -261,7 +261,7 @@ PUBLIC int ApiZoneAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid,
case json_type_object: {
AlsaSndZoneT * newZone = zoneCreate(mixer, uid, argsJ);
if (!newZone) {
- AFB_ReqFailF(request, "bad-zone", "mixer=%s invalid zone= %s", mixer->uid, json_object_get_string(argsJ));
+ afb_req_fail_f(request, "bad-zone", "mixer=%s invalid zone= %s", mixer->uid, json_object_get_string(argsJ));
goto OnErrorExit;
}
break;
@@ -269,7 +269,7 @@ PUBLIC int ApiZoneAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid,
case json_type_array:
count = json_object_array_length(argsJ);
if (count > (mixer->max.zones - mixer->nbZones)) {
- AFB_ReqFailF(request, "too-small", "mixer=%s max zone=%d", mixer->uid, mixer->max.zones);
+ afb_req_fail_f(request, "too-small", "mixer=%s max zone=%d", mixer->uid, mixer->max.zones);
goto OnErrorExit;
}
@@ -277,17 +277,17 @@ PUBLIC int ApiZoneAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid,
json_object *zoneJ = json_object_array_get_idx(argsJ, idx);
AlsaSndZoneT * newZone = zoneCreate(mixer, uid, zoneJ);
if (!newZone) {
- AFB_ReqFailF(request, "bad-zone", "mixer=%s invalid zone= %s", mixer->uid, json_object_get_string(zoneJ));
+ afb_req_fail_f(request, "bad-zone", "mixer=%s invalid zone= %s", mixer->uid, json_object_get_string(zoneJ));
goto OnErrorExit;
}
}
break;
default:
- AFB_ReqFailF(request, "invalid-syntax", "mixer=%s zones invalid argsJ= %s", mixer->uid, json_object_get_string(argsJ));
+ afb_req_fail_f(request, "invalid-syntax", "mixer=%s zones invalid argsJ= %s", mixer->uid, json_object_get_string(argsJ));
goto OnErrorExit;
}
- AFB_ApiDebug(mixer->api, "%s uid %s DONE", __func__, uid);
+ AFB_API_DEBUG(mixer->api, "%s uid %s DONE", __func__, uid);
return 0;
OnErrorExit: