Gentoo Archives: gentoo-commits

From: "Gilles Dartiguelongue (eva)" <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/sound-juicer/files: sound-juicer-2.22.0-sj-handle-uri.patch
Date: Thu, 31 Jul 2008 21:23:48
Message-Id: E1KOfcg-00045f-4X@stork.gentoo.org
1 eva 08/07/31 21:23:46
2
3 Added: sound-juicer-2.22.0-sj-handle-uri.patch
4 Log:
5 bump to r1, add patch to handle uris, bug #229745.
6 (Portage version: 2.2_rc3/cvs/Linux 2.6.24-gentoo-r8-mactel x86_64)
7
8 Revision Changes Path
9 1.1 media-sound/sound-juicer/files/sound-juicer-2.22.0-sj-handle-uri.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/sound-juicer/files/sound-juicer-2.22.0-sj-handle-uri.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/sound-juicer/files/sound-juicer-2.22.0-sj-handle-uri.patch?rev=1.1&content-type=text/plain
13
14 Index: sound-juicer-2.22.0-sj-handle-uri.patch
15 ===================================================================
16 Index: src/sj-main.c
17 ===================================================================
18 --- src/sj-main.c (revision 2168)
19 +++ src/sj-main.c (working copy)
20 @@ -1576,12 +1576,13 @@
21 GnomeProgram *program;
22 GError *error = NULL;
23 GtkTreeSelection *selection;
24 - char *device = NULL;
25 + char *device = NULL, **uris = NULL;
26 GOptionContext *ctx;
27 const GOptionEntry entries[] = {
28 { "auto-start", 'a', 0, G_OPTION_ARG_NONE, &autostart, N_("Start extracting immediately"), NULL },
29 { "play", 'p', 0, G_OPTION_ARG_NONE, &autoplay, N_("Start playing immediately"), NULL},
30 { "device", 'd', 0, G_OPTION_ARG_FILENAME, &device, N_("What CD device to read"), N_("DEVICE") },
31 + { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &uris, N_("URI to the CD device to read"), NULL },
32 { NULL }
33 };
34
35 @@ -1803,10 +1804,26 @@
36 eject_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_EJECT, NULL, TRUE, NULL), NULL);
37 open_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_OPEN, NULL, TRUE, NULL), NULL);
38 audio_volume_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_AUDIO_VOLUME, NULL, TRUE, NULL), NULL);
39 - if (device == NULL) {
40 + if (device == NULL && uris == NULL) {
41 device_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_DEVICE, NULL, TRUE, NULL), GINT_TO_POINTER (TRUE));
42 } else {
43 - set_device (device, TRUE);
44 + if (device)
45 + set_device (device, TRUE);
46 + else {
47 + char *d;
48 +
49 + /* Mash up the CDDA URIs into a device path */
50 + if (g_str_has_prefix (uris[0], "cdda://")) {
51 + guint len;
52 + d = g_strdup_printf ("/dev/%s", uris[0] + strlen ("cdda://"));
53 + len = strlen (d);
54 + d[len - 1] = '\0';
55 + set_device (d, TRUE);
56 + g_free (d);
57 + } else {
58 + device_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_DEVICE, NULL, TRUE, NULL), GINT_TO_POINTER (TRUE));
59 + }
60 + }
61 }
62
63 if (sj_extractor_supports_encoding (&error) == FALSE) {
64 Index: data/sound-juicer.desktop.in.in
65 ===================================================================
66 --- data/sound-juicer.desktop.in.in (revision 2168)
67 +++ data/sound-juicer.desktop.in.in (working copy)
68 @@ -2,7 +2,7 @@
69 Encoding=UTF-8
70 _Name=Audio CD Extractor
71 _Comment=Copy music from your CDs
72 -Exec=sound-juicer
73 +Exec=sound-juicer %u
74 Icon=sound-juicer
75 StartupNotify=true
76 MimeType=x-content/audio-cdda;