X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/5b053666c0488ce2b0f0acc4304ac1a1d92a7035..b50cfb8a0d4fc71877ae0bfcd7b28879886a2ac1:/server/server.c diff --git a/server/server.c b/server/server.c index 2874357..345c2ca 100644 --- a/server/server.c +++ b/server/server.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004-2008 Richard Kettlewell + * Copyright (C) 2004-2009 Richard Kettlewell * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -825,17 +825,18 @@ static int c_volume(struct conn *c, sink_writes(ev_writer_sink(c->w), "510 Prohibited\n"); return 1; } - if(mixer_control(-1/*as configured*/, &l, &r, set)) + if(!api || !api->set_volume) { sink_writes(ev_writer_sink(c->w), "550 error accessing mixer\n"); - else { - sink_printf(ev_writer_sink(c->w), "252 %d %d\n", l, r); - if(l != volume_left || r != volume_right) { - volume_left = l; - volume_right = r; - snprintf(lb, sizeof lb, "%d", l); - snprintf(rb, sizeof rb, "%d", r); - eventlog("volume", lb, rb, (char *)0); - } + return 1; + } + api->set_volume(&l, &r); + sink_printf(ev_writer_sink(c->w), "252 %d %d\n", l, r); + if(l != volume_left || r != volume_right) { + volume_left = l; + volume_right = r; + snprintf(lb, sizeof lb, "%d", l); + snprintf(rb, sizeof rb, "%d", r); + eventlog("volume", lb, rb, (char *)0); } return 1; } @@ -1098,7 +1099,7 @@ static int c_new(struct conn *c, static int c_rtp_address(struct conn *c, char attribute((unused)) **vec, int attribute((unused)) nvec) { - if(config->api == BACKEND_NETWORK) { + if(api == &uaudio_rtp) { sink_printf(ev_writer_sink(c->w), "252 %s %s\n", quoteutf8(config->broadcast.s[0]), quoteutf8(config->broadcast.s[1]));