Mercurial > audlegacy
changeset 1273:3b990c26fc46 trunk
[svn] - Support for the buffer indicator in playpaus.png that was apparently
ignored by XMMS devs. Supports mp3 streams only, at the moment.
author | nhjm449 |
---|---|
date | Fri, 16 Jun 2006 02:17:33 -0700 |
parents | 11785f0bf967 |
children | d7d7037fc583 |
files | ChangeLog Plugins/Input/mpg123/http.c audacious/input.c audacious/input.h audacious/playback.c audacious/playstatus.c audacious/playstatus.h audacious/plugin.h audacious/pluginenum.c skin/playpaus.png |
diffstat | 10 files changed, 59 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Jun 16 01:45:08 2006 -0700 +++ b/ChangeLog Fri Jun 16 02:17:33 2006 -0700 @@ -1,3 +1,12 @@ +2006-06-16 08:45:08 +0000 William Pitcock <nenolod@nenolod.net> + revision [1458] + - fix ui_fileinfo problem + + + Changes: Modified: + +2 -2 trunk/audacious/glade/fileinfo.glade + + 2006-06-16 06:02:11 +0000 William Pitcock <nenolod@nenolod.net> revision [1456] - remove file_info_box code, it sucked.
--- a/Plugins/Input/mpg123/http.c Fri Jun 16 01:45:08 2006 -0700 +++ b/Plugins/Input/mpg123/http.c Fri Jun 16 02:17:33 2006 -0700 @@ -655,8 +655,10 @@ while (going) { - if (!http_used() && !mpgdec_ip.output->buffer_playing()) + if (!http_used() && !mpgdec_ip.output->buffer_playing()) { prebuffering = TRUE; + mpgdec_ip.set_status_buffering(TRUE); + } if (http_free() > 0 && !eof) { if (http_check_for_data()) { cnt = min(http_free(), buffer_length - wr_index); @@ -667,6 +669,7 @@ eof = TRUE; if (prebuffering) { prebuffering = FALSE; + mpgdec_ip.set_status_buffering(FALSE); mpgdec_ip.set_info_text(NULL); } @@ -679,6 +682,7 @@ if (prebuffering) { if (http_used() > prebuffer_length) { prebuffering = FALSE; + mpgdec_ip.set_status_buffering(FALSE); mpgdec_ip.set_info_text(NULL); } else { @@ -733,6 +737,7 @@ buffer_read = 0; icy_metaint = 0; prebuffering = TRUE; + mpgdec_ip.set_status_buffering(TRUE); going = TRUE; eof = FALSE; buffer = g_malloc(buffer_length);
--- a/audacious/input.c Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/input.c Fri Jun 16 02:17:33 2006 -0700 @@ -61,6 +61,7 @@ FALSE, FALSE, FALSE, + FALSE, NULL }; @@ -747,6 +748,22 @@ } void +input_set_status_buffering(gboolean status) +{ + if (!bmp_playback_get_playing()) + return; + + if (!get_current_input_plugin()) + return; + + ip_data.buffering = status; + + if (ip_data.buffering == TRUE && mainwin_playstatus->ps_status == STATUS_STOP) + mainwin_playstatus->ps_status = STATUS_PLAY; + playstatus_set_status_buffering(mainwin_playstatus, ip_data.buffering); +} + +void input_about(gint index) { InputPlugin *ip;
--- a/audacious/input.h Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/input.h Fri Jun 16 02:17:33 2006 -0700 @@ -32,6 +32,7 @@ gboolean playing; gboolean paused; gboolean stop; + gboolean buffering; GMutex *playback_mutex; }; @@ -62,6 +63,7 @@ void input_update_vis(gint time); void input_set_info_text(const gchar * text); +void input_set_status_buffering(gboolean status); GList *input_scan_dir(const gchar * dir); void input_get_volume(gint * l, gint * r);
--- a/audacious/playback.c Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/playback.c Fri Jun 16 02:17:33 2006 -0700 @@ -157,6 +157,8 @@ } } + ip_data.buffering = FALSE; + playstatus_set_status_buffering(mainwin_playstatus, FALSE); ip_data.playing = FALSE; } @@ -179,6 +181,7 @@ } } + ip_data.buffering = FALSE; ip_data.playing = FALSE; }
--- a/audacious/playstatus.c Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/playstatus.c Fri Jun 16 02:17:33 2006 -0700 @@ -34,8 +34,13 @@ return; obj = ps->ps_widget.parent; - - if (ps->ps_status == STATUS_PLAY) + if (ps->ps_status == STATUS_STOP && ps->ps_status_buffering == TRUE) + ps->ps_status_buffering = FALSE; + if (ps->ps_status == STATUS_PLAY && ps->ps_status_buffering == TRUE) + skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, + SKIN_PLAYPAUSE, 39, 0, ps->ps_widget.x, + ps->ps_widget.y, 3, 9); + else if (ps->ps_status == STATUS_PLAY) skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, SKIN_PLAYPAUSE, 36, 0, ps->ps_widget.x, ps->ps_widget.y, 3, 9); @@ -72,6 +77,16 @@ widget_draw(WIDGET(ps)); } +void +playstatus_set_status_buffering(PlayStatus * ps, gboolean status) +{ + if (!ps) + return; + + ps->ps_status_buffering = status; + widget_draw(WIDGET(ps)); +} + PlayStatus * create_playstatus(GList ** wlist, GdkPixmap * parent, GdkGC * gc, gint x, gint y)
--- a/audacious/playstatus.h Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/playstatus.h Fri Jun 16 02:17:33 2006 -0700 @@ -28,11 +28,13 @@ struct _PlayStatus { Widget ps_widget; PStatus ps_status; + gboolean ps_status_buffering; }; typedef struct _PlayStatus PlayStatus; void playstatus_set_status(PlayStatus * ps, PStatus status); +void playstatus_set_status_buffering(PlayStatus * ps, gboolean status); PlayStatus *create_playstatus(GList ** wlist, GdkPixmap * parent, GdkGC * gc, gint x, gint y);
--- a/audacious/plugin.h Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/plugin.h Fri Jun 16 02:17:33 2006 -0700 @@ -155,6 +155,7 @@ TitleInput *(*get_song_tuple) (gchar * filename); void (*set_song_tuple) (TitleInput * tuple); + void (*set_status_buffering) (gboolean status); }; struct _GeneralPlugin {
--- a/audacious/pluginenum.c Fri Jun 16 01:45:08 2006 -0700 +++ b/audacious/pluginenum.c Fri Jun 16 02:17:33 2006 -0700 @@ -133,7 +133,8 @@ - descender */ p->set_info = (void (*)(gchar *, gint, gint, gint, gint)) playlist_set_info; p->set_info_text = (void (*)(gchar *)) input_set_info_text; - + p->set_status_buffering = (void (*)(gboolean)) input_set_status_buffering; + ip_data.input_list = g_list_append(ip_data.input_list, p); g_hash_table_replace(plugin_matrix, g_path_get_basename(p->filename),