static void
equalizerwin_read_winamp_eqf(VFSFile * file)
{
    Index * presets = aud_import_winamp_presets (file);

    if (! presets)
    {
        SPRINTF (error, _("Error importing Winamp EQF file '%s'"), vfs_get_filename (file));
        aud_interface_show_error (error);
        return;
    }

    if (! index_count (presets))
        goto DONE;

    /* just get the first preset --asphyx */
    EqualizerPreset * preset = index_get (presets, 0);
    equalizerwin_set_preamp(preset->preamp);

    for (int i = 0; i < AUD_EQUALIZER_NBANDS; i ++)
        equalizerwin_set_band(i, preset->bands[i]);

    equalizerwin_eq_changed();

DONE:
    index_free_full (presets, (IndexFreeFunc) aud_equalizer_preset_free);
}
void
action_equ_zero_preset(void)
{
    gint i;

    equalizerwin_set_preamp(0);
    for (i = 0; i < AUD_EQUALIZER_NBANDS; i++)
        equalizerwin_set_band(i, 0);
}
static void
equalizerwin_apply_preset(EqualizerPreset *preset)
{
    if (preset == NULL)
        return;

    gint i;

    equalizerwin_set_preamp(preset->preamp);
    for (i = 0; i < AUD_EQUALIZER_NBANDS; i++)
        equalizerwin_set_band(i, preset->bands[i]);
}
static bool_t equalizerwin_load_preset (Index * list, const char * name)
{
    int p = equalizerwin_find_preset (list, name);
    if (p < 0)
        return FALSE;

    EqualizerPreset * preset = index_get (list, p);
    equalizerwin_set_preamp (preset->preamp);

    for (int i = 0; i < AUD_EQUALIZER_NBANDS; i ++)
        equalizerwin_set_band (i, preset->bands[i]);

    return TRUE;
}
static void
equalizerwin_read_winamp_eqf(VFSFile * file)
{
    Index * presets;
    if ((presets = aud_import_winamp_eqf(file)) == NULL)
        return;

    if (! index_count (presets))
        goto DONE;

    /* just get the first preset --asphyx */
    EqualizerPreset * preset = index_get (presets, 0);
    equalizerwin_set_preamp(preset->preamp);

    for (int i = 0; i < AUD_EQUALIZER_NBANDS; i ++)
        equalizerwin_set_band(i, preset->bands[i]);

    equalizerwin_eq_changed();

DONE:
    free_presets (presets);
}