Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

implement smooth seeking acceleration for audio playback and mpegplayer

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17843 a1c6a512-1295-4272-9138-f99709370657

+78 -20
+3 -11
apps/gui/gwps-common.c
··· 196 196 unsigned int max_step = 0; /* maximum ff/rewind step */ 197 197 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */ 198 198 int direction = -1; /* forward=1 or backward=-1 */ 199 - long accel_tick = 0; /* next time at which to bump the step size */ 200 199 bool exit = false; 201 200 bool usb = false; 202 201 int i = 0; 202 + const long ff_rw_accel = (global_settings.ff_rewind_accel + 3); 203 203 204 204 if (button == ACTION_NONE) 205 205 { ··· 237 237 238 238 ff_rewind_count += step * direction; 239 239 240 - if (global_settings.ff_rewind_accel != 0 && 241 - current_tick >= accel_tick) 242 - { 243 - step *= 2; 244 - accel_tick = current_tick + 245 - global_settings.ff_rewind_accel*HZ; 246 - } 240 + /* smooth seeking by multiplying step by: 1 + (2 ^ -accel) */ 241 + step += step >> ff_rw_accel; 247 242 } 248 243 else 249 244 { ··· 268 263 wps_state.ff_rewind = true; 269 264 270 265 step = 1000 * global_settings.ff_rewind_min_step; 271 - 272 - accel_tick = current_tick + 273 - global_settings.ff_rewind_accel*HZ; 274 266 } 275 267 else 276 268 break;
+68
apps/lang/english.lang
··· 11750 11750 gigabeatf: "High" 11751 11751 </voice> 11752 11752 </phrase> 11753 + <phrase> 11754 + id: LANG_VERY_SLOW 11755 + desc: in settings_menu 11756 + user: 11757 + <source> 11758 + *: none 11759 + gigabeatf: "Very slow" 11760 + </source> 11761 + <dest> 11762 + *: none 11763 + gigabeatf: "Very slow" 11764 + </dest> 11765 + <voice> 11766 + *: none 11767 + gigabeatf: "Very slow" 11768 + </voice> 11769 + </phrase> 11770 + <phrase> 11771 + id: LANG_SLOW 11772 + desc: in settings_menu 11773 + user: 11774 + <source> 11775 + *: none 11776 + gigabeatf: "Slow" 11777 + </source> 11778 + <dest> 11779 + *: none 11780 + gigabeatf: "Slow" 11781 + </dest> 11782 + <voice> 11783 + *: none 11784 + gigabeatf: "Slow" 11785 + </voice> 11786 + </phrase> 11787 + <phrase> 11788 + id: LANG_VERY_FAST 11789 + desc: in settings_menu 11790 + user: 11791 + <source> 11792 + *: none 11793 + gigabeatf: "Very fast" 11794 + </source> 11795 + <dest> 11796 + *: none 11797 + gigabeatf: "Very fast" 11798 + </dest> 11799 + <voice> 11800 + *: none 11801 + gigabeatf: "Very fast" 11802 + </voice> 11803 + </phrase> 11804 + <phrase> 11805 + id: LANG_FAST 11806 + desc: in settings_menu 11807 + user: 11808 + <source> 11809 + *: none 11810 + gigabeatf: "Fast" 11811 + </source> 11812 + <dest> 11813 + *: none 11814 + gigabeatf: "Fast" 11815 + </dest> 11816 + <voice> 11817 + *: none 11818 + gigabeatf: "Fast" 11819 + </voice> 11820 + </phrase>
+3 -7
apps/plugins/mpegplayer/mpegplayer.c
··· 1109 1109 static uint32_t wvs_ff_rw(int btn, unsigned refresh) 1110 1110 { 1111 1111 unsigned int step = TS_SECOND*rb->global_settings->ff_rewind_min_step; 1112 - const long ff_rw_accel = rb->global_settings->ff_rewind_accel; 1113 - long accel_tick = *rb->current_tick + ff_rw_accel*HZ; 1112 + const long ff_rw_accel = (rb->global_settings->ff_rewind_accel + 3); 1114 1113 uint32_t start; 1115 1114 uint32_t time = stream_get_seek_time(&start); 1116 1115 const uint32_t duration = stream_get_duration(); ··· 1145 1144 1146 1145 while (1) 1147 1146 { 1148 - long tick = *rb->current_tick; 1149 1147 stream_keep_disk_active(); 1150 1148 1151 1149 switch (btn) ··· 1199 1197 1200 1198 ff_rw_count += step; 1201 1199 1202 - if (ff_rw_accel != 0 && TIME_AFTER(tick, accel_tick)) { 1203 - step *= 2; 1204 - accel_tick = tick + ff_rw_accel*HZ; 1205 - } 1200 + /* smooth seeking by multiplying step by: 1 + (2 ^ -accel) */ 1201 + step += step >> ff_rw_accel; 1206 1202 1207 1203 if (wvs.status == WVS_STATUS_FF) { 1208 1204 if (duration - time <= ff_rw_count)
+4 -2
apps/settings_list.c
··· 666 666 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, ff_rewind_min_step, 667 667 LANG_FFRW_STEP, 1, "scan min step", NULL, UNIT_SEC, 668 668 NULL, NULL, NULL, 14, 1,2,3,4,5,6,8,10,15,20,25,30,45,60), 669 - INT_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 3, "scan accel", UNIT_SEC, 670 - 16, 0, -1, scanaccel_formatter, getlang_unit_0_is_off, NULL), 669 + CHOICE_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 2, 670 + "seek accel", "very fast,fast,normal,slow,very slow", NULL, 5, 671 + ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL), 672 + ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)), 671 673 #if (CONFIG_CODEC == SWCODEC) && !defined(HAVE_FLASH_STORAGE) 672 674 STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip", 673 675 "5s,15s,30s,1min,2min,3min,5min,10min", NULL, 8,