# HG changeset patch # User Matti Hamalainen # Date 1054636142 0 # Node ID 041bebb28dc0b76c845845589cc85c815514fa0f # Parent 183e7cbc1036864178b3009c746af48bbfa6c3c3 Removed obsolete patches diff -r 183e7cbc1036 -r 041bebb28dc0 xmms-songpos.patch-1.2.2 --- a/xmms-songpos.patch-1.2.2 Tue Jun 03 10:23:04 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,349 +0,0 @@ -diff -r -u xmms-1.2.2/General/ir/ir.c xmms-1.2.2-songpos/General/ir/ir.c ---- xmms-1.2.2/General/ir/ir.c Wed Mar 1 15:13:49 2000 -+++ xmms-1.2.2-songpos/General/ir/ir.c Sat Nov 11 18:23:55 2000 -@@ -288,12 +288,7 @@ - } - else if (!strcmp(text, ircfg.button_seekf) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(ir_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(ir_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(ir_gp.xmms_session, + 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -@@ -301,10 +296,7 @@ - } - else if (!strcmp(text, ircfg.button_seekb) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(ir_gp.xmms_session, - 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -diff -r -u xmms-1.2.2/General/joystick/joy.c xmms-1.2.2-songpos/General/joystick/joy.c ---- xmms-1.2.2/General/joystick/joy.c Wed Mar 1 15:13:49 2000 -+++ xmms-1.2.2-songpos/General/joystick/joy.c Sat Nov 11 18:23:55 2000 -@@ -316,18 +316,10 @@ - xmms_remote_set_volume(joy_gp.xmms_session, vl - 5, vr - 5); - break; - case JC_FWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(joy_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(joy_gp.xmms_session, + 5000); - break; - case JC_RWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(joy_gp.xmms_session, - 5000); - break; - case JC_SHUFFLE: - xmms_remote_toggle_shuffle(joy_gp.xmms_session); -diff -r -u xmms-1.2.2/Input/mikmod/plugin.c xmms-1.2.2-songpos/Input/mikmod/plugin.c ---- xmms-1.2.2/Input/mikmod/plugin.c Sun Feb 6 14:52:58 2000 -+++ xmms-1.2.2-songpos/Input/mikmod/plugin.c Sat Nov 11 18:23:55 2000 -@@ -189,15 +189,8 @@ - - static void seek(int time) - { -- /* -- We need to seek in pattrens somehow -- can't seek by time only by X pattrens on way or the other -- -- Player_NextPosition (); -- Player_PrevPosition (); -- -- */ -- return; -+ Player_SetPosition(time); -+ mikmod_ip.output->flush(get_time()); - } - - static void mod_pause(short p) -@@ -213,6 +206,7 @@ - return -1; - if(!Player_Active() && !mikmod_ip.output->buffer_playing()) - return -1; -+ set_song_position(mf->sngpos, 0, (mf->numpos - 1)); - return mikmod_ip.output->output_time(); - } - -diff -r -u xmms-1.2.2/libxmms/xmmsctrl.c xmms-1.2.2-songpos/libxmms/xmmsctrl.c ---- xmms-1.2.2/libxmms/xmmsctrl.c Wed Jun 21 15:29:29 2000 -+++ xmms-1.2.2-songpos/libxmms/xmmsctrl.c Sat Nov 11 18:23:55 2000 -@@ -365,6 +365,11 @@ - remote_send_guint32(session, CMD_JUMP_TO_TIME, pos); - } - -+void xmms_remote_seek(gint session, gint off) -+{ -+ remote_send_guint32(session, CMD_SEEK, off); -+} -+ - void xmms_remote_get_volume(gint session, gint * vl, gint * vr) - { - ServerPktHeader pkt_hdr; -diff -r -u xmms-1.2.2/libxmms/xmmsctrl.h xmms-1.2.2-songpos/libxmms/xmmsctrl.h ---- xmms-1.2.2/libxmms/xmmsctrl.h Mon Jun 19 15:25:09 2000 -+++ xmms-1.2.2-songpos/libxmms/xmmsctrl.h Sat Nov 11 18:23:55 2000 -@@ -40,6 +40,7 @@ - void xmms_remote_playlist_clear(gint session); - gint xmms_remote_get_output_time(gint session); - void xmms_remote_jump_to_time(gint session, gint pos); -+void xmms_remote_seek(gint session, gint off); - void xmms_remote_get_volume(gint session, gint * vl, gint * vr); - gint xmms_remote_get_main_volume(gint session); - gint xmms_remote_get_balance(gint session); -diff -r -u xmms-1.2.2/xmms/controlsocket.c xmms-1.2.2-songpos/xmms/controlsocket.c ---- xmms-1.2.2/xmms/controlsocket.c Sat Jul 8 17:35:12 2000 -+++ xmms-1.2.2-songpos/xmms/controlsocket.c Sat Nov 11 18:27:16 2000 -@@ -445,6 +445,10 @@ - if (num <= playlist_get_current_length()) - input_seek(num / 1000); - break; -+ case CMD_SEEK: -+ num = *((guint32 *) data); -+ song_seek(num); -+ break; - case CMD_SET_VOLUME: - v[0] = ((guint32 *) data)[0]; - v[1] = ((guint32 *) data)[1]; -diff -r -u xmms-1.2.2/xmms/controlsocket.h xmms-1.2.2-songpos/xmms/controlsocket.h ---- xmms-1.2.2/xmms/controlsocket.h Mon Jun 19 15:25:14 2000 -+++ xmms-1.2.2-songpos/xmms/controlsocket.h Sat Nov 11 18:23:55 2000 -@@ -31,7 +31,7 @@ - CMD_GET_VERSION, CMD_PLAYLIST_ADD, CMD_PLAY, CMD_PAUSE, CMD_STOP, - CMD_IS_PLAYING, CMD_IS_PAUSED, CMD_GET_PLAYLIST_POS, - CMD_SET_PLAYLIST_POS, CMD_GET_PLAYLIST_LENGTH, CMD_PLAYLIST_CLEAR, -- CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_GET_VOLUME, -+ CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_SEEK, CMD_GET_VOLUME, - CMD_SET_VOLUME, CMD_GET_SKIN, CMD_SET_SKIN, CMD_GET_PLAYLIST_FILE, - CMD_GET_PLAYLIST_TITLE, CMD_GET_PLAYLIST_TIME, CMD_GET_INFO, - CMD_GET_EQ_DATA, CMD_SET_EQ_DATA, CMD_PL_WIN_TOGGLE, -diff -r -u xmms-1.2.2/xmms/input.c xmms-1.2.2-songpos/xmms/input.c ---- xmms-1.2.2/xmms/input.c Wed Feb 16 23:05:57 2000 -+++ xmms-1.2.2-songpos/xmms/input.c Sat Nov 11 18:28:47 2000 -@@ -281,6 +281,7 @@ - } - } - ip_data->playing = FALSE; -+ set_song_position(0, 0, 0); - } - - void input_pause(void) -diff -r -u xmms-1.2.2/xmms/main.c xmms-1.2.2-songpos/xmms/main.c ---- xmms-1.2.2/xmms/main.c Tue Jul 11 19:11:14 2000 -+++ xmms-1.2.2-songpos/xmms/main.c Sat Nov 11 18:32:36 2000 -@@ -614,6 +614,55 @@ - g_free(filename); - } - -+/*\ -+|*| Separate song position stuff, for songs without a time length, -+|*| but that want to be able to seek anyway. -+|*| -+|*| Have the input plugin's get_time() function call -+|*| set_song_position(int pos, int first, int last) -+|*| to set the slider. If the slider is dragged, -+|*| the plugin's seek() is called with the position. -+|*| (If last <= first the feature is turned off) -+\*/ -+ -+static int song_pos_cur, song_pos_first, song_pos_num = 0; -+ -+void set_song_position(int pos, int first, int last) -+{ -+ last -= first; -+ song_pos_cur = pos; -+ song_pos_first = first; -+ song_pos_num = last; -+ if (last <= 0) return; -+ pos -= first; -+ if (pos > last) pos = last; -+ if (cfg.player_shaded) -+ show_widget(mainwin_sposition); -+ show_widget(mainwin_position); -+ hslider_set_position(mainwin_position, (pos * 219) / last); -+ hslider_set_position(mainwin_sposition, ((pos * 12) / last) + 1); -+} -+ -+void song_seek(gint off) -+{ -+ if (!get_input_playing()) return; -+ if (song_pos_num > 0) { -+ gint newpos; -+ if (off < 0) newpos = song_pos_cur - 1; -+ else if (off > 0) newpos = song_pos_cur + 1; -+ if (newpos < song_pos_first) newpos = song_pos_first; -+ if (newpos > song_pos_first + song_pos_num) -+ newpos = song_pos_first + song_pos_num; -+ input_seek(newpos); -+ } else { -+ gint newpos = (input_get_time() / 1000) + (off / 1000); -+ gint pcl = playlist_get_current_length() / 1000; -+ if (newpos >= pcl) newpos = pcl - 1; -+ if (newpos < 0) newpos = 0; -+ input_seek(newpos); -+ } -+} -+ - void mainwin_set_always_on_top(gboolean always) - { - cfg.always_on_top = always; -@@ -680,7 +729,9 @@ - show_widget(mainwin_stime_min); - show_widget(mainwin_stime_sec); - -- if (get_input_playing() && playlist_get_current_length() != -1) -+ if (get_input_playing() && -+ ((playlist_get_current_length() != -1) || -+ (song_pos_num > 0))) - show_widget(mainwin_sposition); - - mainwin_shade->pb_ny = mainwin_shade->pb_py = 27; -@@ -987,7 +1038,7 @@ - show_widget(mainwin_10sec_num); - show_widget(mainwin_sec_num); - playstatus_set_status(mainwin_playstatus, STATUS_PLAY); -- if (playlist_get_current_length() != -1) -+ if ((playlist_get_current_length() != -1) || (song_pos_num > 0)) - { - if (cfg.player_shaded) - show_widget(mainwin_sposition); -@@ -1217,13 +1268,19 @@ - break; - case GDK_Left: - case GDK_KP_Left: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() - 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(-5000); - break; - case GDK_Right: - case GDK_KP_Right: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() + 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(+5000); - break; - default: - break; -@@ -1805,6 +1862,16 @@ - - pos--; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 6) / 12) + song_pos_first; -+ tmp = g_strdup_printf("%d", time); -+ textbox_set_text(mainwin_stime_min, tmp); -+ g_free(tmp); -+ tmp = g_strdup_printf("%d", song_pos_first + song_pos_num); -+ textbox_set_text(mainwin_stime_sec, tmp); -+ g_free(tmp); -+ return; -+ } - time = ((playlist_get_current_length() / 1000) * pos) / 12; - if (cfg.timer_mode == TIMER_REMAINING) - { -@@ -1826,6 +1893,10 @@ - - void mainwin_spos_release_cb(gint pos) - { -+ if (song_pos_num > 0) { -+ input_seek(((song_pos_num * (pos - 1) + 6) / 12) + song_pos_first); -+ return; -+ } - input_seek(((playlist_get_current_length() / 1000) * (pos - 1)) / 12); - } - -@@ -1834,6 +1905,14 @@ - gint length, time; - gchar *buf; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ buf = g_strdup_printf("JUMP TO: %d/%d", time, -+ song_pos_num + song_pos_first); -+ mainwin_lock_info_text(buf); -+ g_free(buf); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - buf = g_strdup_printf(_("SEEK TO: %d:%-2.2d/%d:%-2.2d (%d%%)"), time / 60, time % 60, length / 60, length % 60, (length != 0) ? (time * 100) / length : 0); -@@ -1845,6 +1924,12 @@ - { - int length, time; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ input_seek(time); -+ mainwin_release_info_text(); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - input_seek(time); -@@ -2236,12 +2321,18 @@ - case MAINWIN_GENERAL_STOPFADE: - break; - case MAINWIN_GENERAL_BACK5SEC: -+/* - if (get_input_playing() && playlist_get_current_length() != -1) - input_seek((((input_get_time() / 1000) - 5 >= 0) ? (input_get_time() / 1000) - 5 : 0)); -+*/ -+ song_seek(-5000); - break; - case MAINWIN_GENERAL_FWD5SEC: -+/* - if (get_input_playing() && playlist_get_current_length() != -1) - input_seek(((((input_get_time() / 1000) + 5) < (playlist_get_current_length() / 1000)) ? ((input_get_time() / 1000) + 5) : ((playlist_get_current_length() / 1000) - 1))); -+*/ -+ song_seek(+5000); - break; - case MAINWIN_GENERAL_START: - playlist_set_position(0); -@@ -2801,7 +2892,7 @@ - hslider_set_position(mainwin_sposition, ((time * 12) / length) + 1); - } - } -- else -+ else if (song_pos_num <= 0) - { - hslider_set_position(mainwin_position, 0); - hslider_set_position(mainwin_sposition, 1); -diff -r -u xmms-1.2.2/xmms/main.h xmms-1.2.2-songpos/xmms/main.h ---- xmms-1.2.2/xmms/main.h Fri Jul 7 19:18:26 2000 -+++ xmms-1.2.2-songpos/xmms/main.h Sat Nov 11 18:23:55 2000 -@@ -82,6 +82,7 @@ - void mainwin_play_pushed(void); - void mainwin_stop_pushed(void); - void mainwin_eject_pushed(void); -+void song_seek(gint off); - - void mainwin_set_back_pixmap(void); - -diff -r -u xmms-1.2.2/xmms/plugin.h xmms-1.2.2-songpos/xmms/plugin.h ---- xmms-1.2.2/xmms/plugin.h Wed Mar 1 22:28:06 2000 -+++ xmms-1.2.2-songpos/xmms/plugin.h Sat Nov 11 18:23:55 2000 -@@ -151,4 +151,6 @@ - void (*render_freq)(gint16 freq_data[2][256]); /* Render the freq data, don't do anything time consuming in here */ - } VisPlugin; - -+void set_song_position(int pos, int first, int last); -+ - #endif diff -r 183e7cbc1036 -r 041bebb28dc0 xmms-songpos.patch-1.2.5 --- a/xmms-songpos.patch-1.2.5 Tue Jun 03 10:23:04 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,403 +0,0 @@ -diff -r -u xmms-1.2.5/General/ir/ir.c xmms-1.2.5-patched/General/ir/ir.c ---- xmms-1.2.5/General/ir/ir.c Mon Mar 5 16:15:13 2001 -+++ xmms-1.2.5-patched/General/ir/ir.c Tue Jul 17 18:44:05 2001 -@@ -292,12 +292,7 @@ - } - else if (!strcmp(text, ircfg.button_seekf) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(ir_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(ir_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(ir_gp.xmms_session, + 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -@@ -305,10 +300,7 @@ - } - else if (!strcmp(text, ircfg.button_seekb) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(ir_gp.xmms_session, - 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -diff -r -u xmms-1.2.5/General/joystick/joy.c xmms-1.2.5-patched/General/joystick/joy.c ---- xmms-1.2.5/General/joystick/joy.c Mon Feb 5 16:27:10 2001 -+++ xmms-1.2.5-patched/General/joystick/joy.c Tue Jul 17 18:44:05 2001 -@@ -343,18 +343,10 @@ - xmms_remote_set_volume(joy_gp.xmms_session, vl - 5, vr - 5); - break; - case JC_FWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(joy_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(joy_gp.xmms_session, + 5000); - break; - case JC_RWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(joy_gp.xmms_session, - 5000); - break; - case JC_SHUFFLE: - xmms_remote_toggle_shuffle(joy_gp.xmms_session); -diff -r -u xmms-1.2.5/Input/mikmod/plugin.c xmms-1.2.5-patched/Input/mikmod/plugin.c ---- xmms-1.2.5/Input/mikmod/plugin.c Tue Aug 1 00:33:04 2000 -+++ xmms-1.2.5-patched/Input/mikmod/plugin.c Tue Jul 17 18:44:05 2001 -@@ -149,15 +149,8 @@ - - static void seek(int time) - { -- /* -- We need to seek in pattrens somehow -- can't seek by time only by X pattrens on way or the other -- -- Player_NextPosition (); -- Player_PrevPosition (); -- -- */ -- return; -+ Player_SetPosition(time); -+ mikmod_ip.output->flush(get_time()); - } - - static void mod_pause(short p) -@@ -173,6 +166,7 @@ - return -1; - if(!Player_Active() && !mikmod_ip.output->buffer_playing()) - return -1; -+ set_song_position(mf->sngpos, 0, (mf->numpos - 1)); - return mikmod_ip.output->output_time(); - } - -diff -r -u xmms-1.2.5/Input/mpg123/common.c xmms-1.2.5-patched/Input/mpg123/common.c ---- xmms-1.2.5/Input/mpg123/common.c Fri Jun 1 16:07:48 2001 -+++ xmms-1.2.5-patched/Input/mpg123/common.c Tue Jul 17 18:44:05 2001 -@@ -56,6 +56,13 @@ - static FILE *filept; - static int filept_opened; - -+int streaming_http(void) -+{ -+ if (!filept_opened) return FALSE; -+ if (filept) return FALSE; -+ return TRUE; -+} -+ - static int get_fileinfo(void); - - static int fullread(FILE * fd, unsigned char *buf, int count) -diff -r -u xmms-1.2.5/Input/mpg123/http.c xmms-1.2.5-patched/Input/mpg123/http.c ---- xmms-1.2.5/Input/mpg123/http.c Fri Jun 1 16:07:48 2001 -+++ xmms-1.2.5-patched/Input/mpg123/http.c Tue Jul 17 18:44:05 2001 -@@ -193,6 +193,11 @@ - return (buffer_length - (wr_index - rd_index)) - 1; - } - -+void show_http_buffer_fullness(void) -+{ -+ set_song_position(http_used(), 0, buffer_length); -+} -+ - static void http_wait_for_data(gint bytes) - { - while ((prebuffering || http_used() < bytes) && !eof && going && mpg123_info->going) -diff -r -u xmms-1.2.5/Input/mpg123/mpg123.c xmms-1.2.5-patched/Input/mpg123/mpg123.c ---- xmms-1.2.5/Input/mpg123/mpg123.c Thu May 10 22:43:37 2001 -+++ xmms-1.2.5-patched/Input/mpg123/mpg123.c Tue Jul 17 18:44:05 2001 -@@ -1029,8 +1029,13 @@ - } - } - -+int streaming_http(void); -+void show_http_buffer_fullness(void); -+ - static void seek(int time) - { -+ if (streaming_http()) -+ return; - mpg123_info->jump_to_time = time; - - while (mpg123_info->jump_to_time != -1) -@@ -1050,6 +1055,8 @@ - return -1; - if (!mpg123_info->going || (mpg123_info->eof && !mpg123_ip.output->buffer_playing())) - return -1; -+ if (streaming_http()) -+ show_http_buffer_fullness(); - return mpg123_ip.output->output_time(); - } - -diff -r -u xmms-1.2.5/libxmms/xmmsctrl.c xmms-1.2.5-patched/libxmms/xmmsctrl.c ---- xmms-1.2.5/libxmms/xmmsctrl.c Fri Jun 1 16:07:49 2001 -+++ xmms-1.2.5-patched/libxmms/xmmsctrl.c Tue Jul 17 18:44:05 2001 -@@ -370,6 +370,11 @@ - remote_send_guint32(session, CMD_JUMP_TO_TIME, pos); - } - -+void xmms_remote_seek(gint session, gint off) -+{ -+ remote_send_guint32(session, CMD_SEEK, off); -+} -+ - void xmms_remote_get_volume(gint session, gint * vl, gint * vr) - { - ServerPktHeader pkt_hdr; -diff -r -u xmms-1.2.5/libxmms/xmmsctrl.h xmms-1.2.5-patched/libxmms/xmmsctrl.h ---- xmms-1.2.5/libxmms/xmmsctrl.h Fri Jun 16 18:00:28 2000 -+++ xmms-1.2.5-patched/libxmms/xmmsctrl.h Tue Jul 17 18:44:05 2001 -@@ -40,6 +40,7 @@ - void xmms_remote_playlist_clear(gint session); - gint xmms_remote_get_output_time(gint session); - void xmms_remote_jump_to_time(gint session, gint pos); -+void xmms_remote_seek(gint session, gint off); - void xmms_remote_get_volume(gint session, gint * vl, gint * vr); - gint xmms_remote_get_main_volume(gint session); - gint xmms_remote_get_balance(gint session); -diff -r -u xmms-1.2.5/xmms/controlsocket.c xmms-1.2.5-patched/xmms/controlsocket.c ---- xmms-1.2.5/xmms/controlsocket.c Sun Jun 17 02:05:47 2001 -+++ xmms-1.2.5-patched/xmms/controlsocket.c Tue Jul 17 18:44:05 2001 -@@ -434,6 +434,10 @@ - num < playlist_get_current_length()) - input_seek(num / 1000); - break; -+ case CMD_SEEK: -+ num = *((guint32 *) data); -+ song_seek(num); -+ break; - case CMD_SET_VOLUME: - v[0] = ((guint32 *) data)[0]; - v[1] = ((guint32 *) data)[1]; -diff -r -u xmms-1.2.5/xmms/controlsocket.h xmms-1.2.5-patched/xmms/controlsocket.h ---- xmms-1.2.5/xmms/controlsocket.h Fri Jun 16 18:00:28 2000 -+++ xmms-1.2.5-patched/xmms/controlsocket.h Tue Jul 17 18:44:05 2001 -@@ -31,7 +31,7 @@ - CMD_GET_VERSION, CMD_PLAYLIST_ADD, CMD_PLAY, CMD_PAUSE, CMD_STOP, - CMD_IS_PLAYING, CMD_IS_PAUSED, CMD_GET_PLAYLIST_POS, - CMD_SET_PLAYLIST_POS, CMD_GET_PLAYLIST_LENGTH, CMD_PLAYLIST_CLEAR, -- CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_GET_VOLUME, -+ CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_SEEK, CMD_GET_VOLUME, - CMD_SET_VOLUME, CMD_GET_SKIN, CMD_SET_SKIN, CMD_GET_PLAYLIST_FILE, - CMD_GET_PLAYLIST_TITLE, CMD_GET_PLAYLIST_TIME, CMD_GET_INFO, - CMD_GET_EQ_DATA, CMD_SET_EQ_DATA, CMD_PL_WIN_TOGGLE, -diff -r -u xmms-1.2.5/xmms/input.c xmms-1.2.5-patched/xmms/input.c ---- xmms-1.2.5/xmms/input.c Thu Jun 14 15:30:33 2001 -+++ xmms-1.2.5-patched/xmms/input.c Tue Jul 17 18:44:05 2001 -@@ -294,6 +294,7 @@ - } - } - ip_data->playing = FALSE; -+ set_song_position(0, 0, 0); - } - - void input_pause(void) -diff -r -u xmms-1.2.5/xmms/main.c xmms-1.2.5-patched/xmms/main.c ---- xmms-1.2.5/xmms/main.c Sun Jun 17 02:05:47 2001 -+++ xmms-1.2.5-patched/xmms/main.c Tue Jul 17 18:49:39 2001 -@@ -669,6 +669,55 @@ - g_free(filename); - } - -+/*\ -+|*| Separate song position stuff, for songs without a time length, -+|*| but that want to be able to seek anyway. -+|*| -+|*| Have the input plugin's get_time() function call -+|*| set_song_position(int pos, int first, int last) -+|*| to set the slider. If the slider is dragged, -+|*| the plugin's seek() is called with the position. -+|*| (If last <= first the feature is turned off) -+\*/ -+ -+static int song_pos_cur, song_pos_first, song_pos_num = 0; -+ -+void set_song_position(int pos, int first, int last) -+{ -+ last -= first; -+ song_pos_cur = pos; -+ song_pos_first = first; -+ song_pos_num = last; -+ if (last <= 0) return; -+ pos -= first; -+ if (pos > last) pos = last; -+ if (cfg.player_shaded) -+ show_widget(mainwin_sposition); -+ show_widget(mainwin_position); -+ hslider_set_position(mainwin_position, (pos * 219) / last); -+ hslider_set_position(mainwin_sposition, ((pos * 12) / last) + 1); -+} -+ -+void song_seek(gint off) -+{ -+ if (!get_input_playing()) return; -+ if (song_pos_num > 0) { -+ gint newpos = 0; -+ if (off < 0) newpos = song_pos_cur - 1; -+ else if (off > 0) newpos = song_pos_cur + 1; -+ if (newpos < song_pos_first) newpos = song_pos_first; -+ if (newpos > song_pos_first + song_pos_num) -+ newpos = song_pos_first + song_pos_num; -+ input_seek(newpos); -+ } else { -+ gint newpos = (input_get_time() / 1000) + (off / 1000); -+ gint pcl = playlist_get_current_length() / 1000; -+ if (newpos >= pcl) newpos = pcl - 1; -+ if (newpos < 0) newpos = 0; -+ input_seek(newpos); -+ } -+} -+ - gchar *xmms_get_gentitle_format(void) - { - return cfg.gentitle_format; -@@ -748,7 +797,9 @@ - show_widget(mainwin_stime_min); - show_widget(mainwin_stime_sec); - -- if (get_input_playing() && playlist_get_current_length() != -1) -+ if (get_input_playing() && -+ ((playlist_get_current_length() != -1) || -+ (song_pos_num > 0))) - show_widget(mainwin_sposition); - - mainwin_shade->pb_ny = mainwin_shade->pb_py = 27; -@@ -1065,7 +1116,7 @@ - show_widget(mainwin_10sec_num); - show_widget(mainwin_sec_num); - playstatus_set_status(mainwin_playstatus, STATUS_PLAY); -- if (playlist_get_current_length() != -1) -+ if ((playlist_get_current_length() != -1) || (song_pos_num > 0)) - { - if (cfg.player_shaded) - show_widget(mainwin_sposition); -@@ -1308,13 +1359,19 @@ - break; - case GDK_Left: - case GDK_KP_Left: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() - 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(-5000); - break; - case GDK_Right: - case GDK_KP_Right: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() + 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(+5000); - break; - default: - break; -@@ -1939,6 +1996,16 @@ - - pos--; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 6) / 12) + song_pos_first; -+ tmp = g_strdup_printf("%d", time); -+ textbox_set_text(mainwin_stime_min, tmp); -+ g_free(tmp); -+ tmp = g_strdup_printf("%d", song_pos_first + song_pos_num); -+ textbox_set_text(mainwin_stime_sec, tmp); -+ g_free(tmp); -+ return; -+ } - time = ((playlist_get_current_length() / 1000) * pos) / 12; - if (cfg.timer_mode == TIMER_REMAINING) - { -@@ -1960,6 +2027,10 @@ - - void mainwin_spos_release_cb(gint pos) - { -+ if (song_pos_num > 0) { -+ input_seek(((song_pos_num * (pos - 1) + 6) / 12) + song_pos_first); -+ return; -+ } - input_seek(((playlist_get_current_length() / 1000) * (pos - 1)) / 12); - } - -@@ -1968,6 +2039,14 @@ - gint length, time; - gchar *buf; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ buf = g_strdup_printf("JUMP TO: %d/%d", time, -+ song_pos_num + song_pos_first); -+ mainwin_lock_info_text(buf); -+ g_free(buf); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - buf = g_strdup_printf(_("SEEK TO: %d:%-2.2d/%d:%-2.2d (%d%%)"), time / 60, time % 60, length / 60, length % 60, (length != 0) ? (time * 100) / length : 0); -@@ -1979,6 +2058,12 @@ - { - int length, time; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ input_seek(time); -+ mainwin_release_info_text(); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - input_seek(time); -@@ -2382,12 +2467,10 @@ - case MAINWIN_GENERAL_STOPFADE: - break; - case MAINWIN_GENERAL_BACK5SEC: -- if (get_input_playing() && playlist_get_current_length() != -1) -- input_seek((((input_get_time() / 1000) - 5 >= 0) ? (input_get_time() / 1000) - 5 : 0)); -+ song_seek(-5000); - break; - case MAINWIN_GENERAL_FWD5SEC: -- if (get_input_playing() && playlist_get_current_length() != -1) -- input_seek(((((input_get_time() / 1000) + 5) < (playlist_get_current_length() / 1000)) ? ((input_get_time() / 1000) + 5) : ((playlist_get_current_length() / 1000) - 1))); -+ song_seek(+5000); - break; - case MAINWIN_GENERAL_START: - playlist_set_position(0); -@@ -2981,7 +3064,7 @@ - hslider_set_position(mainwin_sposition, ((time * 12) / length) + 1); - } - } -- else -+ else if (song_pos_num <= 0) - { - hslider_set_position(mainwin_position, 0); - hslider_set_position(mainwin_sposition, 1); -diff -r -u xmms-1.2.5/xmms/main.h xmms-1.2.5-patched/xmms/main.h ---- xmms-1.2.5/xmms/main.h Wed Mar 14 16:06:39 2001 -+++ xmms-1.2.5-patched/xmms/main.h Tue Jul 17 18:44:05 2001 -@@ -88,6 +88,7 @@ - void mainwin_play_pushed(void); - void mainwin_stop_pushed(void); - void mainwin_eject_pushed(void); -+void song_seek(gint off); - - void mainwin_set_back_pixmap(void); - -diff -r -u xmms-1.2.5/xmms/plugin.h xmms-1.2.5-patched/xmms/plugin.h ---- xmms-1.2.5/xmms/plugin.h Wed Mar 1 22:28:06 2000 -+++ xmms-1.2.5-patched/xmms/plugin.h Tue Jul 17 18:44:05 2001 -@@ -151,4 +151,6 @@ - void (*render_freq)(gint16 freq_data[2][256]); /* Render the freq data, don't do anything time consuming in here */ - } VisPlugin; - -+void set_song_position(int pos, int first, int last); -+ - #endif diff -r 183e7cbc1036 -r 041bebb28dc0 xmms-songpos.patch-1.2.7 --- a/xmms-songpos.patch-1.2.7 Tue Jun 03 10:23:04 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,408 +0,0 @@ -diff -r -u xmms-1.2.7/General/ir/ir.c xmms-1.2.7-patched/General/ir/ir.c ---- xmms-1.2.7/General/ir/ir.c Mon Mar 5 15:15:13 2001 -+++ xmms-1.2.7-patched/General/ir/ir.c Sat Jun 1 17:27:31 2002 -@@ -292,12 +292,7 @@ - } - else if (!strcmp(text, ircfg.button_seekf) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(ir_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(ir_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(ir_gp.xmms_session, + 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -@@ -305,10 +300,7 @@ - } - else if (!strcmp(text, ircfg.button_seekb) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2) - { -- output_time = xmms_remote_get_output_time(ir_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(ir_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(ir_gp.xmms_session, - 5000); - g_timer_reset(timer1); - g_timer_reset(timer2); - g_timer_stop(timer2); -diff -r -u xmms-1.2.7/General/joystick/joy.c xmms-1.2.7-patched/General/joystick/joy.c ---- xmms-1.2.7/General/joystick/joy.c Mon Feb 5 15:27:10 2001 -+++ xmms-1.2.7-patched/General/joystick/joy.c Sat Jun 1 17:27:31 2002 -@@ -343,18 +343,10 @@ - xmms_remote_set_volume(joy_gp.xmms_session, vl - 5, vr - 5); - break; - case JC_FWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session); -- playlist_time = xmms_remote_get_playlist_time(joy_gp.xmms_session, playlist_pos); -- if (playlist_time - output_time < 5000) -- output_time = playlist_time - 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time + 5000); -+ xmms_remote_seek(joy_gp.xmms_session, + 5000); - break; - case JC_RWD: -- output_time = xmms_remote_get_output_time(joy_gp.xmms_session); -- if (output_time < 5000) -- output_time = 5000; -- xmms_remote_jump_to_time(joy_gp.xmms_session, output_time - 5000); -+ xmms_remote_seek(joy_gp.xmms_session, - 5000); - break; - case JC_SHUFFLE: - xmms_remote_toggle_shuffle(joy_gp.xmms_session); -diff -r -u xmms-1.2.7/Input/mikmod/plugin.c xmms-1.2.7-patched/Input/mikmod/plugin.c ---- xmms-1.2.7/Input/mikmod/plugin.c Mon Jul 23 14:26:27 2001 -+++ xmms-1.2.7-patched/Input/mikmod/plugin.c Sat Jun 1 17:27:31 2002 -@@ -150,15 +150,8 @@ - - static void seek(int time) - { -- /* -- We need to seek in pattrens somehow -- can't seek by time only by X pattrens on way or the other -- -- Player_NextPosition (); -- Player_PrevPosition (); -- -- */ -- return; -+ Player_SetPosition(time); -+ mikmod_ip.output->flush(get_time()); - } - - static void mod_pause(short p) -@@ -174,6 +167,7 @@ - return -1; - if(!Player_Active() && !mikmod_ip.output->buffer_playing()) - return -1; -+ set_song_position(mf->sngpos, 0, (mf->numpos - 1)); - return mikmod_ip.output->output_time(); - } - -Only in xmms-1.2.7-patched/Input/mikmod: plugin.c~ -diff -r -u xmms-1.2.7/Input/mpg123/common.c xmms-1.2.7-patched/Input/mpg123/common.c ---- xmms-1.2.7/Input/mpg123/common.c Wed Feb 20 15:17:30 2002 -+++ xmms-1.2.7-patched/Input/mpg123/common.c Sat Jun 1 17:27:31 2002 -@@ -56,6 +56,13 @@ - static FILE *filept; - static int filept_opened; - -+int streaming_http(void) -+{ -+ if (!filept_opened) return FALSE; -+ if (filept) return FALSE; -+ return TRUE; -+} -+ - static int get_fileinfo(void); - - static int fullread(FILE * fd, unsigned char *buf, int count) -diff -r -u xmms-1.2.7/Input/mpg123/http.c xmms-1.2.7-patched/Input/mpg123/http.c ---- xmms-1.2.7/Input/mpg123/http.c Mon Jan 7 15:08:04 2002 -+++ xmms-1.2.7-patched/Input/mpg123/http.c Sat Jun 1 17:27:31 2002 -@@ -194,6 +194,11 @@ - return (buffer_length - (wr_index - rd_index)) - 1; - } - -+void show_http_buffer_fullness(void) -+{ -+ set_song_position(http_used(), 0, buffer_length); -+} -+ - static void http_wait_for_data(gint bytes) - { - while ((prebuffering || http_used() < bytes) && !eof && going && mpg123_info->going) -Only in xmms-1.2.7-patched/Input/mpg123: http.c~ -diff -r -u xmms-1.2.7/Input/mpg123/mpg123.c xmms-1.2.7-patched/Input/mpg123/mpg123.c ---- xmms-1.2.7/Input/mpg123/mpg123.c Wed Feb 20 15:17:31 2002 -+++ xmms-1.2.7-patched/Input/mpg123/mpg123.c Sat Jun 1 17:27:31 2002 -@@ -1059,8 +1059,13 @@ - } - } - -+int streaming_http(void); -+void show_http_buffer_fullness(void); -+ - static void seek(int time) - { -+ if (streaming_http()) -+ return; - mpg123_info->jump_to_time = time; - - while (mpg123_info->jump_to_time != -1) -@@ -1083,6 +1088,8 @@ - return -1; - if (!mpg123_info->going || (mpg123_info->eof && !mpg123_ip.output->buffer_playing())) - return -1; -+ if (streaming_http()) -+ show_http_buffer_fullness(); - return mpg123_ip.output->output_time(); - } - -Only in xmms-1.2.7-patched/Input/mpg123: mpg123.c~ -diff -r -u xmms-1.2.7/libxmms/xmmsctrl.c xmms-1.2.7-patched/libxmms/xmmsctrl.c ---- xmms-1.2.7/libxmms/xmmsctrl.c Sun Mar 3 21:24:27 2002 -+++ xmms-1.2.7-patched/libxmms/xmmsctrl.c Sat Jun 1 17:27:31 2002 -@@ -377,6 +377,11 @@ - remote_send_guint32(session, CMD_JUMP_TO_TIME, pos); - } - -+void xmms_remote_seek(gint session, gint off) -+{ -+ remote_send_guint32(session, CMD_SEEK, off); -+} -+ - void xmms_remote_get_volume(gint session, gint * vl, gint * vr) - { - ServerPktHeader pkt_hdr; -Only in xmms-1.2.7-patched/libxmms: xmmsctrl.c~ -diff -r -u xmms-1.2.7/libxmms/xmmsctrl.h xmms-1.2.7-patched/libxmms/xmmsctrl.h ---- xmms-1.2.7/libxmms/xmmsctrl.h Sun Mar 3 21:24:27 2002 -+++ xmms-1.2.7-patched/libxmms/xmmsctrl.h Sat Jun 1 17:27:31 2002 -@@ -42,6 +42,7 @@ - void xmms_remote_playlist_clear(gint session); - gint xmms_remote_get_output_time(gint session); - void xmms_remote_jump_to_time(gint session, gint pos); -+void xmms_remote_seek(gint session, gint off); - void xmms_remote_get_volume(gint session, gint * vl, gint * vr); - gint xmms_remote_get_main_volume(gint session); - gint xmms_remote_get_balance(gint session); -Only in xmms-1.2.7-patched/libxmms: xmmsctrl.h~ -diff -r -u xmms-1.2.7/xmms/controlsocket.c xmms-1.2.7-patched/xmms/controlsocket.c ---- xmms-1.2.7/xmms/controlsocket.c Sun Mar 3 21:24:33 2002 -+++ xmms-1.2.7-patched/xmms/controlsocket.c Sat Jun 1 17:28:51 2002 -@@ -451,6 +451,10 @@ - num < playlist_get_current_length()) - input_seek(num / 1000); - break; -+ case CMD_SEEK: -+ num = *((guint32 *) data); -+ song_seek(num); -+ break; - case CMD_SET_VOLUME: - v[0] = ((guint32 *) data)[0]; - v[1] = ((guint32 *) data)[1]; -diff -r -u xmms-1.2.7/xmms/controlsocket.h xmms-1.2.7-patched/xmms/controlsocket.h ---- xmms-1.2.7/xmms/controlsocket.h Sun Mar 3 21:24:33 2002 -+++ xmms-1.2.7-patched/xmms/controlsocket.h Sat Jun 1 17:27:31 2002 -@@ -33,7 +33,7 @@ - CMD_GET_VERSION, CMD_PLAYLIST_ADD, CMD_PLAY, CMD_PAUSE, CMD_STOP, - CMD_IS_PLAYING, CMD_IS_PAUSED, CMD_GET_PLAYLIST_POS, - CMD_SET_PLAYLIST_POS, CMD_GET_PLAYLIST_LENGTH, CMD_PLAYLIST_CLEAR, -- CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_GET_VOLUME, -+ CMD_GET_OUTPUT_TIME, CMD_JUMP_TO_TIME, CMD_SEEK, CMD_GET_VOLUME, - CMD_SET_VOLUME, CMD_GET_SKIN, CMD_SET_SKIN, CMD_GET_PLAYLIST_FILE, - CMD_GET_PLAYLIST_TITLE, CMD_GET_PLAYLIST_TIME, CMD_GET_INFO, - CMD_GET_EQ_DATA, CMD_SET_EQ_DATA, CMD_PL_WIN_TOGGLE, -diff -r -u xmms-1.2.7/xmms/input.c xmms-1.2.7-patched/xmms/input.c ---- xmms-1.2.7/xmms/input.c Wed Jul 11 14:19:23 2001 -+++ xmms-1.2.7-patched/xmms/input.c Sat Jun 1 17:27:31 2002 -@@ -295,6 +295,7 @@ - } - } - ip_data->playing = FALSE; -+ set_song_position(0, 0, 0); - } - - void input_pause(void) -diff -r -u xmms-1.2.7/xmms/main.c xmms-1.2.7-patched/xmms/main.c ---- xmms-1.2.7/xmms/main.c Wed Feb 27 15:30:28 2002 -+++ xmms-1.2.7-patched/xmms/main.c Sat Jun 1 17:28:05 2002 -@@ -681,6 +681,55 @@ - g_free(filename); - } - -+/*\ -+|*| Separate song position stuff, for songs without a time length, -+|*| but that want to be able to seek anyway. -+|*| -+|*| Have the input plugin's get_time() function call -+|*| set_song_position(int pos, int first, int last) -+|*| to set the slider. If the slider is dragged, -+|*| the plugin's seek() is called with the position. -+|*| (If last <= first the feature is turned off) -+\*/ -+ -+static int song_pos_cur, song_pos_first, song_pos_num = 0; -+ -+void set_song_position(int pos, int first, int last) -+{ -+ last -= first; -+ song_pos_cur = pos; -+ song_pos_first = first; -+ song_pos_num = last; -+ if (last <= 0) return; -+ pos -= first; -+ if (pos > last) pos = last; -+ if (cfg.player_shaded) -+ show_widget(mainwin_sposition); -+ show_widget(mainwin_position); -+ hslider_set_position(mainwin_position, (pos * 219) / last); -+ hslider_set_position(mainwin_sposition, ((pos * 12) / last) + 1); -+} -+ -+void song_seek(gint off) -+{ -+ if (!get_input_playing()) return; -+ if (song_pos_num > 0) { -+ gint newpos = 0; -+ if (off < 0) newpos = song_pos_cur - 1; -+ else if (off > 0) newpos = song_pos_cur + 1; -+ if (newpos < song_pos_first) newpos = song_pos_first; -+ if (newpos > song_pos_first + song_pos_num) -+ newpos = song_pos_first + song_pos_num; -+ input_seek(newpos); -+ } else { -+ gint newpos = (input_get_time() / 1000) + (off / 1000); -+ gint pcl = playlist_get_current_length() / 1000; -+ if (newpos >= pcl) newpos = pcl - 1; -+ if (newpos < 0) newpos = 0; -+ input_seek(newpos); -+ } -+} -+ - gchar *xmms_get_gentitle_format(void) - { - return cfg.gentitle_format; -@@ -760,7 +809,9 @@ - show_widget(mainwin_stime_min); - show_widget(mainwin_stime_sec); - -- if (get_input_playing() && playlist_get_current_length() != -1) -+ if (get_input_playing() && -+ ((playlist_get_current_length() != -1) || -+ (song_pos_num > 0))) - show_widget(mainwin_sposition); - - mainwin_shade->pb_ny = mainwin_shade->pb_py = 27; -@@ -1056,7 +1107,7 @@ - show_widget(mainwin_sec_num); - if (!get_input_paused()) - playstatus_set_status(mainwin_playstatus, STATUS_PLAY); -- if (playlist_get_current_length() != -1) -+ if ((playlist_get_current_length() != -1) || (song_pos_num > 0)) - { - if (cfg.player_shaded) - show_widget(mainwin_sposition); -@@ -1352,13 +1403,19 @@ - break; - case GDK_Left: - case GDK_KP_Left: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() - 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(-5000); - break; - case GDK_Right: - case GDK_KP_Right: -+/* - if(playlist_get_current_length() != -1) - input_seek(CLAMP(input_get_time() + 5000, 0, playlist_get_current_length()) / 1000); -+*/ -+ song_seek(+5000); - break; - default: - break; -@@ -1988,6 +2045,16 @@ - - pos--; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 6) / 12) + song_pos_first; -+ tmp = g_strdup_printf("%d", time); -+ textbox_set_text(mainwin_stime_min, tmp); -+ g_free(tmp); -+ tmp = g_strdup_printf("%d", song_pos_first + song_pos_num); -+ textbox_set_text(mainwin_stime_sec, tmp); -+ g_free(tmp); -+ return; -+ } - time = ((playlist_get_current_length() / 1000) * pos) / 12; - if (cfg.timer_mode == TIMER_REMAINING) - { -@@ -2009,6 +2076,10 @@ - - void mainwin_spos_release_cb(gint pos) - { -+ if (song_pos_num > 0) { -+ input_seek(((song_pos_num * (pos - 1) + 6) / 12) + song_pos_first); -+ return; -+ } - input_seek(((playlist_get_current_length() / 1000) * (pos - 1)) / 12); - } - -@@ -2017,6 +2088,14 @@ - gint length, time; - gchar *buf; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ buf = g_strdup_printf("JUMP TO: %d/%d", time, -+ song_pos_num + song_pos_first); -+ mainwin_lock_info_text(buf); -+ g_free(buf); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - buf = g_strdup_printf(_("SEEK TO: %d:%-2.2d/%d:%-2.2d (%d%%)"), time / 60, time % 60, length / 60, length % 60, (length != 0) ? (time * 100) / length : 0); -@@ -2028,6 +2107,12 @@ - { - int length, time; - -+ if (song_pos_num > 0) { -+ time = ((song_pos_num * pos + 110) / 219) + song_pos_first; -+ input_seek(time); -+ mainwin_release_info_text(); -+ return; -+ } - length = playlist_get_current_length() / 1000; - time = (length * pos) / 219; - input_seek(time); -@@ -2423,12 +2508,10 @@ - case MAINWIN_GENERAL_STOPFADE: - break; - case MAINWIN_GENERAL_BACK5SEC: -- if (get_input_playing() && playlist_get_current_length() != -1) -- input_seek((((input_get_time() / 1000) - 5 >= 0) ? (input_get_time() / 1000) - 5 : 0)); -+ song_seek(-5000); - break; - case MAINWIN_GENERAL_FWD5SEC: -- if (get_input_playing() && playlist_get_current_length() != -1) -- input_seek(((((input_get_time() / 1000) + 5) < (playlist_get_current_length() / 1000)) ? ((input_get_time() / 1000) + 5) : ((playlist_get_current_length() / 1000) - 1))); -+ song_seek(+5000); - break; - case MAINWIN_GENERAL_START: - playlist_set_position(0); -@@ -3032,7 +3115,7 @@ - hslider_set_position(mainwin_sposition, ((time * 12) / length) + 1); - } - } -- else -+ else if (song_pos_num <= 0) - { - hslider_set_position(mainwin_position, 0); - hslider_set_position(mainwin_sposition, 1); -diff -r -u xmms-1.2.7/xmms/main.h xmms-1.2.7-patched/xmms/main.h ---- xmms-1.2.7/xmms/main.h Mon Jan 21 15:22:38 2002 -+++ xmms-1.2.7-patched/xmms/main.h Sat Jun 1 17:27:31 2002 -@@ -87,6 +87,7 @@ - void mainwin_play_pushed(void); - void mainwin_stop_pushed(void); - void mainwin_eject_pushed(void); -+void song_seek(gint off); - - void mainwin_set_back_pixmap(void); - -diff -r -u xmms-1.2.7/xmms/plugin.h xmms-1.2.7-patched/xmms/plugin.h ---- xmms-1.2.7/xmms/plugin.h Fri Jul 6 21:15:34 2001 -+++ xmms-1.2.7-patched/xmms/plugin.h Sat Jun 1 17:27:31 2002 -@@ -154,4 +154,6 @@ - void (*render_freq)(gint16 freq_data[2][256]); /* Render the freq data, don't do anything time consuming in here */ - } VisPlugin; - -+void set_song_position(int pos, int first, int last); -+ - #endif