Ejemplo n.º 1
0
static void clear_infowin (void)
{
    gtk_entry_set_text ((GtkEntry *) entry_title, "");
    gtk_entry_set_text ((GtkEntry *) entry_artist, "");
    gtk_entry_set_text ((GtkEntry *) entry_album, "");
    gtk_entry_set_text ((GtkEntry *) entry_comment, "");
    gtk_entry_set_text ((GtkEntry *) gtk_bin_get_child ((GtkBin *) entry_genre),
     "");
    gtk_entry_set_text ((GtkEntry *) entry_year, "");
    gtk_entry_set_text ((GtkEntry *) entry_track, "");

    infowin_label_set_text (label_format_name, NULL);
    infowin_label_set_text (label_quality, NULL);
    infowin_label_set_text (label_bitrate, NULL);

    gtk_label_set_text ((GtkLabel *) label_mini_status,
     "<span size=\"small\"></span>");
    gtk_label_set_use_markup ((GtkLabel *) label_mini_status, TRUE);

    g_free (current_file);
    current_file = NULL;
    current_decoder = NULL;

    something_changed = FALSE;
    can_write = FALSE;
    gtk_widget_set_sensitive (btn_apply, FALSE);
    gtk_image_clear ((GtkImage *) image_artwork);
}
Ejemplo n.º 2
0
static void infowin_show (gint list, gint entry, const gchar * filename,
 const Tuple * tuple, PluginHandle * decoder, gboolean updating_enabled)
{
    gchar * tmp;

    if (infowin == NULL)
        create_infowin ();
    else
        clear_infowin ();

    current_file = g_strdup (filename);
    current_decoder = decoder;
    can_write = updating_enabled;

    set_entry_str_from_field (entry_title, tuple, FIELD_TITLE, updating_enabled);
    set_entry_str_from_field (entry_artist, tuple, FIELD_ARTIST,
     updating_enabled);
    set_entry_str_from_field (entry_album, tuple, FIELD_ALBUM, updating_enabled);
    set_entry_str_from_field (entry_comment, tuple, FIELD_COMMENT,
     updating_enabled);
    set_entry_str_from_field (gtk_bin_get_child ((GtkBin *) entry_genre), tuple,
     FIELD_GENRE, updating_enabled);

    tmp = uri_to_display (filename);
    gtk_label_set_text ((GtkLabel *) location_text, tmp);
    g_free (tmp);

    set_entry_int_from_field (entry_year, tuple, FIELD_YEAR, updating_enabled);
    set_entry_int_from_field (entry_track, tuple, FIELD_TRACK_NUMBER,
     updating_enabled);

    infowin_label_set_text (label_format_name, tuple_get_string (tuple,
     FIELD_CODEC, NULL));
    infowin_label_set_text (label_quality, tuple_get_string (tuple,
     FIELD_QUALITY, NULL));

    if (tuple_get_value_type (tuple, FIELD_BITRATE, NULL) == TUPLE_INT)
    {
        tmp = g_strdup_printf (_("%d kb/s"), tuple_get_int (tuple,
         FIELD_BITRATE, NULL));
        infowin_label_set_text (label_bitrate, tmp);
        g_free (tmp);
    }
    else
        infowin_label_set_text (label_bitrate, NULL);

    infowin_entry_set_image (image_artwork, list, entry);

    gtk_window_present ((GtkWindow *) infowin);
}