Пример #1
0
static void equalizerwin_delete_preset (Index * list, gchar * name, gchar * filename)
{
    int p = equalizerwin_find_preset (list, name);
    if (p < 0)
        return;

    index_delete_full (list, p, 1, (IndexFreeFunc) aud_equalizer_preset_free);

    aud_equalizer_write_presets (list, filename);
}
Пример #2
0
static void equalizerwin_delete_preset (Index * list, gchar * name, gchar * filename)
{
    int p = equalizerwin_find_preset (list, name);
    if (p < 0)
        return;

    EqualizerPreset * preset = index_get (list, p);
    equalizer_preset_free(preset);
    index_delete (list, p, 1);

    aud_equalizer_write_preset_file(list, filename);
}
Пример #3
0
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;
}
Пример #4
0
static void equalizerwin_save_preset (Index * list, const char * name,
                                      const char * filename)
{
    int p = equalizerwin_find_preset (list, name);
    EqualizerPreset * preset = (p >= 0) ? index_get (list, p) : NULL;

    if (! preset)
    {
        preset = aud_equalizer_preset_new (name);
        index_insert (list, -1, preset);
    }

    equalizerwin_update_preset (preset);

    aud_equalizer_write_presets (list, filename);
}
Пример #5
0
static void equalizerwin_save_preset (Index * list, const char * name,
 const char * filename)
{
    int p = equalizerwin_find_preset (list, name);
    EqualizerPreset * preset = (p >= 0) ? index_get (list, p) : NULL;

    if (! preset)
    {
        preset = g_new0(EqualizerPreset, 1);
        preset->name = g_strdup(name);
        index_append (list, preset);
    }

    preset->preamp = equalizerwin_get_preamp();
    for (int i = 0; i < AUD_EQUALIZER_NBANDS; i ++)
        preset->bands[i] = equalizerwin_get_band(i);

    aud_equalizer_write_preset_file(list, filename);
}