[Rhythmbox-devel] Second Podcast Patch



Hi all,


In this patch i made various changes:
- changes for minimun memory usage;
- remove g_thread calls;
- created widget for podcast head information;
- usage gnome_vfs async calls;
- changes in the interface of podcast source;

Please let me know what you think about it.

Attached there are the diff against the CVS HEAD and a
tarball with the new files. To test it just apply the patch and
decompress the tarball inside your rhythmbox devel src dir.

BR,
Renato Araujo
INdT - Instituto Nokia de Tecnologia
reanato filho indt org br
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/Makefile.am,v
retrieving revision 1.41
diff -u -3 -p -r1.41 Makefile.am
--- Makefile.am	6 Sep 2005 07:15:31 -0000	1.41
+++ Makefile.am	7 Sep 2005 04:19:43 -0000
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = 1.7
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install
 
-SUBDIRS = macros lib metadata player rhythmdb widgets sources iradio remote daapsharing shell data po help tests
+SUBDIRS = macros lib metadata player rhythmdb widgets sources iradio podcast remote shell data po help tests
 
 EXTRA_DIST = 			\
 	autogen.sh		\
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.164
diff -u -3 -p -r1.164 configure.ac
--- configure.ac	6 Sep 2005 20:13:41 -0000	1.164
+++ configure.ac	7 Sep 2005 04:19:43 -0000
@@ -504,6 +504,7 @@ player/Makefile
 rhythmdb/Makefile
 widgets/Makefile
 iradio/Makefile
+podcast/Makefile
 remote/Makefile
 remote/bonobo/Makefile
 remote/dbus/Makefile
Index: data/rhythmbox.schemas
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/rhythmbox.schemas,v
retrieving revision 1.47
diff -u -3 -p -r1.47 rhythmbox.schemas
--- data/rhythmbox.schemas	6 Sep 2005 07:15:32 -0000	1.47
+++ data/rhythmbox.schemas	7 Sep 2005 04:19:44 -0000
@@ -199,7 +199,7 @@
         <applyto>/apps/rhythmbox/ui/columns_setup</applyto>
         <owner>rhythmbox</owner>
         <type>string</type>
-        <default>RB_TREE_MODEL_NODE_COL_TRACK_NUMBER_STR,RB_TREE_MODEL_NODE_COL_ARTIST,RB_TREE_MODEL_NODE_COL_ALBUM,RB_TREE_MODEL_NODE_COL_GENRE,RB_TREE_MODEL_NODE_COL_DURATION</default>
+        <default>RHYTHMDB_PROP_POST_TIME,RB_TREE_MODEL_NODE_COL_TRACK_NUMBER_STR,RB_TREE_MODEL_NODE_COL_ARTIST,RB_TREE_MODEL_NODE_COL_ALBUM,RB_TREE_MODEL_NODE_COL_GENRE,RB_TREE_MODEL_NODE_COL_DURATION</default>
         <locale name="C">
 	<short>(obsolete) List of active columns.</short>
 	<long>The list of columns that will be shown for Rhythmbox versions &lt; 0.6.0.  If a source
@@ -211,7 +211,7 @@
         <applyto>/apps/rhythmbox/ui/rhythmdb_columns_setup</applyto>
         <owner>rhythmbox</owner>
         <type>string</type>
-        <default>RHYTHMDB_PROP_TRACK_NUMBER,RHYTHMDB_PROP_ARTIST,RHYTHMDB_PROP_ALBUM,RHYTHMDB_PROP_GENRE,RHYTHMDB_PROP_DURATION</default>
+        <default>RHYTHMDB_PROP_POST_TIME,RHYTHMDB_PROP_TRACK_NUMBER,RHYTHMDB_PROP_ARTIST,RHYTHMDB_PROP_ALBUM,RHYTHMDB_PROP_GENRE,RHYTHMDB_PROP_DURATION</default>
         <locale name="C">
 	<short>List of active columns.</short>
 	<long>The list of columns that will be shown.  If a source
@@ -244,6 +244,29 @@
       <schema>
         <key>/schemas/apps/rhythmbox/state/iradio/sorting</key>
         <applyto>/apps/rhythmbox/state/iradio/sorting</applyto>
+        <owner>rhythmbox</owner>
+        <type>string</type>
+        <default>Title,ascending</default>
+        <locale name="C">
+	<short>The sorting order</short>
+	<long>A comma-separated list.  The first is the title of the
+	column to sort on, the second is the sort type.</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/rhythmbox/state/podcast/show_browser</key>
+        <applyto>/apps/rhythmbox/state/podcast/show_browser</applyto>
+        <owner>rhythmbox</owner>
+        <type>bool</type>
+        <default>0</default>
+        <locale name="C">
+	  <short>Show browser in podcast display</short>
+	  <long>Show the album browser in the Podcast display.</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/rhythmbox/state/podcast/sorting</key>
+        <applyto>/apps/rhythmbox/state/podcast/sorting</applyto>
         <owner>rhythmbox</owner>
         <type>string</type>
         <default>Title,ascending</default>
Index: data/art/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/art/Makefile.am,v
retrieving revision 1.20
diff -u -3 -p -r1.20 Makefile.am
--- data/art/Makefile.am	8 Feb 2005 19:04:38 -0000	1.20
+++ data/art/Makefile.am	7 Sep 2005 04:19:44 -0000
@@ -24,6 +24,7 @@ art_DATA = rhythmbox-shuffle.png       \
 	   rhythmbox-audiocd.png       \
 	   rhythmbox-dnd.png           \
 	   rhythmbox-ipod.png	       \
+	   rhythmbox-podcast.png       \
 	   about-logo.png
 
 artdir = $(pkgdatadir)/art
Index: data/glade/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/glade/Makefile.am,v
retrieving revision 1.16
diff -u -3 -p -r1.16 Makefile.am
--- data/glade/Makefile.am	16 Sep 2004 19:16:07 -0000	1.16
+++ data/glade/Makefile.am	7 Sep 2005 04:19:44 -0000
@@ -2,11 +2,15 @@
 
 glade_DATA =	general-prefs.glade	  	\
 		library-prefs.glade	  	\
+		podcast-prefs.glade		\
 		song-info.glade			\
 		song-info-multiple.glade	\
 		load-failure.glade		\
 		station-new.glade		\
 		station-properties.glade	\
+		podcast-site-properties.glade	\
+		podcast-new.glade		\
+		podcast-properties.glade	\
 		create-playlist.glade		\
 		druid.glade			\
 		recorder.glade			\
Index: data/glade/general-prefs.glade
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/glade/general-prefs.glade,v
retrieving revision 1.6
diff -u -3 -p -r1.6 general-prefs.glade
--- data/glade/general-prefs.glade	26 Jun 2005 21:49:57 -0000	1.6
+++ data/glade/general-prefs.glade	7 Sep 2005 04:19:44 -0000
@@ -2,7 +2,6 @@
 <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
 
 <glade-interface>
-<requires lib="gnome"/>
 
 <widget class="GtkWindow" id="preferences">
   <property name="visible">True</property>
@@ -12,6 +11,12 @@
   <property name="modal">False</property>
   <property name="resizable">False</property>
   <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
 
   <child>
     <widget class="GtkVBox" id="general_vbox">
@@ -45,6 +50,10 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -72,6 +81,10 @@
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -105,6 +118,10 @@
 			      <property name="yalign">0.5</property>
 			      <property name="xpad">0</property>
 			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>
@@ -116,7 +133,7 @@
 			  <child>
 			    <widget class="GtkTable" id="table1">
 			      <property name="visible">True</property>
-			      <property name="n_rows">5</property>
+			      <property name="n_rows">6</property>
 			      <property name="n_columns">2</property>
 			      <property name="homogeneous">True</property>
 			      <property name="row_spacing">6</property>
@@ -298,6 +315,29 @@
 				  <property name="right_attach">2</property>
 				  <property name="top_attach">3</property>
 				  <property name="bottom_attach">4</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkCheckButton" id="date_check">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">Da_te</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				  <signal name="toggled" handler="rb_shell_preferences_column_check_changed_cb" last_modification_time="Fri, 02 May 2003 04:26:32 GMT"/>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">4</property>
+				  <property name="bottom_attach">5</property>
 				  <property name="x_options">fill</property>
 				  <property name="y_options"></property>
 				</packing>
Index: data/ui/rhythmbox-ui.xml
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/ui/rhythmbox-ui.xml,v
retrieving revision 1.22
diff -u -3 -p -r1.22 rhythmbox-ui.xml
--- data/ui/rhythmbox-ui.xml	6 Sep 2005 07:15:32 -0000	1.22
+++ data/ui/rhythmbox-ui.xml	7 Sep 2005 04:19:44 -0000
@@ -15,6 +15,7 @@
 	<menuitem name="MusicPlaylistDeletePlaylistMenu" action="MusicPlaylistDeletePlaylist"/>
       </menu>
       <menuitem name="MusicNewInternetRadioStationMenu" action="MusicNewInternetRadioStation"/>
+      <menuitem name="MusicNewPodcastMenu" action="MusicNewPodcast"/>
       <separator/>
       <menuitem name="MusicPropertiesMenu" action="MusicProperties"/>
       <separator/>
@@ -119,6 +120,16 @@
     <menuitem name="DeleteIRadioPopup" action="EditDelete"/>
     <separator/>
     <menuitem name="PropertiesIRadioPopup" action="MusicProperties"/>
+  </popup>
+  <popup name="PodcastSourcePopup">
+    <menuitem name="PodcastSrcPopupNew" action="MusicNewPodcast"/>
+  </popup>
+
+  <popup name="PodcastViewPopup">
+    <menuitem name="DeletePodcastPopup" action="EditDelete"/>
+    <menuitem name="DownloadPodcastPopup" action="PodcastSrcDownloadPost"/>
+    <separator/>
+    <menuitem name="PropertiesPodcastPopup" action="MusicProperties"/>
   </popup>
 
   <popup name="PlaylistSourcePopup">
Index: lib/rb-stock-icons.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 rb-stock-icons.c
--- lib/rb-stock-icons.c	8 Feb 2005 19:04:39 -0000	1.17
+++ lib/rb-stock-icons.c	7 Sep 2005 04:19:44 -0000
@@ -60,7 +60,8 @@ rb_stock_icons_init (void)
 		RB_STOCK_NO_STAR,
 		RB_STOCK_DND_ICON,
                 RB_STOCK_AUDIOCD,
-		RB_STOCK_IPOD
+		RB_STOCK_IPOD,
+		RB_STOCK_PODCAST
 	};
 
 	g_return_if_fail (factory == NULL);
Index: lib/rb-stock-icons.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.h,v
retrieving revision 1.17
diff -u -3 -p -r1.17 rb-stock-icons.h
--- lib/rb-stock-icons.h	8 Feb 2005 19:04:39 -0000	1.17
+++ lib/rb-stock-icons.h	7 Sep 2005 04:19:44 -0000
@@ -50,6 +50,7 @@ G_BEGIN_DECLS
 #define RB_STOCK_AUDIOCD       "rhythmbox-audiocd"
 #define RB_STOCK_DND_ICON      "rhythmbox-dnd"
 #define RB_STOCK_IPOD          "rhythmbox-ipod"
+#define RB_STOCK_PODCAST       "rhythmbox-podcast"
 
 void	rb_stock_icons_init	(void);
 
Index: player/rb-player-gst.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/player/rb-player-gst.c,v
retrieving revision 1.44
diff -u -3 -p -r1.44 rb-player-gst.c
--- player/rb-player-gst.c	6 Sep 2005 19:32:49 -0000	1.44
+++ player/rb-player-gst.c	7 Sep 2005 04:19:44 -0000
@@ -784,20 +784,8 @@ rb_player_get_time (RBPlayer *mp)
 		gint64 gst_position;
 		GstFormat fmt = GST_FORMAT_TIME;
 		gst_element_query (mp->priv->playbin, GST_QUERY_POSITION, &fmt, &gst_position);
-<<<<<<< rb-player-gst.c
-
-		ret = (glong) (gst_position / (1000*1000*1000));
-#ifdef WITH_DAAP_SUPPORT
-		if (mp->priv->uri && g_strncasecmp (mp->priv->uri, "daap://", 7) == 0) {
-			ret += rb_daap_src_get_time ();
-		}
-#endif
-
-		return ret;
-=======
 	
 		return (long)(gst_position / (1000*1000*1000));
->>>>>>> 1.42
 	} else
 		return -1;
 }
Index: rhythmdb/rhythmdb-tree.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb-tree.c,v
retrieving revision 1.70
diff -u -3 -p -r1.70 rhythmdb-tree.c
--- rhythmdb/rhythmdb-tree.c	3 Sep 2005 13:18:55 -0000	1.70
+++ rhythmdb/rhythmdb-tree.c	7 Sep 2005 04:19:45 -0000
@@ -249,6 +249,10 @@ rhythmdb_tree_parser_start_element (stru
 						type = RHYTHMDB_ENTRY_TYPE_SONG;
 					else if (!strcmp (typename, "iradio"))
 						type = RHYTHMDB_ENTRY_TYPE_IRADIO_STATION;
+					else if (!strcmp (typename, "podcast"))
+						type = RHYTHMDB_ENTRY_TYPE_PODCAST_POST;
+					else if (!strcmp (typename, "podcast-head"))
+						type = RHYTHMDB_ENTRY_TYPE_PODCAST_HEAD;
 					else
 						return;
 					type_set = TRUE;
@@ -393,6 +397,30 @@ rhythmdb_tree_parser_end_element (struct
 		case RHYTHMDB_PROP_MIMETYPE:
 			ctx->entry->mimetype = rb_refstring_new (ctx->buf->str);
 			break;
+		case RHYTHMDB_PROP_STATUS:
+			ctx->entry->podcast->status = parse_ulong (ctx->buf->str);
+			break;			
+		case RHYTHMDB_PROP_DESCRIPTION:
+			ctx->entry->podcast->description = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_SUBTITLE:
+			ctx->entry->podcast->subtitle = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_SUMMARY:
+			ctx->entry->podcast->summary = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_LANG:
+			ctx->entry->podcast->lang = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_COPYRIGHT:
+			ctx->entry->podcast->copyright = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_IMAGE:
+			ctx->entry->podcast->image = rb_refstring_new (ctx->buf->str);
+			break;
+		case RHYTHMDB_PROP_POST_TIME:			
+			ctx->entry->podcast->post_time = parse_ulong (ctx->buf->str);
+			break;
 		case RHYTHMDB_PROP_TITLE_SORT_KEY:
 		case RHYTHMDB_PROP_GENRE_SORT_KEY:
 		case RHYTHMDB_PROP_ARTIST_SORT_KEY:
@@ -615,6 +643,10 @@ save_entry (RhythmDBTree *db, RhythmDBEn
 		RHYTHMDB_FWRITE_STATICSTR ("song", ctx->handle, ctx->error);
 	} else if (entry->type == RHYTHMDB_ENTRY_TYPE_IRADIO_STATION) {
 		RHYTHMDB_FWRITE_STATICSTR ("iradio", ctx->handle, ctx->error);
+	} else if (entry->type == RHYTHMDB_ENTRY_TYPE_PODCAST_POST) {
+		RHYTHMDB_FWRITE_STATICSTR ("podcast", ctx->handle, ctx->error);
+	} else if (entry->type == RHYTHMDB_ENTRY_TYPE_PODCAST_HEAD) {
+		RHYTHMDB_FWRITE_STATICSTR ("podcast-head", ctx->handle, ctx->error);
 	} else
 		g_assert_not_reached ();
 
@@ -703,6 +735,38 @@ save_entry (RhythmDBTree *db, RhythmDBEn
 		case RHYTHMDB_PROP_LAST_PLAYED:
 			save_entry_ulong(ctx, elt_name, entry->last_played);
 			break;
+		case RHYTHMDB_PROP_STATUS:
+			if (entry->podcast)
+				save_entry_ulong (ctx, elt_name, entry->podcast->status);
+			break;
+		case RHYTHMDB_PROP_DESCRIPTION:
+			if (entry->podcast && entry->podcast->description)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->description));
+			break;
+		case RHYTHMDB_PROP_SUBTITLE:
+			if (entry->podcast && entry->podcast->subtitle)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->subtitle));
+			break;
+		case RHYTHMDB_PROP_SUMMARY:
+			if (entry->podcast && entry->podcast->summary)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->summary));
+			break;
+		case RHYTHMDB_PROP_LANG:
+			if (entry->podcast && entry->podcast->lang)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->lang));
+			break;
+		case RHYTHMDB_PROP_COPYRIGHT:
+			if (entry->podcast && entry->podcast->copyright)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->copyright));
+			break;
+		case RHYTHMDB_PROP_IMAGE:
+			if (entry->podcast && entry->podcast->image)
+				save_entry_string(ctx, elt_name, rb_refstring_get (entry->podcast->image));
+			break;
+		case RHYTHMDB_PROP_POST_TIME:
+			if (entry->podcast)
+				save_entry_ulong (ctx, elt_name, entry->podcast->post_time);
+			break;			
 		case RHYTHMDB_PROP_TITLE_SORT_KEY:
 		case RHYTHMDB_PROP_GENRE_SORT_KEY:
 		case RHYTHMDB_PROP_ARTIST_SORT_KEY:
@@ -754,6 +818,12 @@ rhythmdb_tree_save (RhythmDB *rdb)
 				    (RBTreeEntryItFunc)save_entry, 
 				    NULL, NULL, NULL, &ctx);
 	rhythmdb_hash_tree_foreach (rdb, RHYTHMDB_ENTRY_TYPE_IRADIO_STATION, 
+				    (RBTreeEntryItFunc)save_entry, 
+				    NULL, NULL, NULL, &ctx);
+	rhythmdb_hash_tree_foreach (rdb, RHYTHMDB_ENTRY_TYPE_PODCAST_POST, 
+				    (RBTreeEntryItFunc)save_entry, 
+				    NULL, NULL, NULL, &ctx);
+	rhythmdb_hash_tree_foreach (rdb, RHYTHMDB_ENTRY_TYPE_PODCAST_HEAD, 
 				    (RBTreeEntryItFunc)save_entry, 
 				    NULL, NULL, NULL, &ctx);
 
Index: rhythmdb/rhythmdb.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.c,v
retrieving revision 1.115
diff -u -3 -p -r1.115 rhythmdb.c
--- rhythmdb/rhythmdb.c	4 Sep 2005 23:17:15 -0000	1.115
+++ rhythmdb/rhythmdb.c	7 Sep 2005 04:19:46 -0000
@@ -866,9 +866,15 @@ rhythmdb_entry_allocate (RhythmDB *db, R
 	ret->artist = rb_refstring_ref (db->priv->empty_string);
 	ret->album = rb_refstring_ref (db->priv->empty_string);
 	ret->mimetype = rb_refstring_ref (db->priv->octet_stream_str);
+	
+	if ((type == RHYTHMDB_ENTRY_TYPE_PODCAST_POST) ||
+	    (type == RHYTHMDB_ENTRY_TYPE_PODCAST_HEAD))
+	       ret->podcast = g_new0 (RhythmDBPodcastFields, 1);
+	else
+		ret->podcast = NULL;
 
 	rhythmdb_entry_sync_mirrored (db, ret, RHYTHMDB_PROP_LAST_PLAYED);
-
+	
 	/* The refcount is initially 0, we want to set it to 1 */
 	g_atomic_int_inc (&ret->refcount);
 	return ret;
@@ -919,6 +925,17 @@ rhythmdb_entry_finalize (RhythmDBEntry *
 	rb_refstring_unref (entry->artist);
 	rb_refstring_unref (entry->album);
 	rb_refstring_unref (entry->mimetype);
+	
+	if (entry->podcast) {
+		rb_refstring_unref (entry->podcast->description);
+		rb_refstring_unref (entry->podcast->subtitle);
+		rb_refstring_unref (entry->podcast->summary);
+		rb_refstring_unref (entry->podcast->lang);
+		rb_refstring_unref (entry->podcast->copyright);
+		rb_refstring_unref (entry->podcast->image);
+		g_free (entry->podcast);
+		entry->podcast = NULL;
+	}
 }
 
 void
@@ -2103,6 +2120,36 @@ rhythmdb_entry_set_internal (RhythmDB *d
 	case RHYTHMDB_PROP_HIDDEN:
 		entry->hidden = g_value_get_boolean (value);
 		break;
+	case RHYTHMDB_PROP_STATUS:
+		entry->podcast->status = g_value_get_ulong (value);
+		break;
+	case RHYTHMDB_PROP_DESCRIPTION:
+		rb_refstring_unref (entry->podcast->description);
+		entry->podcast->description = rb_refstring_new (g_value_get_string (value));
+		break;	
+	case RHYTHMDB_PROP_SUBTITLE:
+		rb_refstring_unref (entry->podcast->subtitle);
+		entry->podcast->subtitle = rb_refstring_new (g_value_get_string (value));
+		break;	
+	case RHYTHMDB_PROP_SUMMARY:
+		rb_refstring_unref (entry->podcast->summary);
+		entry->podcast->summary = rb_refstring_new (g_value_get_string (value));
+		break;	
+	case RHYTHMDB_PROP_LANG:
+		rb_refstring_unref (entry->podcast->lang);
+		entry->podcast->lang = rb_refstring_new (g_value_get_string (value));
+		break;	
+	case RHYTHMDB_PROP_COPYRIGHT:
+		rb_refstring_unref (entry->podcast->copyright);
+		entry->podcast->copyright = rb_refstring_new (g_value_get_string (value));
+		break;	
+	case RHYTHMDB_PROP_IMAGE:
+		rb_refstring_unref (entry->podcast->image);
+		entry->podcast->image = rb_refstring_new (g_value_get_string (value));
+		break;
+	case RHYTHMDB_PROP_POST_TIME:
+		entry->podcast->post_time = g_value_get_ulong (value);
+		break;	
 	case RHYTHMDB_NUM_PROPERTIES:
 		g_assert_not_reached ();
 		break;
@@ -2761,6 +2808,14 @@ rhythmdb_prop_get_type (void)
 			ENUM_ENTRY (RHYTHMDB_PROP_LAST_PLAYED_STR, "Last Played (gchararray) [last-played-str]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_PLAYBACK_ERROR, "Playback error string (gchararray) [playback-error]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_HIDDEN, "Visibility (gboolean) [visibility]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_STATUS, "Status of file (gulong) [status]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_DESCRIPTION, "Podcast description(gchararray) [description]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_SUBTITLE, "Podcast subtitle (gchararray) [subtitle]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_SUMMARY, "Podcast summary (gchararray) [summary]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_LANG, "Podcast language (gchararray) [lang]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_COPYRIGHT, "Podcast copyright (gchararray) [copyright]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_IMAGE, "Podcast image(gchararray) [image]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_POST_TIME, "Podcast time of post (gulong) [post-time]"),
 			{ 0, 0, 0 }
 		};
 		g_assert ((sizeof (values) / sizeof (values[0]) - 1) == RHYTHMDB_NUM_PROPERTIES);
@@ -2913,6 +2968,33 @@ RhythmDBEntryType rhythmdb_entry_iradio_
 
 	return iradio_type;
 }
+
+RhythmDBEntryType rhythmdb_entry_podcast_post_get_type (void) 
+{
+	static RhythmDBEntryType podcast_post_type = -1;
+       
+	g_static_mutex_lock (&entry_type_mutex);
+	if (podcast_post_type == -1) {
+		podcast_post_type = rhythmdb_entry_register_type ();
+	}
+	g_static_mutex_unlock (&entry_type_mutex);
+
+	return podcast_post_type;
+}
+
+RhythmDBEntryType rhythmdb_entry_podcast_head_get_type (void) 
+{
+	static RhythmDBEntryType podcast_head_type = -1;
+       
+	g_static_mutex_lock (&entry_type_mutex);
+	if (podcast_head_type == -1) {
+		podcast_head_type = rhythmdb_entry_register_type ();
+	}
+	g_static_mutex_unlock (&entry_type_mutex);
+
+	return podcast_head_type;
+}
+
 
 struct MountCtxt {
 	RhythmDB *db;
Index: rhythmdb/rhythmdb.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.h,v
retrieving revision 1.47
diff -u -3 -p -r1.47 rhythmdb.h
--- rhythmdb/rhythmdb.h	29 Aug 2005 23:19:41 -0000	1.47
+++ rhythmdb/rhythmdb.h	7 Sep 2005 04:19:47 -0000
@@ -48,6 +48,8 @@ typedef gint32 RhythmDBEntryType;
 
 #define RHYTHMDB_ENTRY_TYPE_SONG (rhythmdb_entry_song_get_type ())
 #define RHYTHMDB_ENTRY_TYPE_IRADIO_STATION (rhythmdb_entry_iradio_get_type ())
+#define RHYTHMDB_ENTRY_TYPE_PODCAST_POST (rhythmdb_entry_podcast_post_get_type ())
+#define RHYTHMDB_ENTRY_TYPE_PODCAST_HEAD (rhythmdb_entry_podcast_head_get_type ())
 
 typedef enum
 {
@@ -100,7 +102,15 @@ typedef enum
 	RHYTHMDB_PROP_LAST_PLAYED_STR,
 	RHYTHMDB_PROP_HIDDEN,
 	RHYTHMDB_PROP_PLAYBACK_ERROR,
-
+//podcast propriets
+	RHYTHMDB_PROP_STATUS,
+	RHYTHMDB_PROP_DESCRIPTION,
+	RHYTHMDB_PROP_SUBTITLE,
+	RHYTHMDB_PROP_SUMMARY,
+	RHYTHMDB_PROP_LANG,
+	RHYTHMDB_PROP_COPYRIGHT,
+	RHYTHMDB_PROP_IMAGE,
+	RHYTHMDB_PROP_POST_TIME,
 	RHYTHMDB_NUM_PROPERTIES
 } RhythmDBPropType;
 
@@ -119,6 +129,19 @@ typedef struct {
 } RhythmDBQueryData;
 
 typedef struct {
+	/* podcast */
+	RBRefString *description;
+	RBRefString *subtitle;
+	RBRefString *summary;
+	RBRefString *lang;
+	RBRefString *copyright;
+	RBRefString *image;
+	gulong status;   //0-99: downloading; 100: Conplete; 101: Error; 102: ready; 103: pause;
+	gulong post_time;
+} RhythmDBPodcastFields;
+
+
+typedef struct {
 	/* internal bits */
 #ifndef G_DISABLE_ASSERT
 	guint magic;
@@ -164,11 +187,17 @@ typedef struct {
 	/* cached data */
 	RBRefString *last_played_str;
 
+	/* cached data */
+	RBRefString *date_str;
+
 	/* playback error string */
 	char *playback_error;
 
 	/* visibility (to hide entries on unmounted volumes) */
 	gboolean hidden;
+
+	/*Podcast*/
+	RhythmDBPodcastFields *podcast;
 } RhythmDBEntry;
 
 typedef struct {
@@ -225,6 +254,19 @@ rhythmdb_entry_get_string (RhythmDBEntry
 		return rb_refstring_get (entry->last_played_str);
 	case RHYTHMDB_PROP_PLAYBACK_ERROR:
 		return entry->playback_error;
+//podcast propriets
+	case RHYTHMDB_PROP_DESCRIPTION:
+		return rb_refstring_get (entry->podcast->description);
+	case RHYTHMDB_PROP_SUBTITLE:
+		return rb_refstring_get (entry->podcast->subtitle);
+	case RHYTHMDB_PROP_SUMMARY: 
+		return rb_refstring_get (entry->podcast->summary);
+	case RHYTHMDB_PROP_LANG:
+		return rb_refstring_get (entry->podcast->lang);
+	case RHYTHMDB_PROP_COPYRIGHT:
+		return rb_refstring_get (entry->podcast->copyright);
+	case RHYTHMDB_PROP_IMAGE:
+		return rb_refstring_get (entry->podcast->image);
 	default:
 		g_assert_not_reached ();
 		return NULL;
@@ -279,6 +321,10 @@ rhythmdb_entry_get_ulong (RhythmDBEntry 
 		return entry->play_count;
 	case RHYTHMDB_PROP_BITRATE:
 		return entry->bitrate;		
+	case RHYTHMDB_PROP_POST_TIME:
+		return entry->podcast->post_time;
+	case RHYTHMDB_PROP_STATUS:
+		return entry->podcast->status;		
 	default:
 		g_assert_not_reached ();
 		return 0;
@@ -356,7 +402,7 @@ typedef struct
 	void            (*impl_entry_delete_by_type) (RhythmDB *db, RhythmDBEntryType type);
 
 	RhythmDBEntry *	(*impl_lookup_by_location)(RhythmDB *db, const char *uri);
-
+	
 	gboolean 	(*impl_evaluate_query)	(RhythmDB *db, GPtrArray *query, RhythmDBEntry *entry);
 
 	void		(*impl_entry_foreach)	(RhythmDB *db, GFunc func, gpointer data);
@@ -464,6 +510,8 @@ RhythmDBEntryType rhythmdb_entry_registe
 
 RhythmDBEntryType rhythmdb_entry_song_get_type          (void);
 RhythmDBEntryType rhythmdb_entry_iradio_get_type        (void);
+RhythmDBEntryType rhythmdb_entry_podcast_post_get_type  (void);
+RhythmDBEntryType rhythmdb_entry_podcast_head_get_type  (void);
 RhythmDBEntryType rhythmdb_entry_icecast_get_type        (void);
 
 extern GType rhythmdb_property_type_map[RHYTHMDB_NUM_PROPERTIES];
Index: shell/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/Makefile.am,v
retrieving revision 1.56
diff -u -3 -p -r1.56 Makefile.am
--- shell/Makefile.am	6 Sep 2005 07:15:33 -0000	1.56
+++ shell/Makefile.am	7 Sep 2005 04:19:47 -0000
@@ -70,6 +70,7 @@ rhythmbox_LDADD =					\
 	$(top_builddir)/sources/libsourcesimpl.la	\
 	$(top_builddir)/rhythmdb/librhythmdb.la         \
 	$(top_builddir)/iradio/librbiradio.la	        \
+	$(top_builddir)/podcast/librbpodcast.la	        \
 	$(top_builddir)/remote/librbremote.la	        \
 	$(top_builddir)/player/librbplayer.la		\
 	$(top_builddir)/metadata/librbmetadata.la	\
@@ -114,6 +115,7 @@ INCLUDES = 						\
 	-I$(top_srcdir)/widgets                    	\
 	-I$(top_srcdir)/sources                    	\
 	-I$(top_srcdir)/iradio                    	\
+	-I$(top_srcdir)/podcast                    	\
 	-I$(top_srcdir)/remote				\
 	-I$(top_builddir)/remote			\
 	-DPIXMAP_DIR=\""$(datadir)/pixmaps"\"		\
Index: shell/rb-playlist-manager.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-playlist-manager.c,v
retrieving revision 1.57
diff -u -3 -p -r1.57 rb-playlist-manager.c
--- shell/rb-playlist-manager.c	6 Sep 2005 07:15:33 -0000	1.57
+++ shell/rb-playlist-manager.c	7 Sep 2005 04:19:47 -0000
@@ -98,6 +98,7 @@ struct RBPlaylistManagerPrivate
 
 	RBLibrarySource *libsource;
 	RBIRadioSource *iradio_source;
+	RBPodcastSource *podcast_source;
 	GtkWindow *window;
 
 	guint playlist_serial;
@@ -126,6 +127,7 @@ enum
 	PROP_SOURCELIST,
 	PROP_LIBRARY_SOURCE,
 	PROP_IRADIO_SOURCE,
+	PROP_PODCAST_SOURCE,
 };
 
 enum
@@ -245,6 +247,16 @@ rb_playlist_manager_class_init (RBPlayli
 							      "IRadioSource",
 							      RB_TYPE_IRADIO_SOURCE,
 							      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+
+	g_object_class_install_property (object_class,
+					 PROP_PODCAST_SOURCE,
+					 g_param_spec_object ("podcast-source",
+							      "PodcastSource",
+							      "PodcastSource",
+							      RB_TYPE_PODCAST_SOURCE,
+							      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
 	g_object_class_install_property (object_class,
 					 PROP_SOURCELIST,
 					 g_param_spec_object ("sourcelist",
@@ -460,6 +472,9 @@ rb_playlist_manager_set_property (GObjec
 	case PROP_IRADIO_SOURCE:
 		mgr->priv->iradio_source = g_value_get_object (value);
 		break;
+	case PROP_PODCAST_SOURCE:
+		mgr->priv->podcast_source = g_value_get_object (value);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -491,6 +506,9 @@ rb_playlist_manager_get_property (GObjec
 	case PROP_IRADIO_SOURCE:
 		g_value_set_object (value, mgr->priv->iradio_source);
 		break;
+	case PROP_PODCAST_SOURCE:
+		g_value_set_object (value, mgr->priv->podcast_source);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -512,13 +530,15 @@ RBPlaylistManager *
 rb_playlist_manager_new (RBShell *shell,
 			 RBSourceList *sourcelist,
 			 RBLibrarySource *libsource,
-			 RBIRadioSource *iradio_source)
+			 RBIRadioSource *iradio_source,
+			 RBPodcastSource *podcast_source)
 {
 	return g_object_new (RB_TYPE_PLAYLIST_MANAGER,
 			     "shell", shell,
 			     "sourcelist", sourcelist,
 			     "library_source", libsource,
 			     "iradio_source", iradio_source,
+			     "podcast_source", podcast_source,
 			     NULL);
 }
 
Index: shell/rb-playlist-manager.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-playlist-manager.h,v
retrieving revision 1.18
diff -u -3 -p -r1.18 rb-playlist-manager.h
--- shell/rb-playlist-manager.h	6 Sep 2005 07:15:33 -0000	1.18
+++ shell/rb-playlist-manager.h	7 Sep 2005 04:19:47 -0000
@@ -27,6 +27,7 @@
 #include "rb-sourcelist.h"
 #include "rb-library-source.h"
 #include "rb-iradio-source.h"
+#include "rb-podcast-source.h"
 
 G_BEGIN_DECLS
 
@@ -71,7 +72,8 @@ GType			rb_playlist_manager_get_type	(vo
 RBPlaylistManager *	rb_playlist_manager_new		(RBShell *shell,
 							 RBSourceList *sourcelist,
 							 RBLibrarySource *libsource,
-							 RBIRadioSource *iradio_source);
+							 RBIRadioSource *iradio_source,
+			 				 RBPodcastSource *podcast_source);
 
 gboolean 		rb_playlist_manager_parse_file	(RBPlaylistManager *mgr,
 							 const char *uri,
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.169
diff -u -3 -p -r1.169 rb-shell-player.c
--- shell/rb-shell-player.c	30 Aug 2005 20:22:37 -0000	1.169
+++ shell/rb-shell-player.c	7 Sep 2005 04:19:49 -0000
@@ -59,6 +59,7 @@
 #include "rb-util.h"
 #include "rb-play-order.h"
 #include "rb-statusbar.h"
+#include "rhythmdb.h"
 
 #ifdef HAVE_XIDLE_EXTENSION
 #include <X11/extensions/xidle.h>
@@ -1055,7 +1056,10 @@ rb_shell_player_open_location (RBShellPl
 static gboolean
 rb_shell_player_open_entry (RBShellPlayer *player, RhythmDBEntry *entry, GError **error)
 {
-	return rb_shell_player_open_location (player, entry->location, error);
+	if (entry->type == RHYTHMDB_ENTRY_TYPE_PODCAST_POST)
+		return rb_shell_player_open_location (player, rb_refstring_get (entry->mountpoint), error);
+	else
+		return rb_shell_player_open_location (player, entry->location, error);
 }
 
 static gboolean
Index: shell/rb-shell-preferences.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-preferences.c,v
retrieving revision 1.43
diff -u -3 -p -r1.43 rb-shell-preferences.c
--- shell/rb-shell-preferences.c	6 Sep 2005 07:15:33 -0000	1.43
+++ shell/rb-shell-preferences.c	7 Sep 2005 04:19:49 -0000
@@ -87,6 +87,8 @@ struct RBShellPreferencesPrivate
 	GtkWidget *play_count_check;
 	GtkWidget *last_played_check;
 	GtkWidget *quality_check;
+	GtkWidget *date_check;
+	GtkWidget *status_check;
 
 	gboolean loading;
 };
@@ -224,6 +226,11 @@ rb_shell_preferences_init (RBShellPrefer
 		glade_xml_get_widget (xml, "last_played_check");
 	shell_preferences->priv->quality_check =
 		glade_xml_get_widget (xml, "quality_check");
+	shell_preferences->priv->date_check =
+		glade_xml_get_widget (xml, "date_check");
+	shell_preferences->priv->status_check =
+		glade_xml_get_widget (xml, "status_check");
+
 
 	gtk_notebook_append_page (GTK_NOTEBOOK (shell_preferences->priv->notebook),
 				  glade_xml_get_widget (xml, "general_vbox"),
@@ -441,6 +448,8 @@ rb_shell_preferences_column_check_change
 	else if (shell_preferences->priv->quality_check
 		 && butt == GTK_CHECK_BUTTON (shell_preferences->priv->quality_check))
 		colname = "RHYTHMDB_PROP_BITRATE";
+	else if (butt == GTK_CHECK_BUTTON (shell_preferences->priv->date_check))
+		colname = "RHYTHMDB_PROP_POST_TIME";
 	else
 		g_assert_not_reached ();
 
@@ -505,6 +514,10 @@ rb_shell_preferences_sync (RBShellPrefer
 			gtk_toggle_button_set_active
 				(GTK_TOGGLE_BUTTON (shell_preferences->priv->quality_check),
 				 strstr (columns, "RHYTHMDB_PROP_BITRATE") != NULL);
+		gtk_toggle_button_set_active
+			(GTK_TOGGLE_BUTTON (shell_preferences->priv->date_check),
+			 strstr (columns, "RHYTHMDB_PROP_POST_TIME") != NULL);
+
 	}
 
 	g_free (columns);
Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.333
diff -u -3 -p -r1.333 rb-shell.c
--- shell/rb-shell.c	6 Sep 2005 07:15:33 -0000	1.333
+++ shell/rb-shell.c	7 Sep 2005 04:19:50 -0000
@@ -66,9 +66,7 @@
 #include "rb-statusbar.h"
 #include "rb-shell-preferences.h"
 #include "rb-library-source.h"
-#ifdef WITH_IPOD_SUPPORT
-#include "rb-ipod-source.h"
-#endif
+#include "rb-podcast-source.h"
 #include "totem-pl-parser.h"
 #ifdef WITH_IPOD_SUPPORT
 #include "rb-ipod-source.h"
@@ -80,6 +78,9 @@
 #include "rb-load-failure-dialog.h"
 #include "rb-new-station-dialog.h"
 #include "rb-iradio-source.h"
+
+#include "rb-new-podcast-dialog.h"
+
 #ifdef HAVE_AUDIOCD
 #include "rb-audiocd-source.h"
 #endif
@@ -166,6 +167,9 @@ static void rb_shell_cmd_add_file_to_lib
 					      RBShell *shell);
 static void rb_shell_cmd_new_station (GtkAction *action,
 				      RBShell *shell);
+static void rb_shell_cmd_new_podcast (GtkAction *action,
+				      RBShell *shell);
+
 static void rb_shell_cmd_extract_cd (GtkAction *action,
 				     RBShell *shell);
 static void rb_shell_cmd_current_song (GtkAction *action,
@@ -329,10 +333,15 @@ struct RBShellPrivate
 
 	RBLibrarySource *library_source;
 	RBIRadioSource *iradio_source;
-#ifdef WITH_IPOD_SUPPORT
+	RBPodcastSource *podcast_source;
+#ifdef WITH_IPOD_SUPPORT	
 	RBiPodSource *ipod_source;
 #endif
 
+#ifdef HAVE_AUDIOCD
+ 	MonkeyMediaAudioCD *cd;
+#endif
+
 	RBSource *selected_source;
 
 	GtkWidget *prefs;
@@ -359,6 +368,10 @@ static GtkActionEntry rb_shell_actions [
 	  N_("Create a new Internet Radio station"),
 	  G_CALLBACK (rb_shell_cmd_new_station) },
 
+	{ "MusicNewPodcast", GTK_STOCK_NEW, N_("Subscribe _Podcast"), "<control>P",
+	  N_("Create a new Podcast Feed"),
+	  G_CALLBACK (rb_shell_cmd_new_podcast) },
+
 	{ "MusicImportFolder", GTK_STOCK_OPEN, N_("_Import Folder..."), "<control>O",
 	  N_("Choose folder to be added to the Library"),
 	  G_CALLBACK (rb_shell_cmd_add_folder_to_library) },
@@ -824,12 +837,19 @@ rb_shell_constructor (GType type, guint 
 	shell = RB_SHELL (parent_class->constructor (type, n_construct_properties,
 						      construct_properties));
 
-	rb_debug ("Constructing shell");
+	rb_debug ("Constructing shell RENTO");
 
 	/* initialize UI */
 	win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
+
+
+	rb_debug ("UI initialized");
+	
 	gtk_window_set_title (win, _("Music Player"));
 
+
+	rb_debug ("UI initialized");
+	
 	shell->priv->window = GTK_WIDGET (win);
 	shell->priv->iconified = FALSE;
 	g_signal_connect_object (G_OBJECT (win), "window-state-event",
@@ -843,6 +863,9 @@ rb_shell_constructor (GType type, guint 
   
 	shell->priv->ui_manager = gtk_ui_manager_new ();
 
+
+	rb_debug ("UI Manager create");
+	
 	shell->priv->actiongroup = gtk_action_group_new ("MainActions");
 	gtk_action_group_set_translation_domain (shell->priv->actiongroup,
 						 GETTEXT_PACKAGE);
@@ -995,6 +1018,9 @@ rb_shell_constructor (GType type, guint 
 	rb_shell_append_source (shell, RB_SOURCE (shell->priv->library_source), NULL);
 	shell->priv->iradio_source = RB_IRADIO_SOURCE (rb_iradio_source_new (shell));
 	rb_shell_append_source (shell, RB_SOURCE (shell->priv->iradio_source), NULL);
+	shell->priv->podcast_source = RB_PODCAST_SOURCE (rb_podcast_source_new (shell));
+	rb_shell_append_source (shell, RB_SOURCE (shell->priv->podcast_source), NULL);
+
 #ifdef WITH_IPOD_SUPPORT
 	shell->priv->ipod_source = RB_IPOD_SOURCE (rb_ipod_source_new (shell));
 	rb_shell_append_source (shell, RB_SOURCE (shell->priv->ipod_source), NULL);
@@ -1005,7 +1031,8 @@ rb_shell_constructor (GType type, guint 
 	shell->priv->playlist_manager = rb_playlist_manager_new (shell,
 								 RB_SOURCELIST (shell->priv->sourcelist),
 								 shell->priv->library_source,
-								 shell->priv->iradio_source);
+								 shell->priv->iradio_source,
+								 shell->priv->podcast_source);
 
 	g_signal_connect_object (G_OBJECT (shell->priv->playlist_manager), "playlist_added",
 				 G_CALLBACK (rb_shell_playlist_added_cb), shell, 0);
@@ -1723,6 +1750,7 @@ add_to_library_response_cb (GtkDialog *d
 			    int response_id,
 			    RBShell *shell)
 {
+	
 	char *current_dir = NULL;
 	GSList *uri_list = NULL, *uris = NULL;
 
@@ -1805,6 +1833,18 @@ rb_shell_cmd_new_station (GtkAction *act
 	gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);
 }
+
+static void
+rb_shell_cmd_new_podcast (GtkAction *action,
+			  RBShell *shell)
+{
+	GtkWidget *dialog;
+	rb_debug ("Got new podcast command");
+	dialog = rb_new_podcast_dialog_new (shell->priv->db);
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+}
+
 
 static void
 rb_shell_cmd_extract_cd (GtkAction *action,
Index: sources/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/Makefile.am,v
retrieving revision 1.22
diff -u -3 -p -r1.22 Makefile.am
--- sources/Makefile.am	6 Sep 2005 07:15:34 -0000	1.22
+++ sources/Makefile.am	7 Sep 2005 04:19:50 -0000
@@ -13,6 +13,8 @@ libsourcesimpl_la_SOURCES =		\
 	rb-library-source.h		\
 	rb-iradio-source.c		\
 	rb-iradio-source.h		\
+	rb-podcast-source.c		\
+	rb-podcast-source.h		\
 	rb-playlist-source.c            \
 	rb-playlist-source.h		
 
@@ -29,8 +31,10 @@ INCLUDES =						\
 	-I$(top_srcdir)/library 			\
 	-I$(top_srcdir)/player	 			\
 	-I$(top_srcdir)/iradio				\
+	-I$(top_srcdir)/podcast				\
 	-I$(top_srcdir)/shell				\
 	-I$(top_srcdir)/daapsharing			\
+	-I$(top_srcdir)/metadata			\
 	-DPIXMAP_DIR=\""$(datadir)/pixmaps"\"		\
 	-DSHARE_DIR=\"$(pkgdatadir)\"                   \
 	-DDATADIR=\""$(datadir)"\"			\
Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.95
diff -u -3 -p -r1.95 rb-entry-view.c
--- widgets/rb-entry-view.c	29 Aug 2005 22:00:32 -0000	1.95
+++ widgets/rb-entry-view.c	7 Sep 2005 04:19:52 -0000
@@ -24,6 +24,7 @@
 
 #include <gtk/gtktreeselection.h>
 #include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtkcellrendererprogress.h>
 #include <gtk/gtkiconfactory.h>
 #include <gtk/gtkstock.h>
 #include <gtk/gtktooltips.h>
@@ -34,6 +35,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
+#define __USE_XOPEN
+#include <time.h>
 
 #include "rb-tree-dnd.h"
 #include "rb-entry-view.h"
@@ -841,6 +844,7 @@ rb_entry_view_string_sort_func (RhythmDB
 {
 	const char *a_val;
 	const char *b_val;	
+	
 	gint ret;
 
 	a_val = rhythmdb_entry_get_string (a, data->propid);
@@ -849,6 +853,7 @@ rb_entry_view_string_sort_func (RhythmDB
 	ret = strcmp (a_val, b_val);
 
 	return ret;
+
 }
 
 static void
@@ -957,6 +962,36 @@ rb_entry_view_duration_cell_data_func (G
 	g_free (str);
 }
 
+static void
+rb_entry_view_post_time_cell_data_func (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
+					 GtkTreeModel *tree_model, GtkTreeIter * iter,
+					 struct RBEntryViewCellDataFuncData *data)
+{
+	RhythmDBEntry *entry;
+	gulong i;
+	char *str;
+
+	entry = entry_from_tree_iter (data->view, iter);
+
+	i = rhythmdb_entry_get_ulong (entry, data->propid);
+	if (i == 0)
+		str = _("Unknown");
+	else {
+		struct tm *time_tm;
+		gint ret;
+		time_t time = (time_t) i;
+		
+		str = g_new0 (char, 30);
+		time_tm = localtime(&time);
+		ret = strftime (str, 30, "%d/%m/%Y %H:%M", time_tm);
+	}
+
+	g_object_set (G_OBJECT (renderer), "text", str, NULL);
+
+	if (i != 0)
+		g_free (str);
+}
+
 #if 0
 static void
 rb_entry_view_quality_cell_data_func (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
@@ -1006,6 +1041,47 @@ rb_entry_view_string_cell_data_func (Gtk
 }
 
 static void
+rb_entry_view_status_cell_data_func (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
+				     GtkTreeModel *tree_model, GtkTreeIter *iter,
+				     RBEntryView *view)
+
+{
+	RhythmDBEntry *entry;
+	guint value;
+	
+	entry = entry_from_tree_iter (view, iter);
+
+	g_assert (entry->podcast != NULL);
+
+	switch (entry->podcast->status) 
+	{
+	case 100:
+		g_object_set (G_OBJECT (renderer), "text", _("Completed"), NULL);
+		value = 100;  
+		break;
+	case 101:
+		g_object_set (G_OBJECT (renderer), "text", _("Failed"), NULL);
+		value = 0;
+		break;
+	case 102:
+		g_object_set (G_OBJECT (renderer), "text", _("Waiting"), NULL);
+		value = 0;
+		break;
+	case 103:
+		g_object_set (G_OBJECT (renderer), "text", _("Paused"), NULL);
+		value = 0;
+		break;
+	default:
+		g_object_set (G_OBJECT (renderer), "text", NULL, NULL);
+		value = entry->podcast->status;
+	}
+		
+	g_object_set (G_OBJECT (renderer), "value", value, NULL);
+	
+
+}
+
+static void
 rb_entry_view_sync_sorting (RBEntryView *view)
 {
 	GtkTreeViewColumn *column;
@@ -1194,6 +1270,43 @@ rb_entry_view_append_column (RBEntryView
 		goto append;
 	}
 
+	if (coltype == RB_ENTRY_VIEW_COL_STATUS) {
+		gint width;
+
+		propid = RHYTHMDB_PROP_STATUS;
+
+		sort_data = g_new0 (struct RBEntryViewCellDataFuncData, 1);
+		sort_data->view = view;
+		sort_data->propid = propid;
+		sort_func = (GCompareDataFunc) rb_entry_view_double_ceiling_sort_func;
+		
+		renderer = gtk_cell_renderer_progress_new();
+		
+		gtk_tree_view_column_pack_start (column, renderer, TRUE);
+		gtk_tree_view_column_set_cell_data_func (column, renderer,
+							 (GtkTreeCellDataFunc)
+							 rb_entry_view_status_cell_data_func,
+							 view,
+							 NULL);
+
+		gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
+		gtk_tree_view_column_set_clickable (column, TRUE);
+		gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, NULL);
+		gtk_tree_view_column_set_fixed_width (column, width * 5 + 5);
+//		g_signal_connect_object (renderer,
+//					 "rated",
+//					 G_CALLBACK (rb_entry_view_rated_cb),
+//					 G_OBJECT (view),
+//					 0);
+		real_sort_data = sort_data;
+		title = _("_Status");
+		key = "Status";
+
+		
+		goto append;
+		
+	}
+	
 	cell_data = g_new0 (struct RBEntryViewCellDataFuncData, 1);
 	cell_data->view = view;
 	sort_data = g_new0 (struct RBEntryViewCellDataFuncData, 1);
@@ -1292,6 +1405,28 @@ rb_entry_view_append_column (RBEntryView
 		title = _("L_ast Played");
 		key = "LastPlayed";
 		break;
+	case RB_ENTRY_VIEW_COL_POST_TIME:
+		propid = RHYTHMDB_PROP_POST_TIME;
+		cell_data->propid = propid;
+		cell_data_func = (GtkTreeCellDataFunc) rb_entry_view_post_time_cell_data_func;
+		sort_data->propid = cell_data->propid;
+		sort_func = (GCompareDataFunc) rb_entry_view_ulong_sort_func;
+		title = _("_Date");
+		key = "Date";
+		break;
+
+	case RB_ENTRY_VIEW_COL_STATUS:
+#if 0		
+		propid = RHYTHMDB_PROP_STATUS;
+		cell_data->propid = RHYTHMDB_PROP_STATUS;
+		cell_data_func = (gtktreecelldatafunc) rb_entry_view_status_cell_data_func;
+		ng_sort_func
+		sort_data->propid = RHYTHMDB_PROP_STATUS;
+		sort_func = (GCompareDataFunc) rb_entry_view_ulong_sort_func;
+		title = _("_Status");
+		key = "Status";
+		break;
+#endif		
 	case RB_ENTRY_VIEW_COL_RATING:
 	default:
 		g_assert_not_reached ();
@@ -1300,6 +1435,7 @@ rb_entry_view_append_column (RBEntryView
 	}
 
 	renderer = gtk_cell_renderer_text_new ();
+	
 	if (ellipsize) {
 		g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 		gtk_tree_view_column_set_expand (GTK_TREE_VIEW_COLUMN (column), TRUE);
@@ -1312,9 +1448,11 @@ rb_entry_view_append_column (RBEntryView
 	gtk_tree_view_column_set_resizable (column, TRUE);
 
 append:
+
 	g_hash_table_insert (view->priv->propid_column_map, GINT_TO_POINTER (propid), column);
 	rb_entry_view_append_column_custom (view, column, title, key, sort_func,
 					    real_sort_data ? real_sort_data : sort_data);
+
 }
 
 void
@@ -2048,7 +2186,8 @@ static void
 set_column_not_visible (guint propid, GtkTreeViewColumn *column, gpointer unused)
 {
 	/* title is always visible */
-	if (propid == RHYTHMDB_PROP_TITLE)
+	if ((propid == RHYTHMDB_PROP_TITLE) ||
+	    (propid == RHYTHMDB_PROP_POST_TIME))
 		return;
 	
 	gtk_tree_view_column_set_visible (column, FALSE);
Index: widgets/rb-entry-view.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.h,v
retrieving revision 1.22
diff -u -3 -p -r1.22 rb-entry-view.h
--- widgets/rb-entry-view.h	7 Jul 2005 12:57:44 -0000	1.22
+++ widgets/rb-entry-view.h	7 Sep 2005 04:19:52 -0000
@@ -51,6 +51,8 @@ typedef enum {
 	RB_ENTRY_VIEW_COL_RATING,
 	RB_ENTRY_VIEW_COL_PLAY_COUNT,
 	RB_ENTRY_VIEW_COL_LAST_PLAYED,
+	RB_ENTRY_VIEW_COL_POST_TIME,
+	RB_ENTRY_VIEW_COL_STATUS
 } RBEntryViewColumn;
 
 typedef struct RBEntryViewPrivate RBEntryViewPrivate;
@@ -77,8 +79,10 @@ typedef struct
 	void (*changed)                (RBEntryView *view);
 	void (*have_selection_changed) (RBEntryView *view, gboolean have_selection);
 	void (*sort_order_changed)     (RBEntryView *view);
+	void (*status_changed)	       (RBEntryView *view, guint status);
 
 	void (*show_popup)             (RBEntryView *view);
+	
 } RBEntryViewClass;
 
 GType		rb_entry_view_get_type			(void);

Attachment: podcast.tar.gz
Description: GNU Zip compressed data



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