[Xfce4-commits] <parole:master> Removed DVD Menu, since the functionality that was implemented was just Previous and Next.

Sean Davis noreply at xfce.org
Mon Jul 23 01:25:01 CEST 2012


Updating branch refs/heads/master
         to 311a4068c42abf355293900c330420f7c1386c85 (commit)
       from 124892a90fa2e5d09ced6a1d6ac5e249eb14b22d (commit)

commit 311a4068c42abf355293900c330420f7c1386c85
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Jul 18 15:39:26 2012 -0400

    Removed DVD Menu, since the functionality that was implemented was just Previous and Next.

 data/interfaces/parole.ui |  125 +-----------------
 src/Makefile.am           |    2 -
 src/parole-disc-menu.c    |  333 ---------------------------------------------
 src/parole-disc-menu.h    |   60 --------
 src/parole-player.c       |  102 ++++-----------
 5 files changed, 28 insertions(+), 594 deletions(-)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index 3ad31aa..af96b01 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -562,133 +562,14 @@
                                       <object class="GtkAlignment" id="alignment3">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="top_padding">3</property>
-                                        <property name="bottom_padding">3</property>
+                                        <property name="top_padding">5</property>
+                                        <property name="bottom_padding">4</property>
                                         <child>
                                           <object class="GtkVBox" id="play-box">
                                             <property name="visible">True</property>
                                             <property name="can_focus">False</property>
                                             <property name="spacing">5</property>
                                             <child>
-                                              <object class="GtkEventBox" id="disc-box">
-                                                <property name="can_focus">False</property>
-                                                <property name="no_show_all">True</property>
-                                                <child>
-                                                  <object class="GtkHBox" id="disc-menu-box">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="spacing">5</property>
-                                                    <child>
-                                                      <object class="GtkButton" id="prev-chapter">
-                                                        <property name="label" translatable="yes">Previous Chapter</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <property name="use_action_appearance">False</property>
-                                                        <property name="image">image1</property>
-                                                        <property name="relief">none</property>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <object class="GtkButton" id="dvd-chapters-menu">
-                                                        <property name="label" translatable="yes">DVD Menu</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <property name="use_action_appearance">False</property>
-                                                        <property name="image">image2</property>
-                                                        <property name="relief">none</property>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">1</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <object class="GtkButton" id="chapter-menu">
-                                                        <property name="label" translatable="yes">Chapter Menu</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <property name="use_action_appearance">False</property>
-                                                        <property name="image">image3</property>
-                                                        <property name="relief">none</property>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">2</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <object class="GtkEventBox" id="eventboxinfo">
-                                                        <property name="can_focus">False</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <child>
-                                                          <object class="GtkLabel" id="info">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="no_show_all">True</property>
-                                                            <property name="use_markup">True</property>
-                                                          </object>
-                                                        </child>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">True</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">3</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <placeholder/>
-                                                    </child>
-                                                    <child>
-                                                      <object class="GtkButton" id="select-track">
-                                                        <property name="label" translatable="yes">Select Track</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <property name="use_action_appearance">False</property>
-                                                        <property name="image">image13</property>
-                                                        <property name="relief">none</property>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">5</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <object class="GtkButton" id="next-chapter">
-                                                        <property name="label" translatable="yes">Next Chapter</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="no_show_all">True</property>
-                                                        <property name="use_action_appearance">False</property>
-                                                        <property name="image">image4</property>
-                                                        <property name="relief">none</property>
-                                                      </object>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">6</property>
-                                                      </packing>
-                                                    </child>
-                                                  </object>
-                                                </child>
-                                              </object>
-                                              <packing>
-                                                <property name="expand">False</property>
-                                                <property name="fill">True</property>
-                                                <property name="position">0</property>
-                                              </packing>
-                                            </child>
-                                            <child>
                                               <object class="GtkHBox" id="hbox7">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
@@ -900,7 +781,7 @@ audio-volume-medium</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">True</property>
-                                                <property name="position">2</property>
+                                                <property name="position">0</property>
                                               </packing>
                                             </child>
                                           </object>
diff --git a/src/Makefile.am b/src/Makefile.am
index 8469028..901b7b9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,8 +68,6 @@ parole_SOURCES =				\
 	parole-subtitle-encoding.h		\
 	parole-open-location.c			\
 	parole-open-location.h			\
-	parole-disc-menu.c			\
-	parole-disc-menu.h			\
 	parole-button.c				\
 	parole-button.h				\
 	parole-plugin-player.c			\
diff --git a/src/parole-disc-menu.c b/src/parole-disc-menu.c
deleted file mode 100644
index 47ce1fd..0000000
--- a/src/parole-disc-menu.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <libxfce4util/libxfce4util.h>
-
-#include "parole-disc-menu.h"
-#include "parole-builder.h"
-#include "parole-gst.h"
-
-static void parole_disc_menu_finalize   (GObject *object);
-
-#define PAROLE_DISC_MENU_GET_PRIVATE(o) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((o), PAROLE_TYPE_DISC_MENU, ParoleDiscMenuPrivate))
-
-struct ParoleDiscMenuPrivate
-{
-    ParoleGst   *gst;
-    ParoleMediaType current_media_type;
-    
-    GtkWidget	*disc_track;
-    GtkWidget   *disc_box;
-    
-    GtkWidget	*next_chapter;
-    GtkWidget	*prev_chapter;
-    GtkWidget	*dvd_menu;
-    GtkWidget	*chapter_menu;
-    GtkWidget	*info;
-    GtkWidget   *eventboxinfo;
-    
-    guint tracks;
-};
-
-G_DEFINE_TYPE (ParoleDiscMenu, parole_disc_menu, G_TYPE_OBJECT)
-
-static void
-parole_disc_menu_hide (ParoleDiscMenu *menu)
-{
-    gtk_widget_hide (menu->priv->disc_track);
-    gtk_widget_hide (menu->priv->next_chapter);
-    gtk_widget_hide (menu->priv->prev_chapter);
-    gtk_widget_hide (menu->priv->info);
-    gtk_widget_hide (menu->priv->eventboxinfo);
-    gtk_widget_hide (menu->priv->disc_box);
-    //gtk_widget_hide (menu->priv->dvd_menu);
-    //gtk_widget_hide (menu->priv->chapter_menu);
-}
-
-static void
-parole_disc_menu_show (ParoleDiscMenu *menu, gboolean show_label)
-{
-    gtk_widget_show (menu->priv->next_chapter);
-    gtk_widget_show (menu->priv->prev_chapter);
-    
-    if ( show_label )
-    {
-	gtk_widget_show (menu->priv->eventboxinfo);
-	gtk_widget_show (menu->priv->info);
-	gtk_widget_show (menu->priv->disc_track);
-    }
-    
-   //gtk_widget_show (menu->priv->dvd_menu);
-   //gtk_widget_show (menu->priv->dvd_menu);
-   gtk_widget_show (menu->priv->disc_box);
-    
-}
-
-static void
-parole_disc_menu_media_state_cb (ParoleGst *gst, const ParoleStream *stream, 	
-				 ParoleState state, ParoleDiscMenu *menu)
-{
-    ParoleMediaType media_type;
-    menu->priv->tracks = 0;
-    
-    if ( state < PAROLE_STATE_PAUSED )
-    {
-	gtk_label_set_markup (GTK_LABEL (menu->priv->info), NULL);
-	parole_disc_menu_hide (menu);
-    }
-    else if ( state == PAROLE_STATE_PLAYING )
-    {
-	g_object_get (G_OBJECT (stream),
-		      "media-type", &media_type,
-		      NULL);
-	
-	if ( media_type == PAROLE_MEDIA_TYPE_DVD )
-	{
-	    gtk_button_set_label (GTK_BUTTON (menu->priv->next_chapter), _("Next Chapter"));
-	    gtk_button_set_label (GTK_BUTTON (menu->priv->prev_chapter), _("Previous Chapter"));
-	    parole_disc_menu_show (menu, FALSE);
-	}
-	else if ( media_type == PAROLE_MEDIA_TYPE_CDDA )
-	{
-	    guint num_tracks;
-	    guint current;
-	    gchar *text;
-	    gtk_button_set_label (GTK_BUTTON (menu->priv->next_chapter), _("Next Track"));
-	    gtk_button_set_label (GTK_BUTTON (menu->priv->prev_chapter), _("Previous Track"));
-	    
-	    g_object_get (G_OBJECT (stream),
-			  "num-tracks", &num_tracks,
-			  "track", &current,
-			  NULL);
-			  
-	    text = g_strdup_printf ("<span font_desc='sans 8' font_size='xx-large' color='#510DEC'>%s %i/%i</span>", _("Playing Track"), current, num_tracks);
-	    
-	    gtk_label_set_markup (GTK_LABEL (menu->priv->info), text);
-	    
-	    g_free (text);
-	    parole_disc_menu_show (menu, TRUE);
-	    menu->priv->tracks = num_tracks;
-	}
-	menu->priv->current_media_type = media_type;
-    }
-}
-
-static void
-parole_disc_menu_next_chapter_cb (ParoleDiscMenu *menu)
-{
-    if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
-	parole_gst_next_dvd_chapter (menu->priv->gst);
-    else if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA)
-	parole_gst_next_cdda_track (menu->priv->gst);
-}
-
-static void
-parole_disc_menu_prev_chapter_cb (ParoleDiscMenu *menu)
-{
-    if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
-	parole_gst_prev_dvd_chapter (menu->priv->gst);
-    else if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA)
-	parole_gst_prev_cdda_track (menu->priv->gst);
-}
-
-static void
-parole_disc_menu_dvd_menu_cb (ParoleDiscMenu *menu)
-{
-    
-}
-
-static void
-parole_disc_menu_chapter_menu_cb (ParoleDiscMenu *menu)
-{
-    
-}
-
-static void
-track_menu_item_activated_cb (GtkWidget *widget, ParoleDiscMenu *menu)
-{
-    guint track;
-    
-    track = GPOINTER_TO_UINT ( g_object_get_data (G_OBJECT (widget), "track"));
-    
-    parole_gst_seek_cdda (menu->priv->gst, track);
-}
-
-static void
-parole_disc_menu_show_disc_track_menu (ParoleDiscMenu *disc_menu, guint button, guint activate_time)
-{
-    GtkWidget *menu, *mi, *img;
-    gchar track[128];
-    guint i;
-    
-    menu = gtk_menu_new ();
-    
-    for ( i = 0; i < disc_menu->priv->tracks; i++)
-    {
-	img = gtk_image_new_from_stock (GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU);
-	g_snprintf (track, 128, _("Track %i"), i+1);
-	mi = gtk_image_menu_item_new_with_label (track);
-	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
-	gtk_widget_show (mi);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
-	g_object_set_data (G_OBJECT (mi), "track", GUINT_TO_POINTER (i+1));
-	g_signal_connect (mi, "activate",
-		          G_CALLBACK (track_menu_item_activated_cb), disc_menu);
-    }
-    
-    g_signal_connect_swapped (menu, "selection-done",
-			      G_CALLBACK (gtk_widget_destroy), menu);
-    
-    gtk_menu_popup (GTK_MENU (menu), 
-		    NULL, NULL,
-		    NULL, NULL,
-		    button, activate_time);
-}
-
-static gboolean
-parole_disc_menu_show_disc_track (GtkWidget *widget, GdkEventButton *ev, ParoleDiscMenu *menu)
-{
-    if ( ev->button == 1 )
-    {
-	parole_disc_menu_show_disc_track_menu (menu, ev->button, ev->time);
-    }
-    
-    return FALSE;
-}
-
-static void
-parole_disc_menu_class_init (ParoleDiscMenuClass *klass)
-{
-    GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-    object_class->finalize = parole_disc_menu_finalize;
-
-    g_type_class_add_private (klass, sizeof (ParoleDiscMenuPrivate));
-}
-
-static void
-parole_disc_menu_init (ParoleDiscMenu *menu)
-{
-    GtkBuilder *builder;
-    GdkColor color;
-    
-    menu->priv = PAROLE_DISC_MENU_GET_PRIVATE (menu);
-    
-    menu->priv->tracks = 0;
-    
-    builder = parole_builder_get_main_interface ();
-    
-    menu->priv->disc_track = GTK_WIDGET (gtk_builder_get_object (builder, "select-track"));
-    menu->priv->next_chapter = GTK_WIDGET (gtk_builder_get_object (builder, "next-chapter"));
-    menu->priv->prev_chapter = GTK_WIDGET (gtk_builder_get_object (builder, "prev-chapter"));
-    menu->priv->chapter_menu = GTK_WIDGET (gtk_builder_get_object (builder, "chapter-menu"));
-    menu->priv->dvd_menu = GTK_WIDGET (gtk_builder_get_object (builder, "dvd-chapters-menu"));
-    menu->priv->info = GTK_WIDGET (gtk_builder_get_object (builder, "info"));
-    menu->priv->eventboxinfo = GTK_WIDGET (gtk_builder_get_object (builder, "eventboxinfo"));
-    menu->priv->disc_box = GTK_WIDGET (gtk_builder_get_object (builder, "disc-box"));
-    
-    gdk_color_parse ("black", &color);
-    
-    gtk_widget_modify_bg (menu->priv->eventboxinfo, GTK_STATE_NORMAL, &color);
-    gtk_widget_modify_bg (menu->priv->disc_box, GTK_STATE_NORMAL, &color);
-
-    menu->priv->current_media_type = PAROLE_MEDIA_TYPE_UNKNOWN;
-    
-    g_signal_connect (menu->priv->disc_track, "button-press-event",
-		      G_CALLBACK (parole_disc_menu_show_disc_track), menu);
-    
-    g_signal_connect_swapped (menu->priv->next_chapter, "clicked",
-			      G_CALLBACK (parole_disc_menu_next_chapter_cb), menu);
-    
-    g_signal_connect_swapped (menu->priv->prev_chapter, "clicked",
-			      G_CALLBACK (parole_disc_menu_prev_chapter_cb), menu);
-			      
-    g_signal_connect_swapped (menu->priv->dvd_menu, "clicked",
-			      G_CALLBACK (parole_disc_menu_dvd_menu_cb), menu);
-    
-    g_signal_connect_swapped (menu->priv->chapter_menu, "clicked",
-			      G_CALLBACK (parole_disc_menu_chapter_menu_cb), menu);
-			      
-    menu->priv->gst = PAROLE_GST (parole_gst_get ());
-    
-    g_signal_connect (G_OBJECT (menu->priv->gst), "media_state",
-		      G_CALLBACK (parole_disc_menu_media_state_cb), menu);
-    
-    g_object_unref (builder);
-}
-
-static void
-parole_disc_menu_finalize (GObject *object)
-{
-    ParoleDiscMenu *menu;
-
-    menu = PAROLE_DISC_MENU (object);
-
-    G_OBJECT_CLASS (parole_disc_menu_parent_class)->finalize (object);
-}
-
-ParoleDiscMenu *
-parole_disc_menu_new (void)
-{
-    ParoleDiscMenu *menu = NULL;
-    menu = g_object_new (PAROLE_TYPE_DISC_MENU, NULL);
-    return menu;
-}
-
-gboolean parole_disc_menu_visible (ParoleDiscMenu *menu)
-{
-    return (GTK_WIDGET_VISIBLE (menu->priv->next_chapter));
-}
-
-gboolean parole_disc_menu_seek_next (ParoleDiscMenu *menu)
-{
-    if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ||
-	 menu->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA )
-    {
-	parole_disc_menu_next_chapter_cb (menu);
-	return TRUE;
-    }
-    
-    return FALSE;
-}
-
-gboolean parole_disc_menu_seek_prev (ParoleDiscMenu *menu)
-{
-    if ( menu->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ||
-	 menu->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA )
-    {
-	parole_disc_menu_prev_chapter_cb (menu);
-	return TRUE;
-    }
-    
-    return FALSE;
-}
-
-void parole_disc_menu_set_fullscreen (ParoleDiscMenu *menu, gboolean fullscreen)
-{
-}
diff --git a/src/parole-disc-menu.h b/src/parole-disc-menu.h
deleted file mode 100644
index 9f0a084..0000000
--- a/src/parole-disc-menu.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef __PAROLE_DISC_MENU_H
-#define __PAROLE_DISC_MENU_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define PAROLE_TYPE_DISC_MENU        (parole_disc_menu_get_type () )
-#define PAROLE_DISC_MENU(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), PAROLE_TYPE_DISC_MENU, ParoleDiscMenu))
-#define PAROLE_IS_DISC_MENU(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAROLE_TYPE_DISC_MENU))
-
-typedef struct ParoleDiscMenuPrivate ParoleDiscMenuPrivate;
-
-typedef struct
-{
-    GObject         		parent;
-    ParoleDiscMenuPrivate      *priv;
-} ParoleDiscMenu;
-
-typedef struct
-{
-    GObjectClass 		parent_class;
-} ParoleDiscMenuClass;
-
-GType        			parole_disc_menu_get_type        (void) G_GNUC_CONST;
-
-ParoleDiscMenu                 *parole_disc_menu_new             (void);
-
-gboolean			parole_disc_menu_visible	 (ParoleDiscMenu *menu);
-
-gboolean			parole_disc_menu_seek_next	 (ParoleDiscMenu *menu);
-
-gboolean			parole_disc_menu_seek_prev	 (ParoleDiscMenu *menu);
-
-void				parole_disc_menu_set_fullscreen  (ParoleDiscMenu *menu,
-								  gboolean fullscreen);
-
-G_END_DECLS
-
-#endif /* __PAROLE_DISC_MENU_H */
diff --git a/src/parole-player.c b/src/parole-player.c
index 4b8d012..e4023ab 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -56,7 +56,6 @@
 #include "parole-medialist.h"
 #include "parole-filters.h"
 #include "parole-disc.h"
-#include "parole-disc-menu.h"
 #include "parole-screensaver.h"
 #include "parole-conf-dialog.h"
 #include "parole-conf.h"
@@ -244,7 +243,6 @@ struct ParolePlayerPrivate
     ParoleDisc          *disc;
     ParoleScreenSaver   *screen_saver;
     ParoleConf          *conf;
-    ParoleDiscMenu      *disc_menu;
 #ifdef HAVE_XF86_KEYSYM
     ParoleButton        *button;
 #endif
@@ -256,6 +254,7 @@ struct ParolePlayerPrivate
     GtkRecentManager    *recent;
 
     GtkWidget 		*gst;
+    ParoleMediaType current_media_type;
 
     GtkWidget 		*window;
     GtkWidget		*playlist_nt;
@@ -536,6 +535,7 @@ parole_player_disc_selected_cb (ParoleDisc *disc, const gchar *uri, const gchar
 {
     parole_player_reset (player);
     parole_gst_play_device_uri (PAROLE_GST (player->priv->gst), uri, device);
+    player->priv->current_media_type = parole_gst_get_current_stream_type (PAROLE_GST (player->priv->gst));
 }
 
 static void
@@ -593,10 +593,6 @@ parole_player_media_progressed_cb (ParoleGst *gst, const ParoleStream *stream, g
 	parole_player_change_range_value (player, value);
     gchar pos_text[128];
     get_time_string (pos_text, value);
-    /*text = g_strdup_printf ("%s %s/%s", 
-			    state == PAROLE_STATE_PAUSED ? _("Paused") : _("Playing"), 
-			    pos_text, 
-			    dur_text);*/
     gtk_label_set_text (GTK_LABEL (player->priv->label_elapsed), pos_text);
     }
 }
@@ -815,6 +811,15 @@ parole_player_play_selected_row (ParolePlayer *player)
 static void
 parole_player_play_next (ParolePlayer *player, gboolean allow_shuffle)
 {
+	if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ||
+	 player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA )
+    {
+		if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
+		parole_gst_next_dvd_chapter (PAROLE_GST(player->priv->gst));
+		else if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA)
+		parole_gst_next_cdda_track (PAROLE_GST(player->priv->gst));
+		return;
+    }
     gboolean repeat, shuffle;
     
     GtkTreeRowReference *row;
@@ -852,6 +857,15 @@ parole_player_play_next (ParolePlayer *player, gboolean allow_shuffle)
 static void
 parole_player_play_prev (ParolePlayer *player)
 {
+	if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ||
+	 player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA )
+    {
+		if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
+		parole_gst_prev_dvd_chapter (PAROLE_GST(player->priv->gst));
+		else if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA)
+		parole_gst_prev_cdda_track (PAROLE_GST(player->priv->gst));
+		return;
+    }
     GtkTreeRowReference *row;
     
     if ( player->priv->row )
@@ -976,13 +990,11 @@ parole_player_get_seek_value (ParolePlayer *player)
 
 void parole_player_forward_cb (GtkButton *button, ParolePlayer *player)
 {
-	if ( !parole_disc_menu_seek_next (player->priv->disc_menu))
 	parole_player_play_next (player, FALSE);
 }
 							 
 void parole_player_back_cb (GtkButton *button, ParolePlayer *player)
 {
-	if ( !parole_disc_menu_seek_prev (player->priv->disc_menu))
 	parole_player_play_prev (player);
 }
 
@@ -1117,18 +1129,6 @@ parole_player_play_menu_item_activate (ParolePlayer *player)
 }
 
 static void
-parole_player_next_menu_item_activate (ParolePlayer *player)
-{
-    parole_disc_menu_seek_next (player->priv->disc_menu);
-}
-
-static void
-parole_player_previous_menu_item_activate (ParolePlayer *player)
-{
-    parole_disc_menu_seek_prev (player->priv->disc_menu);
-}
-
-static void
 parole_player_move_fs_window (ParolePlayer *player)
 {
     GdkScreen *screen;
@@ -1163,7 +1163,6 @@ parole_player_full_screen (ParolePlayer *player, gboolean fullscreen)
 	npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (player->priv->main_nt));
 	gtk_widget_reparent (player->priv->play_box, player->priv->control);
 	gtk_widget_hide (player->priv->fs_window);
-	parole_disc_menu_set_fullscreen (player->priv->disc_menu, FALSE);
 	gtk_widget_show (player->priv->play_box);
 	gtk_widget_show (player->priv->menu_bar);
 	gtk_widget_show (player->priv->playlist_nt);
@@ -1179,7 +1178,6 @@ parole_player_full_screen (ParolePlayer *player, gboolean fullscreen)
     }
     else
     {
-	parole_disc_menu_set_fullscreen (player->priv->disc_menu, TRUE);
 	parole_player_move_fs_window (player);
 	gtk_widget_reparent (player->priv->play_box, player->priv->fs_window);
 	
@@ -1219,12 +1217,8 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
 {
     GtkWidget *menu, *mi, *img;
     gboolean sensitive;
-    gboolean dvd_menu;
-    ParoleMediaType media_type;
     
-    dvd_menu = parole_disc_menu_visible (player->priv->disc_menu);
-    
-    media_type = parole_gst_get_current_stream_type (PAROLE_GST (player->priv->gst));
+    player->priv->current_media_type = parole_gst_get_current_stream_type (PAROLE_GST (player->priv->gst));
     
     menu = gtk_menu_new ();
     
@@ -1267,46 +1261,6 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
     
     /*
-     * Stop menu item
-     */
-    mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_MEDIA_STOP, NULL);
-					     
-    gtk_widget_set_sensitive (mi, player->priv->state == PAROLE_STATE_PLAYING);
-    gtk_widget_show (mi);
-    /*g_signal_connect_swapped (mi, "activate",
-			      G_CALLBACK (parole_player_stop_menu_item_activate), player);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);*/
-    
-    /*
-     * Next chapter menu item
-     */
-    mi = gtk_image_menu_item_new_with_label (media_type == PAROLE_MEDIA_TYPE_CDDA ? _("Next Track") : _("Next Chapter"));
-    img = gtk_image_new_from_stock (GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_MENU);
-    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),img);
-    gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_STATE_PLAYING) && dvd_menu);
-    gtk_widget_show (mi);
-    g_signal_connect_swapped (mi, "activate",
-			      G_CALLBACK (parole_player_next_menu_item_activate), player);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
-    
-    /*
-     * Previous chapter menu item
-     */
-    mi = gtk_image_menu_item_new_with_label (media_type == PAROLE_MEDIA_TYPE_CDDA ? _("Previous Track") : _("Previous Chapter"));
-    img = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PREVIOUS, GTK_ICON_SIZE_MENU);
-    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
-					     
-    gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_STATE_PLAYING) && dvd_menu);
-    gtk_widget_show (mi);
-    g_signal_connect_swapped (mi, "activate",
-			      G_CALLBACK (parole_player_previous_menu_item_activate), player);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
-    
-    mi = gtk_separator_menu_item_new ();
-    gtk_widget_show (mi);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
-    
-    /*
      * Un/Full screen
      */
     mi = gtk_image_menu_item_new_from_stock (player->priv->full_screen ? GTK_STOCK_LEAVE_FULLSCREEN:
@@ -1546,7 +1500,6 @@ parole_player_finalize (GObject *object)
     g_object_unref (player->priv->conf);
     g_object_unref (player->priv->video_filter);
     g_object_unref (player->priv->disc);
-    g_object_unref (player->priv->disc_menu);
     g_object_unref (player->priv->screen_saver);
 
     if ( player->priv->client_id )
@@ -1803,11 +1756,9 @@ parole_player_key_press (GtkWidget *widget, GdkEventKey *ev, ParolePlayer *playe
 	    parole_player_volume_mute (NULL, player);
 	    return TRUE;
 	case XF86XK_AudioPrev:
-	    if ( !parole_disc_menu_seek_prev (player->priv->disc_menu))
 		parole_player_play_prev (player);
 	    return TRUE;
 	case XF86XK_AudioNext:
-	    if ( !parole_disc_menu_seek_next (player->priv->disc_menu))
 		parole_player_play_next (player, FALSE);
 	    return TRUE;
 #endif /* HAVE_XF86_KEYSYM */
@@ -1833,11 +1784,9 @@ parole_player_button_pressed_cb (ParoleButton *button, ParoleButtonKey key, Paro
 	    parole_player_stop_clicked (NULL, player);
 	    break;
 	case PAROLE_KEY_AUDIO_PREV:
-	    if ( !parole_disc_menu_seek_prev (player->priv->disc_menu))
 		parole_player_play_prev (player);
 	    break;
 	case PAROLE_KEY_AUDIO_NEXT:
-	    if ( !parole_disc_menu_seek_next (player->priv->disc_menu))
 		parole_player_play_next (player, FALSE);
 	    break;
 	default:
@@ -2040,6 +1989,8 @@ parole_player_init (ParolePlayer *player)
 
     player->priv->bus = parole_g_session_bus_get ();
     
+    player->priv->current_media_type = PAROLE_MEDIA_TYPE_UNKNOWN;
+    
     player->priv->video_filter = parole_get_supported_video_filter ();
     g_object_ref_sink (player->priv->video_filter);
     
@@ -2055,9 +2006,7 @@ parole_player_init (ParolePlayer *player)
     player->priv->disc = parole_disc_new ();
     g_signal_connect (player->priv->disc, "disc-selected",
 		      G_CALLBACK (parole_player_disc_selected_cb), player);
-		      
-    player->priv->disc_menu = parole_disc_menu_new ();
-    
+	    
     player->priv->screen_saver = parole_screen_saver_new ();
     player->priv->list = PAROLE_MEDIA_LIST (parole_media_list_get ());
     
@@ -2256,6 +2205,7 @@ ParoleMediaList	*parole_player_get_media_list (ParolePlayer *player)
 
 void parole_player_play_uri_disc (ParolePlayer *player, const gchar *uri, const gchar *device)
 {
+	g_print("%s\n", uri);
     if ( uri )
     {
 	parole_player_disc_selected_cb (NULL, uri, device, player);
@@ -2349,7 +2299,6 @@ static gboolean	parole_player_dbus_stop (ParolePlayer *player,
 static gboolean	parole_player_dbus_next_track (ParolePlayer *player,
 					       GError *error)
 {
-    if ( !parole_disc_menu_seek_next (player->priv->disc_menu))
 	parole_player_play_next (player, FALSE);
     return TRUE;
 }
@@ -2357,7 +2306,6 @@ static gboolean	parole_player_dbus_next_track (ParolePlayer *player,
 static gboolean	parole_player_dbus_prev_track (ParolePlayer *player,
 					       GError *error)
 {
-    if ( !parole_disc_menu_seek_prev (player->priv->disc_menu))
 	parole_player_play_prev (player);
     return TRUE;
 }


More information about the Xfce4-commits mailing list