2 * gcc -o ht-albumart ht-album-art.c `pkg-config --cflags --libs hildon-thumbnail`
4 #include <hildon-albumart-factory.h>
5 #include <hildon-thumbnail-factory.h>
8 static gchar *artist = NULL;
9 static gchar *album = NULL;
11 static GOptionEntry entries[] = {
12 { "artist", 'a', 0, G_OPTION_ARG_STRING, &artist,
16 { "album", 'b', 0, G_OPTION_ARG_STRING, &album,
23 main (gint argc, gchar **argv)
25 gchar *album_art, *thumbnail, *album_art_uri;
26 GOptionContext *context;
30 context = g_option_context_new ("- Ask image/thum path for album art");
32 g_option_context_add_main_entries (context, entries, NULL);
33 g_option_context_parse (context, &argc, &argv, NULL);
40 "Album is a mandatory field");
42 help = g_option_context_get_help (context, TRUE, NULL);
43 g_option_context_free (context);
44 g_printerr ("%s", help);
51 * USE NULL for artist!!! (It is what UKMP and media player use!)
53 album_art = hildon_albumart_get_path (NULL, album, "album");
54 g_print ("album art: %s\n", album_art);
57 * USE uri!!! (Not path)
59 album_art_uri = g_filename_to_uri (album_art, NULL, NULL);
60 thumbnail = hildon_thumbnail_get_uri (album_art_uri, 124, 124, FALSE);
61 g_print ("thumbnail (using uri): %s\n", thumbnail);
65 g_free (album_art_uri);