summaryrefslogtreecommitdiffstats
path: root/polyp
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-02-03 13:33:21 +0000
committerPierre Ossman <ossman@cendio.se>2006-02-03 13:33:21 +0000
commitd431e0094b95f671a9f557887dc4cfbc40a28d10 (patch)
tree2500af0dc47898f98c43d7d8a09159ed85862c87 /polyp
parentbbc6dd68e22171670271e694f3a42db736eca60d (diff)
Use defines and not hard coded values for volume levels. Caused incorrect
volume levels for all esound clients that changed the volume. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@473 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp')
-rw-r--r--polyp/protocol-esound.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/polyp/protocol-esound.c b/polyp/protocol-esound.c
index ce183a6f..40b0be28 100644
--- a/polyp/protocol-esound.c
+++ b/polyp/protocol-esound.c
@@ -474,7 +474,7 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
assert(k);
for (conn = pa_idxset_first(c->protocol->connections, &idx); conn; conn = pa_idxset_next(c->protocol->connections, &idx)) {
- int format = ESD_BITS16 | ESD_STEREO, rate = 44100, lvolume = 0xFF, rvolume = 0xFF;
+ int format = ESD_BITS16 | ESD_STEREO, rate = 44100, lvolume = ESD_VOLUME_BASE, rvolume = ESD_VOLUME_BASE;
if (conn->state != ESD_STREAMING_DATA)
continue;
@@ -483,8 +483,8 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
if (conn->sink_input) {
rate = conn->sink_input->sample_spec.rate;
- lvolume = (conn->sink_input->volume.values[0]*0xFF)/0x100;
- rvolume = (conn->sink_input->volume.values[1]*0xFF)/0x100;
+ lvolume = (conn->sink_input->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
+ rvolume = (conn->sink_input->volume.values[1]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
format = format_native2esd(&conn->sink_input->sample_spec);
}
@@ -544,11 +544,11 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
response += sizeof(int);
/* left */
- *((int*) response) = maybe_swap_endian_32(c->swap_byte_order, (ce->volume.values[0]*0xFF)/0x100);
+ *((int*) response) = maybe_swap_endian_32(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
response += sizeof(int);
/*right*/
- *((int*) response) = maybe_swap_endian_32(c->swap_byte_order, (ce->volume.values[0]*0xFF)/0x100);
+ *((int*) response) = maybe_swap_endian_32(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
response += sizeof(int);
/*format*/
@@ -578,9 +578,9 @@ static int esd_proto_stream_pan(struct connection *c, PA_GCC_UNUSED esd_proto_t
idx = (uint32_t) maybe_swap_endian_32(c->swap_byte_order, *(const int*)data)-1;
lvolume = (uint32_t) maybe_swap_endian_32(c->swap_byte_order, *((const int*)data + 1));
- lvolume = (lvolume*0x100)/0xFF;
+ lvolume = (lvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
rvolume = (uint32_t) maybe_swap_endian_32(c->swap_byte_order, *((const int*)data + 2));
- rvolume = (rvolume*0x100)/0xFF;
+ rvolume = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
ok = connection_write(c, sizeof(int));
assert(ok);