changeset 3174:21c6e57af470 trunk

Automated merge with ssh://hg.atheme-project.org//hg/audacious
author Christian Birchinger <joker@netswarm.net>
date Thu, 26 Jul 2007 22:33:34 +0200
parents 734a25cd1efb (current diff) 959fba26290d (diff)
children faa0b632a4f6 a6299755b78a
files
diffstat 3 files changed, 37 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/input.c	Thu Jul 26 22:33:25 2007 +0200
+++ b/src/audacious/input.c	Thu Jul 26 22:33:34 2007 +0200
@@ -1,5 +1,5 @@
 /*  Audacious - Cross-platform multimedia player
- *  Copyright (C) 2005-2006  Audacious development team
+ *  Copyright (C) 2005-2007  Audacious development team
  *
  *  Based on BMP:
  *  Copyright (C) 2003-2004  BMP development team
@@ -513,14 +513,16 @@
 void
 input_set_eq(gint on, gfloat preamp, gfloat * bands)
 {
+    InputPlayback *playback;
+
     if (!ip_data.playing)
         return;
 
-    if (!get_current_input_playback())
+    if ((playback = get_current_input_playback()) == NULL)
         return;
 
-    if (get_current_input_playback()->plugin->set_eq)
-        get_current_input_playback()->plugin->set_eq(on, preamp, bands);
+    if (playback->plugin->set_eq)
+        playback->plugin->set_eq(on, preamp, bands);
 }
 
 void
@@ -766,14 +768,15 @@
 void
 input_get_volume(gint * l, gint * r)
 {
+    InputPlayback *playback;
+
     *l = -1;
     *r = -1;
     if (playback_get_playing()) {
-        if (get_current_input_playback() &&
-            get_current_input_playback()->plugin->get_volume &&
-            get_current_input_playback()->plugin->get_volume(l, r)) {
+        if ((playback = get_current_input_playback()) != NULL &&
+            playback->plugin->get_volume &&
+            playback->plugin->get_volume(l, r))
             return;
-        }
     }
     output_get_volume(l, r);
 }
@@ -781,19 +784,21 @@
 void
 input_set_volume(gint l, gint r)
 {
+    InputPlayback *playback;
+
     gint h_vol[2];
+
+    h_vol[0] = l;
+    h_vol[1] = r;
+    hook_call("volume set", h_vol);
     
     if (playback_get_playing() &&
-        get_current_input_playback() &&
-        get_current_input_playback()->plugin->set_volume &&
-        get_current_input_playback()->plugin->set_volume(l, r))
+        (playback = get_current_input_playback()) != NULL &&
+        playback->plugin->set_volume &&
+        playback->plugin->set_volume(l, r))
         return;
 
     output_set_volume(l, r);
-    
-    h_vol[0] = l;
-    h_vol[1] = r;
-    hook_call("volume set", h_vol);
 }
 
 void
--- a/src/audacious/playback.c	Thu Jul 26 22:33:25 2007 +0200
+++ b/src/audacious/playback.c	Thu Jul 26 22:33:34 2007 +0200
@@ -148,17 +148,18 @@
 void
 playback_pause(void)
 {
+    InputPlayback *playback;
+
     if (!playback_get_playing())
         return;
 
-    if (!get_current_input_playback())
+    if ((playback = get_current_input_playback()) == NULL)
         return;
 
     ip_data.paused = !ip_data.paused;
 
-    if (get_current_input_playback()->plugin->pause)
-        get_current_input_playback()->plugin->pause(get_current_input_playback(),
-						    ip_data.paused);
+    if (playback->plugin->pause)
+        playback->plugin->pause(playback, ip_data.paused);
 
     if (ip_data.paused)
         hook_call("playback pause", NULL);
@@ -176,23 +177,26 @@
 void
 playback_stop(void)
 {
-    if (ip_data.playing && get_current_input_playback()) {
+    InputPlayback *playback;
 
-        if (playback_get_paused()) {
+    if (ip_data.playing && (playback = get_current_input_playback()) != NULL)
+    {
+        if (playback_get_paused() == TRUE)
+        {
             output_flush(get_written_time()); /* to avoid noise */
             playback_pause();
         }
 
         ip_data.playing = FALSE; 
 
-        if (get_current_input_playback()->plugin->stop)
-            get_current_input_playback()->plugin->stop(get_current_input_playback());
+        if (playback->plugin->stop)
+            playback->plugin->stop(playback);
 
         free_vis_data();
         ip_data.paused = FALSE;
 
-	g_free(get_current_input_playback()->filename);
-	g_free(get_current_input_playback());
+	g_free(playback->filename);
+	g_free(playback);
 	set_current_input_playback(NULL);
     }
 
--- a/src/audacious/ui_main.c	Thu Jul 26 22:33:25 2007 +0200
+++ b/src/audacious/ui_main.c	Thu Jul 26 22:33:34 2007 +0200
@@ -2984,14 +2984,9 @@
 mainwin_idle_func(gpointer data)
 {
     static gint count = 0;
-    gint time = 0;
-
-    switch((time = playback_get_time()))
-    {
-        default:
-            input_update_vis(time);
-            /* nothing at this time */
-    }
+    gint time = playback_get_time();
+
+    input_update_vis(time);
 
     GDK_THREADS_ENTER();