forked from enlightenment/enlightenment
Merge branch 'devs/bu5hm4n/mixer'
This merge fixes problems which where discovered by the mail "[e-users] alsa NOT mixer?"
This commit is contained in:
commit
c61320ce72
|
@ -352,14 +352,13 @@ static void
|
|||
_slider_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||
void *event EINA_UNUSED)
|
||||
{
|
||||
int val, pval;
|
||||
int val;
|
||||
Emix_Volume v;
|
||||
unsigned int i;
|
||||
Emix_Sink *s = (Emix_Sink *)mixer_context->sink_default;
|
||||
|
||||
pval = s->volume.volumes[0];
|
||||
|
||||
val = (int)elm_slider_value_get(obj);
|
||||
if ((pval > 80) && (pval <= 100) && (val > 100) && (val < 120)) val = 100;
|
||||
v.volumes = calloc(s->volume.channel_count, sizeof(int));
|
||||
v.channel_count = s->volume.channel_count;
|
||||
for (i = 0; i < s->volume.channel_count; i++) v.volumes[i] = val;
|
||||
|
@ -639,7 +638,10 @@ _sink_event(int type, void *info)
|
|||
if (sink == mixer_context->sink_default)
|
||||
{
|
||||
l = emix_sinks_get();
|
||||
mixer_context->sink_default = l->data;
|
||||
if (l)
|
||||
mixer_context->sink_default = l->data;
|
||||
else
|
||||
mixer_context->sink_default = NULL;
|
||||
_mixer_gadget_update();
|
||||
}
|
||||
}
|
||||
|
@ -670,7 +672,10 @@ _ready(void)
|
|||
if (emix_sink_default_support())
|
||||
mixer_context->sink_default = emix_sink_default_get();
|
||||
else
|
||||
mixer_context->sink_default = emix_sinks_get()->data;
|
||||
{
|
||||
if (emix_sinks_get())
|
||||
mixer_context->sink_default = emix_sinks_get()->data;
|
||||
}
|
||||
|
||||
_mixer_gadget_update();
|
||||
}
|
||||
|
|
|
@ -188,9 +188,9 @@ _alsa_device_sink_create(const char *name, const char* hw_name,
|
|||
return NULL;
|
||||
}
|
||||
sink->sink.name = eina_stringshare_add(name);
|
||||
_alsa_volume_create(&sink->sink.volume, channels);
|
||||
sink->hw_name = eina_stringshare_add(hw_name);
|
||||
sink->channels = channels;
|
||||
_alsa_volume_create(&sink->sink.volume, channels);
|
||||
_alsa_sink_mute_get(sink);
|
||||
if (ctx->cb)
|
||||
{
|
||||
|
@ -214,9 +214,9 @@ _alsa_device_source_create(const char *name, const char* hw_name,
|
|||
return NULL;
|
||||
}
|
||||
source->source.name = eina_stringshare_add(name);
|
||||
_alsa_volume_create(&source->source.volume, channels);
|
||||
source->hw_name = eina_stringshare_add(hw_name);
|
||||
source->channels = channels;
|
||||
_alsa_volume_create(&source->source.volume, channels);
|
||||
_alsa_sources_mute_get(source);
|
||||
if (ctx->cb)
|
||||
ctx->cb((void *)ctx->userdata, EMIX_SOURCE_ADDED_EVENT,
|
||||
|
@ -305,7 +305,7 @@ _alsa_cards_refresh(void)
|
|||
//check if its a source or a sink
|
||||
if (snd_mixer_selem_has_capture_volume(elem))
|
||||
tmp_source = eina_list_append(tmp_source, elem);
|
||||
else
|
||||
else if (snd_mixer_selem_has_playback_volume(elem))
|
||||
tmp_sink = eina_list_append(tmp_sink, elem);
|
||||
}
|
||||
|
||||
|
@ -420,7 +420,11 @@ _alsa_sources_volume_set(Emix_Source *source, Emix_Volume v)
|
|||
{
|
||||
elem = eina_list_nth(s->channels, i);
|
||||
_alsa_channel_volume_set(elem, v.volumes[i], EINA_FALSE);
|
||||
s->source.volume.volumes[i] = v.volumes[i];
|
||||
}
|
||||
if (ctx->cb)
|
||||
ctx->cb((void *)ctx->userdata, EMIX_SOURCE_CHANGED_EVENT,
|
||||
(Emix_Source *)s);
|
||||
}
|
||||
|
||||
|
||||
|
@ -488,7 +492,11 @@ _alsa_sink_volume_set(Emix_Sink *sink, Emix_Volume v)
|
|||
{
|
||||
elem = eina_list_nth(s->channels, i);
|
||||
_alsa_channel_volume_set(elem, v.volumes[i], EINA_FALSE);
|
||||
s->sink.volume.volumes[i] = v.volumes[i];
|
||||
}
|
||||
if (ctx->cb)
|
||||
ctx->cb((void *)ctx->userdata, EMIX_SINK_CHANGED_EVENT,
|
||||
(Emix_Sink *)s);
|
||||
}
|
||||
|
||||
static Emix_Backend
|
||||
|
|
Loading…
Reference in New Issue