[Xfce4-commits] <parole:bluesabre/gtk3> Update title and playlist play time from gstreamer.

Sean Davis noreply at xfce.org
Sun Aug 11 15:16:29 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 951040f0490267967fad21b1cb9984c29fb60d0b (commit)
       from 766b03e4e56a539a56b16f3626b8f6544769971b (commit)

commit 951040f0490267967fad21b1cb9984c29fb60d0b
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Feb 23 10:33:54 2013 -0500

    Update title and playlist play time from gstreamer.

 src/parole-medialist.c |   28 ++++++++++++++++++++++++++++
 src/parole-medialist.h |    3 +++
 src/parole-player.c    |    9 ++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index df65065..13b5ebc 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -2027,6 +2027,34 @@ void parole_media_list_set_row_pixbuf  (ParoleMediaList *list, GtkTreeRowReferen
     }
 }
 
+gchar* parole_media_list_get_row_name (ParoleMediaList *list,
+GtkTreeRowReference *row)
+{
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    gchar *name = NULL;
+    
+    if ( gtk_tree_row_reference_valid (row) )
+    {
+	path = gtk_tree_row_reference_get_path (row);
+	
+	if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
+	{
+    	if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path) )
+    	    gtk_tree_model_get (GTK_TREE_MODEL(list->priv->store), &iter, NAME_COL, &name, -1);
+	}
+	else
+	{
+    	if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->disc_store), &iter, path) )
+    	    gtk_tree_model_get (GTK_TREE_MODEL(list->priv->store), &iter, NAME_COL, &name, -1);
+	}
+	
+	gtk_tree_path_free (path);
+    }
+    
+    return name;
+}
+
 void parole_media_list_set_row_name (ParoleMediaList *list, GtkTreeRowReference *row, const gchar *name)
 {
     GtkTreeIter iter;
diff --git a/src/parole-medialist.h b/src/parole-medialist.h
index 95721dd..ef3e65e 100644
--- a/src/parole-medialist.h
+++ b/src/parole-medialist.h
@@ -124,6 +124,9 @@ GtkTreeRowReference		*parole_media_list_get_row_random   (ParoleMediaList *list)
 void				 parole_media_list_set_row_pixbuf   (ParoleMediaList *list,
 								     GtkTreeRowReference *row,
 								     GdkPixbuf *pix);
+								     
+gchar                   *parole_media_list_get_row_name (ParoleMediaList *list,
+GtkTreeRowReference *row);
 
 void				 parole_media_list_set_row_name     (ParoleMediaList *list,
 							             GtkTreeRowReference *row,
diff --git a/src/parole-player.c b/src/parole-player.c
index 43e2b9f..38932b4 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1059,7 +1059,7 @@ parole_player_media_activated_cb (ParoleMediaList *list, GtkTreeRowReference *ro
 				 parole_file_get_uri (file),
 				 sub);
 	    
-	    gtk_window_set_title (GTK_WINDOW (player->priv->window), parole_file_get_display_name(file));
+	    gtk_window_set_title (GTK_WINDOW (player->priv->window), parole_media_list_get_row_name (player->priv->list, player->priv->row));
 	    
 	    if ( directory )
 	    {
@@ -1373,6 +1373,12 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
 	    get_time_string (dur_text, duration);
 
 	    gtk_label_set_text (GTK_LABEL (player->priv->label_duration), dur_text);
+	    if ( player->priv->current_media_type != PAROLE_MEDIA_TYPE_DVD )
+	    {
+	    parole_media_list_set_row_length (player->priv->list,
+	                                      player->priv->row,
+	                                      dur_text);
+	    }
 	}
 	
     player->priv->internal_range_change = FALSE;
@@ -1732,6 +1738,7 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
 	if ( title )
 	{
 	    parole_media_list_set_row_name (player->priv->list, player->priv->row, title);
+	    gtk_window_set_title (GTK_WINDOW (player->priv->window), title);
 	    gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title), g_markup_printf_escaped("<span color='#F4F4F4'><b><big>%s</big></b></span>", title));
 	    g_free (title);
 	}


More information about the Xfce4-commits mailing list