Commit e911cf1f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: fix and partly clean-up the "visual" callback

parent 66ffb52c
...@@ -275,52 +275,27 @@ static block_t *aout_FiltersPipelinePlay(filter_t *const *filters, ...@@ -275,52 +275,27 @@ static block_t *aout_FiltersPipelinePlay(filter_t *const *filters,
} }
/** Callback for visualization selection */ /** Callback for visualization selection */
static int VisualizationCallback (vlc_object_t *obj, char const *var, static int VisualizationCallback (vlc_object_t *obj, const char *var,
vlc_value_t oldval, vlc_value_t newval, vlc_value_t oldval, vlc_value_t newval,
void *data) void *data)
{ {
audio_output_t *aout = (audio_output_t *)obj;
const char *mode = newval.psz_string; const char *mode = newval.psz_string;
if (!*mode) if (!*mode)
{ mode = "none";
ChangeFiltersString (obj, "audio-visual", "goom", false); /* FIXME: This ugly hack enforced by visual effect-list, as is the need for
ChangeFiltersString (obj, "audio-visual", "visual", false); * separate "visual" (external) and "audio-visual" (internal) variables...
ChangeFiltersString (obj, "audio-visual", "projectm", false); * The visual plugin should have one submodule per effect instead. */
ChangeFiltersString (obj, "audio-visual", "vsxu", false); if (strcasecmp (mode, "none") && strcasecmp (mode, "goom")
} && strcasecmp (mode, "projectm") && strcasecmp (mode, "vsxu"))
else if (!strcmp ("goom", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false );
ChangeFiltersString (obj, "audio-visual", "goom", true );
ChangeFiltersString (obj, "audio-visual", "projectm", false );
ChangeFiltersString (obj, "audio-visual", "vsxu", false);
}
else if (!strcmp ("projectm", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false);
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "projectm", true);
ChangeFiltersString (obj, "audio-visual", "vsxu", false);
}
else if (!strcmp ("vsxu", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false);
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "projectm", false);
ChangeFiltersString (obj, "audio-visual", "vsxu", true);
}
else
{ {
var_Create (obj, "effect-list", VLC_VAR_STRING); var_Create (obj, "effect-list", VLC_VAR_STRING);
var_SetString (obj, "effect-list", mode); var_SetString (obj, "effect-list", mode);
mode = "visual";
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "visual", true);
ChangeFiltersString (obj, "audio-visual", "projectm", false);
} }
aout_InputRequestRestart (aout); var_SetString (obj, "audio-visual", mode);
aout_InputRequestRestart ((audio_output_t *)obj);
(void) var; (void) oldval; (void) data; (void) var; (void) oldval; (void) data;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment