changeset 4542:26209b646930

Some cosmetic changes
author mf0102 <0102@gmx.at>
date Mon, 12 May 2008 19:19:49 +0200
parents d8920be7275a
children ed94ac6182df
files src/audacious/auddrct.c src/audacious/main.c
diffstat 2 files changed, 138 insertions(+), 141 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/auddrct.c	Mon May 12 00:13:38 2008 +0200
+++ b/src/audacious/auddrct.c	Mon May 12 19:19:49 2008 +0200
@@ -37,69 +37,69 @@
 void
 drct_quit ( void )
 {
-  aud_quit();
+    aud_quit();
 }
 
 void
 drct_eject ( void )
 {
-  if (has_x11_connection)
-    mainwin_eject_pushed();
-  return;
+    if (has_x11_connection)
+        mainwin_eject_pushed();
+    return;
 }
 
 void
 drct_jtf_show ( void )
 {
-  if (has_x11_connection)
-    ui_jump_to_track();
-  return;
+    if (has_x11_connection)
+        ui_jump_to_track();
+    return;
 }
 
 gboolean
 drct_main_win_is_visible ( void )
 {
-  return cfg.player_visible;
+    return cfg.player_visible;
 }
 
 void
 drct_main_win_toggle ( gboolean show )
 {
-  if (has_x11_connection)
-    mainwin_show(show);
-  return;
+    if (has_x11_connection)
+        mainwin_show(show);
+    return;
 }
 
 gboolean
 drct_eq_win_is_visible ( void )
 {
-  return cfg.equalizer_visible;
+    return cfg.equalizer_visible;
 }
 
 void
 drct_eq_win_toggle ( gboolean show )
 {
-  if (has_x11_connection)
-    equalizerwin_show(show);
-  return;
+    if (has_x11_connection)
+        equalizerwin_show(show);
+    return;
 }
 
 gboolean
 drct_pl_win_is_visible ( void )
 {
-  return cfg.playlist_visible;
+    return cfg.playlist_visible;
 }
 
 void
 drct_pl_win_toggle ( gboolean show )
 {
-  if (has_x11_connection) {
-    if (show)
-      playlistwin_show();
-    else
-      playlistwin_hide();
-  }
-  return;
+    if (has_x11_connection) {
+        if (show)
+            playlistwin_show();
+        else
+            playlistwin_hide();
+    }
+    return;
 }
 
 void drct_activate(void)
@@ -112,48 +112,48 @@
 void
 drct_play ( void )
 {
-  if (playback_get_paused())
-    playback_pause();
-  else if (playlist_get_length(playlist_get_active()))
-    event_queue("playback initiate", (gpointer)0xdeadbeef); // to avoid crash at startup. --yaz
-  else
-    mainwin_eject_pushed();
-  return;
+    if (playback_get_paused())
+        playback_pause();
+    else if (playlist_get_length(playlist_get_active()))
+        event_queue("playback initiate", (gpointer)0xdeadbeef); // to avoid crash at startup. --yaz
+    else
+        mainwin_eject_pushed();
+    return;
 }
 
 void
 drct_pause ( void )
 {
-  playback_pause();
-  return;
+    playback_pause();
+    return;
 }
 
 void
 drct_stop ( void )
 {
-  ip_data.stop = TRUE;
-  playback_stop();
-  ip_data.stop = FALSE;
-  mainwin_clear_song_info();
-  return;
+    ip_data.stop = TRUE;
+    playback_stop();
+    ip_data.stop = FALSE;
+    mainwin_clear_song_info();
+    return;
 }
 
 gboolean
 drct_get_playing ( void )
 {
-  return playback_get_playing();
+    return playback_get_playing();
 }
 
 gboolean
 drct_get_paused ( void )
 {
-  return playback_get_paused();
+    return playback_get_paused();
 }
 
 gboolean
 drct_get_stopped ( void )
 {
-  return !playback_get_playing();
+    return !playback_get_playing();
 }
 
 void
@@ -165,108 +165,108 @@
 gint
 drct_get_time ( void )
 {
-  gint time;
-  if (playback_get_playing())
-    time = playback_get_time();
-  else
-    time = 0;
-  return time;
+    gint time;
+    if (playback_get_playing())
+        time = playback_get_time();
+    else
+        time = 0;
+    return time;
 }
 
 void
 drct_seek ( guint pos )
 {
-  if (playlist_get_current_length(playlist_get_active()) > 0 &&
-      pos < (guint)playlist_get_current_length(playlist_get_active()))
-    playback_seek(pos / 1000);
-  return;
+    if (playlist_get_current_length(playlist_get_active()) > 0 &&
+        pos < (guint)playlist_get_current_length(playlist_get_active()))
+        playback_seek(pos / 1000);
+    return;
 }
 
 void
 drct_get_volume ( gint *vl, gint *vr )
 {
-  input_get_volume(vl, vr);
-  return;
+    input_get_volume(vl, vr);
+    return;
 }
 
 void
 drct_set_volume ( gint vl, gint vr )
 {
-  if (vl > 100)
-    vl = 100;
-  if (vr > 100)
-    vr = 100;
-  input_set_volume(vl, vr);
-  return;
+    if (vl > 100)
+        vl = 100;
+    if (vr > 100)
+        vr = 100;
+    input_set_volume(vl, vr);
+    return;
 }
 
 void
 drct_get_volume_main( gint *v )
 {
-  gint vl, vr;
-  drct_get_volume(&vl, &vr);
-  *v = (vl > vr) ? vl : vr;
-  return;
+    gint vl, vr;
+    drct_get_volume(&vl, &vr);
+    *v = (vl > vr) ? vl : vr;
+    return;
 }
 
 void
 drct_set_volume_main ( gint v )
 {
-  gint b, vl, vr;
-  drct_get_volume_balance(&b);
-  if (b < 0) {
-    vl = v;
-    vr = (v * (100 - abs(b))) / 100;
-  }
-  else if (b > 0) {
-    vl = (v * (100 - b)) / 100;
-    vr = v;
-  }
-  else
-    vl = vr = v;
-  drct_set_volume(vl, vr);
+    gint b, vl, vr;
+    drct_get_volume_balance(&b);
+    if (b < 0) {
+        vl = v;
+        vr = (v * (100 - abs(b))) / 100;
+    }
+    else if (b > 0) {
+        vl = (v * (100 - b)) / 100;
+        vr = v;
+    }
+    else
+        vl = vr = v;
+    drct_set_volume(vl, vr);
 }
 
 void
 drct_get_volume_balance ( gint *b )
 {
-  gint vl, vr;
-  input_get_volume(&vl, &vr);
-  if (vl < 0 || vr < 0)
-    *b = 0;
-  else if (vl > vr)
-    *b = -100 + ((vr * 100) / vl);
-  else if (vr > vl)
-    *b = 100 - ((vl * 100) / vr);
-  else
-    *b = 0;
-  return;
+    gint vl, vr;
+    input_get_volume(&vl, &vr);
+    if (vl < 0 || vr < 0)
+        *b = 0;
+    else if (vl > vr)
+        *b = -100 + ((vr * 100) / vl);
+    else if (vr > vl)
+        *b = 100 - ((vl * 100) / vr);
+    else
+        *b = 0;
+    return;
 }
 
 void
 drct_set_volume_balance ( gint b )
 {
-  gint v, vl, vr;
-  if (b < -100)
-    b = -100;
-  if (b > 100)
-    b = 100;
-  drct_get_volume_main(&v);
-  if (b < 0) {
-    vl = v;
-    vr = (v * (100 - abs(b))) / 100;
-  }
-  else if (b > 0) {
-    vl = (v * (100 - b)) / 100;
-    vr = v;
-  }
-  else
-  {
-    vl = v;
-    vr = v;
-  }
-  drct_set_volume(vl, vr);
-  return;
+    gint v, vl, vr;
+    if (b < -100)
+        b = -100;
+    if (b > 100)
+        b = 100;
+    drct_get_volume_main(&v);
+    if (b < 0) {
+        vl = v;
+        vr = (v * (100 - abs(b))) / 100;
+    }
+    else if (b > 0) {
+        vl = (v * (100 - b)) / 100;
+        vr = v;
+    }
+    else
+    {
+        vl = v;
+        vr = v;
+    }
+    drct_set_volume(vl, vr);
+    return;
 }
 
 
@@ -275,15 +275,15 @@
 void
 drct_pl_next ( void )
 {
-  playlist_next(playlist_get_active());
-  return;
+    playlist_next(playlist_get_active());
+    return;
 }
 
 void
 drct_pl_prev ( void )
 {
-  playlist_prev(playlist_get_active());
-  return;
+    playlist_prev(playlist_get_active());
+    return;
 }
 
 gboolean
@@ -295,8 +295,8 @@
 void
 drct_pl_repeat_toggle( void )
 {
-  mainwin_repeat_pushed(!cfg.repeat);
-  return;
+    mainwin_repeat_pushed(!cfg.repeat);
+    return;
 }
 
 gboolean
@@ -308,8 +308,8 @@
 void
 drct_pl_shuffle_toggle( void )
 {
-  mainwin_shuffle_pushed(!cfg.shuffle);
-  return;
+    mainwin_shuffle_pushed(!cfg.shuffle);
+    return;
 }
 
 gchar *
@@ -339,21 +339,21 @@
 void
 drct_pl_add ( GList * list )
 {
-  GList *node = list;
-  while ( node != NULL )
-  {
-    playlist_add_url(playlist_get_active(), (gchar*)node->data);
-    node = g_list_next(node);
-  }
-  return;
+    GList *node = list;
+    while ( node != NULL )
+    {
+        playlist_add_url(playlist_get_active(), (gchar*)node->data);
+        node = g_list_next(node);
+    }
+    return;
 }
 
 void
 drct_pl_clear ( void )
 {
-  playlist_clear(playlist_get_active());
-  mainwin_clear_song_info();
-  return;
+    playlist_clear(playlist_get_active());
+    mainwin_clear_song_info();
+    return;
 }
 
 
--- a/src/audacious/main.c	Mon May 12 00:13:38 2008 +0200
+++ b/src/audacious/main.c	Mon May 12 19:19:49 2008 +0200
@@ -105,12 +105,10 @@
     gchar *previous_session_id;
     gboolean macpack;
 };
-
 typedef struct _AudCmdLineOpt AudCmdLineOpt;
 
 static AudCmdLineOpt options;
 
-
 gchar *aud_paths[BMP_PATH_COUNT] = {};
 
 GCond *cond_scan;
@@ -120,7 +118,7 @@
 #endif
 
 static void
-dump_version(void)
+print_version(void)
 {
     g_printf("%s %s [%s]\n", _(application_name), VERSION, svn_stamp);
 }
@@ -138,18 +136,6 @@
 }
 
 static void
-aud_free_paths(void)
-{
-    int i;
-
-    for (i = 0; i < BMP_PATH_COUNT; i++)
-    {
-        g_free(aud_paths[i]);
-        aud_paths[i] = 0;
-    }
-}
-
-static void
 aud_init_paths()
 {
     char *xdg_config_home;
@@ -205,6 +191,17 @@
     g_atexit(aud_free_paths);
 }
 
+static void
+aud_free_paths(void)
+{
+    int i;
+
+    for (i = 0; i < BMP_PATH_COUNT; i++)
+    {
+        g_free(aud_paths[i]);
+        aud_paths[i] = 0;
+    }
+}
 
 static void
 aud_set_default_icon(void)
@@ -329,7 +326,7 @@
 
     if (options.version)
     {
-        dump_version();
+        print_version();
         exit(EXIT_SUCCESS);
     }