annotate src/audacious/ui_fileinfopopup.c @ 2516:a2b862cb4269 trunk

[svn] - avoid double free while playing cdda.
author yaz
date Wed, 14 Feb 2007 06:42:50 -0800
parents ba8c2a94262c
children 98d02ad44f3b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
1 /*
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
2 * Audacious: A cross-platform multimedia player
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
3 * Copyright (c) 2006 William Pitcock, Tony Vroon, George Averill,
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
4 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa.
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
5 *
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
8 * the Free Software Foundation; under version 2 of the License.
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
9 *
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
13 * GNU General Public License for more details.
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
14 *
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
18 * 02110-1301, USA.
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
19 */
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
20
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
21 #ifdef HAVE_CONFIG_H
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
22 # include "config.h"
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
23 #endif
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
24
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
25 #include <glib.h>
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
26 #include <glib/gi18n.h>
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
27 #include <gtk/gtk.h>
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
28 #include <string.h>
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
29
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
30 #include "titlestring.h"
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
31 #include "ui_fileinfopopup.h"
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
32 #include "main.h"
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
33 #include "ui_main.h"
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
34 #include "playlist.h"
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
35 #include "playback.h"
2442
44df6c17411b [svn] - split out albumart locating functions into a seperate file and make the public API available in util.h
nenolod
parents: 2428
diff changeset
36 #include "util.h"
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
37
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
38 static void
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
39 filepopup_entry_set_text(GtkWidget *filepopup_win, const char *entry_name, const char *text)
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
40 {
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
41 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name);
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
42
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
43 if (widget == NULL)
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
44 return;
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
45
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
46 gtk_label_set_text( GTK_LABEL(widget) , text );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
47 return;
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
48 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
49
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
50 static void
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
51 filepopup_entry_set_image(GtkWidget *filepopup_win, const char *entry_name, const char *text)
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
52 {
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
53 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name);
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
54 GdkPixbuf *pixbuf;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
55 int width, height;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
56 double aspect;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
57 GdkPixbuf *pixbuf2;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
58
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
59 if (widget == NULL)
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
60 return;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
61
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
62 pixbuf = gdk_pixbuf_new_from_file(text, NULL);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
63
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
64 if (pixbuf == NULL)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
65 return;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
66
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
67 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf));
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
68 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf));
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
69
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
70 if(strcmp(DATA_DIR "/images/audio.png", text))
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
71 {
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
72 if(width == 0)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
73 width = 1;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
74 aspect = (double)height / (double)width;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
75 if(aspect > 1.0) {
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
76 height = (int)(cfg.filepopup_pixelsize * aspect);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
77 width = cfg.filepopup_pixelsize;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
78 } else {
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
79 height = cfg.filepopup_pixelsize;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
80 width = (int)(cfg.filepopup_pixelsize / aspect);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
81 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
82 pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), width, height, GDK_INTERP_BILINEAR);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
83 g_object_unref(G_OBJECT(pixbuf));
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
84 pixbuf = pixbuf2;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
85 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
86
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
87 gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf));
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
88 g_object_unref(G_OBJECT(pixbuf));
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
89 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
90
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
91 static void
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
92 filepopup_entry_set_text_free(GtkWidget *filepopup_win, const char *entry_name, char *text)
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
93 {
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
94 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name);
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
95
2484
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
96 if (widget == NULL || text == NULL)
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
97 return;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
98
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
99 gtk_label_set_text(GTK_LABEL(widget), text);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
100
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
101 g_free(text);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
102 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
103
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
104 static gboolean
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
105 audacious_fileinfopopup_progress_cb ( gpointer filepopup_win )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
106 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
107 GtkWidget *progressbar = g_object_get_data( G_OBJECT(filepopup_win) , "progressbar" );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
108 gchar *tooltip_file = g_object_get_data( G_OBJECT(filepopup_win) , "file" );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
109 gchar *current_file;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
110 Playlist *pl;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
111 gint length = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(filepopup_win) , "length" ));
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
112 gint pos;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
113 gint time;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
114
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
115 pl = playlist_get_active();
2484
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
116
2487
ba8c2a94262c [svn] - suppress warning
yaz
parents: 2484
diff changeset
117 g_return_val_if_fail(pl != NULL, FALSE);
2484
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
118
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
119 pos = playlist_get_position(pl);
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
120
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
121 current_file = playlist_get_filename( pl , pos );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
122 time = playback_get_time();
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
123
2484
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
124 if (current_file == NULL)
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
125 return FALSE;
adc63272c9ff [svn] - add some debugging assertions to this code
nenolod
parents: 2442
diff changeset
126
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
127 if ( ( time != -1 ) &&
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
128 ( length != -1 ) &&
2428
e832d4981008 [svn] - make sure tooltip_file != NULL otherwise filepopup may crash in strcmp().
yaz
parents: 2405
diff changeset
129 ( ( current_file != NULL ) && ( tooltip_file != NULL ) &&
e832d4981008 [svn] - make sure tooltip_file != NULL otherwise filepopup may crash in strcmp().
yaz
parents: 2405
diff changeset
130 ( !strcmp(tooltip_file, current_file) ) && ( cfg.filepopup_showprogressbar ) ) )
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
131 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
132 gchar *progress_time = g_strdup_printf("%d:%02d", time / 60000, (time / 1000) % 60);
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
133 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(progressbar) , (gdouble)time / (gdouble)length );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
134 gtk_progress_bar_set_text( GTK_PROGRESS_BAR(progressbar) , progress_time );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
135 g_free( progress_time );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
136 if ( GTK_WIDGET_VISIBLE(progressbar) != TRUE )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
137 gtk_widget_show(progressbar);
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
138 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
139 else
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
140 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
141 /* tooltip opened, but song is not the same,
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
142 or playback is stopped, or length is not applicabile */
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
143 if ( GTK_WIDGET_VISIBLE(progressbar) == TRUE )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
144 gtk_widget_hide(progressbar);
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
145 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
146
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
147 return TRUE;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
148 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
149
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
150 static gboolean
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
151 audacious_fileinfopopup_progress_check_active ( GtkWidget * filepopup_win )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
152 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
153 if ( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(filepopup_win),"progress_sid")) == 0 )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
154 return FALSE;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
155 else
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
156 return TRUE;
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
157 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
158
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
159 static void
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
160 audacious_fileinfopopup_progress_init ( GtkWidget * filepopup_win )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
161 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
162 g_object_set_data( G_OBJECT(filepopup_win) , "progress_sid" , GINT_TO_POINTER(0) );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
163 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
164
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
165 static void
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
166 audacious_fileinfopopup_progress_start ( GtkWidget * filepopup_win )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
167 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
168 gint sid = g_timeout_add( 500 , (GSourceFunc)audacious_fileinfopopup_progress_cb , filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
169 g_object_set_data( G_OBJECT(filepopup_win) , "progress_sid" , GINT_TO_POINTER(sid) );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
170 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
171
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
172 static void
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
173 audacious_fileinfopopup_progress_stop ( GtkWidget * filepopup_win )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
174 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
175 gint sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(filepopup_win),"progress_sid"));
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
176 if ( sid != 0 )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
177 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
178 g_source_remove( sid );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
179 g_object_set_data(G_OBJECT(filepopup_win),"progress_sid",GINT_TO_POINTER(0));
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
180 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
181 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
182
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
183
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
184
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
185 GtkWidget *
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
186 audacious_fileinfopopup_create(void)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
187 {
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
188 GtkWidget *filepopup_win;
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
189 GtkWidget *filepopup_hbox;
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
190 GtkWidget *filepopup_data_image;
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
191 GtkWidget *filepopup_data_table;
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
192 GtkWidget *filepopup_data_info_header[7];
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
193 GtkWidget *filepopup_data_info_label[7];
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
194 GtkWidget *filepopup_progress;
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
195 gchar *markup;
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
196
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
197 filepopup_win = gtk_window_new( GTK_WINDOW_POPUP );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
198 gtk_window_set_decorated( GTK_WINDOW(filepopup_win), FALSE );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
199 gtk_container_set_border_width( GTK_CONTAINER(filepopup_win) , 6 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
200 gtk_window_set_transient_for( GTK_WINDOW(filepopup_win) , GTK_WINDOW(mainwin) );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
201
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
202 filepopup_hbox = gtk_hbox_new( FALSE , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
203 gtk_container_add( GTK_CONTAINER(filepopup_win) , filepopup_hbox );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
204
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
205 filepopup_data_image = gtk_image_new();
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
206 gtk_misc_set_alignment( GTK_MISC(filepopup_data_image) , 0.5 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
207 gtk_image_set_from_file( GTK_IMAGE(filepopup_data_image) , DATA_DIR "/images/audio.png" );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
208 g_object_set_data( G_OBJECT(filepopup_win) , "image_artwork" , filepopup_data_image );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
209 g_object_set_data( G_OBJECT(filepopup_win) , "last_artwork" , NULL );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
210 gtk_box_pack_start( GTK_BOX(filepopup_hbox) , filepopup_data_image , FALSE , FALSE , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
211
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
212 gtk_box_pack_start( GTK_BOX(filepopup_hbox) , gtk_vseparator_new() , FALSE , FALSE , 6 );
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
213
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
214 filepopup_data_table = gtk_table_new( 8 , 2 , FALSE );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
215 gtk_table_set_row_spacings( GTK_TABLE(filepopup_data_table) , 0 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
216 gtk_table_set_col_spacings( GTK_TABLE(filepopup_data_table) , 6 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
217 gtk_box_pack_start( GTK_BOX(filepopup_hbox) , filepopup_data_table , TRUE , TRUE , 0 );
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
218
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
219 /* title */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
220 filepopup_data_info_header[0] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
221 filepopup_data_info_label[0] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
222 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[0]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
223 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[0]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
224 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[0]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
225 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[0]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
226 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Title") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
227 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[0]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
228 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
229 g_object_set_data( G_OBJECT(filepopup_win) , "header_title" , filepopup_data_info_header[0] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
230 g_object_set_data( G_OBJECT(filepopup_win) , "label_title" , filepopup_data_info_label[0] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
231 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[0] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
232 0 , 1 , 0 , 1 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
233 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[0] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
234 1 , 2 , 0 , 1 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
235
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
236 /* artist */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
237 filepopup_data_info_header[1] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
238 filepopup_data_info_label[1] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
239 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[1]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
240 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[1]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
241 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[1]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
242 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[1]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
243 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Artist") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
244 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[1]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
245 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
246 g_object_set_data( G_OBJECT(filepopup_win) , "header_artist" , filepopup_data_info_header[1] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
247 g_object_set_data( G_OBJECT(filepopup_win) , "label_artist" , filepopup_data_info_label[1] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
248 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[1] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
249 0 , 1 , 1 , 2 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
250 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[1] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
251 1 , 2 , 1 , 2 , GTK_FILL , 0 , 0 , 0 );
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
252
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
253 /* album */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
254 filepopup_data_info_header[2] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
255 filepopup_data_info_label[2] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
256 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[2]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
257 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[2]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
258 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[2]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
259 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[2]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
260 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Album") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
261 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[2]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
262 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
263 g_object_set_data( G_OBJECT(filepopup_win) , "header_album" , filepopup_data_info_header[2] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
264 g_object_set_data( G_OBJECT(filepopup_win) , "label_album" , filepopup_data_info_label[2] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
265 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[2] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
266 0 , 1 , 2 , 3 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
267 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[2] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
268 1 , 2 , 2 , 3 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
269
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
270 /* genre */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
271 filepopup_data_info_header[3] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
272 filepopup_data_info_label[3] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
273 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[3]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
274 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[3]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
275 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[3]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
276 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[3]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
277 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Genre") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
278 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[3]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
279 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
280 g_object_set_data( G_OBJECT(filepopup_win) , "header_genre" , filepopup_data_info_header[3] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
281 g_object_set_data( G_OBJECT(filepopup_win) , "label_genre" , filepopup_data_info_label[3] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
282 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[3] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
283 0 , 1 , 3 , 4 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
284 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[3] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
285 1 , 2 , 3 , 4 , GTK_FILL , 0 , 0 , 0 );
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
286
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
287 /* year */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
288 filepopup_data_info_header[4] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
289 filepopup_data_info_label[4] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
290 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[4]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
291 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[4]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
292 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[4]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
293 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[4]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
294 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Year") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
295 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[4]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
296 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
297 g_object_set_data( G_OBJECT(filepopup_win) , "header_year" , filepopup_data_info_header[4] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
298 g_object_set_data( G_OBJECT(filepopup_win) , "label_year" , filepopup_data_info_label[4] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
299 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[4] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
300 0 , 1 , 4 , 5 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
301 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[4] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
302 1 , 2 , 4 , 5 , GTK_FILL , 0 , 0 , 0 );
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
303
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
304 /* Track Number */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
305 filepopup_data_info_header[5] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
306 filepopup_data_info_label[5] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
307 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[5]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
308 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[5]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
309 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[5]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
310 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[5]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
311 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Track Number") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
312 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[5]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
313 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
314 g_object_set_data( G_OBJECT(filepopup_win) , "header_tracknum" , filepopup_data_info_header[5] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
315 g_object_set_data( G_OBJECT(filepopup_win) , "label_tracknum" , filepopup_data_info_label[5] );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
316 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[5] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
317 0 , 1 , 5 , 6 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
318 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[5] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
319 1 , 2 , 5 , 6 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
320
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
321 /* Track Length */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
322 filepopup_data_info_header[6] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
323 filepopup_data_info_label[6] = gtk_label_new("");
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
324 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_header[6]) , 0 , 0.5 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
325 gtk_misc_set_alignment( GTK_MISC(filepopup_data_info_label[6]) , 0 , 0.5 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
326 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_header[6]) , 0 , 3 );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
327 gtk_misc_set_padding( GTK_MISC(filepopup_data_info_label[6]) , 0 , 3 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
328 markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Track Length") );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
329 gtk_label_set_markup( GTK_LABEL(filepopup_data_info_header[6]) , markup );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
330 g_free( markup );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
331 g_object_set_data( G_OBJECT(filepopup_win) , "header_tracklen" , filepopup_data_info_header[6] );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
332 g_object_set_data( G_OBJECT(filepopup_win) , "label_tracklen" , filepopup_data_info_label[6] );
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
333 g_object_set_data( G_OBJECT(filepopup_win), "length" , GINT_TO_POINTER(-1) );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
334 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_header[6] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
335 0 , 1 , 6 , 7 , GTK_FILL , 0 , 0 , 0 );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
336 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_data_info_label[6] ,
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
337 1 , 2 , 6 , 7 , GTK_FILL , 0 , 0 , 0 );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
338 gtk_table_set_row_spacing( GTK_TABLE(filepopup_data_table) , 6 , 6 );
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
339
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
340 /* Track Progress */
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
341 filepopup_progress = gtk_progress_bar_new();
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
342 gtk_progress_bar_set_orientation( GTK_PROGRESS_BAR(filepopup_progress) , GTK_PROGRESS_LEFT_TO_RIGHT );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
343 gtk_progress_bar_set_text( GTK_PROGRESS_BAR(filepopup_progress) , "" );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
344 gtk_table_attach( GTK_TABLE(filepopup_data_table) , filepopup_progress ,
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
345 0 , 2 , 7 , 8 , GTK_FILL , 0 , 0 , 0 );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
346 g_object_set_data( G_OBJECT(filepopup_win) , "file" , NULL );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
347 g_object_set_data( G_OBJECT(filepopup_win) , "progressbar" , filepopup_progress );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
348 audacious_fileinfopopup_progress_init( filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
349
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
350 /* this will realize all widgets contained in filepopup_hbox */
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
351 gtk_widget_show_all(filepopup_hbox);
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
352
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
353 /* do not show the track progress */
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
354 gtk_widget_hide( filepopup_progress );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
355
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
356 return filepopup_win;
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
357 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
358
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
359 void
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
360 audacious_fileinfopopup_destroy(GtkWidget *filepopup_win)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
361 {
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
362 audacious_fileinfopopup_progress_stop( filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
363
2355
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
364 gchar *last_artwork = g_object_get_data( G_OBJECT(filepopup_win) , "last_artwork" );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
365 if ( last_artwork != NULL ) g_free(last_artwork);
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
366 gtk_widget_destroy( filepopup_win );
f03beaca8e81 [svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents: 2351
diff changeset
367 return;
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
368 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
369
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
370 void
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
371 audacious_fileinfopopup_show_from_tuple(GtkWidget *filepopup_win, TitleInput *tuple)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
372 {
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
373 gchar *tmp = NULL;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
374 gint x, y, x_off = 3, y_off = 3, h, w;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
375
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
376 gchar *last_artwork = g_object_get_data( G_OBJECT(filepopup_win) , "last_artwork" );
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
377 const static char default_artwork[] = DATA_DIR "/images/audio.png";
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
378
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
379 if (tuple == NULL)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
380 return;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
381
2516
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
382 tmp = g_object_get_data( G_OBJECT(filepopup_win) , "file" );
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
383 if ( tmp != NULL ) {
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
384 g_free( tmp );
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
385 tmp = NULL;
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
386 g_object_set_data( G_OBJECT(filepopup_win) , "file" , NULL );
a2b862cb4269 [svn] - avoid double free while playing cdda.
yaz
parents: 2487
diff changeset
387 }
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
388 if ( ( tuple->file_path ) && ( tuple->file_name ) )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
389 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
390 g_object_set_data( G_OBJECT(filepopup_win) , "file" ,
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
391 g_build_filename( tuple->file_path , tuple->file_name , NULL ) );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
392 }
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
393
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
394 gtk_widget_realize(filepopup_win);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
395
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
396 if ( tuple->track_name != NULL )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
397 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
398 gchar *markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Title") );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
399 gtk_label_set_markup( GTK_LABEL(g_object_get_data(G_OBJECT(filepopup_win),"header_title")), markup );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
400 g_free( markup );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
401 filepopup_entry_set_text(filepopup_win, "label_title", tuple->track_name);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
402 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
403 else
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
404 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
405 /* display the filename if track_name is not available */
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
406 gchar *markup = g_markup_printf_escaped( "<span style=\"italic\">%s</span>" , _("Filename") );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
407 gtk_label_set_markup( GTK_LABEL(g_object_get_data(G_OBJECT(filepopup_win),"header_title")), markup );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
408 g_free( markup );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
409 filepopup_entry_set_text(filepopup_win, "label_title", tuple->file_name);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
410 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
411
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
412 if ( tuple->performer != NULL )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
413 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
414 filepopup_entry_set_text(filepopup_win, "label_artist", tuple->performer);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
415 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_artist")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
416 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_artist")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
417 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
418 else
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
419 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
420 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_artist")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
421 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_artist")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
422 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
423
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
424 if ( tuple->album_name != NULL )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
425 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
426 filepopup_entry_set_text(filepopup_win, "label_album", tuple->album_name);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
427 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_album")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
428 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_album")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
429 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
430 else
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
431 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
432 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_album")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
433 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_album")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
434 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
435
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
436 if ( tuple->genre != NULL )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
437 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
438 filepopup_entry_set_text(filepopup_win, "label_genre", tuple->genre);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
439 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_genre")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
440 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_genre")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
441 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
442 else
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
443 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
444 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_genre")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
445 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_genre")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
446 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
447
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
448 if (tuple->length > 0)
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
449 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
450 filepopup_entry_set_text_free(filepopup_win, "label_tracklen", g_strdup_printf("%d:%02d", tuple->length / 60000, (tuple->length / 1000) % 60));
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
451 g_object_set_data( G_OBJECT(filepopup_win), "length" , GINT_TO_POINTER(tuple->length) );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
452 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_tracklen")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
453 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_tracklen")));
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
454 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
455 else
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
456 {
2362
424bc51df918 [svn] - ensure that year/tracknumber/length fields are cleared if necessary
giacomo
parents: 2357
diff changeset
457 filepopup_entry_set_text(filepopup_win, "label_tracklen", "");
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
458 g_object_set_data( G_OBJECT(filepopup_win), "length" , GINT_TO_POINTER(-1) );
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
459 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_tracklen")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
460 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_tracklen")));
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
461 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
462
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
463 if (tuple->year != 0)
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
464 {
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
465 filepopup_entry_set_text_free(filepopup_win, "label_year", g_strdup_printf("%d", tuple->year));
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
466 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_year")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
467 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_year")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
468 }
2362
424bc51df918 [svn] - ensure that year/tracknumber/length fields are cleared if necessary
giacomo
parents: 2357
diff changeset
469 else
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
470 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
471 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_year")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
472 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_year")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
473 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
474
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
475 if (tuple->track_number != 0)
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
476 {
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
477 filepopup_entry_set_text_free(filepopup_win, "label_tracknum", g_strdup_printf("%d", tuple->track_number));
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
478 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_tracknum")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
479 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_tracknum")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
480 }
2362
424bc51df918 [svn] - ensure that year/tracknumber/length fields are cleared if necessary
giacomo
parents: 2357
diff changeset
481 else
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
482 {
2362
424bc51df918 [svn] - ensure that year/tracknumber/length fields are cleared if necessary
giacomo
parents: 2357
diff changeset
483 filepopup_entry_set_text(filepopup_win, "label_tracknum", "");
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
484 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"header_tracknum")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
485 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win),"label_tracknum")));
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
486 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
487
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
488 if ( ( tuple->file_path ) && ( tuple->file_name ) )
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
489 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
490 tmp = fileinfo_recursive_get_image(tuple->file_path, tuple->file_name, 0);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
491 if (tmp) { // picture found
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
492 if (!last_artwork || strcmp(last_artwork, tmp)) { // new picture
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
493 filepopup_entry_set_image(filepopup_win, "image_artwork", tmp);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
494 if (last_artwork) g_free(last_artwork);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
495 last_artwork = tmp;
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
496 g_object_set_data( G_OBJECT(filepopup_win) , "last_artwork" , last_artwork );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
497 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
498 else { // same picture
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
499 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
500 }
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
501 else { // no picture found
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
502 if (!last_artwork || strcmp(last_artwork, default_artwork)) {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
503 filepopup_entry_set_image(filepopup_win, "image_artwork", default_artwork);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
504 if (last_artwork) g_free(last_artwork);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
505 last_artwork = g_strdup(default_artwork);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
506 g_object_set_data( G_OBJECT(filepopup_win) , "last_artwork" , last_artwork );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
507 }
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
508 else {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
509 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
510 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
511 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
512
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
513 /* start a timer that updates a progress bar if the tooltip
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
514 is shown for the song that is being currently played */
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
515 if ( audacious_fileinfopopup_progress_check_active( filepopup_win ) == FALSE )
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
516 {
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
517 audacious_fileinfopopup_progress_start( filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
518 /* also run immediately the callback once, to update progressbar status */
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
519 audacious_fileinfopopup_progress_cb( filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
520 }
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
521
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
522 gdk_window_get_pointer(NULL, &x, &y, NULL);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
523 gtk_window_get_size(GTK_WINDOW(filepopup_win), &w, &h);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
524 if (gdk_screen_width()-(w+3) < x) x_off = (w*-1)-3;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
525 if (gdk_screen_height()-(h+3) < y) y_off = (h*-1)-3;
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
526 gtk_window_move(GTK_WINDOW(filepopup_win), x + x_off, y + y_off);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
527
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
528 gtk_widget_show(filepopup_win);
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
529 }
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
530
2395
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
531 void
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
532 audacious_fileinfopopup_show_from_title(GtkWidget *filepopup_win, gchar *title)
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
533 {
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
534 TitleInput * tuple = bmp_title_input_new();
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
535 tuple->track_name = g_strdup(title);
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
536 audacious_fileinfopopup_show_from_tuple( filepopup_win , tuple );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
537 bmp_title_input_free( tuple );
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
538 return;
b047268eec32 [svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents: 2362
diff changeset
539 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
540
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
541 void
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
542 audacious_fileinfopopup_hide(GtkWidget *filepopup_win, gpointer unused)
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
543 {
2351
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
544 if ( GTK_WIDGET_VISIBLE(filepopup_win) == TRUE )
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
545 {
2357
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
546 audacious_fileinfopopup_progress_stop( filepopup_win );
139d2358f617 [svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents: 2355
diff changeset
547
2351
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
548 gtk_widget_hide(filepopup_win);
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
549
2351
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
550 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_title", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
551 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_artist", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
552 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_album", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
553 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_genre", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
554 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_track", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
555 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_year", "");
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
556 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_length", "");
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
557
2351
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
558 gtk_window_resize(GTK_WINDOW(filepopup_win), 1, 1);
911743d27aba [svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents: 2348
diff changeset
559 }
2348
564e8a1fe09a [svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff changeset
560 }