char *name;
int client_idx;
int sink_idx;
+ uns channels;
uns volume;
uns mute;
};
return;
}
- DBG("Pulse: SINK INPUT #%u: %s client=%d sink=%d has_vol=%d vol_rw=%d volume=%u mute=%d",
- i->index, i->name, i->client, i->sink, i->has_volume, i->volume_writable, i->volume.values[0], i->mute);
+ DBG("Pulse: SINK INPUT #%u: %s client=%d sink=%d chans=%d has_vol=%d vol_rw=%d volume=%u mute=%d",
+ i->index, i->name, i->client, i->sink, i->channel_map.channels, i->has_volume, i->volume_writable, i->volume.values[0], i->mute);
pulse_dump_proplist(i->proplist);
struct pulse_sink_input *s = pulse_sink_input_lookup(i->index);
SET_STRING(s->name, i->name);
s->client_idx = i->client;
s->sink_idx = i->sink;
+ s->channels = i->channel_map.channels;
s->volume = pa_cvolume_avg(&i->volume);
s->mute = i->mute;
schedule_update();
struct pulse_sink {
int idx;
char *name;
+ uns channels;
uns volume;
uns base_volume;
int mute;
return;
}
- DBG("Pulse: SINK #%u: %s (%s) flags=%08x volume=%u mute=%d base_vol=%u state=%u",
- i->index, i->name, i->description, i->flags, i->volume.values[0], i->mute, i->base_volume, i->state);
+ DBG("Pulse: SINK #%u: %s (%s) flags=%08x channels=%u volume=%u mute=%d base_vol=%u state=%u",
+ i->index, i->name, i->description, i->flags, i->channel_map.channels, i->volume.values[0], i->mute, i->base_volume, i->state);
pulse_dump_proplist(i->proplist);
struct pulse_sink *s = pulse_sink_lookup(i->index);
SET_STRING(s->name, i->name);
+ s->channels = i->channel_map.channels;
s->volume = pa_cvolume_avg(&i->volume);
s->base_volume = i->base_volume;
s->mute = i->mute;
HASH_FOR_ALL(pulse_sink, s)
{
- DBG("## Sink #%d: %s volume=%u base_vol=%u mute=%u",
- s->idx, s->name, s->volume, s->base_volume, s->mute);
+ DBG("## Sink #%d: %s channels=%u volume=%u base_vol=%u mute=%u",
+ s->idx, s->name, s->channels, s->volume, s->base_volume, s->mute);
}
HASH_END_FOR;
HASH_FOR_ALL(pulse_sink_input, s)
{
- DBG("## Sink input #%d: %s client=%d sink=%d volume=%u mute=%u",
- s->idx, s->name, s->client_idx, s->sink_idx, s->volume, s->mute);
+ DBG("## Sink input #%d: %s client=%d sink=%d channels=%u volume=%u mute=%u",
+ s->idx, s->name, s->client_idx, s->sink_idx, s->channels, s->volume, s->mute);
}
HASH_END_FOR;
}
void schedule_update(void)
{
- timer_add_rel(&update_timer, 10); // FIXME
+ timer_add_rel(&update_timer, 10);
}
static void update_sink_from_rotary(int delta, const char *sink_name)
if (pavol == s->volume)
return;
pa_cvolume cvol;
- pa_cvolume_set(&cvol, 2, pavol);
+ pa_cvolume_set(&cvol, s->channels, pavol);
DBG("## Setting volume of sink %s to %d", s->name, cvol.values[0]);
PULSE_ASYNC_RUN(pa_context_set_sink_volume_by_index, pulse_ctx, s->idx, &cvol, pulse_success_cb);
{
DBG("@@ Client #%d, sink input #%d: setting volume=%u", s->client_idx, s->idx, pavol);
pa_cvolume cvol;
- pa_cvolume_set(&cvol, 2, pavol); // FIXME: #channels
+ pa_cvolume_set(&cvol, s->channels, pavol);
PULSE_ASYNC_RUN(pa_context_set_sink_input_volume, pulse_ctx, s->idx, &cvol, pulse_success_cb);
}
}