changeset 1469:08364e03c918

merge
author Cristi Magherusan <majeru@atheme-project.org>
date Sat, 11 Aug 2007 15:57:05 +0300
parents 159186076d9a (current diff) 42306c187663 (diff)
children 429b29e8004c 355f8e284c94
files
diffstat 18 files changed, 66 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Aug 11 15:55:14 2007 +0300
+++ b/configure.ac	Sat Aug 11 15:57:05 2007 +0300
@@ -1072,9 +1072,6 @@
 fi
 
 
-AC_CHECK_HEADERS(linux/cdrom.h)
-AC_CHECK_HEADERS(sys/cdio.h)
-AC_CHECK_HEADERS(sys/cdrio.h)
 AC_CHECK_HEADERS(linux/joystick.h)
 AC_CHECK_HEADERS(unistd.h)
 AC_CHECK_HEADERS(fcntl.h)
@@ -1101,15 +1098,24 @@
 
 if test "$enable_cdaudio_ng" = "yes"; then
    PKG_CHECK_MODULES(CDIO, [libcdio >= 0.70],
-   [INPUT_PLUGINS="$INPUT_PLUGINS cdaudio-ng"
-   CDIO_LIBS=`pkg-config --libs libcdio_cdda`
+   ,
+   [AC_MSG_WARN([*** Cannot find libcdio 0.70 or newer, cdaudio-ng will not be built ***])
+   enable_cdaudio_ng=no]
+)
+fi
+
+if test "$enable_cdaudio_ng" = "yes"; then
+   PKG_CHECK_MODULES(CDIO, [libcdio_cdda >= 0.70],
+   [CDIO_LIBS=`pkg-config --libs libcdio_cdda`
    CDIO_CFLAGS=`pkg-config --cflags libcdio_cdda`
    AC_SUBST(CDIO_LIBS)
    AC_SUBST(CDIO_CFLAGS)],
-   [AC_MSG_WARN([*** Cannot find libcdio 0.70 or newer, cdaudio-ng will not be built ***])
-   enable_cdaudio_ng=no]
+   [AC_MSG_WARN([*** Cannot find libcdio_cdda 0.70 or newer, cdaudio-ng will not be built ***])
+   enable_cdaudio_ng=no] 
 )
+fi
 
+if test "$enable_cdaudio_ng" = "yes"; then
    PKG_CHECK_MODULES(CDDB, [libcddb >= 1.2.1],
    [INPUT_PLUGINS="$INPUT_PLUGINS cdaudio-ng"
    CDDB_LIBS=`pkg-config --libs libcddb`
@@ -1121,7 +1127,6 @@
 )
 fi
 
-
 AM_CONDITIONAL(HAVE_CDROM, test "${ac_cv_header_linux_cdrom_h}" = "yes" || test "${ac_cv_header_sys_cdio_h}" = "yes")
 AM_CONDITIONAL(HAVE_LINUX_JOYSTICK,test "${ac_cv_header_linux_joystick_h}" = "yes")
 
--- a/src/aac/src/libmp4.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/aac/src/libmp4.c	Sat Aug 11 15:57:05 2007 +0300
@@ -462,7 +462,7 @@
 
     title = tuple_formatter_process_string(tuple, cfg.gentitle_format);
 
-    mowgli_object_unref(tuple);
+    tuple_free(tuple);
 
     return title;
 }
--- a/src/cdaudio-ng/cdaudio-ng.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/cdaudio-ng/cdaudio-ng.c	Sat Aug 11 15:57:05 2007 +0300
@@ -59,9 +59,9 @@
 static gint				cdaudio_set_volume(gint l, gint r);
 static void				cdaudio_cleanup();
 static void				cdaudio_get_song_info(gchar *filename, gchar **title, gint *length);
-static TitleInput		*cdaudio_get_song_tuple(gchar *filename);
+static Tuple			*cdaudio_get_song_tuple(gchar *filename);
 
-static TitleInput		*create_tuple_from_trackinfo(char *filename);
+static Tuple			*create_tuple_from_trackinfo(char *filename);
 static void				dae_play_loop(dae_params_t *pdae_params);
 static int				calculate_track_length(int startlsn, int endlsn);
 static int				find_trackno_from_filename(char *filename);
@@ -447,6 +447,9 @@
 
 void cdaudio_play_file(InputPlayback *pinputplayback)
 {
+	Tuple *tuple;
+	char *title;
+
 	if (debug)
 		printf("cdaudio-ng: cdaudio_play_file(\"%s\")\n", pinputplayback->filename);
 
@@ -482,10 +485,12 @@
 	playing_track = trackno;
 	is_paused = FALSE;
 
-	char *title = xmms_get_titlestring(xmms_get_gentitle_format(), create_tuple_from_trackinfo(pinputplayback->filename));
+	tuple = create_tuple_from_trackinfo(pinputplayback->filename);
+	title = tuple_formatter_process_string(tuple, xmms_get_gentitle_format());
 
 	inputplugin.set_info(title, calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn), 1411200, 44100, 2);
-	free(title);
+	free(title); title = NULL;
+	tuple_free(tuple); tuple = NULL;
 
 	if (use_dae) {
 		if (debug)
@@ -728,12 +733,17 @@
 		printf("cdaudio-ng: cdaudio_get_song_info(\"%s\")\n", filename);
 
 	int trackno = find_trackno_from_filename(filename);
+	Tuple *tuple = create_tuple_from_trackinfo(filename);
 
-	*title = xmms_get_titlestring(xmms_get_gentitle_format(), create_tuple_from_trackinfo(filename));
+	if(tuple) {
+		*title = tuple_formatter_process_string(tuple, xmms_get_gentitle_format());
+		tuple_free(tuple);
+		tuple = NULL;
+	}
 	*length = calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn);
 }
 
-TitleInput *cdaudio_get_song_tuple(gchar *filename)
+Tuple *cdaudio_get_song_tuple(gchar *filename)
 {
 	if (debug)
 		printf("cdaudio-ng: cdaudio_get_song_tuple(\"%s\")\n", filename);
@@ -744,26 +754,33 @@
 
 	/* auxiliar functions */
 
-TitleInput *create_tuple_from_trackinfo(char *filename)
+Tuple *create_tuple_from_trackinfo(char *filename)
 {
 	if (trackinfo == NULL)
 		return NULL;
 
-	TitleInput *tuple = bmp_title_input_new();
+	Tuple *tuple = tuple_new_from_filename(filename);
 	int trackno = find_trackno_from_filename(filename);
 
 	if (trackno < firsttrackno || trackno > lasttrackno)
 		return NULL;
 
-	tuple->performer = strlen(trackinfo[trackno].performer) > 0 ? g_strdup(trackinfo[trackno].performer) : NULL;
-	tuple->album_name = strlen(trackinfo[0].name) > 0 ? g_strdup(trackinfo[0].name) : NULL;
-	tuple->track_name = strlen(trackinfo[trackno].name) > 0 ? g_strdup(trackinfo[trackno].name) : NULL;
-	tuple->track_number = trackno;
-	tuple->file_name = g_strdup(basename(filename));
-	tuple->file_path = g_strdup(basename(filename));
-	tuple->file_ext = g_strdup("cda");
-	tuple->length = calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn);
-	tuple->genre = strlen(trackinfo[trackno].genre) > 0 ? g_strdup(trackinfo[trackno].genre) : NULL;
+	if(strlen(trackinfo[trackno].performer)) {
+		tuple_associate_string(tuple, "artist", trackinfo[trackno].performer);
+	}
+	if(strlen(trackinfo[0].name)) {
+		tuple_associate_string(tuple, "album", trackinfo[0].name);
+	}
+	if(strlen(trackinfo[trackno].name)) {
+		tuple_associate_string(tuple, "title", trackinfo[trackno].name);
+	}
+	tuple_associate_int(tuple, "track-number", trackno);
+	tuple_associate_string(tuple, "ext", "cda"); //XXX should do? --yaz
+
+	tuple_associate_int(tuple, "length", calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn));
+	if(strlen(trackinfo[trackno].genre)) {
+		tuple_associate_string(tuple, "genre",  trackinfo[trackno].genre);
+	}
 	//tuple->year = 0; todo: set the year
 
 	return tuple;
--- a/src/console/Audacious_Driver.cxx	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/console/Audacious_Driver.cxx	Sat Aug 11 15:57:05 2007 +0300
@@ -242,7 +242,7 @@
 	char* result = tuple_formatter_process_string(ti, cfg.gentitle_format);
 	if ( result )
 		*length = tuple_get_int(ti, "length");
-	mowgli_object_unref((void *) ti);
+	tuple_free((void *) ti);
 
 	return result;
 }
--- a/src/cue/cuesheet.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/cue/cuesheet.c	Sat Aug 11 15:57:05 2007 +0300
@@ -295,7 +295,7 @@
 
     tuple_associate_int(out, "length", tuple_get_int(phys_tuple, "length"));
 
-    mowgli_object_unref(phys_tuple);
+    tuple_free(phys_tuple);
 
     tuple_associate_string(out, "title", cue_tracks[track].title);
     tuple_associate_string(out, "artist", cue_tracks[track].performer ?
@@ -327,7 +327,7 @@
 	*title = tuple_formatter_process_string(tuple, cfg.gentitle_format);
 	*length = tuple_get_int(tuple, "length");
 
-	mowgli_object_unref(tuple);
+	tuple_free(tuple);
 }
 
 static void seek(InputPlayback * data, gint time)
--- a/src/flacng/tools.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/flacng/tools.c	Sat Aug 11 15:57:05 2007 +0300
@@ -286,7 +286,7 @@
 
     title = tuple_formatter_process_string(input, cfg.gentitle_format);
 
-    mowgli_object_unref(input);
+    tuple_free(input);
 
     _DEBUG("Title created: <%s>", title);
 
--- a/src/madplug/decoder.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/madplug/decoder.c	Sat Aug 11 15:57:05 2007 +0300
@@ -708,7 +708,7 @@
     g_message("e: decode");
 #endif                          /* DEBUG */
 
-    mowgli_object_unref(info->tuple);
+    tuple_free(info->tuple);
     info->tuple = NULL;
 
     info->playback->output->close_audio();
--- a/src/madplug/fileinfo.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/madplug/fileinfo.c	Sat Aug 11 15:57:05 2007 +0300
@@ -519,7 +519,6 @@
     g_signal_connect(G_OBJECT(save), "clicked",
                        G_CALLBACK(save_cb), NULL);
     gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0);
-    gtk_widget_grab_default(save);
 
     remove_id3 = gtk_button_new_from_stock(GTK_STOCK_DELETE);
     g_signal_connect(G_OBJECT(remove_id3), "clicked",
--- a/src/madplug/input.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/madplug/input.c	Sat Aug 11 15:57:05 2007 +0300
@@ -664,7 +664,7 @@
         g_free(info->mp3gain_minmax_str);
 
     if (info->tuple) {
-        mowgli_object_unref(info->tuple);
+        tuple_free(info->tuple);
         info->tuple = NULL;
     }
 
--- a/src/musepack/libmpc.cxx	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/musepack/libmpc.cxx	Sat Aug 11 15:57:05 2007 +0300
@@ -739,7 +739,7 @@
     if (!*title)
         title = g_strdup(tuple_get_string(tuple, "file-name"));
 
-    mowgli_object_unref((void *) tuple);
+    tuple_free((void *) tuple);
     return title;
 }
 
--- a/src/scrobbler/scrobbler.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/scrobbler/scrobbler.c	Sat Aug 11 15:57:05 2007 +0300
@@ -889,7 +889,7 @@
 
 			item = q_put(tuple, atoi(len));
 
-			mowgli_object_unref(tuple);
+			tuple_free(tuple);
 		}
 
 		pdebug(fmt_vastr("a[%d]=%s t[%d]=%s l[%d]=%s i[%d]=%s m[%d]=%s b[%d]=%s",
--- a/src/sexypsf/plugin.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/sexypsf/plugin.c	Sat Aug 11 15:57:05 2007 +0300
@@ -252,7 +252,7 @@
 
     if (tuple != NULL) {
         title = tuple_formatter_process_string(tuple, cfg.gentitle_format);
-        mowgli_object_unref(tuple);
+        tuple_free(tuple);
     }
     else
         title = g_path_get_basename(fn);
--- a/src/timidity/src/xmms-timidity.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/timidity/src/xmms-timidity.c	Sat Aug 11 15:57:05 2007 +0300
@@ -314,7 +314,7 @@
 	if (title == NULL || *title == '\0')
 		title = g_strdup(tuple_get_string(input, "file-name"));
 
-	mowgli_object_unref(input);
+	tuple_free(input);
 
 	return title;
 }
--- a/src/tta/libtta.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/tta/libtta.c	Sat Aug 11 15:57:05 2007 +0300
@@ -193,7 +193,7 @@
     	    *title = get_song_title(tuple);
 	}
 
-	mowgli_object_unref(tuple);
+	tuple_free(tuple);
 }
 
 static void *
@@ -503,7 +503,7 @@
 
 	tuple = get_song_tuple(filename);
 	title = get_song_title(tuple);
-	mowgli_object_unref(tuple);
+	tuple_free(tuple);
 
 	datasize = file_size(filename) - info.DATAPOS;
 	origsize = info.DATALENGTH * info.BSIZE * info.NCH;
--- a/src/vorbis/vorbis.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/vorbis/vorbis.c	Sat Aug 11 15:57:05 2007 +0300
@@ -611,7 +611,7 @@
     *title = tuple_formatter_process_string(tuple, vorbis_cfg.tag_override ?
                                   vorbis_cfg.tag_format : cfg.gentitle_format);
 
-    mowgli_object_unref(tuple);
+    tuple_free(tuple);
 }
 
 static const gchar *
@@ -845,7 +845,7 @@
 	g_free(tmp);
     }
 
-    mowgli_object_unref(input);
+    tuple_free(input);
 
     return displaytitle;
 }
--- a/src/vtx/vtx.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/vtx/vtx.c	Sat Aug 11 15:57:05 2007 +0300
@@ -241,7 +241,7 @@
 
       g_free (buf);
 
-      mowgli_object_unref(ti);
+      tuple_free(ti);
 
       playback->playing = TRUE;
       play_thread = g_thread_self();
@@ -302,7 +302,7 @@
     *length = tuple_get_int(ti, "length");
 
     ayemu_vtx_free (&tmp);
-    mowgli_object_unref(ti);
+    tuple_free(ti);
   }
 }
 
--- a/src/wav/wav.c	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/wav/wav.c	Sat Aug 11 15:57:05 2007 +0300
@@ -222,7 +222,7 @@
         title = g_strdup(tuple_get_string(tuple, "file-name"));
     }
 
-    mowgli_object_unref(tuple);
+    tuple_free(tuple);
 
     return title;
 }
--- a/src/wavpack/libwavpack.cxx	Sat Aug 11 15:55:14 2007 +0300
+++ b/src/wavpack/libwavpack.cxx	Sat Aug 11 15:57:05 2007 +0300
@@ -410,7 +410,7 @@
     if (!displaytitle || *displaytitle == '\0')
         displaytitle = g_strdup(fn);
 
-    mowgli_object_unref((void *) ti);
+    tuple_free((void *) ti);
 
     return displaytitle;
 }