changeset 3151:6494bb1f23a4 trunk

Death to genevent functions.
author William Pitcock <nenolod@atheme-project.org>
date Mon, 23 Jul 2007 16:13:54 -0500
parents 5d1fe50ebbce
children c9471f83944c
files src/audacious/Makefile src/audacious/genevent.c src/audacious/genevent.h src/audacious/main.c src/audacious/ui_jumptotrack.c src/audacious/ui_main.c
diffstat 6 files changed, 1 insertions(+), 189 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/Makefile	Mon Jul 23 15:55:40 2007 -0500
+++ b/src/audacious/Makefile	Mon Jul 23 16:13:54 2007 -0500
@@ -73,7 +73,6 @@
 	fft.c \
 	formatter.c \
 	general.c \
-	genevent.c \
 	glade.c \
 	hints.c \
 	hook.c \
--- a/src/audacious/genevent.c	Mon Jul 23 15:55:40 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*  Audacious - Cross-platform multimedia platform.
- *  Copyright (C) 2005-2007  Audacious development team.
- *
- *  Based on BMP:
- *  Copyright (C) 2003-2004  BMP development team.
- *
- *  Based on XMMS:
- *  Copyright (C) 1998-2003  XMMS development team.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; under version 3 of the License.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses>.
- *
- *  The Audacious team does not consider modular code linking to
- *  Audacious or using our public API to be a derived work.
- */
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include "main.h"
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <glib/gprintf.h>
-#include <gdk/gdk.h>
-#include <stdlib.h>
-#include <string.h>
-#include <getopt.h>
-#include <ctype.h>
-#include <time.h>
-
-#include <unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-
-#include "dnd.h"
-#include "effect.h"
-#include "general.h"
-#include "hints.h"
-#include "input.h"
-#include "logger.h"
-#include "output.h"
-#include "playback.h"
-#include "playlist.h"
-#include "pluginenum.h"
-#include "ui_main.h"
-#include "ui_playlist.h"
-#include "ui_skinned_textbox.h"
-#include "ui_skinned_number.h"
-#include "ui_skinned_horizontal_slider.h"
-#include "util.h"
-#include "visualization.h"
-#include "vfs.h"
-
-gboolean ev_waiting = FALSE;
-
-static gboolean
-idle_func_change_song(gboolean waiting)
-{
-    static GTimer *pause_timer = NULL;
-
-    if (!pause_timer)
-        pause_timer = g_timer_new();
-
-    if (cfg.pause_between_songs) {
-        gint timeleft;
-
-        if (!waiting) {
-            g_timer_start(pause_timer);
-            waiting = TRUE;
-        }
-
-        timeleft = cfg.pause_between_songs_time -
-            (gint) g_timer_elapsed(pause_timer, NULL);
-
-        if (mainwin_10min_num != NULL) {
-            ui_skinned_number_set_number(mainwin_10min_num, timeleft / 600);
-            ui_skinned_number_set_number(mainwin_min_num, (timeleft / 60) % 10);
-            ui_skinned_number_set_number(mainwin_10sec_num, (timeleft / 10) % 6);
-            ui_skinned_number_set_number(mainwin_sec_num, timeleft % 10);
-        }
-
-        if (mainwin_sposition != NULL && !UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->pressed) {
-            gchar *time_str;
-
-            time_str = g_strdup_printf("%2.2d", timeleft / 60);
-            ui_skinned_textbox_set_text(mainwin_stime_min, time_str);
-            g_free(time_str);
-
-            time_str = g_strdup_printf("%2.2d", timeleft % 60);
-            ui_skinned_textbox_set_text(mainwin_stime_sec, time_str);
-            g_free(time_str);
-        }
-
-        playlistwin_set_time(timeleft * 1000, 0, TIMER_ELAPSED);
-    }
-
-    if (!cfg.pause_between_songs ||
-        g_timer_elapsed(pause_timer, NULL) >= cfg.pause_between_songs_time)
-    {
-	Playlist *playlist = playlist_get_active();
-
-        GDK_THREADS_ENTER();
-        playlist_eof_reached(playlist);
-        GDK_THREADS_LEAVE();
-
-        waiting = FALSE;
-    }
-
-    return waiting;
-}
-
-gint
-audcore_generic_events(void)
-{
-    gint time = 0;
-
-    if (playback_get_playing()) {
-        time = playback_get_time();
-
-        switch (time) {
-        case -1:
-            /* no song playing */
-            ev_waiting = idle_func_change_song(ev_waiting);
-            break;
-
-        default:
-            ev_waiting = FALSE;
-        }
-    }
-
-    return time;
-}
-
--- a/src/audacious/genevent.h	Mon Jul 23 15:55:40 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*  Audacious -- Cross-platform multimedia platform
- *  Copyright (C) 2005-2007  Audacious development team.
- *
- *  Based on BMP:
- *  Copyright (C) 2003-2004  BMP development team.
- *
- *  Based on XMMS:
- *  Copyright (C) 1998-2003  XMMS development team.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; under version 3 of the License.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses>.
- *
- *  The Audacious team does not consider modular code linking to
- *  Audacious or using our public API to be a derived work.
- */
-
-#ifndef GENEVENT_H
-#define GENEVENT_H
-
-#include "ui_main.h"
-
-extern gboolean ev_waiting;
-
-gint audcore_generic_events(void);
-
-#endif
--- a/src/audacious/main.c	Mon Jul 23 15:55:40 2007 -0500
+++ b/src/audacious/main.c	Mon Jul 23 16:13:54 2007 -0500
@@ -60,7 +60,6 @@
 #include "effect.h"
 #include "ui_equalizer.h"
 #include "general.h"
-#include "genevent.h"
 #include "hints.h"
 #include "input.h"
 #include "logger.h"
@@ -1098,7 +1097,6 @@
 static gboolean
 aud_headless_iteration(gpointer unused)
 {
-    audcore_generic_events();
     free_vis_data();
     return TRUE;
 }
--- a/src/audacious/ui_jumptotrack.c	Mon Jul 23 15:55:40 2007 -0500
+++ b/src/audacious/ui_jumptotrack.c	Mon Jul 23 16:13:54 2007 -0500
@@ -63,7 +63,6 @@
 
 #include "dnd.h"
 #include "dock.h"
-#include "genevent.h"
 #include "hints.h"
 #include "input.h"
 #include "playback.h"
--- a/src/audacious/ui_main.c	Mon Jul 23 15:55:40 2007 -0500
+++ b/src/audacious/ui_main.c	Mon Jul 23 16:13:54 2007 -0500
@@ -63,7 +63,6 @@
 #include "configdb.h"
 #include "dnd.h"
 #include "dock.h"
-#include "genevent.h"
 #include "hints.h"
 #include "input.h"
 #include "playback.h"
@@ -2992,8 +2991,7 @@
     static gint count = 0;
     gint time = 0;
 
-    /* run audcore events, then run our own. --nenolod */
-    switch((time = audcore_generic_events()))
+    switch((time = playback_get_time()))
     {
         case -2:
             /* no usable output device */
@@ -3001,7 +2999,6 @@
             run_no_output_device_dialog();
             mainwin_stop_pushed();
             GDK_THREADS_LEAVE();
-            ev_waiting = FALSE;
             break;
 
         default: