Commit b63c5f7f authored by Ali Abdallah's avatar Ali Abdallah

* Support for Recent played media files.

	* Better configuration loading based GValues.
	* Register posix signal handler.
	* Much better cdda support.
	* Patch the makefile by Enrico Tröger to fix issue with 
	generating the enum types.
	* Fix the sound image menu items size.
	* Double clicks a file close the media chooser dialog.
	* Remove grey border in fullscreen mode.
	* Set the main window name to Parole Media Player.
	* Fix the expander packing style in the savelist chooser.
	

(Old svn revision: 7882)
parent dfedf6f6
2009-07-31: 11:30 Ali aliov@xfce.org
* Support for Recent played media files.
* Better configuration loading based GValues.
* Register posix signal handler.
* Much better cdda support.
* Patch the makefile by Enrico Tröger to fix issue with
generating the enum types.
* Fix the sound image menu items size.
* Double clicks a file close the media chooser dialog.
* Remove grey border in fullscreen mode.
* Set the main window name to Parole Media Player.
* Fix the expander packing style in the savelist chooser.
2009-07-30: Ali aliov@xfce.org 2009-07-30: Ali aliov@xfce.org
* Supports for Aspect ratio views. * Supports for Aspect ratio views.
* Remember the size of the main window set. * Remember the size of the main window set.
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* Complete the shortcut keys. * Complete the shortcut keys.
* Handle missing gstreamer plugins. * Handle missing gstreamer plugins.
* Support scale ratio view. * Support scale ratio view.
* Better support for cdda.
* Support some playlist title entity. * Support some playlist title entity.
* Use pixel-aspect-ratio info when calculating the * Use pixel-aspect-ratio info when calculating the
aspect ratio. aspect ratio.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">1</property> <property name="spacing">1</property>
<signal name="file_activated" handler="media_chooser_file_activate_cb"/>
<signal name="current_folder_changed" handler="media_chooser_folder_changed_cb"/> <signal name="current_folder_changed" handler="media_chooser_folder_changed_cb"/>
</object> </object>
<packing> <packing>
......
...@@ -21,86 +21,6 @@ ...@@ -21,86 +21,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">10</property> <property name="spacing">10</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="enable-vis">
<property name="label" translatable="yes">Enable visualization when playing audio file</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Changing this will take effect after parole is restarted or a new media file is loaded.</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="parole_conf_dialog_enable_vis_changed_cb"/>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Visualization type:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="vis-combobox">
<property name="visible">True</property>
<property name="model">liststore1</property>
<signal name="changed" handler="parole_conf_dialog_vis_plugin_changed_cb"/>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Audio&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkFrame" id="frame-display"> <object class="GtkFrame" id="frame-display">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -262,6 +182,85 @@ ...@@ -262,6 +182,85 @@
</object> </object>
</child> </child>
</object> </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="enable-vis">
<property name="label" translatable="yes">Enable visualization when playing audio file</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="parole_conf_dialog_enable_vis_changed_cb"/>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Visualization type:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="vis-combobox">
<property name="visible">True</property>
<property name="model">liststore1</property>
<signal name="changed" handler="parole_conf_dialog_vis_plugin_changed_cb"/>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Audio&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
...@@ -282,7 +281,7 @@ ...@@ -282,7 +281,7 @@
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkCheckButton" id="enable-subtitle"> <object class="GtkCheckButton" id="enable-subtitle">
<property name="label" translatable="yes">Automatically load subtitle when playing movie file</property> <property name="label" translatable="yes">Automatically load subtitles when playing movie file</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<requires lib="gtk+" version="2.16"/> <requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="main-window"> <object class="GtkWindow" id="main-window">
<property name="title" translatable="yes">Parole Media Player</property>
<property name="window_position">center</property> <property name="window_position">center</property>
<property name="default_width">780</property> <property name="default_width">780</property>
<property name="default_height">480</property> <property name="default_height">480</property>
...@@ -219,7 +220,7 @@ ...@@ -219,7 +220,7 @@
<object class="GtkMenu" id="menu1"> <object class="GtkMenu" id="menu1">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkImageMenuItem" id="imagemenuitem1"> <object class="GtkImageMenuItem" id="volume-mute-menu">
<property name="label" translatable="yes">Mute</property> <property name="label" translatable="yes">Mute</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="image">image12</property> <property name="image">image12</property>
...@@ -227,7 +228,7 @@ ...@@ -227,7 +228,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImageMenuItem" id="imagemenuitem2"> <object class="GtkImageMenuItem" id="volume-up-menu">
<property name="label" translatable="yes">Volume Up</property> <property name="label" translatable="yes">Volume Up</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="image">image11</property> <property name="image">image11</property>
...@@ -237,7 +238,7 @@ ...@@ -237,7 +238,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImageMenuItem" id="imagemenuitem3"> <object class="GtkImageMenuItem" id="volume-down-menu">
<property name="label" translatable="yes">Volume Down</property> <property name="label" translatable="yes">Volume Down</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="image">image10</property> <property name="image">image10</property>
...@@ -286,6 +287,7 @@ ...@@ -286,6 +287,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="show_tabs">False</property> <property name="show_tabs">False</property>
<property name="show_border">False</property>
<property name="scrollable">True</property> <property name="scrollable">True</property>
<property name="group_id">0</property> <property name="group_id">0</property>
<child> <child>
...@@ -378,13 +380,18 @@ ...@@ -378,13 +380,18 @@
</packing> </packing>
</child> </child>
<child> <child>
<placeholder/> <object class="GtkEventBox" id="eventboxinfo">
</child> <property name="no_show_all">True</property>
<child> <child>
<placeholder/> <object class="GtkLabel" id="info">
</child> <property name="no_show_all">True</property>
<child> <property name="use_markup">True</property>
<placeholder/> </object>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child> </child>
</object> </object>
<packing> <packing>
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
</object> </object>
<object class="GtkFileChooserDialog" id="filechooserdialog"> <object class="GtkFileChooserDialog" id="filechooserdialog">
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="default_width">480</property>
<property name="default_height">300</property>
<property name="type_hint">normal</property> <property name="type_hint">normal</property>
<property name="has_separator">False</property> <property name="has_separator">False</property>
<property name="action">save</property> <property name="action">save</property>
...@@ -74,6 +72,8 @@ ...@@ -74,6 +72,8 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
......
...@@ -10,18 +10,11 @@ INCLUDES = \ ...@@ -10,18 +10,11 @@ INCLUDES = \
-DLOCALEDIR=\"$(localedir)\" \ -DLOCALEDIR=\"$(localedir)\" \
-DG_LOG_DOMAIN=\"parole\" \ -DG_LOG_DOMAIN=\"parole\" \
-DPAROLE_PLUGINS_DIR=\"$(libdir)/parole-$(PAROLE_VERSION_API)\"\ -DPAROLE_PLUGINS_DIR=\"$(libdir)/parole-$(PAROLE_VERSION_API)\"\
$(GTK_CFLAGS) \
$(GLIB_CFLAGS) \
$(GOBJECT_CFLAGS) \
$(GTHREAD_CFLAGS) \ $(GTHREAD_CFLAGS) \
$(GIO_CFLAGS) \ $(GIO_CFLAGS) \
$(DBUS_CFLAGS) \
$(DBUS_GLIB_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \
$(LIBXFCE4GUI_CFLAGS) \ $(LIBXFCE4GUI_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(GST_CFLAGS) \
$(GST_VIDEO_CFLAGS) \ $(GST_VIDEO_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_INTERFACES_CFLAGS) $(GST_INTERFACES_CFLAGS)
PAROLE_LDFLAGS = \ PAROLE_LDFLAGS = \
...@@ -30,17 +23,10 @@ PAROLE_LDFLAGS = \ ...@@ -30,17 +23,10 @@ PAROLE_LDFLAGS = \
-export-symbols-regex "^[[^_]].*" -export-symbols-regex "^[[^_]].*"
PAROLE_LIBS = \ PAROLE_LIBS = \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GTHREAD_LIBS) \ $(GTHREAD_LIBS) \
$(GIO_LIBS) \ $(GIO_LIBS) \
$(DBUS_LIBS) \
$(DBUS_GLIB_LIBS) \ $(DBUS_GLIB_LIBS) \
$(LIBXFCE4GUI_LIBS) \ $(LIBXFCE4GUI_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(GST_LIBS) \
$(GST_BASE_LIBS) \
$(GST_VIDEO_LIBS) \ $(GST_VIDEO_LIBS) \
$(GST_INTERFACES_LIBS) $(GST_INTERFACES_LIBS)
...@@ -134,8 +120,7 @@ parole_media_player_SOURCES = \ ...@@ -134,8 +120,7 @@ parole_media_player_SOURCES = \
main.c main.c
parole_media_player_LDADD = \ parole_media_player_LDADD = \
libparole.la \ libparole.la
$(PAROLE_LIBS)
parole_media_player_LDFLAGS = \ parole_media_player_LDFLAGS = \
$(PAROLE_LDFLAGS) $(PAROLE_LDFLAGS)
...@@ -167,9 +152,9 @@ stamp-enum-gtypes.h: $(parole_glib_enum_headers) Makefile ...@@ -167,9 +152,9 @@ stamp-enum-gtypes.h: $(parole_glib_enum_headers) Makefile
--fprod "/* enumerations from \"@filename@\" */\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void);\n#define ENUM_GTYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --vhead "GType @enum_name@_get_type (void);\n#define ENUM_GTYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* __ENUM_GTYPES_H__ */" \ --ftail "G_END_DECLS\n\n#endif /* __ENUM_GTYPES_H__ */" \
$(parole_glib_enum_headers) ) > xgen-enum \ $(parole_glib_enum_headers) ) > xgen-enum.h \
&& (cmp -s xgen-enum enum-gtypes.h || cp xgen-enum enum-gtypes.h) \ && (cmp -s xgen-enum.h enum-gtypes.h || cp xgen-enum.h enum-gtypes.h) \
&& rm -f xgen-enum \ && rm -f xgen-enum.h \
&& echo timestamp > $(@F) && echo timestamp > $(@F)
enum-gtypes.c: $(parole_glib_enum_headers) Makefile enum-gtypes.c: $(parole_glib_enum_headers) Makefile
...@@ -184,9 +169,9 @@ enum-gtypes.c: $(parole_glib_enum_headers) Makefile ...@@ -184,9 +169,9 @@ enum-gtypes.c: $(parole_glib_enum_headers) Makefile
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
$(parole_glib_enum_headers) ) >> xgen-enum \ $(parole_glib_enum_headers) ) >> xgen-enum.c \
&& cp xgen-enum enum-gtypes.c \ && cp xgen-enum.c enum-gtypes.c \
&& rm -f xgen-enum && rm -f xgen-enum.c
org.parole.media.list.h: $(srcdir)/org.parole.media.list.xml org.parole.media.list.h: $(srcdir)/org.parole.media.list.xml
dbus-binding-tool --mode=glib-server --prefix=parole_media_list $< >$@ dbus-binding-tool --mode=glib-server --prefix=parole_media_list $< >$@
......
...@@ -58,6 +58,14 @@ show_version (void) ...@@ -58,6 +58,14 @@ show_version (void)
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} }
static void
parole_sig_handler (gint sig, gpointer data)
{
ParolePlayer *player = (ParolePlayer *) data;
parole_player_terminate (player);
}
static void static void
parole_send_play_disc (DBusGProxy *proxy, const gchar *uri) parole_send_play_disc (DBusGProxy *proxy, const gchar *uri)
{ {
...@@ -203,6 +211,27 @@ int main (int argc, char **argv) ...@@ -203,6 +211,27 @@ int main (int argc, char **argv)
parole_media_list_add_files (list, filenames); parole_media_list_add_files (list, filenames);
} }
} }
if ( xfce_posix_signal_handler_init (&error))
{
xfce_posix_signal_handler_set_handler(SIGHUP,
parole_sig_handler,
player, NULL);
xfce_posix_signal_handler_set_handler(SIGINT,
parole_sig_handler,
player, NULL);
xfce_posix_signal_handler_set_handler(SIGTERM,
parole_sig_handler,
player, NULL);
}
else
{
g_warning ("Unable to set up POSIX signal handlers: %s", error->message);
g_error_free (error);
}
plugins = parole_plugins_manager_new (); plugins = parole_plugins_manager_new ();
parole_plugins_manager_load_plugins (plugins); parole_plugins_manager_load_plugins (plugins);
g_object_unref (builder); g_object_unref (builder);
......
...@@ -37,22 +37,7 @@ ...@@ -37,22 +37,7 @@
struct ParoleConfPrivate struct ParoleConfPrivate
{ {
gchar *vis_sink; GValue *values;
gboolean enable_vis;
gboolean enable_subtitle;
gchar *subtitle_font;
gchar *subtitle_encoding;
gboolean repeat;
gboolean shuffle;
gint brightness;
gint contrast;
gint hue;
gint saturation;
ParoleAspectRatio aspect_ratio;
gint window_width;
gint window_height;
}; };
static gpointer parole_conf_object = NULL; static gpointer parole_conf_object = NULL;
...@@ -85,81 +70,43 @@ static void parole_conf_set_property (GObject *object, ...@@ -85,81 +70,43 @@ static void parole_conf_set_property (GObject *object,
GParamSpec *pspec) GParamSpec *pspec)
{ {
ParoleConf *conf; ParoleConf *conf;
GValue *dst;
GValue save_dst = { 0, };
conf = PAROLE_CONF (object); conf = PAROLE_CONF (object);
dst = conf->priv->values + prop_id;
switch (prop_id) if ( !G_IS_VALUE (dst) )
{ {
case PROP_VIS_ENABLED: g_value_init (dst, pspec->value_type);
conf->priv->enable_vis = g_value_get_boolean (value); g_param_value_set_default (pspec, dst);
g_object_notify (G_OBJECT (conf), pspec->name); }
parole_rc_write_entry_bool ("VIS_ENABLED", PAROLE_RC_GROUP_GENERAL, conf->priv->enable_vis);
break; if ( g_param_values_cmp (pspec, value, dst) != 0 )
case PROP_SUBTITLE_ENCODING: {
if ( conf->priv->subtitle_encoding ) g_value_copy (value, dst);
g_free (conf->priv->subtitle_encoding); g_object_notify (object, pspec->name);
conf->priv->subtitle_encoding = g_value_dup_string (value);
parole_rc_write_entry_string ("SUBTITLE_ENCODING", PAROLE_RC_GROUP_GENERAL, conf->priv->subtitle_encoding); if ( pspec->value_type != G_TYPE_STRING )
break; {
case PROP_VIS_NAME: g_value_init (&save_dst, G_TYPE_STRING);
if ( conf->priv->vis_sink )
g_free (conf->priv->vis_sink); if ( G_LIKELY (g_value_transform (value, &save_dst)) )
conf->priv->vis_sink = g_value_dup_string (value); {
parole_rc_write_entry_string ("VIS_NAME", PAROLE_RC_GROUP_GENERAL, conf->priv->vis_sink); g_object_set_property (G_OBJECT (conf), pspec->name, &save_dst);
break; parole_rc_write_entry_string (pspec->name, PAROLE_RC_GROUP_GENERAL, g_value_get_string (&save_dst));
case PROP_SUBTITLE_ENABLED: }
conf->priv->enable_subtitle = g_value_get_boolean (value); else
parole_rc_write_entry_bool ("ENABLE_SUBTITLE", PAROLE_RC_GROUP_GENERAL, conf->priv->enable_subtitle); g_warning ("Unable to save property : %s", pspec->name);
break;
case PROP_SUBTITLE_FONT: g_value_unset (&save_dst);
if ( conf->priv->subtitle_font ) }
g_free (conf->priv->subtitle_font); else
conf->priv->subtitle_font = g_value_dup_string (value); {
parole_rc_write_entry_string ("SUBTITLE_FONT", PAROLE_RC_GROUP_GENERAL, conf->priv->subtitle_font); parole_rc_write_entry_string (pspec->name, PAROLE_RC_GROUP_GENERAL, g_value_get_string (value));
break; }
case PROP_REPEAT:
conf->priv->repeat = g_value_get_boolean (value);
parole_rc_write_entry_bool ("REPEAT", PAROLE_RC_GROUP_GENERAL, conf->priv->repeat);
break;
case PROP_SHUFFLE:
conf->priv->shuffle = g_value_get_boolean (value);
parole_rc_write_entry_bool ("SHUFFLE", PAROLE_RC_GROUP_GENERAL, conf->priv->shuffle);
break;
case PROP_SATURATION:
conf->priv->saturation = g_value_get_int (value);
parole_rc_write_entry_int ("SATURATION", PAROLE_RC_GROUP_GENERAL, conf->priv->saturation);
break;
case PROP_HUE:
conf->priv->hue = g_value_get_int (value);
parole_rc_write_entry_int ("HUE", PAROLE_RC_GROUP_GENERAL, conf->priv->hue);
break;
case PROP_CONTRAST:
conf->priv->contrast = g_value_get_int (value);
parole_rc_write_entry_int ("CONTRAST", PAROLE_RC_GROUP_GENERAL, conf->priv->contrast);
break;
case PROP_BRIGHTNESS:
conf->priv->brightness = g_value_get_int (value);
parole_rc_write_entry_int ("BRIGHTNESS", PAROLE_RC_GROUP_GENERAL, conf->priv->brightness);
break;
case PROP_ASPECT_RATIO: