Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
void eqslider_button_press_cb(GtkWidget * w, GdkEventButton * event, gpointer data)
{
	EqSlider *es = (EqSlider *) data;
	gint y;

	if (inside_widget(event->x, event->y, &es->es_widget))
	{
		if (event->button == 1)
		{
			y = event->y - es->es_widget.y;
			es->es_isdragging = TRUE;
			if (y >= es->es_position && y < es->es_position + 11)
				es->es_drag_y = y - es->es_position;
			else
			{
				es->es_position = y - 5;
				es->es_drag_y = 5;
				if (es->es_position < 0)
					es->es_position = 0;
				if (es->es_position > 50)
					es->es_position = 50;
				if (es->es_position >= 24 && es->es_position <= 26)
					es->es_position = 25;
				equalizerwin_eq_changed();
			}
			eqslider_set_mainwin_text(es);
			draw_widget(es);
		}
		if (event->button == 4)
		{
			es->es_position -= 2;
			if (es->es_position < 0)
				es->es_position = 0;
			equalizerwin_eq_changed();
			draw_widget(es);
		}
		if (event->button == 5)
		{
			es->es_position += 2;
			if (es->es_position > 50)
				es->es_position = 50;
			equalizerwin_eq_changed();
			draw_widget(es);
		}
	}
}
Ejemplo n.º 3
0
void eqslider_motion_cb(GtkWidget * w, GdkEventMotion * event, gpointer data)
{
	EqSlider *es = (EqSlider *) data;
	gint y;

	y = event->y - es->es_widget.y;
	if (es->es_isdragging)
	{
		es->es_position = y - es->es_drag_y;
		if (es->es_position < 0)
			es->es_position = 0;
		if (es->es_position > 50)
			es->es_position = 50;
		if (es->es_position >= 24 && es->es_position <= 26)
			es->es_position = 25;
		equalizerwin_eq_changed();
		eqslider_set_mainwin_text(es);
		draw_widget(es);
	}
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
static void equalizerwin_set_band (gint band, gfloat value)
{
    g_return_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS);
    eq_slider_set_val (equalizerwin_bands[band], value);
    equalizerwin_eq_changed();
}
Ejemplo n.º 6
0
static void equalizerwin_set_preamp (gfloat preamp)
{
    eq_slider_set_val (equalizerwin_preamp, preamp);
    equalizerwin_eq_changed();
}