[Xfce4-commits] <parole:master> Added better audiobox support for Audio CDs, remote streams, and unknown media. Don't show subtitle options for DVD media.

Sean Davis noreply at xfce.org
Fri Dec 7 12:26:01 CET 2012


Updating branch refs/heads/master
         to b200875632fec3876157f0c6ff02fd2ae14f495e (commit)
       from 6efd6b3562333bd8c143ef505d6f6461ffe27e5e (commit)

commit b200875632fec3876157f0c6ff02fd2ae14f495e
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Dec 7 06:23:56 2012 -0500

    Added better audiobox support for Audio CDs, remote streams, and unknown media.  Don't show subtitle options for DVD media.

 data/interfaces/parole.ui |   12 ++++++------
 src/gst/parole-gst.c      |   38 +++++++++++++++++++++++++++++++++++++-
 src/parole-player.c       |   11 +++++++----
 3 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index 53e1c6e..05c5292 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -472,9 +472,9 @@
                         <property name="use_underline">True</property>
                         <property name="image">image_volume_up</property>
                         <property name="use_stock">False</property>
-                        <accelerator key="plus" signal="activate"/>
-                        <accelerator key="equal" signal="activate"/>
                         <accelerator key="KP_Add" signal="activate"/>
+                        <accelerator key="equal" signal="activate"/>
+                        <accelerator key="plus" signal="activate"/>
                         <signal name="activate" handler="parole_player_volume_up" swapped="no"/>
                       </object>
                     </child>
@@ -487,8 +487,8 @@
                         <property name="use_underline">True</property>
                         <property name="image">image_volume_down</property>
                         <property name="use_stock">False</property>
-                        <accelerator key="KP_Subtract" signal="activate"/>
                         <accelerator key="minus" signal="activate"/>
+                        <accelerator key="KP_Subtract" signal="activate"/>
                         <signal name="activate" handler="parole_player_volume_down" swapped="no"/>
                       </object>
                     </child>
@@ -720,7 +720,7 @@
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
                                         <property name="yalign">1</property>
-                                        <property name="label" translatable="yes"><b><big>Song Title</big></b></property>
+                                        <property name="label" translatable="yes"><span color='#F4F4F4'><b><big>Unknown Song</big></b></span></property>
                                         <property name="use_markup">True</property>
                                         <property name="ellipsize">end</property>
                                       </object>
@@ -735,7 +735,7 @@
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
-                                        <property name="label" translatable="yes"><big>on Song Album (2012)</big></property>
+                                        <property name="label" translatable="yes"><big><span color='#BBBBBB'><i>on</i></span> <span color='#F4F4F4'>Unknown Album</span></big></property>
                                         <property name="use_markup">True</property>
                                         <property name="ellipsize">end</property>
                                       </object>
@@ -751,7 +751,7 @@
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
                                         <property name="yalign">0</property>
-                                        <property name="label" translatable="yes"><big>by Song Artist</big></property>
+                                        <property name="label" translatable="yes"><big><span color='#BBBBBB'><i>by</i></span> <span color='#F4F4F4'>Unknown Artist</span></big></property>
                                         <property name="use_markup">True</property>
                                         <property name="ellipsize">end</property>
                                       </object>
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index be44b5d..ba67e64 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -1236,7 +1236,18 @@ parole_gst_get_meta_data_cdda (ParoleGst *gst, GstTagList *tag)
 	g_object_set (G_OBJECT (gst->priv->stream),
 		      "num-tracks", num_tracks,
 		      "track", track,
+		      "title", g_strdup_printf(_("Track %i"), track),
+		      "artist", NULL,
+		      "year", NULL,
+		      "album", _("Audio CD"),
+		      "comment", NULL,
 		      NULL);
+		      
+    parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
+    g_object_set (G_OBJECT (gst->priv->stream),
+		  "tag-available", FALSE,
+		  NULL);
+    
 	TRACE ("num_tracks=%i track=%i", num_tracks, track);
 	g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
     }
@@ -1314,6 +1325,26 @@ parole_gst_get_meta_data_local_file (ParoleGst *gst, GstTagList *tag)
 }
 
 static void
+parole_gst_get_meta_data_unknown (ParoleGst *gst)
+{
+	g_object_set (G_OBJECT (gst->priv->stream),
+		      "title", NULL,
+		      "artist", NULL,
+		      "year", NULL,
+		      "album", NULL,
+		      "comment", NULL,
+		      NULL);
+    
+    parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
+
+    g_object_set (G_OBJECT (gst->priv->stream),
+		  "tag-available", FALSE,
+		  NULL);
+		  
+    g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
+}
+
+static void
 parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
 {
     ParoleMediaType media_type;
@@ -1321,7 +1352,7 @@ parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
     g_object_get (G_OBJECT (gst->priv->stream),
 		  "media-type", &media_type,
 		  NULL);
-    
+		  
     switch ( media_type )
     {
 	case PAROLE_MEDIA_TYPE_LOCAL_FILE:
@@ -1332,6 +1363,11 @@ parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
 	    break;
     case PAROLE_MEDIA_TYPE_DVD:
         parole_gst_get_meta_data_dvd (gst);
+        break;
+    case PAROLE_MEDIA_TYPE_REMOTE:
+    case PAROLE_MEDIA_TYPE_UNKNOWN:
+	    parole_gst_get_meta_data_unknown (gst);
+	    break;
 	default:
 	    break;
     }
diff --git a/src/parole-player.c b/src/parole-player.c
index fd1b550..584c949 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -835,7 +835,10 @@ parole_player_update_languages (ParolePlayer *player, ParoleGst *gst)
 		{
 			parole_player_update_audio_tracks(player, gst);
 			parole_player_update_subtitles(player, gst);
-			gtk_widget_set_sensitive(player->priv->subtitles_menu_custom, TRUE);
+			
+			/* Enable custom subtitles for video as long as its not a DVD. */
+			gtk_widget_set_sensitive(player->priv->subtitles_menu_custom, 
+			    player->priv->current_media_type != PAROLE_MEDIA_TYPE_DVD);
 		}
 		else
 		    gtk_widget_set_sensitive(player->priv->subtitles_menu_custom, FALSE);
@@ -1694,11 +1697,11 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
 	    g_free (album);
 	}
 	
-	if (year)
-	    g_free (year);
-	
 	else
 	    gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album), g_strdup_printf("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));
+	
+	if (year)
+	    g_free (year);
 
 	if ( artist )
 	{


More information about the Xfce4-commits mailing list