Patch #1352575 - Shorten codec from the ffmpeg project. Rockbox implementation by...
[Rockbox.git] / apps / wps.c
blob31fcd2cb6d5075d098ff08becba4de47612e3090
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Jerome Kuptz
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include <stdio.h>
20 #include <string.h>
21 #include <stdlib.h>
23 #include "system.h"
24 #include "file.h"
25 #include "lcd.h"
26 #include "font.h"
27 #include "backlight.h"
28 #include "button.h"
29 #include "kernel.h"
30 #include "tree.h"
31 #include "debug.h"
32 #include "sprintf.h"
33 #include "settings.h"
34 #include "wps.h"
35 #include "wps-display.h"
36 #include "audio.h"
37 #include "mp3_playback.h"
38 #include "usb.h"
39 #include "status.h"
40 #include "main_menu.h"
41 #include "ata.h"
42 #include "screens.h"
43 #include "playlist.h"
44 #ifdef HAVE_LCD_BITMAP
45 #include "icons.h"
46 #include "peakmeter.h"
47 #endif
48 #include "action.h"
49 #include "lang.h"
50 #include "bookmark.h"
51 #include "misc.h"
52 #include "sound.h"
53 #include "onplay.h"
54 #include "abrepeat.h"
55 #include "playback.h"
57 #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
58 /* 3% of 30min file == 54s step size */
59 #define MIN_FF_REWIND_STEP 500
61 bool keys_locked = false;
62 static bool ff_rewind = false;
63 static bool paused = false;
64 static struct mp3entry* id3 = NULL;
65 static struct mp3entry* nid3 = NULL;
66 static char current_track_path[MAX_PATH+1];
68 /* set volume
69 return true if screen restore is needed
70 return false otherwise
72 static bool setvol(void)
74 if (global_settings.volume < sound_min(SOUND_VOLUME))
75 global_settings.volume = sound_min(SOUND_VOLUME);
76 if (global_settings.volume > sound_max(SOUND_VOLUME))
77 global_settings.volume = sound_max(SOUND_VOLUME);
78 sound_set_volume(global_settings.volume);
79 status_draw(false);
80 wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
81 settings_save();
82 #ifdef HAVE_LCD_CHARCELLS
83 splash(0, false, "Vol: %d %% ",
84 sound_val2phys(SOUND_VOLUME, global_settings.volume));
85 return true;
86 #endif
87 return false;
90 static bool ffwd_rew(int button)
92 static const int ff_rew_steps[] = {
93 1000, 2000, 3000, 4000,
94 5000, 6000, 8000, 10000,
95 15000, 20000, 25000, 30000,
96 45000, 60000
99 unsigned int step = 0; /* current ff/rewind step */
100 unsigned int max_step = 0; /* maximum ff/rewind step */
101 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */
102 int direction = -1; /* forward=1 or backward=-1 */
103 long accel_tick = 0; /* next time at which to bump the step size */
104 bool exit = false;
105 bool usb = false;
107 while (!exit) {
108 switch ( button ) {
109 case WPS_FFWD:
110 #ifdef WPS_RC_FFWD
111 case WPS_RC_FFWD:
112 #endif
113 direction = 1;
114 case WPS_REW:
115 #ifdef WPS_RC_REW
116 case WPS_RC_REW:
117 #endif
118 if (ff_rewind)
120 if (direction == 1)
122 /* fast forwarding, calc max step relative to end */
123 max_step =
124 (id3->length - (id3->elapsed + ff_rewind_count)) *
125 FF_REWIND_MAX_PERCENT / 100;
127 else
129 /* rewinding, calc max step relative to start */
130 max_step = (id3->elapsed + ff_rewind_count) *
131 FF_REWIND_MAX_PERCENT / 100;
134 max_step = MAX(max_step, MIN_FF_REWIND_STEP);
136 if (step > max_step)
137 step = max_step;
139 ff_rewind_count += step * direction;
141 if (global_settings.ff_rewind_accel != 0 &&
142 current_tick >= accel_tick)
144 step *= 2;
145 accel_tick = current_tick +
146 global_settings.ff_rewind_accel*HZ;
149 else
151 if ( (audio_status() & AUDIO_STATUS_PLAY) &&
152 id3 && id3->length )
154 if (!paused)
155 audio_pause();
156 #if CONFIG_KEYPAD == PLAYER_PAD
157 lcd_stop_scroll();
158 #endif
159 if (direction > 0)
160 status_set_ffmode(STATUS_FASTFORWARD);
161 else
162 status_set_ffmode(STATUS_FASTBACKWARD);
164 ff_rewind = true;
166 step = ff_rew_steps[global_settings.ff_rewind_min_step];
168 accel_tick = current_tick +
169 global_settings.ff_rewind_accel*HZ;
171 else
172 break;
175 if (direction > 0) {
176 if ((id3->elapsed + ff_rewind_count) > id3->length)
177 ff_rewind_count = id3->length - id3->elapsed;
179 else {
180 if ((int)(id3->elapsed + ff_rewind_count) < 0)
181 ff_rewind_count = -id3->elapsed;
184 if(wps_time_countup == false)
185 wps_refresh(id3, nid3, -ff_rewind_count,
186 WPS_REFRESH_PLAYER_PROGRESS |
187 WPS_REFRESH_DYNAMIC);
188 else
189 wps_refresh(id3, nid3, ff_rewind_count,
190 WPS_REFRESH_PLAYER_PROGRESS |
191 WPS_REFRESH_DYNAMIC);
193 break;
195 case WPS_PREV:
196 case WPS_NEXT:
197 #ifdef WPS_RC_PREV
198 case WPS_RC_PREV:
199 case WPS_RC_NEXT:
200 #endif
201 audio_ff_rewind(id3->elapsed+ff_rewind_count);
202 ff_rewind_count = 0;
203 ff_rewind = false;
204 status_set_ffmode(0);
205 if (!paused)
206 audio_resume();
207 #ifdef HAVE_LCD_CHARCELLS
208 wps_display(id3, nid3);
209 #endif
210 exit = true;
211 break;
213 default:
214 if(default_event_handler(button) == SYS_USB_CONNECTED) {
215 status_set_ffmode(0);
216 usb = true;
217 exit = true;
219 break;
221 if (!exit)
222 button = button_get(true);
225 /* let audio thread update id3->elapsed before calling wps_refresh */
226 yield();
227 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
228 return usb;
231 static bool update(void)
233 bool track_changed = audio_has_changed_track();
234 bool retcode = false;
236 nid3 = audio_next_track();
237 if (track_changed)
239 lcd_stop_scroll();
240 id3 = audio_current_track();
241 if (wps_display(id3, nid3))
242 retcode = true;
243 else
244 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
246 if (id3)
247 memcpy(current_track_path, id3->path, sizeof(current_track_path));
250 if (id3)
251 wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
253 status_draw(false);
255 return retcode;
258 static void fade(bool fade_in)
260 unsigned fp_global_vol = global_settings.volume << 8;
261 unsigned fp_step = fp_global_vol / 30;
263 if (fade_in) {
264 /* fade in */
265 unsigned fp_volume = 0;
267 /* zero out the sound */
268 sound_set_volume(0);
270 sleep(HZ/10); /* let audio thread run */
271 audio_resume();
273 while (fp_volume < fp_global_vol) {
274 fp_volume += fp_step;
275 sleep(1);
276 sound_set_volume(fp_volume >> 8);
278 sound_set_volume(global_settings.volume);
280 else {
281 /* fade out */
282 unsigned fp_volume = fp_global_vol;
284 while (fp_volume > fp_step) {
285 fp_volume -= fp_step;
286 sleep(1);
287 sound_set_volume(fp_volume >> 8);
289 audio_pause();
290 #ifndef SIMULATOR
291 /* let audio thread run and wait for the mas to run out of data */
292 while (!mp3_pause_done())
293 #endif
294 sleep(HZ/10);
296 /* reset volume to what it was before the fade */
297 sound_set_volume(global_settings.volume);
302 #ifdef WPS_KEYLOCK
303 static void display_keylock_text(bool locked)
305 char* s;
306 lcd_stop_scroll();
307 #ifdef HAVE_LCD_CHARCELLS
308 if(locked)
309 s = str(LANG_KEYLOCK_ON_PLAYER);
310 else
311 s = str(LANG_KEYLOCK_OFF_PLAYER);
312 #else
313 if(locked)
314 s = str(LANG_KEYLOCK_ON_RECORDER);
315 else
316 s = str(LANG_KEYLOCK_OFF_RECORDER);
317 #endif
318 splash(HZ, true, s);
321 static void waitfor_nokey(void)
323 /* wait until all keys are released */
324 while (button_get(false) != BUTTON_NONE)
325 yield();
327 #endif
329 /* demonstrates showing different formats from playtune */
330 long wps_show(void)
332 long button = 0, lastbutton = 0;
333 bool ignore_keyup = true;
334 bool restore = false;
335 long restoretimer = 0; /* timer to delay screen redraw temporarily */
336 bool exit = false;
337 bool update_track = false;
338 unsigned long right_lastclick = 0;
339 unsigned long left_lastclick = 0;
341 id3 = nid3 = NULL;
342 current_track_path[0] = '\0';
344 #ifdef HAVE_LCD_CHARCELLS
345 status_set_audio(true);
346 status_set_param(false);
347 #else
348 if(global_settings.statusbar)
349 lcd_setmargins(0, STATUSBAR_HEIGHT);
350 else
351 lcd_setmargins(0, 0);
352 #endif
354 #ifdef AB_REPEAT_ENABLE
355 ab_repeat_init();
356 ab_reset_markers();
357 #endif
359 ff_rewind = false;
361 if(audio_status() & AUDIO_STATUS_PLAY)
363 id3 = audio_current_track();
364 nid3 = audio_next_track();
365 if (id3) {
366 if (wps_display(id3, nid3))
367 return 0;
368 wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL);
370 memcpy(current_track_path, id3->path, sizeof(current_track_path));
373 restore = true;
376 while ( 1 )
378 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
380 /* did someone else (i.e power thread) change audio pause mode? */
381 if (paused != audio_paused) {
382 paused = audio_paused;
384 /* if another thread paused audio, we are probably in car mode,
385 about to shut down. lets save the settings. */
386 if (paused) {
387 settings_save();
388 #if !defined(HAVE_RTC) && !defined(HAVE_SW_POWEROFF)
389 ata_flush();
390 #endif
394 #ifdef HAVE_LCD_BITMAP
395 /* when the peak meter is enabled we want to have a
396 few extra updates to make it look smooth. On the
397 other hand we don't want to waste energy if it
398 isn't displayed */
399 if (peak_meter_enabled) {
400 long next_refresh = current_tick;
401 long next_big_refresh = current_tick + HZ / 5;
402 button = BUTTON_NONE;
403 while (TIME_BEFORE(current_tick, next_big_refresh)) {
404 button = button_get(false);
405 if (button != BUTTON_NONE) {
406 break;
408 peak_meter_peek();
409 sleep(0); /* Sleep until end of current tick. */
411 if (TIME_AFTER(current_tick, next_refresh)) {
412 wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER);
413 next_refresh += HZ / PEAK_METER_FPS;
419 /* The peak meter is disabled
420 -> no additional screen updates needed */
421 else {
422 button = button_get_w_tmo(HZ/5);
424 #else
425 button = button_get_w_tmo(HZ/5);
426 #endif
428 /* discard first event if it's a button release */
429 if (button && ignore_keyup)
431 ignore_keyup = false;
432 /* Negative events are system events */
433 if (button >= 0 && button & BUTTON_REL )
434 continue;
437 #ifdef WPS_KEYLOCK
438 /* ignore non-remote buttons when keys are locked */
439 if (keys_locked &&
440 ! ((button < 0) ||
441 (button == BUTTON_NONE) ||
442 ((button & WPS_KEYLOCK) == WPS_KEYLOCK) ||
443 (button & BUTTON_REMOTE)
446 if (!(button & BUTTON_REL))
447 display_keylock_text(true);
448 restore = true;
449 button = BUTTON_NONE;
451 #endif
453 /* Exit if audio has stopped playing. This can happen if using the
454 sleep timer with the charger plugged or if starting a recording
455 from F1 */
456 if (!audio_status())
457 exit = true;
459 switch(button)
461 #ifdef WPS_CONTEXT
462 case WPS_CONTEXT:
463 onplay(id3->path, TREE_ATTR_MPA, CONTEXT_WPS);
464 restore = true;
465 break;
466 #endif
468 #ifdef WPS_RC_BROWSE
469 case WPS_RC_BROWSE:
470 #endif
471 case WPS_BROWSE:
472 #ifdef WPS_BROWSE_PRE
473 if ((lastbutton != WPS_BROWSE_PRE)
474 #ifdef WPS_RC_BROWSE_PRE
475 && (lastbutton != WPS_RC_BROWSE_PRE)
476 #endif
478 break;
479 #endif
480 #ifdef HAVE_LCD_CHARCELLS
481 status_set_record(false);
482 status_set_audio(false);
483 #endif
484 lcd_stop_scroll();
486 /* set dir browser to current playing song */
487 if (global_settings.browse_current &&
488 current_track_path[0] != '\0')
489 set_current_file(current_track_path);
491 return 0;
492 break;
494 /* play/pause */
495 case WPS_PAUSE:
496 #ifdef WPS_PAUSE_PRE
497 if (lastbutton != WPS_PAUSE_PRE)
498 break;
499 #endif
500 #ifdef WPS_RC_PAUSE
501 case WPS_RC_PAUSE:
502 #ifdef WPS_RC_PAUSE_PRE
503 if ((button == WPS_RC_PAUSE) && (lastbutton != WPS_RC_PAUSE_PRE))
504 break;
505 #endif
506 #endif
507 if ( paused )
509 paused = false;
510 if ( global_settings.fade_on_stop )
511 fade(1);
512 else
513 audio_resume();
515 else
517 paused = true;
518 if ( global_settings.fade_on_stop )
519 fade(0);
520 else
521 audio_pause();
522 settings_save();
523 #if !defined(HAVE_RTC) && !defined(HAVE_SW_POWEROFF)
524 ata_flush(); /* make sure resume info is saved */
525 #endif
527 break;
529 /* volume up */
530 case WPS_INCVOL:
531 case WPS_INCVOL | BUTTON_REPEAT:
532 #ifdef WPS_RC_INCVOL
533 case WPS_RC_INCVOL:
534 case WPS_RC_INCVOL | BUTTON_REPEAT:
535 #endif
536 global_settings.volume++;
537 if (setvol()) {
538 restore = true;
539 restoretimer = current_tick + HZ;
541 break;
543 /* volume down */
544 case WPS_DECVOL:
545 case WPS_DECVOL | BUTTON_REPEAT:
546 #ifdef WPS_RC_DECVOL
547 case WPS_RC_DECVOL:
548 case WPS_RC_DECVOL | BUTTON_REPEAT:
549 #endif
550 global_settings.volume--;
551 if (setvol()) {
552 restore = true;
553 restoretimer = current_tick + HZ;
555 break;
557 /* fast forward / rewind */
558 #ifdef WPS_RC_FFWD
559 case WPS_RC_FFWD:
560 #endif
561 case WPS_FFWD:
562 #ifdef WPS_NEXT_DIR
563 if (current_tick - right_lastclick < HZ)
565 audio_next_dir();
566 right_lastclick = 0;
567 break;
569 #endif
570 #ifdef WPS_RC_REW
571 case WPS_RC_REW:
572 #endif
573 case WPS_REW:
574 #ifdef WPS_PREV_DIR
575 if (current_tick - left_lastclick < HZ)
577 audio_prev_dir();
578 left_lastclick = 0;
579 break;
581 #endif
582 ffwd_rew(button);
583 break;
585 /* prev / restart */
586 case WPS_PREV:
587 #ifdef WPS_PREV_PRE
588 if (lastbutton != WPS_PREV_PRE)
589 break;
590 #endif
591 #ifdef WPS_RC_PREV
592 case WPS_RC_PREV:
593 #ifdef WPS_RC_PREV_PRE
594 if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE))
595 break;
596 #endif
597 #endif
598 left_lastclick = current_tick;
600 #ifdef AB_REPEAT_ENABLE
601 /* if we're in A/B repeat mode and the current position
602 is past the A marker, jump back to the A marker... */
603 if ( ab_repeat_mode_enabled() && ab_after_A_marker(id3->elapsed) )
605 ab_jump_to_A_marker();
606 update_track = true;
607 break;
609 /* ...otherwise, do it normally */
610 #endif
612 if (!id3 || (id3->elapsed < 3*1000)) {
613 audio_prev();
615 else {
616 if (!paused)
617 audio_pause();
619 audio_ff_rewind(0);
621 if (!paused)
622 audio_resume();
624 break;
626 #ifdef WPS_NEXT_DIR
627 #ifdef WPS_RC_NEXT_DIR
628 case WPS_RC_NEXT_DIR:
629 #endif
630 case WPS_NEXT_DIR:
631 audio_next_dir();
632 break;
633 #endif
634 #ifdef WPS_PREV_DIR
635 #ifdef WPS_RC_PREV_DIR
636 case WPS_RC_PREV_DIR:
637 #endif
638 case WPS_PREV_DIR:
639 audio_prev_dir();
640 break;
641 #endif
643 /* next */
644 case WPS_NEXT:
645 #ifdef WPS_NEXT_PRE
646 if (lastbutton != WPS_NEXT_PRE)
647 break;
648 #endif
649 #ifdef WPS_RC_NEXT
650 case WPS_RC_NEXT:
651 #ifdef WPS_RC_NEXT_PRE
652 if ((button == WPS_RC_NEXT) && (lastbutton != WPS_RC_NEXT_PRE))
653 break;
654 #endif
655 #endif
656 right_lastclick = current_tick;
658 #ifdef AB_REPEAT_ENABLE
659 /* if we're in A/B repeat mode and the current position is
660 before the A marker, jump to the A marker... */
661 if ( ab_repeat_mode_enabled() && ab_before_A_marker(id3->elapsed) )
663 ab_jump_to_A_marker();
664 update_track = true;
665 break;
667 /* ...otherwise, do it normally */
668 #endif
670 audio_next();
671 break;
673 #ifdef WPS_MENU
674 /* menu key functions */
675 case WPS_MENU:
676 #ifdef WPS_MENU_PRE
677 if (lastbutton != WPS_MENU_PRE)
678 break;
679 #endif
680 #ifdef WPS_RC_MENU
681 case WPS_RC_MENU:
682 #ifdef WPS_RC_MENU_PRE
683 if ((button == WPS_RC_MENU) && (lastbutton != WPS_RC_MENU_PRE))
684 break;
685 #endif
686 #endif
687 lcd_stop_scroll();
689 if (main_menu())
690 return true;
691 #ifdef HAVE_LCD_BITMAP
692 if (global_settings.statusbar)
693 lcd_setmargins(0, STATUSBAR_HEIGHT);
694 else
695 lcd_setmargins(0, 0);
696 #endif
697 restore = true;
698 break;
699 #endif /* WPS_MENU */
701 #ifdef WPS_KEYLOCK
702 /* key lock */
703 case WPS_KEYLOCK:
704 case WPS_KEYLOCK | BUTTON_REPEAT:
705 keys_locked = !keys_locked;
706 display_keylock_text(keys_locked);
707 restore = true;
708 waitfor_nokey();
709 break;
710 #endif
712 #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD)
713 /* play settings */
714 case WPS_QUICK:
715 if (quick_screen(CONTEXT_WPS, WPS_QUICK))
716 return SYS_USB_CONNECTED;
717 restore = true;
718 lastbutton = 0;
719 break;
721 /* screen settings */
722 #ifdef BUTTON_F3
723 case BUTTON_F3:
724 if (quick_screen(CONTEXT_WPS, BUTTON_F3))
725 return SYS_USB_CONNECTED;
726 restore = true;
727 break;
728 #endif
730 /* pitch screen */
731 #if CONFIG_KEYPAD == RECORDER_PAD
732 case BUTTON_ON | BUTTON_UP:
733 case BUTTON_ON | BUTTON_DOWN:
734 if (2 == pitch_screen())
735 return SYS_USB_CONNECTED;
736 restore = true;
737 break;
738 #endif
739 #endif
741 #ifdef AB_REPEAT_ENABLE
743 #ifdef WPS_AB_SET_A_MARKER
744 /* set A marker for A-B repeat */
745 case WPS_AB_SET_A_MARKER:
746 if (ab_repeat_mode_enabled())
747 ab_set_A_marker(id3->elapsed);
748 break;
749 #endif
751 #ifdef WPS_AB_SET_B_MARKER
752 /* set B marker for A-B repeat and jump to A */
753 case WPS_AB_SET_B_MARKER:
754 if (ab_repeat_mode_enabled())
756 ab_set_B_marker(id3->elapsed);
757 ab_jump_to_A_marker();
758 update_track = true;
760 break;
761 #endif
763 #ifdef WPS_AB_RESET_AB_MARKERS
764 /* reset A&B markers */
765 case WPS_AB_RESET_AB_MARKERS:
766 if (ab_repeat_mode_enabled())
768 ab_reset_markers();
769 update_track = true;
771 break;
772 #endif
774 #endif /* AB_REPEAT_ENABLE */
776 /* stop and exit wps */
777 #ifdef WPS_EXIT
778 case WPS_EXIT:
779 # ifdef WPS_EXIT_PRE
780 if (lastbutton != WPS_EXIT_PRE)
781 break;
782 # endif
783 exit = true;
785 # ifdef WPS_RC_EXIT
786 case WPS_RC_EXIT:
787 # ifdef WPS_RC_EXIT_PRE
788 if (lastbutton != WPS_RC_EXIT_PRE)
789 break;
790 # endif
791 exit = true;
792 # endif
793 break;
794 #endif
796 #ifdef WPS_ID3
797 case WPS_ID3:
798 browse_id3();
799 restore = true;
800 break;
801 #endif
803 case BUTTON_NONE: /* Timeout */
804 update_track = true;
805 break;
807 default:
808 if(default_event_handler(button) == SYS_USB_CONNECTED)
809 return SYS_USB_CONNECTED;
810 update_track = true;
811 break;
814 if (update_track)
816 if (update())
818 /* set dir browser to current playing song */
819 if (global_settings.browse_current &&
820 current_track_path[0] != '\0')
821 set_current_file(current_track_path);
823 return 0;
825 update_track = false;
828 if (exit) {
829 #ifdef HAVE_LCD_CHARCELLS
830 status_set_record(false);
831 status_set_audio(false);
832 #endif
833 if (global_settings.fade_on_stop)
834 fade(0);
836 lcd_stop_scroll();
837 bookmark_autobookmark();
838 audio_stop();
839 #ifdef AB_REPEAT_ENABLE
840 ab_reset_markers();
841 #endif
843 /* Keys can be locked when exiting, so either unlock here
844 or implement key locking in tree.c too */
845 keys_locked=false;
847 /* set dir browser to current playing song */
848 if (global_settings.browse_current &&
849 current_track_path[0] != '\0')
850 set_current_file(current_track_path);
852 return 0;
855 if ( button )
856 ata_spin();
858 if (restore &&
859 ((restoretimer == 0) ||
860 (restoretimer < current_tick)))
862 restore = false;
863 restoretimer = 0;
864 if (wps_display(id3, nid3))
866 /* set dir browser to current playing song */
867 if (global_settings.browse_current &&
868 current_track_path[0] != '\0')
869 set_current_file(current_track_path);
871 return 0;
874 if (id3)
875 wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
877 if (button != BUTTON_NONE)
878 lastbutton = button;
880 return 0; /* unreachable - just to reduce compiler warnings */