Re: [Rhythmbox-devel] LAST_PLAYED's type.

On Mon, 23 Aug 2004, Colin Walters wrote:

On Sun, 2004-08-22 at 22:49 -0500, Alex Goddard wrote:
I'm in the middle of adding 'Last Played' to the smart playlist dialogue.
The dialogue itself was the easy part.  The hard part has come with
dealing with RHYTHMDB_PROP_LAST_PLAYED.  The source, as far as I can tell,
treats RHYTHMDB_PROP_LAST_PLAYED as G_TYPE_ULONG (see examples like lines
1703-1705 in rhythmdb.c and its presence in rhythmdb_entry_get_ulong () in

However, in getting the smart playlist to query the database, I'm
triggering a number of assertions regarding LAST_PLAYED's type, all of
which can be worked around by adding cases for G_TYPE_LONG.  I've been
unable to pinpoint precisely where the type is getting switched.

Any ideas as to why I might be encountering this?  Is adding cases for
G_TYPE_LONG the right way to go, or should I be making a more strenuous
effort to find where LAST_PLAYED is picking up a sign?

It comes from rhythmdb.c:2336:

			ENUM_ENTRY (RHYTHMDB_PROP_LAST_PLAYED, "Last Played (glong) [last-played]"),

That should probably be changed to gulong.

Attaching a patch, since to make a publicly available arch branch, I'll need to write a permission-fixing script first (god knows when I'll get around to that).

The patch does precisely the above.  Changes the type to gulong.

Alex Goddard
agoddard at purdue dot edu
--- rhythmdb.c.orig	2004-08-24 21:23:56.216886128 -0500
+++ rhythmdb.c	2004-08-24 21:24:24.927521448 -0500
@@ -2333,7 +2333,7 @@ rhythmdb_prop_get_type (void)
 			ENUM_ENTRY (RHYTHMDB_PROP_RATING, "Rating (gdouble) [rating]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_AUTO_RATE, "Whether to auto-rate song (gboolean) [auto-rate]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_PLAY_COUNT, "Play Count (gint) [play-count]"),
-			ENUM_ENTRY (RHYTHMDB_PROP_LAST_PLAYED, "Last Played (glong) [last-played]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_LAST_PLAYED, "Last Played (gulong) [last-played]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_BITRATE, "Bitrate (gulong) [bitrate]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_TRACK_GAIN, "Replaygain track gain (gdouble) [replaygain-track-gain]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_TRACK_PEAK, "Replaygain track peak (gdouble) [replaygain-track-peak]"),

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]