[Xfce4-commits] [apps/parole] 01/01: cpplint: An else should appear on the same line as the preceding }
noreply at xfce.org
noreply at xfce.org
Sun May 28 15:38:53 CEST 2017
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/parole.
commit 0952a4058a2f1980dd1b43aed550afe8484e21b1
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sun May 28 09:38:41 2017 -0400
cpplint: An else should appear on the same line as the preceding }
---
src/common/parole-rc-utils.c | 7 +-
src/dbus/parole-dbus.c | 7 +-
src/gst/parole-gst.c | 187 +++++++-------------
src/main.c | 32 +---
src/misc/parole-file.c | 8 +-
src/misc/parole-pl-parser.c | 63 +++----
src/misc/parole-stream.c | 7 +-
src/parole-builder.c | 7 +-
src/parole-clutter.c | 14 +-
src/parole-conf-dialog.c | 31 +---
src/parole-conf.c | 40 ++---
src/parole-disc.c | 45 ++---
src/parole-medialist.c | 154 ++++++-----------
src/parole-player.c | 321 ++++++++++++-----------------------
src/parole-plugins-manager.c | 37 ++--
src/parole-utils.c | 121 +++++--------
src/plugins/mpris2/mpris2-provider.c | 31 ++--
17 files changed, 354 insertions(+), 758 deletions(-)
diff --git a/src/common/parole-rc-utils.c b/src/common/parole-rc-utils.c
index 468ca62..f6d50c5 100644
--- a/src/common/parole-rc-utils.c
+++ b/src/common/parole-rc-utils.c
@@ -85,16 +85,15 @@ void parole_insert_line_history_full (const gchar *relpath, const gchar *line)
history = xfce_resource_save_location (XFCE_RESOURCE_CACHE, relpath, TRUE);
- if ( history )
- {
+ if ( history ) {
FILE *f;
f = fopen (history, "a");
fprintf (f, "%s\n", line);
fclose (f);
g_free (history);
- }
- else
+ } else {
g_warning ("Unable to open cache file");
+ }
}
void parole_clear_history_file (void)
diff --git a/src/dbus/parole-dbus.c b/src/dbus/parole-dbus.c
index cc0f256..aba863b 100644
--- a/src/dbus/parole-dbus.c
+++ b/src/dbus/parole-dbus.c
@@ -54,12 +54,9 @@ parole_g_session_bus_get (void)
DBusGConnection *bus;
GError *error = NULL;
- if ( G_LIKELY (session_bus_connected) )
- {
+ if ( G_LIKELY (session_bus_connected) ) {
bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
- }
- else
- {
+ } else {
bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if ( error )
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index 9161963..5bdd894 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -353,13 +353,10 @@ parole_gst_get_video_output_size (ParoleGst *gst, gint *ret_w, gint *ret_h)
video_par_n, video_par_d,
disp_par_n, disp_par_d) )
{
- if (video_w % dar_n == 0)
- {
+ if (video_w % dar_n == 0) {
*ret_w = video_w;
*ret_h = (guint) gst_util_uint64_scale (video_w, dar_d, dar_n);
- }
- else
- {
+ } else {
*ret_w = (guint) gst_util_uint64_scale (video_h, dar_n, dar_d);
*ret_h = video_h;
}
@@ -561,16 +558,12 @@ parole_gst_tick (ParoleGst *gst)
"live", &live,
NULL);
- if ( gst->priv->state >= GST_STATE_PAUSED && !live)
- {
- if ( gst->priv->tick_id != 0 )
- {
+ if ( gst->priv->state >= GST_STATE_PAUSED && !live) {
+ if ( gst->priv->tick_id != 0 ) {
return;
}
gst->priv->tick_id = g_timeout_add (250, (GSourceFunc) parole_gst_tick_timeout, gst);
- }
- else if ( gst->priv->tick_id != 0)
- {
+ } else if ( gst->priv->tick_id != 0) {
g_source_remove (gst->priv->tick_id);
gst->priv->tick_id = 0;
}
@@ -821,24 +814,20 @@ parole_gst_update_vis (ParoleGst *gst)
"flags", &flags,
NULL);
- if ( gst->priv->with_vis )
- {
+ if ( gst->priv->with_vis ) {
GstElement *vis_sink;
flags |= GST_PLAY_FLAG_VIS;
vis_sink = gst_element_factory_make (vis_name, "vis");
- if (vis_sink)
- {
+ if (vis_sink) {
g_object_set (G_OBJECT (gst->priv->playbin),
"vis-plugin", vis_sink,
NULL);
gst->priv->vis_loaded = TRUE;
}
- }
- else
- {
+ } else {
flags &= ~GST_PLAY_FLAG_VIS;
g_object_set (G_OBJECT (gst->priv->playbin),
"vis-plugin", NULL,
@@ -914,16 +903,11 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
gst->priv->stream, PAROLE_STATE_STOPPED);
- if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED)
- {
+ if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED) {
parole_gst_play_file_internal (gst);
- }
- else if ( gst->priv->target == GST_STATE_PAUSED)
- {
+ } else if ( gst->priv->target == GST_STATE_PAUSED) {
parole_gst_change_state (gst, GST_STATE_PAUSED);
- }
- else if ( gst->priv->target == GST_STATE_READY)
- {
+ } else if ( gst->priv->target == GST_STATE_READY) {
gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
g_free(allocation);
@@ -987,13 +971,10 @@ parole_gst_buffer_to_pixbuf (GstBuffer *buffer)
gdk_pixbuf_loader_close (loader, &err))
{
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf)
- {
+ if (pixbuf) {
g_object_ref (pixbuf);
}
- }
- else
- {
+ } else {
GST_WARNING("could not convert tag image to pixbuf: %s", err->message);
g_error_free (err);
}
@@ -1162,19 +1143,14 @@ parole_gst_tag_list_get_cover (ParoleGst *gst, GstTagList *tag_list)
return NULL;
}
- if (gdk_pixbuf_get_width(pixbuf) == gdk_pixbuf_get_height(pixbuf))
- {
+ if (gdk_pixbuf_get_width(pixbuf) == gdk_pixbuf_get_height(pixbuf)) {
height = 256;
width = 256;
- }
- else if (gdk_pixbuf_get_width(pixbuf) < gdk_pixbuf_get_height(pixbuf))
- {
+ } else if (gdk_pixbuf_get_width(pixbuf) < gdk_pixbuf_get_height(pixbuf)) {
multiplier = gdk_pixbuf_get_height(pixbuf)/256.0;
height = 256;
width = gdk_pixbuf_get_width(pixbuf) / multiplier;
- }
- else
- {
+ } else {
multiplier = gdk_pixbuf_get_width(pixbuf)/256.0;
height = gdk_pixbuf_get_height(pixbuf)/multiplier;
width = 256;
@@ -1658,9 +1634,9 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
gst_install_plugins_async(details, ctx, parole_gst_install_plugins_result_func, gst);
#endif
gst_install_plugins_context_free(ctx);
- }
- else if ( (response == GTK_RESPONSE_REJECT) || (response == GTK_RESPONSE_OK) )
+ } else if ( (response == GTK_RESPONSE_REJECT) || (response == GTK_RESPONSE_OK) ) {
gtk_widget_destroy(GTK_WIDGET(dialog));
+ }
}
break;
case GST_MESSAGE_INFO:
@@ -1896,10 +1872,8 @@ parole_gst_seek_by_format (ParoleGst *gst, GstFormat format, gint step)
{
g_warning ("Seek failed : %s", gst_format_get_name (format));
}
- }
- else
- {
- g_warning ("Failed to query element position: %s", gst_format_get_name (format));
+ } else {
+ g_warning ("Failed to query element position: %s", gst_format_get_name (format));
}
}
@@ -1993,28 +1967,20 @@ static void
parole_gst_conf_notify_cb (GObject *object, GParamSpec *spec, ParoleGst *gst)
{
GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
- if ( !g_strcmp0 ("vis-enabled", spec->name) || !g_strcmp0 ("vis-name", spec->name) )
- {
+ if ( !g_strcmp0 ("vis-enabled", spec->name) || !g_strcmp0 ("vis-name", spec->name) ) {
gst->priv->update_vis = TRUE;
- }
- else if ( !g_strcmp0 ("subtitle-font", spec->name) || !g_strcmp0 ("enable-subtitle", spec->name) )
- {
+ } else if ( !g_strcmp0 ("subtitle-font", spec->name) || !g_strcmp0 ("enable-subtitle", spec->name) ) {
parole_gst_set_subtitle_font (gst);
- }
- else if (!g_strcmp0 ("subtitle-encoding", spec->name) )
- {
+ } else if (!g_strcmp0 ("subtitle-encoding", spec->name) ) {
parole_gst_set_subtitle_encoding (gst);
- }
- else if ( !g_strcmp0 ("brightness", spec->name) || !g_strcmp0 ("hue", spec->name) ||
+ } else if ( !g_strcmp0 ("brightness", spec->name) || !g_strcmp0 ("hue", spec->name) ||
!g_strcmp0 ("contrast", spec->name) || !g_strcmp0 ("saturation", spec->name) )
{
gst->priv->update_color_balance = TRUE;
if ( gst->priv->state >= GST_STATE_PAUSED )
parole_gst_set_video_color_balance (gst);
- }
- else if ( !g_strcmp0 ("aspect-ratio", spec->name) )
- {
+ } else if ( !g_strcmp0 ("aspect-ratio", spec->name) ) {
g_object_get (G_OBJECT (gst->priv->conf),
"aspect-ratio", &gst->priv->aspect_ratio,
NULL);
@@ -2440,17 +2406,14 @@ parole_gst_new (gpointer conf_obj)
GtkWidget *parole_gst_get (void)
{
- if ( G_LIKELY (parole_gst_object != NULL ) )
- {
+ if ( G_LIKELY (parole_gst_object != NULL ) ) {
/*
* Don't increase the reference count of this object as
* we need it to be destroyed immediately when the main
* window is destroyed.
*/
//g_object_ref (parole_gst_object);
- }
- else
- {
+ } else {
parole_gst_object = g_object_new (PAROLE_TYPE_GST, NULL);
g_object_add_weak_pointer (parole_gst_object, &parole_gst_object);
}
@@ -2476,13 +2439,10 @@ parole_gst_play_idle (gpointer data)
void parole_gst_set_custom_subtitles (ParoleGst *gst, const gchar* sub_file)
{
- if ( sub_file == NULL )
- {
+ if ( sub_file == NULL ) {
gst->priv->use_custom_subtitles = FALSE;
gst->priv->custom_subtitles = NULL;
- }
- else
- {
+ } else {
gst->priv->use_custom_subtitles = TRUE;
gst->priv->custom_subtitles = g_strdup(sub_file);
}
@@ -2543,22 +2503,14 @@ void parole_gst_play_device_uri (ParoleGst *gst, const gchar *uri, const gchar *
* Don't play cdda:/ as gstreamer gives an error
* but cdda:// works.
*/
- if ( G_UNLIKELY (!g_strcmp0 (uri, "cdda:/") ) )
- {
+ if ( G_UNLIKELY (!g_strcmp0 (uri, "cdda:/") ) ) {
local_uri = "cdda://";
- }
- else if (g_strcmp0(uri, "cdda://") == 0)
- {
+ } else if (g_strcmp0(uri, "cdda://") == 0) {
local_uri = "cdda://";
- }
- else
- {
- if (g_str_has_prefix(device, "/dev/"))
- {
+ } else {
+ if (g_str_has_prefix(device, "/dev/")) {
local_uri = g_strconcat(uri, "/", device, NULL);
- }
- else
- {
+ } else {
local_uri = uri;
}
}
@@ -2788,15 +2740,14 @@ gboolean parole_gst_get_is_xvimage_sink (ParoleGst *gst)
void
parole_gst_set_cursor_visible (ParoleGst *gst, gboolean visible)
{
- if ( visible )
- {
+ if ( visible ) {
if (gst->priv->target == gst->priv->state)
parole_window_normal_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
else
parole_window_busy_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
- }
- else
+ } else {
parole_window_invisible_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
+ }
}
GList *
@@ -2805,8 +2756,7 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
GList *ret = NULL;
gint num = 1;
- if (g_str_equal (type_name, "AUDIO"))
- {
+ if (g_str_equal (type_name, "AUDIO")) {
gint i, n;
g_object_get (G_OBJECT (gst->priv->playbin), "n-audio", &n, NULL);
@@ -2819,42 +2769,31 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
g_signal_emit_by_name (G_OBJECT (gst->priv->playbin), "get-audio-tags",
i, &tags);
- if (tags)
- {
+ if (tags) {
gchar *lc = NULL, *cd = NULL, *language_name = NULL;
gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &lc);
gst_tag_list_get_string (tags, GST_TAG_CODEC, &cd);
- if (lc)
- {
+ if (lc) {
language_name = g_strdup(gst_tag_get_language_name(lc));
- if (language_name)
- {
+ if (language_name) {
ret = g_list_prepend (ret, language_name);
- }
- else
+ } else {
ret = g_list_prepend (ret, lc);
+ }
g_free (cd);
- }
- else if (cd)
- {
+ } else if (cd) {
ret = g_list_prepend (ret, cd);
- }
- else
- {
+ } else {
ret = g_list_prepend (ret, g_strdup_printf (_("Audio Track #%d"), num++));
}
gst_tag_list_free (tags);
- }
- else
- {
+ } else {
ret = g_list_prepend (ret, g_strdup_printf (_("Audio Track #%d"), num++));
}
}
- }
- else if (g_str_equal (type_name, "TEXT"))
- {
+ } else if (g_str_equal (type_name, "TEXT")) {
gint i, n = 0;
g_object_get (G_OBJECT (gst->priv->playbin), "n-text", &n, NULL);
@@ -2865,17 +2804,14 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
if ( gst->priv->use_custom_subtitles == TRUE )
n--;
- if (n != 0)
- {
- for (i = 0; i < n; i++)
- {
+ if (n != 0) {
+ for (i = 0; i < n; i++) {
GstTagList *tags = NULL;
g_signal_emit_by_name (G_OBJECT (gst->priv->playbin), "get-text-tags",
i, &tags);
- if (tags)
- {
+ if (tags) {
gchar *lc = NULL, *cd = NULL, *language_name = NULL;
gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &lc);
@@ -2886,19 +2822,15 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
if (language_name)
{
ret = g_list_prepend (ret, language_name);
- }
- else
+ } else {
ret = g_list_prepend (ret, lc);
+ }
g_free (cd);
- }
- else
- {
+ } else {
ret = g_list_prepend (ret, g_strdup_printf (_("Subtitle #%d"), num++));
}
gst_tag_list_free (tags);
- }
- else
- {
+ } else {
ret = g_list_prepend (ret, g_strdup_printf (_("Subtitle #%d"), num++));
}
}
@@ -2908,9 +2840,7 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
{
ret = g_list_append (ret, g_strdup_printf("%s",gst->priv->custom_subtitles));
}
- }
- else
- {
+ } else {
g_critical ("Invalid stream type '%s'", type_name);
return NULL;
}
@@ -2968,13 +2898,10 @@ gst_set_current_subtitle_track( ParoleGst *gst, gint track_no )
track_no = track_no -1;
- if (track_no <= -1)
- {
+ if (track_no <= -1) {
flags &= ~GST_PLAY_FLAG_TEXT;
track_no = -1;
- }
- else
- {
+ } else {
flags |= GST_PLAY_FLAG_TEXT;
}
diff --git a/src/main.c b/src/main.c
index e2f9f5a..2551108 100644
--- a/src/main.c
+++ b/src/main.c
@@ -87,12 +87,9 @@ parole_send_play_disc (const gchar *uri, const gchar *device)
GError *error = NULL;
gchar *uri_local;
- if ( uri )
- {
+ if ( uri ) {
uri_local = g_strdup (uri);
- }
- else
- {
+ } else {
uri_local = parole_get_uri_from_unix_device (device);
}
@@ -333,11 +330,9 @@ int main (int argc, char **argv)
if ( unmute )
parole_send_message ("Unmute");
- }
/* Create a new instance because Parole isn't running */
- else
- {
+ } else {
builder = parole_builder_get_main_interface ();
parole_dbus_register_name (PAROLE_DBUS_NAME);
@@ -349,26 +344,19 @@ int main (int argc, char **argv)
else if (fullscreen)
parole_player_full_screen (player, TRUE);
- if ( filenames && filenames[0] != NULL )
- {
- if ( g_strv_length (filenames) == 1 && parole_is_uri_disc (filenames[0]))
- {
+ if ( filenames && filenames[0] != NULL ) {
+ if ( g_strv_length (filenames) == 1 && parole_is_uri_disc (filenames[0])) {
parole_player_play_uri_disc (player, filenames[0], device);
- }
- else
- {
+ } else {
ParoleMediaList *list;
list = parole_player_get_media_list (player);
parole_media_list_add_files (list, filenames, enqueue);
}
- }
- else if ( device != NULL )
- {
+ } else if ( device != NULL ) {
parole_player_play_uri_disc (player, NULL, device);
}
- if ( xfce_posix_signal_handler_init (&error))
- {
+ if ( xfce_posix_signal_handler_init (&error)) {
xfce_posix_signal_handler_set_handler(SIGHUP,
parole_sig_handler,
player, NULL);
@@ -380,9 +368,7 @@ int main (int argc, char **argv)
xfce_posix_signal_handler_set_handler(SIGTERM,
parole_sig_handler,
player, NULL);
- }
- else
- {
+ } else {
g_warning ("Unable to set up POSIX signal handlers: %s", error->message);
g_error_free (error);
}
diff --git a/src/misc/parole-file.c b/src/misc/parole-file.c
index 6b14d10..9003ac0 100644
--- a/src/misc/parole-file.c
+++ b/src/misc/parole-file.c
@@ -214,14 +214,11 @@ parole_file_constructed (GObject *object)
if ( error )
{
- if ( G_LIKELY (error->code == G_IO_ERROR_NOT_SUPPORTED) )
- {
+ if ( G_LIKELY (error->code == G_IO_ERROR_NOT_SUPPORTED) ) {
g_error_free (error);
if ( !priv->display_name )
priv->display_name = g_file_get_basename (gfile);
- }
- else
- {
+ } else {
if ( !priv->display_name )
priv->display_name = g_strdup (priv->filename);
g_warning ("Unable to read file info %s", error->message);
@@ -659,4 +656,3 @@ parole_file_set_dvd_chapter (const ParoleFile *file, gint dvd_chapter)
G_PARAM_CONSTRUCT_ONLY|
G_PARAM_READWRITE));
}
-
diff --git a/src/misc/parole-pl-parser.c b/src/misc/parole-pl-parser.c
index 9f3fee6..0fb6e80 100644
--- a/src/misc/parole-pl-parser.c
+++ b/src/misc/parole-pl-parser.c
@@ -101,21 +101,16 @@ parole_xspf_xml_text (GMarkupParseContext *context, const gchar *text, gsize tex
element_name = g_markup_parse_context_get_element (context);
- if (!g_ascii_strcasecmp (element_name, "location") )
- {
- if (data->uri)
- {
+ if (!g_ascii_strcasecmp (element_name, "location") ) {
+ if (data->uri) {
g_free (data->uri);
data->uri = NULL;
}
if (text_len > 0)
data->uri = g_strdup (text);
- }
- else if (!g_ascii_strcasecmp (element_name, "title") )
- {
- if (data->title)
- {
+ } else if (!g_ascii_strcasecmp (element_name, "title") ) {
+ if (data->title) {
g_free (data->title);
data->title = NULL;
}
@@ -274,12 +269,10 @@ parole_pl_parser_parse_asx (const gchar *filename)
if ( !g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) )
goto out;
- if ( g_utf8_validate (contents, -1, NULL) == FALSE)
- {
+ if ( g_utf8_validate (contents, -1, NULL) == FALSE) {
gchar *fixed;
fixed = g_convert (contents, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
- if (fixed != NULL)
- {
+ if (fixed != NULL) {
g_free (contents);
contents = fixed;
}
@@ -287,18 +280,13 @@ parole_pl_parser_parse_asx (const gchar *filename)
pctx = g_markup_parse_context_new (&parser, 0, &data, NULL);
- if ( !g_markup_parse_context_parse (pctx, contents, size, &error) )
- {
- if ( error )
- {
+ if ( !g_markup_parse_context_parse (pctx, contents, size, &error) ) {
+ if ( error ) {
g_critical ("Unable to parse asx file : %s : %s\n", filename, error->message);
g_error_free (error);
}
- }
- else
- {
- if ( !g_markup_parse_context_end_parse (pctx, &error) )
- {
+ } else {
+ if ( !g_markup_parse_context_end_parse (pctx, &error) ) {
g_critical ("Unable to finish parsing ASX playlist file %s", error->message);
g_error_free (error);
}
@@ -354,12 +342,9 @@ parole_pl_parser_parse_m3u (const gchar *filename)
}
}
- if ( strstr (contents,"\x0d") == NULL)
- {
+ if ( strstr (contents,"\x0d") == NULL) {
split_char = "\n";
- }
- else
- {
+ } else {
split_char = "\x0d\n";
}
@@ -372,23 +357,18 @@ parole_pl_parser_parse_m3u (const gchar *filename)
num_lines = g_strv_length (lines);
num_lines--; /* Drop the terminating NULL */
- for ( i = 0; lines[i] != NULL; i++)
- {
+ for ( i = 0; lines[i] != NULL; i++) {
if ( lines[i][0] == '\0' || lines[i][0] == '#')
continue;
/* Absolute, local path */
if ( lines[i][0] == '/' ) {
pl_filename = g_strdup(lines[i]);
- }
-
- else {
+ } else {
/* Stream protocol */
if ( g_regex_match (regex, lines[i], 0, &match_info) ) {
pl_filename = g_strdup(lines[i]);
- }
-
- else {
+ } else {
/* Relative path */
pl_filename = g_strjoin("/", path, lines[i], NULL);
}
@@ -488,18 +468,13 @@ parole_pl_parser_parse_xspf (const gchar *filename)
pctx = g_markup_parse_context_new (&parser, 0, &data, NULL);
- if ( !g_markup_parse_context_parse (pctx, contents, size, &error) )
- {
- if ( error )
- {
+ if ( !g_markup_parse_context_parse (pctx, contents, size, &error) ) {
+ if ( error ) {
g_critical ("Unable to parse xspf file : %s : %s\n", filename, error->message);
g_error_free (error);
}
- }
- else
- {
- if ( !g_markup_parse_context_end_parse (pctx, &error) )
- {
+ } else {
+ if ( !g_markup_parse_context_end_parse (pctx, &error) ) {
g_critical ("Unable to finish parsing xspf playlist file %s", error->message);
g_error_free (error);
}
diff --git a/src/misc/parole-stream.c b/src/misc/parole-stream.c
index 208fafd..2b988bf 100644
--- a/src/misc/parole-stream.c
+++ b/src/misc/parole-stream.c
@@ -365,8 +365,7 @@ parole_stream_set_image (GObject *object, GdkPixbuf *pixbuf)
if ( PAROLE_STREAM_GET_PRIVATE (stream)->image )
g_object_unref(G_OBJECT(PAROLE_STREAM_GET_PRIVATE (stream)->image));
- if (pixbuf)
- {
+ if (pixbuf) {
PAROLE_STREAM_GET_PRIVATE (stream)->image = gdk_pixbuf_copy(pixbuf);
/* Create a jpeg of the artwork for other components to easily access */
@@ -377,9 +376,7 @@ parole_stream_set_image (GObject *object, GdkPixbuf *pixbuf)
PAROLE_STREAM_GET_PRIVATE (stream)->previous_image = g_strdup(filename);
PAROLE_STREAM_GET_PRIVATE (stream)->image_uri = g_strdup_printf("file://%s", filename);
g_free(filename);
- }
- else
- {
+ } else {
PAROLE_STREAM_GET_PRIVATE (stream)->image = NULL;
PAROLE_STREAM_GET_PRIVATE (stream)->previous_image = NULL;
PAROLE_STREAM_GET_PRIVATE (stream)->image_uri = g_strdup_printf ("file://%s/no-cover.png", PIXMAPS_DIR);
diff --git a/src/parole-builder.c b/src/parole-builder.c
index 1ebfd66..9402bee 100644
--- a/src/parole-builder.c
+++ b/src/parole-builder.c
@@ -44,12 +44,9 @@ parole_builder_get_main_interface (void)
{
static gpointer parole_builder_object = NULL;
- if ( G_LIKELY (parole_builder_object != NULL) )
- {
+ if ( G_LIKELY (parole_builder_object != NULL) ) {
g_object_ref (parole_builder_object);
- }
- else
- {
+ } else {
parole_builder_object = parole_builder_new_from_string (parole_ui, parole_ui_length);
g_object_add_weak_pointer (parole_builder_object, &parole_builder_object);
}
diff --git a/src/parole-clutter.c b/src/parole-clutter.c
index 4399410..1a90674 100644
--- a/src/parole-clutter.c
+++ b/src/parole-clutter.c
@@ -166,13 +166,10 @@ parole_clutter_get_video_output_size (ParoleClutter *clutter, gint *ret_w, gint
video_par_n, video_par_d,
disp_par_n, disp_par_d) )
{
- if (video_w % dar_n == 0)
- {
+ if (video_w % dar_n == 0) {
*ret_w = video_w;
*ret_h = (guint) gst_util_uint64_scale (video_w, dar_d, dar_n);
- }
- else
- {
+ } else {
*ret_w = (guint) gst_util_uint64_scale (video_h, dar_n, dar_d);
*ret_h = video_h;
}
@@ -357,16 +354,13 @@ parole_clutter_new (gpointer conf_obj)
GtkWidget *parole_clutter_get (void)
{
- if ( G_LIKELY (parole_clutter_object != NULL ) )
- {
+ if ( G_LIKELY (parole_clutter_object != NULL ) ) {
/*
* Don't increase the reference count of this object as
* we need it to be destroyed immediately when the main
* window is destroyed.
*/
- }
- else
- {
+ } else {
parole_clutter_object = g_object_new (PAROLE_TYPE_CLUTTER, NULL);
g_object_add_weak_pointer (parole_clutter_object, &parole_clutter_object);
}
diff --git a/src/parole-conf-dialog.c b/src/parole-conf-dialog.c
index de08abc..6fac5b5 100644
--- a/src/parole-conf-dialog.c
+++ b/src/parole-conf-dialog.c
@@ -336,13 +336,10 @@ parole_conf_dialog_set_default_vis_plugin (GtkTreeModel *model, GtkTreePath *pat
f = g_hash_table_lookup (self->priv->vis_plugins, combox_text);
- if ( !g_strcmp0 (vis_name, "none") )
- {
+ if ( !g_strcmp0 (vis_name, "none") ) {
if ( !g_strcmp0 (gst_object_get_name (GST_OBJECT (f)), "Goom") )
ret = TRUE;
- }
- else if ( !g_strcmp0 (gst_object_get_name (GST_OBJECT (f)), vis_name) )
- {
+ } else if ( !g_strcmp0 (gst_object_get_name (GST_OBJECT (f)), vis_name) ) {
ret = TRUE;
}
@@ -362,26 +359,18 @@ parole_conf_dialog_set_default_sink_plugin (ParoleConfDialog *self)
"videosink", &sink_name,
NULL);
- if (g_strcmp0(sink_name, "xvimagesink") == 0)
- {
+ if (g_strcmp0(sink_name, "xvimagesink") == 0) {
gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->sink_combox), 0);
return TRUE;
- }
-
- else if (g_strcmp0(sink_name, "ximagesink") == 0)
- {
+ } else if (g_strcmp0(sink_name, "ximagesink") == 0) {
gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->sink_combox), 1);
return TRUE;
- }
#ifdef HAVE_CLUTTER
- else if (g_strcmp0(sink_name, "cluttersink") == 0)
- {
+ } else if (g_strcmp0(sink_name, "cluttersink") == 0) {
gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->sink_combox), 2);
return TRUE;
- }
#endif
- else
- {
+ } else {
gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->sink_combox), 1);
return FALSE;
}
@@ -467,12 +456,9 @@ void parole_conf_dialog_open (ParoleConfDialog *self, GtkWidget *parent)
with_display = parole_gst_get_is_xvimage_sink (PAROLE_GST (parole_gst_get ()));
- if ( !with_display )
- {
+ if ( !with_display ) {
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "frame-display")), FALSE);
- }
- else
- {
+ } else {
gint brightness_value;
gint contrast_value;
gint hue_value;
@@ -575,4 +561,3 @@ void parole_conf_dialog_open (ParoleConfDialog *self, GtkWidget *parent)
gtk_widget_show (dialog);
}
-
diff --git a/src/parole-conf.c b/src/parole-conf.c
index 14eb438..319721d 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -165,25 +165,20 @@ static void parole_conf_set_property (GObject *object,
/* freeze */
g_signal_handler_block (conf->channel, conf->property_changed_id);
- if (G_VALUE_HOLDS_ENUM (value))
- {
+ if (G_VALUE_HOLDS_ENUM (value)) {
/* convert into a string */
g_value_init (&dst, G_TYPE_STRING);
if (g_value_transform (value, &dst))
xfconf_channel_set_property (conf->channel, xfconf_nick, &dst);
g_value_unset (&dst);
- }
- else if (G_VALUE_HOLDS (value, G_TYPE_STRV))
- {
+ } else if (G_VALUE_HOLDS (value, G_TYPE_STRV)) {
/* convert to a GValue GPtrArray in xfconf */
array = g_value_get_boxed (value);
if (array != NULL && *array != NULL)
xfconf_channel_set_string_list (conf->channel, xfconf_nick, (const gchar * const *) array);
else
xfconf_channel_reset_property (conf->channel, xfconf_nick, FALSE);
- }
- else
- {
+ } else {
/* other types we support directly */
xfconf_channel_set_property (conf->channel, xfconf_nick, value);
}
@@ -240,22 +235,17 @@ static void parole_conf_get_property (GObject *object,
/* store xfconf values using the spec nick */
xfconf_nick = g_strdup_printf("%s", g_param_spec_get_nick(pspec));
- if (G_VALUE_TYPE (value) == G_TYPE_STRV)
- {
+ if (G_VALUE_TYPE (value) == G_TYPE_STRV) {
/* handle arrays directly since we cannot transform those */
array = xfconf_channel_get_string_list (conf->channel, xfconf_nick);
g_value_take_boxed (value, array);
- }
- else if (xfconf_channel_get_property (conf->channel, xfconf_nick, &src))
- {
+ } else if (xfconf_channel_get_property (conf->channel, xfconf_nick, &src)) {
if (G_VALUE_TYPE (value) == G_VALUE_TYPE (&src))
g_value_copy (&src, value);
else if (!g_value_transform (&src, value))
g_printerr ("Parole: Failed to transform property %s\n", prop_name);
g_value_unset (&src);
- }
- else
- {
+ } else {
/* value is not found, return default */
g_param_value_set_default (pspec, value);
}
@@ -972,19 +962,14 @@ parole_conf_load_rc_file (ParoleConf *conf)
g_value_set_static_string (&src, string);
/* store string and enums directly */
- if (G_IS_PARAM_SPEC_STRING (pspec) || G_IS_PARAM_SPEC_ENUM (pspec))
- {
+ if (G_IS_PARAM_SPEC_STRING (pspec) || G_IS_PARAM_SPEC_ENUM (pspec)) {
xfconf_channel_set_property (conf->channel, prop_name, &src);
- }
- else if (g_value_type_transformable (G_TYPE_STRING, G_PARAM_SPEC_VALUE_TYPE (pspec)))
- {
+ } else if (g_value_type_transformable (G_TYPE_STRING, G_PARAM_SPEC_VALUE_TYPE (pspec))) {
g_value_init (&dst, G_PARAM_SPEC_VALUE_TYPE (pspec));
if (g_value_transform (&src, &dst))
xfconf_channel_set_property (conf->channel, prop_name, &dst);
g_value_unset (&dst);
- }
- else
- {
+ } else {
g_warning ("Failed to migrate property \"%s\"", g_param_spec_get_name (pspec));
}
@@ -1042,12 +1027,9 @@ parole_conf_init (ParoleConf *conf)
ParoleConf *
parole_conf_new (void)
{
- if ( parole_conf_object != NULL )
- {
+ if ( parole_conf_object != NULL ) {
g_object_ref (parole_conf_object);
- }
- else
- {
+ } else {
parole_conf_object = g_object_new (PAROLE_TYPE_CONF, NULL);
g_object_add_weak_pointer (parole_conf_object, &parole_conf_object);
}
diff --git a/src/parole-disc.c b/src/parole-disc.c
index 7cf074f..379cb37 100644
--- a/src/parole-disc.c
+++ b/src/parole-disc.c
@@ -109,13 +109,10 @@ parole_disc_set_label(ParoleDisc *disc, const gchar *label)
{
gchar *menu_label;
- if ( g_strcmp0(label, _("Insert Disc")) != 0 )
- {
+ if ( g_strcmp0(label, _("Insert Disc")) != 0 ) {
menu_label = g_strdup_printf ("%s '%s'", _("Play Disc"), label);
g_signal_emit (G_OBJECT (disc), signals [LABEL_CHANGED], 0, label);
- }
- else
- {
+ } else {
menu_label = g_strdup(label);
g_signal_emit (G_OBJECT (disc), signals [LABEL_CHANGED], 0, label);
}
@@ -271,26 +268,19 @@ parole_disc_add_mount_to_menu (ParoleDisc *disc, GMount *mount, const gchar *dev
{
TRACE ("Checking disc content type : %s", content_type[i]);
- if ( !g_strcmp0 (content_type[i], "x-content/video-dvd") )
- {
+ if ( !g_strcmp0 (content_type[i], "x-content/video-dvd") ) {
kind = PAROLE_DISC_DVD;
uri = g_strdup ("dvd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/video-vcd") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/video-vcd") ) {
kind = PAROLE_DISC_VCD;
uri = g_strdup ("vcd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/video-svcd") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/video-svcd") ) {
kind = PAROLE_DISC_SVCD;
uri = g_strdup ("svcd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/audio-cdda") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/audio-cdda") ) {
kind = PAROLE_DISC_CDDA;
uri = g_strdup ("cdda://");
break;
@@ -349,19 +339,13 @@ parole_disc_check_cdrom (ParoleDisc *disc, GVolume *volume, const gchar *device)
goto out;
}
- if ( (drive = ioctl (fd, CDROM_DRIVE_STATUS, NULL)) )
- {
- if ( drive == CDS_DRIVE_NOT_READY )
- {
+ if ( (drive = ioctl (fd, CDROM_DRIVE_STATUS, NULL)) ) {
+ if ( drive == CDS_DRIVE_NOT_READY ) {
g_print ("Drive :%s is not yet ready\n", device);
disc->priv->needs_update = TRUE;
- }
- else if ( drive == CDS_DISC_OK )
- {
- if ( (drive = ioctl (fd, CDROM_DISC_STATUS, NULL)) > 0 )
- {
- if ( drive == CDS_AUDIO || drive == CDS_MIXED )
- {
+ } else if ( drive == CDS_DISC_OK ) {
+ if ( (drive = ioctl (fd, CDROM_DISC_STATUS, NULL)) > 0 ) {
+ if ( drive == CDS_AUDIO || drive == CDS_MIXED ) {
data = parole_disc_get_mount_data (disc, "cdda://", device, PAROLE_DISC_CDDA);
name = g_volume_get_name (volume);
@@ -406,14 +390,11 @@ parole_disc_add_drive (ParoleDisc *disc, GDrive *drive, const gchar *device)
TRACE ("Volume name %s", g_volume_get_name (volume));
mount = g_volume_get_mount (volume);
- if ( mount )
- {
+ if ( mount ) {
TRACE ("Mount name : %s", g_mount_get_name (mount));
parole_disc_add_mount_to_menu (disc, mount, device);
g_object_unref (mount);
- }
- else
- {
+ } else {
/* Could be a cdda?*/
parole_disc_check_cdrom (disc, volume, device);
}
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index 618a759..792216c 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -218,15 +218,12 @@ parole_media_list_set_playlist_count (ParoleMediaList *list, gint n_items)
gtk_widget_set_sensitive (list->priv->remove_button, n_items != 0);
gtk_widget_set_sensitive (list->priv->clear_button, n_items != 0);
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
- {
- gtk_tree_view_column_set_title (list->priv->col,
- g_strdup_printf(ngettext("Playlist (%i item)", "Playlist (%i items)", n_items), n_items));
- }
- else
- {
- gtk_tree_view_column_set_title (list->priv->disc_col,
- g_strdup_printf(ngettext("Playlist (%i chapter)", "Playlist (%i chapters)", n_items), n_items));
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0) {
+ gtk_tree_view_column_set_title (list->priv->col,
+ g_strdup_printf(ngettext("Playlist (%i item)", "Playlist (%i items)", n_items), n_items));
+ } else {
+ gtk_tree_view_column_set_title (list->priv->disc_col,
+ g_strdup_printf(ngettext("Playlist (%i chapter)", "Playlist (%i chapters)", n_items), n_items));
}
/*
@@ -239,12 +236,9 @@ parole_media_list_set_playlist_count (ParoleMediaList *list, gint n_items)
gint
parole_media_list_get_playlist_count (ParoleMediaList *list)
{
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
- {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0) {
return gtk_tree_model_iter_n_children(GTK_TREE_MODEL(list->priv->store), NULL);
- }
- else
- {
+ } else {
return gtk_tree_model_iter_n_children(GTK_TREE_MODEL(list->priv->disc_store), NULL);
}
}
@@ -440,12 +434,9 @@ parole_media_list_open_uri (ParoleMediaList *list, const gchar *uri)
{
ParoleFile *file;
- if ( parole_is_uri_disc (uri) )
- {
+ if ( parole_is_uri_disc (uri) ) {
g_signal_emit (G_OBJECT (list), signals [URI_OPENED], 0, uri);
- }
- else
- {
+ } else {
file = parole_file_new (uri);
parole_media_list_add (list, file, FALSE, TRUE, TRUE);
}
@@ -1399,13 +1390,10 @@ parole_media_list_button_release_event (GtkWidget *widget, GdkEventButton *ev, P
static void
parole_media_list_select_path (ParoleMediaList *list, gboolean disc, GtkTreePath *path)
{
- if (disc)
- {
+ if (disc) {
gtk_tree_selection_select_path (list->priv->disc_sel, path);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (list->priv->disc_view), path, NULL, FALSE);
- }
- else
- {
+ } else {
gtk_tree_selection_select_path (list->priv->sel, path);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (list->priv->view), path, NULL, FALSE);
}
@@ -1672,12 +1660,9 @@ parole_media_list_get (void)
{
static gpointer list = NULL;
- if ( G_LIKELY (list != NULL ) )
- {
+ if ( G_LIKELY (list != NULL ) ) {
g_object_ref (list);
- }
- else
- {
+ } else {
list = g_object_new (PAROLE_TYPE_MEDIA_LIST, NULL);
g_object_add_weak_pointer (list, &list);
}
@@ -1729,15 +1714,10 @@ parole_media_list_add_by_path (ParoleMediaList *list, const gchar *path, gboolea
if (g_path_is_absolute(path)) {
full_path = g_strdup(path);
- }
- else
- {
- if (g_file_test( g_strjoin("/", g_get_current_dir(), g_strdup(path), NULL), G_FILE_TEST_EXISTS))
- {
+ } else {
+ if (g_file_test( g_strjoin("/", g_get_current_dir(), g_strdup(path), NULL), G_FILE_TEST_EXISTS)) {
full_path = g_strjoin("/", g_get_current_dir(), g_strdup(path), NULL);
- }
- else
- {
+ } else {
full_path = g_strdup(path);
}
}
@@ -1774,15 +1754,11 @@ GtkTreeRowReference *parole_media_list_get_next_row (ParoleMediaList *list,
gtk_tree_path_next (path);
- if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path))
- {
+ if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path)) {
next = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->store), path);
//parole_media_list_select_path (list, path);
- }
- else if ( repeat ) /* Repeat playing ?*/
- {
- if ( gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->priv->store), &iter))
- {
+ } else if ( repeat ) { /* Repeat playing ?*/
+ if ( gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->priv->store), &iter)) {
next = parole_media_list_get_row_reference_from_iter (list, &iter, TRUE);
}
}
@@ -1808,13 +1784,12 @@ GtkTreeRowReference *parole_media_list_get_prev_row (ParoleMediaList *list,
gtk_tree_path_prev (path);
- if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path))
- {
+ if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path)) {
prev = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->store), path);
//parole_media_list_select_path (list, path);
- }
- else
+ } else {
prev = row;
+ }
gtk_tree_path_free (path);
@@ -1833,13 +1808,10 @@ GtkTreeRowReference *parole_media_list_get_row_n (ParoleMediaList *list,
path = gtk_tree_path_new_from_string( g_strdup_printf("%i", wanted_row) );
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
- {
+ 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))
row = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->store), path);
- }
- else
- {
+ } else {
if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->disc_store), &iter, path))
row = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->disc_store), path);
}
@@ -1948,13 +1920,10 @@ GtkTreeRowReference *parole_media_list_get_first_row (ParoleMediaList *list)
GtkTreeRowReference *row = NULL;
GtkTreeIter iter;
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
- {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0) {
if ( gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->priv->store), &iter) )
row = parole_media_list_get_row_reference_from_iter (list, &iter, TRUE);
- }
- else
- {
+ } else {
if ( gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->priv->disc_store), &iter) )
row = parole_media_list_get_row_reference_from_iter (list, &iter, TRUE);
}
@@ -2005,17 +1974,13 @@ void parole_media_list_set_row_playback_state (ParoleMediaList *list, GtkTreeRo
GtkTreeIter iter;
GtkTreePath *path;
- if ( gtk_tree_row_reference_valid (row) )
- {
+ 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_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_list_store_set (list->priv->store, &iter, STATE_COL, state, -1);
- }
- else
- {
+ } else {
if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->disc_store), &iter, path) )
gtk_list_store_set (list->priv->disc_store, &iter, STATE_COL, state, -1);
}
@@ -2035,13 +2000,10 @@ GtkTreeRowReference *row)
{
path = gtk_tree_row_reference_get_path (row);
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(list->priv->playlist_notebook)) == 0)
- {
+ 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
- {
+ } 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->disc_store), &iter, NAME_COL, &name, -1);
}
@@ -2057,17 +2019,13 @@ void parole_media_list_set_row_name (ParoleMediaList *list, GtkTreeRowReference
GtkTreeIter iter;
GtkTreePath *path;
- if ( gtk_tree_row_reference_valid (row) )
- {
+ 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_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_list_store_set (list->priv->store, &iter, NAME_COL, name, -1);
- }
- else
- {
+ } else {
if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->disc_store), &iter, path) )
gtk_list_store_set (list->priv->disc_store, &iter, NAME_COL, name, -1);
}
@@ -2081,17 +2039,13 @@ void parole_media_list_set_row_length (ParoleMediaList *list, GtkTreeRowReferenc
GtkTreeIter iter;
GtkTreePath *path;
- if ( gtk_tree_row_reference_valid (row) )
- {
+ 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_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_list_store_set (list->priv->store, &iter, LENGTH_COL, len, -1);
- }
- else
- {
+ } else {
if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->disc_store), &iter, path) )
gtk_list_store_set (list->priv->disc_store, &iter, LENGTH_COL, len, -1);
}
@@ -2120,22 +2074,19 @@ gboolean parole_media_list_add_files (ParoleMediaList *list, gchar **filenames,
/*
* File on disk?
*/
- if ( !enqueue && g_file_test (filenames[i], G_FILE_TEST_EXISTS ) )
- {
+ if ( !enqueue && g_file_test (filenames[i], G_FILE_TEST_EXISTS ) ) {
added += parole_media_list_add_by_path (list, filenames[i], i == 0 ? TRUE : FALSE);
- }
- else if ( g_file_test (filenames[i], G_FILE_TEST_IS_DIR) ) {
+ } else if ( g_file_test (filenames[i], G_FILE_TEST_IS_DIR) ) {
added += parole_media_list_add_by_path (list, filenames[i], i == 0 ? TRUE : FALSE);
- }
- else
- {
+ } else {
ParoleFile *file;
TRACE ("File=%s", filenames[i]);
file = parole_file_new (filenames[i]);
if (enqueue) {
- parole_media_list_add (list, file, FALSE, FALSE, FALSE);}
- else
+ parole_media_list_add (list, file, FALSE, FALSE, FALSE);
+ } else {
parole_media_list_add (list, file, FALSE, i == 0 ? TRUE : FALSE, i == 0 ? TRUE : FALSE);
+ }
added++;
}
}
@@ -2158,20 +2109,16 @@ void parole_media_list_save_list (ParoleMediaList *list)
history = xfce_resource_save_location (XFCE_RESOURCE_DATA, PAROLE_AUTO_SAVED_PLAYLIST , TRUE);
- if ( !history )
- {
+ if ( !history ) {
g_warning ("Failed to save playlist");
return;
}
fileslist = parole_media_list_get_files (list);
- if ( g_slist_length (fileslist) > 0 )
- {
+ if ( g_slist_length (fileslist) > 0 ) {
parole_pl_parser_save_from_files (fileslist, history, PAROLE_PL_FORMAT_M3U);
g_slist_foreach (fileslist, (GFunc) g_object_unref, NULL);
- }
- else
- {
+ } else {
// If the playlist is empty, delete the list.
if (remove(history) != 0)
g_warning ("Failed to remove playlist");
@@ -2226,13 +2173,10 @@ static void
update_media_list_n_shuffled_items(void)
{
gboolean repeat = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(media_list->priv->repeat_button));
- if (repeat)
- {
+ if (repeat) {
/* Disable the control on the number of shuffled items in case of randomization */
media_list->priv->n_shuffled_items = -1;
- }
- else
- {
+ } else {
/* Enable the control on the number of shuffled items in case of randomization */
media_list->priv->n_shuffled_items = 0;
}
diff --git a/src/parole-player.c b/src/parole-player.c
index 224437e..931dc50 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -98,12 +98,9 @@ get_time_string (gchar *timestring, gint total_seconds)
hours = minutes / 60;
minutes = minutes % 60;
- if ( hours == 0 )
- {
+ if ( hours == 0 ) {
g_snprintf (timestring, 128, "%02i:%02i", minutes, seconds);
- }
- else
- {
+ } else {
g_snprintf (timestring, 128, "%i:%02i:%02i", hours, minutes, seconds);
}
}
@@ -557,8 +554,7 @@ void parole_player_set_playlist_visible (ParolePlayer *player, gboolean visibili
g_simple_toggle_action_set_active( player->priv->toggle_playlist_action, visibility );
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(player->priv->showhide_playlist_menu_item), visibility);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(player->priv->showhide_playlist_button), visibility);
- if ( visibility )
- {
+ if ( visibility ) {
if ( !player->priv->full_screen )
gtk_window_resize(GTK_WINDOW (player->priv->window), window_w+playlist_w+player->priv->handle_width, window_h);
@@ -566,9 +562,7 @@ void parole_player_set_playlist_visible (ParolePlayer *player, gboolean visibili
g_object_set (G_OBJECT (player->priv->conf),
"showhide-playlist", TRUE,
NULL);
- }
- else
- {
+ } else {
gtk_widget_hide (player->priv->playlist_nt);
g_object_set (G_OBJECT (player->priv->conf),
"showhide-playlist", FALSE,
@@ -871,8 +865,7 @@ parole_player_set_audio_list (ParolePlayer *player, GList *audio_list)
gtk_list_store_append(GTK_LIST_STORE(player->priv->liststore_audiotrack), &iter);
gtk_list_store_set(GTK_LIST_STORE(player->priv->liststore_audiotrack), &iter, 0, language, -1);
- if (player->priv->audio_group == NULL)
- {
+ if (player->priv->audio_group == NULL) {
player->priv->audio_group = GTK_WIDGET (gtk_radio_menu_item_new_with_label (NULL, language));
gtk_widget_show (GTK_WIDGET(player->priv->audio_group));
gtk_menu_shell_append (GTK_MENU_SHELL (player->priv->languages_menu), GTK_WIDGET(player->priv->audio_group));
@@ -898,8 +891,7 @@ parole_player_set_audio_list (ParolePlayer *player, GList *audio_list)
if (g_list_length (audio_list) >= 2) {
gtk_widget_set_sensitive( GTK_WIDGET( player->priv->combobox_audiotrack ), TRUE );
gtk_widget_show(player->priv->infobar);
- }
- else {
+ } else {
gtk_widget_set_sensitive( GTK_WIDGET( player->priv->combobox_audiotrack ), FALSE );
}
}
@@ -962,19 +954,18 @@ parole_player_update_subtitles (ParolePlayer *player, ParoleGst *gst)
static void
parole_player_update_languages (ParolePlayer *player, ParoleGst *gst)
{
- if (player->priv->update_languages == TRUE)
- {
- if (gst_get_has_video( PAROLE_GST(player->priv->gst) ))
- {
+ if (player->priv->update_languages == TRUE) {
+ if (gst_get_has_video( PAROLE_GST(player->priv->gst) )) {
parole_player_update_audio_tracks(player, gst);
parole_player_update_subtitles(player, gst);
/* 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
+ } else {
gtk_widget_set_sensitive(player->priv->subtitles_menu_custom, FALSE);
+ }
+
player->priv->update_languages = FALSE;
}
}
@@ -990,9 +981,7 @@ parole_player_show_audiobox (ParolePlayer *player)
{
gtk_widget_show(player->priv->audiobox);
gtk_widget_hide(player->priv->videobox);
- }
- else
- {
+ } else {
gtk_widget_hide(player->priv->audiobox);
gtk_widget_show(player->priv->videobox);
}
@@ -1177,11 +1166,9 @@ parole_player_disc_selected_cb (ParoleDisc *disc, const gchar *uri, const gchar
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));
- if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA )
- {
+ if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_CDDA ) {
player->priv->wait_for_gst_disc_info = TRUE;
- if ( player->priv->row )
- {
+ if ( player->priv->row ) {
parole_media_list_set_row_playback_state (player->priv->list, player->priv->row, PAROLE_MEDIA_STATE_NONE);
gtk_tree_row_reference_free (player->priv->row);
player->priv->row = NULL;
@@ -1189,9 +1176,7 @@ parole_player_disc_selected_cb (ParoleDisc *disc, const gchar *uri, const gchar
TRACE("CLEAR PLAYLIST");
parole_media_list_clear_list (player->priv->list);
TRACE("END CLEAR PLAYLIST");
- }
- else if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
- {
+ } else if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ) {
parole_media_list_set_playlist_view(player->priv->list, PAROLE_MEDIA_LIST_PLAYLIST_VIEW_DISC);
gtk_widget_show(GTK_WIDGET(player->priv->dvd_menu));
g_simple_action_set_enabled (player->priv->toggle_repeat_action, FALSE);
@@ -1439,8 +1424,7 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
parole_clutter_set_video_dimensions (PAROLE_CLUTTER(player->priv->clutter), width, height);
#endif
- if (player->priv->wait_for_gst_disc_info == TRUE)
- {
+ if (player->priv->wait_for_gst_disc_info == TRUE) {
parole_media_list_add_cdda_tracks(player->priv->list, parole_gst_get_num_tracks(PAROLE_GST (player->priv->gst)));
player->priv->wait_for_gst_disc_info = FALSE;
}
@@ -1452,29 +1436,24 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
gtk_widget_set_sensitive (player->priv->range, seekable);
player->priv->internal_range_change = TRUE;
- if ( live || duration == 0)
- {
+ if ( live || duration == 0) {
parole_player_change_range_value (player, 0);
gtk_widget_set_visible( player->priv->label_duration, FALSE );
gtk_widget_set_visible( player->priv->label_divider, FALSE );
gtk_widget_set_visible( player->priv->label_elapsed, FALSE );
- }
- else
- {
+ } else {
gtk_range_set_range (GTK_RANGE (player->priv->range), 0, duration);
gtk_widget_set_visible( player->priv->label_duration, TRUE );
gtk_widget_set_visible( player->priv->label_divider, TRUE );
gtk_widget_set_visible( player->priv->label_elapsed, TRUE );
}
- if ( duration != 0)
- {
+ if ( duration != 0) {
gchar dur_text[128];
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 )
- {
+ if ( player->priv->current_media_type != PAROLE_MEDIA_TYPE_DVD ) {
parole_media_list_set_row_length (player->priv->list,
player->priv->row,
dur_text);
@@ -1583,8 +1562,7 @@ parole_player_play_next (ParolePlayer *player, gboolean allow_shuffle)
gboolean repeat, shuffle;
GtkTreeRowReference *row;
- if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
- {
+ if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ) {
parole_gst_next_dvd_chapter (PAROLE_GST(player->priv->gst));
return;
}
@@ -1594,8 +1572,7 @@ parole_player_play_next (ParolePlayer *player, gboolean allow_shuffle)
"repeat", &repeat,
NULL);
- if ( player->priv->row )
- {
+ if ( player->priv->row ) {
parole_media_list_set_row_playback_state (player->priv->list, player->priv->row, PAROLE_MEDIA_STATE_NONE);
if ( shuffle && allow_shuffle )
@@ -1603,13 +1580,10 @@ parole_player_play_next (ParolePlayer *player, gboolean allow_shuffle)
else
row = parole_media_list_get_next_row (player->priv->list, player->priv->row, repeat);
- if ( row )
- {
+ if ( row ) {
parole_player_media_activated_cb (player->priv->list, row, player);
return;
- }
- else
- {
+ } else {
TRACE ("No remaining media in the list");
gtk_tree_row_reference_free (player->priv->row);
player->priv->row = NULL;
@@ -1624,25 +1598,20 @@ parole_player_play_prev (ParolePlayer *player)
{
GtkTreeRowReference *row;
- if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
- {
+ if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD ) {
parole_gst_prev_dvd_chapter (PAROLE_GST(player->priv->gst));
return;
}
- if ( player->priv->row )
- {
+ if ( player->priv->row ) {
parole_media_list_set_row_playback_state (player->priv->list, player->priv->row, PAROLE_MEDIA_STATE_NONE);
row = parole_media_list_get_prev_row (player->priv->list, player->priv->row);
- if ( row )
- {
+ if ( row ) {
parole_player_media_activated_cb (player->priv->list, row, player);
return;
- }
- else
- {
+ } else {
TRACE ("No remaining media in the list");
gtk_tree_row_reference_free (player->priv->row);
player->priv->row = NULL;
@@ -1663,23 +1632,21 @@ parole_player_reset_saver_changed (ParolePlayer *player, const ParoleStream *str
"reset-saver", &reset_saver,
NULL);
- if ( !reset_saver )
+ if ( !reset_saver ) {
parole_screen_saver_uninhibit (player->priv->screen_saver, GTK_WINDOW (player->priv->window));
- else if ( player->priv->state == PAROLE_STATE_PLAYING )
- {
+ } else if ( player->priv->state == PAROLE_STATE_PLAYING ) {
gboolean has_video;
g_object_get (G_OBJECT (stream),
"has-video", &has_video,
NULL);
- if ( has_video )
- {
+ if ( has_video ) {
parole_screen_saver_inhibit (player->priv->screen_saver, GTK_WINDOW (player->priv->window));
}
+ } else {
+ parole_screen_saver_uninhibit (player->priv->screen_saver, GTK_WINDOW (player->priv->window));
}
- else
- parole_screen_saver_uninhibit (player->priv->screen_saver, GTK_WINDOW (player->priv->window));
}
static void
@@ -1690,30 +1657,21 @@ parole_player_media_state_cb (ParoleGst *gst, const ParoleStream *stream, Parole
player->priv->state = state;
parole_player_reset_saver_changed (player, stream);
- if ( state == PAROLE_STATE_PLAYING )
- {
+ if ( state == PAROLE_STATE_PLAYING ) {
parole_player_playing (player, stream);
parole_player_show_audiobox(player);
- }
- else if ( state == PAROLE_STATE_PAUSED )
- {
+ } else if ( state == PAROLE_STATE_PAUSED ) {
parole_player_paused (player);
- }
- else if ( state == PAROLE_STATE_STOPPED )
- {
+ } else if ( state == PAROLE_STATE_STOPPED ) {
parole_player_stopped (player);
- }
/* PAROLE_STATE_ABOUT_TO_FINISH is used for continuous playback of audio CDs */
- else if ( state == PAROLE_STATE_ABOUT_TO_FINISH )
- {
+ } else if ( state == PAROLE_STATE_ABOUT_TO_FINISH ) {
#ifdef DEBUG
TRACE ("***Playback about to finish***");
#endif
if ( player->priv->current_media_type == PAROLE_MEDIA_TYPE_DVD )
parole_player_play_next (player, TRUE);
- }
- else if ( state == PAROLE_STATE_PLAYBACK_FINISHED )
- {
+ } else if ( state == PAROLE_STATE_PLAYBACK_FINISHED ) {
#ifdef DEBUG
TRACE ("***Playback finished***");
#endif
@@ -1908,8 +1866,7 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
gchar *filename;
GdkPixbuf *image = NULL;
- if ( player->priv->row )
- {
+ if ( player->priv->row ) {
g_object_get (G_OBJECT (stream),
"title", &title,
"album", &album,
@@ -1918,63 +1875,53 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
"uri", &uri,
NULL);
- if ( title )
- {
+ 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);
- }
- else
- {
+ } else {
/* No ID3, no problem! Show the filename instead */
filename = parole_player_get_filename_from_uri (uri);
- if ( filename )
- {
+ if ( filename ) {
gtk_window_set_title (GTK_WINDOW (player->priv->window), filename);
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title), g_markup_printf_escaped("<span color='#F4F4F4'><b><big>%s</big></b></span>", filename));
g_free (filename);
- }
- else
- {
+ } else {
gtk_window_set_title (GTK_WINDOW (player->priv->window), _("Parole Media Player"));
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title), g_markup_printf_escaped("<span color='#F4F4F4'><b><big>%s</big></b></span>", _("Unknown Song")));
}
}
g_free(uri);
- if ( album )
- {
+ if ( album ) {
if (year)
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album), g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s (%s)</span></big>", _("on"), album, year));
else
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album), g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s</span></big>", _("on"), album));
g_free (album);
- }
-
- else
+ } else {
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album), g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));
+ }
if (year)
g_free (year);
- if ( artist )
- {
+ if ( artist ) {
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist), g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s</span></big>", _("by"), artist));
g_free (artist);
- }
- else
+ } else {
gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist), g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span> <span color='#F4F4F4'>%s</span></big>", _("by"), _("Unknown Artist")));
+ }
image = parole_stream_get_image(G_OBJECT(stream));
- if (image)
- {
+ if (image) {
gtk_image_set_from_pixbuf(GTK_IMAGE(player->priv->audiobox_cover), image);
g_object_unref(image);
+ } else {
+ gtk_image_set_from_icon_name(GTK_IMAGE(player->priv->audiobox_cover), "audio-x-generic-symbolic", GTK_ICON_SIZE_ARTWORK_FALLBACK);
}
- else
- gtk_image_set_from_icon_name(GTK_IMAGE(player->priv->audiobox_cover), "audio-x-generic-symbolic", GTK_ICON_SIZE_ARTWORK_FALLBACK);
}
}
@@ -1983,8 +1930,7 @@ parole_player_buffering_cb (ParoleGst *gst, const ParoleStream *stream, gint per
{
gchar *buff;
- if ( percentage == 100 )
- {
+ if ( percentage == 100 ) {
player->priv->buffering = FALSE;
parole_gst_resume (PAROLE_GST (player->priv->gst));
gtk_widget_hide (player->priv->progressbar_buffering);
@@ -1994,9 +1940,7 @@ parole_player_buffering_cb (ParoleGst *gst, const ParoleStream *stream, gint per
else
gtk_widget_show (player->priv->range);
gtk_widget_show (player->priv->label_elapsed);
- }
- else
- {
+ } else {
player->priv->buffering = TRUE;
if ( player->priv->state == PAROLE_STATE_PLAYING )
@@ -2061,17 +2005,14 @@ parole_player_window_state_event (GtkWidget *widget,
{
gboolean fullscreen = FALSE;
- if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
- {
+ if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) {
/* Restore the previously saved window size if maximized */
g_object_set (G_OBJECT (player->priv->conf),
"window-width", player->priv->last_w,
"window-height", player->priv->last_h,
"window-maximized", TRUE,
NULL);
- }
- else
- {
+ } else {
g_object_set (G_OBJECT (player->priv->conf),
"window-maximized", FALSE,
NULL);
@@ -2109,8 +2050,7 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
"window-width", &w,
NULL);
- if ( player->priv->full_screen != fullscreen )
- {
+ if ( player->priv->full_screen != fullscreen ) {
/* If the player is in fullscreen mode, change to windowed mode. */
if ( player->priv->full_screen )
{
@@ -2131,9 +2071,7 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
gtk_window_unfullscreen (GTK_WINDOW (player->priv->window));
gtk_notebook_set_current_page (GTK_NOTEBOOK (player->priv->playlist_nt), current_page);
player->priv->full_screen = FALSE;
- }
- else
- {
+ } else {
gtk_widget_hide (player->priv->menu_bar);
gtk_widget_hide (player->priv->playlist_nt);
parole_player_set_playlist_visible(player, FALSE);
@@ -2149,18 +2087,13 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
}
}
- if ( player->priv->embedded )
- {
+ if ( player->priv->embedded ) {
gtk_widget_hide (player->priv->menu_bar);
gtk_widget_hide (player->priv->playlist_nt);
gtk_widget_hide (player->priv->fullscreen_button);
gtk_widget_hide (player->priv->showhide_playlist_button);
- }
-
- else
- {
- if ( player->priv->mini_mode )
- {
+ } else {
+ if ( player->priv->mini_mode ) {
gtk_widget_hide (player->priv->menu_bar);
gtk_widget_hide (player->priv->playlist_nt);
gtk_widget_hide (player->priv->fullscreen_button);
@@ -2175,10 +2108,7 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
gtk_widget_set_size_request (GTK_WIDGET (player->priv->window), 256, 256);
gtk_window_set_default_size (GTK_WINDOW (player->priv->window), 256, 256);
gtk_window_set_resizable (GTK_WINDOW (player->priv->window), FALSE);
- }
-
- else
- {
+ } else {
gtk_widget_set_size_request (GTK_WIDGET (player->priv->window), -1, -1);
gtk_window_set_default_size (GTK_WINDOW (player->priv->window), -1, -1);
gtk_window_set_resizable (GTK_WINDOW (player->priv->window), TRUE);
@@ -2189,8 +2119,7 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
gtk_widget_show(player->priv->range);
gtk_widget_set_halign (player->priv->audiobox_cover, GTK_ALIGN_END);
- if ( !player->priv->full_screen )
- {
+ if ( !player->priv->full_screen ) {
gtk_widget_show (player->priv->menu_bar);
gtk_widget_show (player->priv->showhide_playlist_button);
if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (player->priv->showhide_playlist_button)) )
@@ -2346,14 +2275,10 @@ parole_player_gst_widget_button_press (GtkWidget *widget, GdkEventButton *ev, Pa
gboolean sensitive = FALSE;
gint w, h;
- if ( ev->type == GDK_2BUTTON_PRESS )
- {
+ if ( ev->type == GDK_2BUTTON_PRESS ) {
g_action_activate (G_ACTION(player->priv->media_fullscreen_action), NULL);
ret_val = TRUE;
- }
-
- else if ( ev->button == 1 && gtk_widget_get_visible (player->priv->logo_image) )
- {
+ } else if ( ev->button == 1 && gtk_widget_get_visible (player->priv->logo_image) ) {
/* Clicking on the play or replay logo will activate appropriate functionality */
h = gtk_widget_get_allocated_height ( widget );
w = gtk_widget_get_allocated_width ( widget );
@@ -2380,14 +2305,11 @@ parole_player_gst_widget_button_release (GtkWidget *widget, GdkEventButton *ev,
{
gboolean ret_val = FALSE;
- if ( ev->button == 3 )
- {
+ if ( ev->button == 3 ) {
parole_player_show_menu (player, ev->button, ev->time);
gtk_widget_grab_focus (widget);
ret_val = TRUE;
- }
- else if ( ev->button == 1 )
- {
+ } else if ( ev->button == 1 ) {
gtk_widget_grab_focus (widget);
ret_val = TRUE;
}
@@ -2426,18 +2348,14 @@ parole_player_gst_widget_motion_notify_event (GtkWidget *widget, GdkEventMotion
parole_player_set_cursor_visible (player, TRUE);
- if (gtk_revealer_get_reveal_child(GTK_REVEALER(player->priv->revealer)))
- {
- if ((gdouble)gtk_widget_get_allocated_height(widget) - ev->y >= 32.0)
- {
- if ( player->priv->state == PAROLE_STATE_PLAYING )
- {
+ if (gtk_revealer_get_reveal_child(GTK_REVEALER(player->priv->revealer))) {
+ if ((gdouble)gtk_widget_get_allocated_height(widget) - ev->y >= 32.0) {
+ if ( player->priv->state == PAROLE_STATE_PLAYING ) {
g_object_get (G_OBJECT (player->priv->conf),
"hide-controls-timeout", &hide_controls_timeout,
NULL);
- if (hide_controls_timeout != 0 || player->priv->full_screen)
- {
+ if (hide_controls_timeout != 0 || player->priv->full_screen) {
if (player->priv->full_screen)
hide_timeout = g_timeout_add_seconds (4,
(GSourceFunc) parole_player_hide_controls, player);
@@ -2447,9 +2365,7 @@ parole_player_gst_widget_motion_notify_event (GtkWidget *widget, GdkEventMotion
}
}
}
- }
- else
- {
+ } else {
gtk_revealer_set_reveal_child(GTK_REVEALER(player->priv->revealer), TRUE);
}
@@ -2518,13 +2434,10 @@ parole_player_volume_scroll_event_cb (GtkWidget *widget, GdkEventScroll *ev, Par
{
gboolean ret_val = FALSE;
- if ( ev->direction == GDK_SCROLL_UP )
- {
+ if ( ev->direction == GDK_SCROLL_UP ) {
parole_player_volume_up (NULL, player);
ret_val = TRUE;
- }
- else if ( ev->direction == GDK_SCROLL_DOWN )
- {
+ } else if ( ev->direction == GDK_SCROLL_DOWN ) {
parole_player_volume_down (NULL, player);
ret_val = TRUE;
}
@@ -2567,15 +2480,12 @@ parole_player_volume_down (GtkWidget *widget, ParolePlayer *player)
void parole_player_volume_mute (GtkWidget *widget, ParolePlayer *player)
{
gint value;
- if (gtk_scale_button_get_value (GTK_SCALE_BUTTON (player->priv->volume)) == 0.0)
- {
+ if (gtk_scale_button_get_value (GTK_SCALE_BUTTON (player->priv->volume)) == 0.0) {
g_object_get (G_OBJECT (player->priv->conf),
"volume", &value,
NULL);
gtk_menu_item_set_label( GTK_MENU_ITEM(player->priv->mute), _("Mute") );
- }
- else
- {
+ } else {
value = 0;
gtk_menu_item_set_label( GTK_MENU_ITEM(player->priv->mute), _("Unmute") );
}
@@ -2764,7 +2674,9 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
{
case GDK_KEY_f:
case GDK_KEY_F:
- if ( player->priv->embedded != TRUE ) g_action_activate (G_ACTION(player->priv->media_fullscreen_action), NULL);
+ if ( player->priv->embedded != TRUE ) {
+ g_action_activate (G_ACTION(player->priv->media_fullscreen_action), NULL);
+ }
ret_val = TRUE;
break;
case GDK_KEY_space:
@@ -2777,35 +2689,44 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
/* Media seekable ?*/
if ( gtk_widget_get_sensitive (player->priv->range) )
{
- if (ev->state & GDK_CONTROL_MASK) parole_player_seekf_cb (NULL, player, seek_medium);
- else parole_player_seekf_cb (NULL, player, seek_short);
+ if (ev->state & GDK_CONTROL_MASK) {
+ parole_player_seekf_cb (NULL, player, seek_medium);
+ } else {
+ parole_player_seekf_cb (NULL, player, seek_short);
+ }
}
ret_val = TRUE;
break;
case GDK_KEY_Left:
if ( gtk_widget_get_sensitive (player->priv->range) )
{
- if (ev->state & GDK_CONTROL_MASK) parole_player_seekb_cb (NULL, player, seek_medium);
- else parole_player_seekb_cb (NULL, player, seek_short);
+ if (ev->state & GDK_CONTROL_MASK) {
+ parole_player_seekb_cb (NULL, player, seek_medium);
+ } else {
+ parole_player_seekb_cb (NULL, player, seek_short);
+ }
}
ret_val = TRUE;
break;
case GDK_KEY_Page_Down:
- if ( gtk_widget_get_sensitive (player->priv->range) )
- parole_player_seekb_cb (NULL, player, seek_long);
+ if ( gtk_widget_get_sensitive (player->priv->range) ) {
+ parole_player_seekb_cb (NULL, player, seek_long);
+ }
ret_val = TRUE;
break;
case GDK_KEY_Page_Up:
- if ( gtk_widget_get_sensitive (player->priv->range) )
- parole_player_seekf_cb (NULL, player, seek_long);
+ if ( gtk_widget_get_sensitive (player->priv->range) ) {
+ parole_player_seekf_cb (NULL, player, seek_long);
+ }
ret_val = TRUE;
break;
case GDK_KEY_Escape:
parole_player_full_screen (player, FALSE);
break;
case GDK_KEY_m:
- if (ev->state & GDK_CONTROL_MASK)
+ if (ev->state & GDK_CONTROL_MASK) {
parole_player_hide_menubar_cb(NULL, player);
+ }
ret_val = TRUE;
break;
case GDK_KEY_n:
@@ -2837,8 +2758,9 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
*/
case GDK_KEY_Up:
case GDK_KEY_Down:
- if (!player->priv->full_screen && gtk_widget_get_visible(player->priv->playlist_nt))
+ if (!player->priv->full_screen && gtk_widget_get_visible(player->priv->playlist_nt)) {
parole_media_list_grab_focus (player->priv->list);
+ }
break;
default:
break;
@@ -3243,13 +3165,10 @@ parole_player_set_cursor_visible (ParolePlayer *player, gboolean visible)
GdkWindow *gdkwindow;
gdkwindow = gtk_widget_get_window (GTK_WIDGET(player->priv->eventbox_output));
- if (visible)
- {
+ if (visible) {
parole_gst_set_cursor_visible (PAROLE_GST (player->priv->gst), TRUE);
parole_window_normal_cursor (gdkwindow);
- }
- else if (gtk_window_is_active (GTK_WINDOW (player->priv->window)))
- {
+ } else if (gtk_window_is_active (GTK_WINDOW (player->priv->window))) {
parole_gst_set_cursor_visible (PAROLE_GST (player->priv->gst), FALSE);
parole_window_invisible_cursor (gdkwindow);
}
@@ -3258,12 +3177,9 @@ parole_player_set_cursor_visible (ParolePlayer *player, gboolean visible)
static void
parole_player_window_notify_is_active (ParolePlayer *player)
{
- if (!gtk_window_is_active (GTK_WINDOW (player->priv->window)) )
- {
+ if (!gtk_window_is_active (GTK_WINDOW (player->priv->window)) ) {
parole_player_set_cursor_visible (player, TRUE);
- }
- else
- {
+ } else {
parole_player_set_cursor_visible (player, FALSE);
}
}
@@ -3838,8 +3754,7 @@ parole_player_init (ParolePlayer *player)
#ifdef HAVE_CLUTTER
player->priv->use_clutter = g_strcmp0(videosink, "cluttersink") == 0;
- if (player->priv->use_clutter)
- {
+ if (player->priv->use_clutter) {
GtkWidget *clutterbox;
GstElement *video_sink;
@@ -3855,9 +3770,7 @@ parole_player_init (ParolePlayer *player)
gtk_widget_show (player->priv->clutter);
gtk_widget_grab_focus (player->priv->clutter);
- }
- else
- {
+ } else {
gtk_box_pack_start (GTK_BOX (player->priv->videobox),
player->priv->gst,
TRUE, TRUE, 0);
@@ -3980,15 +3893,11 @@ ParoleMediaList *parole_player_get_media_list (ParolePlayer *player)
void parole_player_play_uri_disc (ParolePlayer *player, const gchar *uri, const gchar *device)
{
- if ( uri )
- {
+ if ( uri ) {
parole_player_disc_selected_cb (NULL, uri, device, player);
- }
- else if (device)
- {
+ } else if (device) {
gchar *uri_local = parole_get_uri_from_unix_device (device);
- if ( uri_local )
- {
+ if ( uri_local ) {
parole_player_disc_selected_cb (NULL, uri_local, device, player);
g_free (uri_local);
}
@@ -4018,12 +3927,9 @@ void parole_player_set_subtitle_radio_menu_item_selected(ParolePlayer *player, g
GList *menu_items, *menu_iter;
menu_items = gtk_container_get_children( GTK_CONTAINER (player->priv->subtitles_menu) );
- if (sub_index <= 0)
- {
+ if (sub_index <= 0) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items->data), TRUE);
- }
- else
- {
+ } else {
gint counter = -3;
for (menu_iter = menu_items; menu_iter != NULL; menu_iter = g_list_next(menu_iter))
{
@@ -4119,12 +4025,9 @@ void parole_player_combo_box_subtitles_changed_cb(GtkWidget *widget, ParolePlaye
gchar *uri = parole_gst_get_file_uri(PAROLE_GST(player->priv->gst));
gint sub_index = gtk_combo_box_get_active(GTK_COMBO_BOX(player->priv->combobox_subtitles));
- if (get_has_file_extension(uri, "mkv"))
- {
+ if (get_has_file_extension(uri, "mkv")) {
gst_set_current_subtitle_track(PAROLE_GST(player->priv->gst), sub_index);
- }
- else
- {
+ } else {
if (player->priv->update_languages == FALSE)
gst_set_current_subtitle_track(PAROLE_GST(player->priv->gst), sub_index);
}
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index 7b79da4..1230e42 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -212,8 +212,7 @@ parole_plugins_manager_save_rc (ParolePluginsManager *manager, gchar *filename,
if ( saved_plugins )
num = g_strv_length (saved_plugins);
- if ( active )
- {
+ if ( active ) {
plugins_rc = g_new0 (gchar *, num + 2);
for ( i = 0; i < num; i++)
@@ -224,15 +223,12 @@ parole_plugins_manager_save_rc (ParolePluginsManager *manager, gchar *filename,
plugins_rc[num] = g_strdup (filename);
plugins_rc[num + 1] = NULL;
parole_conf_write_entry_list (PAROLE_CONF(manager->priv->conf), "plugins", plugins_rc);
- }
- else
- {
+ } else {
plugins_rc = g_new0 (gchar *, num + 1);
for ( i = 0; i < num; i++)
{
- if ( g_strcmp0 (saved_plugins[i], filename) != 0 )
- {
+ if ( g_strcmp0 (saved_plugins[i], filename) != 0 ) {
plugins_rc[count] = g_strdup (saved_plugins[i]);
count++;
}
@@ -265,22 +261,17 @@ parole_plugins_manager_cell_toggled_cb (GtkCellRendererToggle *cell_renderer,
active ^= 1;
- if ( pref->manager->priv->load_plugins )
- {
- if ( active )
- {
+ if ( pref->manager->priv->load_plugins ) {
+ if ( active ) {
g_type_module_use (G_TYPE_MODULE (module));
- if (!parole_provider_module_new_plugin (module))
- {
+ if (!parole_provider_module_new_plugin (module)) {
// If plugin loading fails...
parole_dialog_error(GTK_WINDOW(pref->window), _("Plugin failed to load"), _("Please check your installation"));
parole_provider_module_free_plugin (module);
g_type_module_unuse (G_TYPE_MODULE (module));
active = FALSE;
}
- }
- else
- {
+ } else {
parole_provider_module_free_plugin (module);
g_type_module_unuse (G_TYPE_MODULE (module));
}
@@ -568,14 +559,11 @@ parole_plugins_manager_load_plugins (ParolePluginsManager *manager)
!g_strcmp0 (plugins_rc[i], PAROLE_PROVIDER_MODULE (module)->library_name) )
{
TRACE ("Loading plugin :%s", module->name);
- if ( !g_type_module_use (module) )
- {
+ if ( !g_type_module_use (module) ) {
parole_plugins_manager_save_rc (manager, module->name, FALSE);
g_ptr_array_remove (manager->priv->array, module);
g_object_unref (module);
- }
- else
- {
+ } else {
parole_provider_module_new_plugin (PAROLE_PROVIDER_MODULE (module));
}
break;
@@ -654,12 +642,9 @@ parole_plugins_manager_finalize (GObject *object)
ParolePluginsManager *
parole_plugins_manager_new (gboolean load_plugins)
{
- if ( G_LIKELY (parole_plugins_manager_object != NULL) )
- {
+ if ( G_LIKELY (parole_plugins_manager_object != NULL) ) {
g_object_ref (parole_plugins_manager_object);
- }
- else
- {
+ } else {
parole_plugins_manager_object = g_object_new (PAROLE_TYPE_PLUGINS_MANAGER,
"load-plugins", load_plugins,
NULL);
diff --git a/src/parole-utils.c b/src/parole-utils.c
index b58753d..114eab7 100644
--- a/src/parole-utils.c
+++ b/src/parole-utils.c
@@ -113,8 +113,7 @@ thunar_file_compare_by_name (ParoleFile *file_a,
bp = parole_file_get_display_name (file_b);
/* check if we should ignore case */
- if (G_LIKELY (case_sensitive))
- {
+ if (G_LIKELY (case_sensitive)) {
/* try simple (fast) ASCII comparison first */
for (;; ++ap, ++bp)
{
@@ -126,20 +125,17 @@ thunar_file_compare_by_name (ParoleFile *file_a,
}
/* fallback to Unicode comparison */
- if (G_UNLIKELY (ac > 127 || bc > 127))
+ if (G_UNLIKELY (ac > 127 || bc > 127)) {
+ for (;; ap = g_utf8_next_char (ap), bp = g_utf8_next_char (bp))
{
- for (;; ap = g_utf8_next_char (ap), bp = g_utf8_next_char (bp))
- {
- /* check if characters differ or end of string */
- ac = g_utf8_get_char (ap);
- bc = g_utf8_get_char (bp);
- if (ac != bc || ac == 0)
- break;
- }
+ /* check if characters differ or end of string */
+ ac = g_utf8_get_char (ap);
+ bc = g_utf8_get_char (bp);
+ if (ac != bc || ac == 0)
+ break;
}
- }
- else
- {
+ }
+ } else {
/* try simple (fast) ASCII comparison first (case-insensitive!) */
for (;; ++ap, ++bp)
{
@@ -151,8 +147,7 @@ thunar_file_compare_by_name (ParoleFile *file_a,
}
/* fallback to Unicode comparison (case-insensitive!) */
- if (G_UNLIKELY (ac > 127 || bc > 127))
- {
+ if (G_UNLIKELY (ac > 127 || bc > 127)) {
for (;; ap = g_utf8_next_char (ap), bp = g_utf8_next_char (bp))
{
/* check if characters differ or end of string */
@@ -193,17 +188,13 @@ thunar_file_compare_by_name (ParoleFile *file_a,
* would be too expensive)
*/
#ifdef HAVE_STRCOLL
- if ((ac > 127 || bc > 127) && g_get_charset (NULL))
- {
+ if ((ac > 127 || bc > 127) && g_get_charset (NULL)) {
/* case-sensitive is easy, case-insensitive is expensive,
* but we use a simple optimization to make it fast.
*/
- if (G_LIKELY (case_sensitive))
- {
+ if (G_LIKELY (case_sensitive)) {
return strcoll (ap, bp);
- }
- else
- {
+ } else {
/* we use a trick here, so we don't need to allocate
* and transform the two strings completely first (8
* byte for each buffer, so all compilers should align
@@ -370,28 +361,22 @@ void parole_get_media_files (GtkFileFilter *filter, const gchar *path,
gtk_main_iteration_do (FALSE);
- if ( g_file_test (path, G_FILE_TEST_IS_REGULAR ) )
- {
+ if ( g_file_test (path, G_FILE_TEST_IS_REGULAR ) ) {
file = parole_file_new (path);
if ( parole_file_filter (playlist_filter, file) &&
parole_pl_parser_guess_format_from_extension (path) != PAROLE_PL_FORMAT_UNKNOWN )
{
playlist = parole_pl_parser_parse_from_file_by_extension (path);
g_object_unref (file);
- if ( playlist)
- {
+ if ( playlist) {
*list = g_slist_concat (*list, playlist);
}
- }
- else if ( parole_file_filter (filter, file) )
- {
+ } else if ( parole_file_filter (filter, file) ) {
*list = g_slist_append (*list, file);
- }
- else
+ } else {
g_object_unref (file);
- }
- else if ( g_file_test (path, G_FILE_TEST_IS_DIR ) )
- {
+ }
+ } else if ( g_file_test (path, G_FILE_TEST_IS_DIR ) ) {
dir = g_dir_open (path, 0, NULL);
if ( G_UNLIKELY (dir == NULL) )
@@ -400,30 +385,24 @@ void parole_get_media_files (GtkFileFilter *filter, const gchar *path,
while ( (name = g_dir_read_name (dir)) )
{
gchar *path_internal = g_build_filename (path, name, NULL);
- if ( g_file_test (path_internal, G_FILE_TEST_IS_DIR) && recursive)
- {
+ if ( g_file_test (path_internal, G_FILE_TEST_IS_DIR) && recursive) {
parole_get_media_files (filter, path_internal, TRUE, list);
- }
- else if ( g_file_test (path_internal, G_FILE_TEST_IS_REGULAR) )
- {
+ } else if ( g_file_test (path_internal, G_FILE_TEST_IS_REGULAR) ) {
file = parole_file_new (path_internal);
if ( parole_file_filter (playlist_filter, file) &&
parole_pl_parser_guess_format_from_extension (path) != PAROLE_PL_FORMAT_UNKNOWN)
{
playlist = parole_pl_parser_parse_from_file_by_extension (path_internal);
g_object_unref (file);
- if ( playlist)
- {
+ if ( playlist) {
*list = g_slist_concat (*list, playlist);
}
- }
- else if ( parole_file_filter (filter, file) )
- {
+ } else if ( parole_file_filter (filter, file) ) {
list_internal = g_slist_append (list_internal, file);
- }
- else
+ } else {
g_object_unref (file);
}
+ }
g_free (path_internal);
}
list_internal = g_slist_sort (list_internal, (GCompareFunc) thunar_file_compare_by_name);
@@ -450,24 +429,17 @@ parole_device_has_cdda (const gchar *device)
TRACE ("device : %s", device);
- if ( (fd = open (device, O_RDONLY)) < 0 )
- {
+ if ( (fd = open (device, O_RDONLY)) < 0 ) {
g_debug ("Failed to open device : %s", device);
return FALSE;
}
- if ( (drive = ioctl (fd, CDROM_DRIVE_STATUS, NULL)) )
- {
- if ( drive == CDS_DRIVE_NOT_READY )
- {
+ if ( (drive = ioctl (fd, CDROM_DRIVE_STATUS, NULL)) ) {
+ if ( drive == CDS_DRIVE_NOT_READY ) {
g_debug ("Drive :%s is not yet ready\n", device);
- }
- else if ( drive == CDS_DISC_OK )
- {
- if ( (drive = ioctl (fd, CDROM_DISC_STATUS, NULL)) > 0 )
- {
- if ( drive == CDS_AUDIO )
- {
+ } else if ( drive == CDS_DISC_OK ) {
+ if ( (drive = ioctl (fd, CDROM_DISC_STATUS, NULL)) > 0 ) {
+ if ( drive == CDS_AUDIO ) {
ret_val = TRUE;
}
}
@@ -489,12 +461,9 @@ parole_guess_uri_from_mount (GMount *mount)
file = g_mount_get_root (mount);
- if ( g_file_has_uri_scheme (file, "cdda") )
- {
+ if ( g_file_has_uri_scheme (file, "cdda") ) {
uri = g_strdup ("cdda://");
- }
- else
- {
+ } else {
gchar **content_type;
int i;
@@ -504,23 +473,16 @@ parole_guess_uri_from_mount (GMount *mount)
{
TRACE ("Checking disc content type : %s", content_type[i]);
- if ( !g_strcmp0 (content_type[i], "x-content/video-dvd") )
- {
+ if ( !g_strcmp0 (content_type[i], "x-content/video-dvd") ) {
uri = g_strdup ("dvd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/video-vcd") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/video-vcd") ) {
uri = g_strdup ("vcd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/video-svcd") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/video-svcd") ) {
uri = g_strdup ("svcd:/");
break;
- }
- else if ( !g_strcmp0 (content_type[i], "x-content/audio-cdda") )
- {
+ } else if ( !g_strcmp0 (content_type[i], "x-content/audio-cdda") ) {
uri = g_strdup ("cdda://");
break;
}
@@ -625,12 +587,9 @@ gchar *parole_format_media_length (gint total_seconds)
hours = minutes / 60;
minutes = minutes % 60;
- if ( hours == 0 )
- {
+ if ( hours == 0 ) {
timestring = g_strdup_printf ("%02i:%02i", minutes, seconds);
- }
- else
- {
+ } else {
timestring = g_strdup_printf ("%i:%02i:%02i", hours, minutes, seconds);
}
diff --git a/src/plugins/mpris2/mpris2-provider.c b/src/plugins/mpris2/mpris2-provider.c
index 13a2a2f..5f4233f 100644
--- a/src/plugins/mpris2/mpris2-provider.c
+++ b/src/plugins/mpris2/mpris2-provider.c
@@ -573,8 +573,7 @@ static GVariant* mpris_Player_get_Metadata (GError **error, Mpris2Provider *prov
stream = parole_provider_player_get_stream(player);
handle_get_metadata (stream, &b);
- }
- else {
+ } else {
g_variant_builder_add (&b, "{sv}", "mpris:trackid",
handle_get_trackid(NULL));
}
@@ -704,14 +703,12 @@ static void parole_mpris_update_any (Mpris2Provider *provider)
g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
g_object_get (G_OBJECT (provider->conf), "shuffle", &shuffle, NULL);
- if(provider->saved_shuffle != shuffle)
- {
+ if(provider->saved_shuffle != shuffle) {
change_detected = TRUE;
provider->saved_shuffle = shuffle;
g_variant_builder_add (&b, "{sv}", "Shuffle", mpris_Player_get_Shuffle (NULL, provider));
}
- if(provider->state != parole_provider_player_get_state (player))
- {
+ if (provider->state != parole_provider_player_get_state (player)) {
change_detected = TRUE;
provider->state = parole_provider_player_get_state (player);
g_variant_builder_add (&b, "{sv}", "PlaybackStatus", mpris_Player_get_PlaybackStatus (NULL, provider));
@@ -720,23 +717,19 @@ static void parole_mpris_update_any (Mpris2Provider *provider)
g_variant_builder_add (&b, "{sv}", "CanSeek", mpris_Player_get_CanSeek(NULL, provider));
}
g_object_get (G_OBJECT (provider->conf), "repeat", &repeat, NULL);
- if(provider->saved_playbackstatus != repeat)
- {
+ if (provider->saved_playbackstatus != repeat) {
change_detected = TRUE;
provider->saved_playbackstatus = repeat;
g_variant_builder_add (&b, "{sv}", "LoopStatus", mpris_Player_get_LoopStatus (NULL, provider));
}
curr_vol = handle_get_volume(provider);
- if(provider->volume != curr_vol)
- {
+ if (provider->volume != curr_vol) {
change_detected = TRUE;
provider->volume = curr_vol;
g_variant_builder_add (&b, "{sv}", "Volume", mpris_Player_get_Volume (NULL, provider));
}
- if (parole_provider_player_get_state (player) == PAROLE_STATE_PLAYING)
- {
- if(g_strcmp0(provider->saved_title, stream_uri))
- {
+ if (parole_provider_player_get_state (player) == PAROLE_STATE_PLAYING) {
+ if(g_strcmp0(provider->saved_title, stream_uri)) {
change_detected = TRUE;
if(provider->saved_title)
g_free(provider->saved_title);
@@ -748,14 +741,12 @@ static void parole_mpris_update_any (Mpris2Provider *provider)
g_variant_builder_add (&b, "{sv}", "Metadata", mpris_Player_get_Metadata (NULL, provider));
}
}
- if (provider->saved_fullscreen != parole_provider_player_get_fullscreen(player))
- {
+ if (provider->saved_fullscreen != parole_provider_player_get_fullscreen(player)) {
change_detected = TRUE;
provider->saved_fullscreen = !provider->saved_fullscreen;
g_variant_builder_add (&b, "{sv}", "Fullscreen", mpris_Root_get_Fullscreen (NULL, provider));
}
- if(change_detected)
- {
+ if (change_detected) {
GVariant * tuples[] = {
g_variant_new_string("org.mpris.MediaPlayer2.Player"),
g_variant_builder_end(&b),
@@ -765,9 +756,7 @@ static void parole_mpris_update_any (Mpris2Provider *provider)
g_dbus_connection_emit_signal(provider->dbus_connection, NULL, MPRIS_PATH,
"org.freedesktop.DBus.Properties", "PropertiesChanged",
g_variant_new_tuple(tuples, 3) , NULL);
- }
- else
- {
+ } else {
g_variant_builder_clear(&b);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list