diff options
author | Eric Linenberg <elinenbe@umich.edu> | 2002-08-29 04:50:39 +0000 |
---|---|---|
committer | Eric Linenberg <elinenbe@umich.edu> | 2002-08-29 04:50:39 +0000 |
commit | de14e53c669adc033691da5c2f32825f3418f7d5 (patch) | |
tree | 78fbf5497f57b48a4cb4913c03ff7b744b8f4aaa /apps | |
parent | 65240761fbcee1274836b74295c10247ca3d8ceb (diff) | |
download | rockbox-de14e53c669adc033691da5c2f32825f3418f7d5.tar.gz rockbox-de14e53c669adc033691da5c2f32825f3418f7d5.zip |
update to the ff/rw options accelerate options
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2045 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 12 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_menu.c | 17 | ||||
-rw-r--r-- | apps/wps.c | 5 |
4 files changed, 11 insertions, 25 deletions
diff --git a/apps/settings.c b/apps/settings.c index bb64886efd..10ebcbb63e 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -65,12 +65,11 @@ offset abs | |||
65 | 0x0d 0x21 <resume settings byte> | 65 | 0x0d 0x21 <resume settings byte> |
66 | 0x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden> | 66 | 0x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden> |
67 | 0x0f 0x23 <scroll speed & WPS display byte> | 67 | 0x0f 0x23 <scroll speed & WPS display byte> |
68 | 0x10 0x24 <ff/rewind step size> | 68 | 0x10 0x24 <ff/rewind accleration rate> |
69 | 0x11 0x25 <AVC byte> | 69 | 0x11 0x25 <AVC byte> |
70 | 0x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> | 70 | 0x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> |
71 | 0x16 0x2a <(int) Byte offset into resume file> | 71 | 0x16 0x2a <(int) Byte offset into resume file> |
72 | 0x1a 0x2e <time until disk spindown> | 72 | 0x1a 0x2e <time until disk spindown> |
73 | 0x1b 0x2f <ff/rewind acceleration rate> | ||
74 | 73 | ||
75 | <all unused space filled with 0xff> | 74 | <all unused space filled with 0xff> |
76 | 75 | ||
@@ -268,10 +267,9 @@ int settings_save( void ) | |||
268 | ((global_settings.scroll_speed << 3) | | 267 | ((global_settings.scroll_speed << 3) | |
269 | (global_settings.wps_display & 7)); | 268 | (global_settings.wps_display & 7)); |
270 | 269 | ||
271 | config_block[0x10] = (unsigned char)global_settings.ff_rewind; | 270 | config_block[0x10] = (unsigned char)global_settings.ff_rewind_accel; |
272 | config_block[0x11] = (unsigned char)global_settings.avc; | 271 | config_block[0x11] = (unsigned char)global_settings.avc; |
273 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; | 272 | config_block[0x1a] = (unsigned char)global_settings.disk_spindown; |
274 | config_block[0x1b] = (unsigned char)global_settings.ff_rewind_accel; | ||
275 | 273 | ||
276 | memcpy(&config_block[0x12], &global_settings.resume_index, 4); | 274 | memcpy(&config_block[0x12], &global_settings.resume_index, 4); |
277 | memcpy(&config_block[0x16], &global_settings.resume_offset, 4); | 275 | memcpy(&config_block[0x16], &global_settings.resume_offset, 4); |
@@ -362,7 +360,7 @@ void settings_load(void) | |||
362 | global_settings.wps_display = c; | 360 | global_settings.wps_display = c; |
363 | 361 | ||
364 | if (config_block[0x10] != 0xFF) | 362 | if (config_block[0x10] != 0xFF) |
365 | global_settings.ff_rewind = config_block[0x10]; | 363 | global_settings.ff_rewind_accel = config_block[0x10]; |
366 | 364 | ||
367 | if (config_block[0x11] != 0xFF) | 365 | if (config_block[0x11] != 0xFF) |
368 | global_settings.avc = config_block[0x11]; | 366 | global_settings.avc = config_block[0x11]; |
@@ -376,9 +374,6 @@ void settings_load(void) | |||
376 | if (config_block[0x1a] != 0xFF) | 374 | if (config_block[0x1a] != 0xFF) |
377 | global_settings.disk_spindown = config_block[0x1a]; | 375 | global_settings.disk_spindown = config_block[0x1a]; |
378 | 376 | ||
379 | if (config_block[0x1b] != 0xFF) | ||
380 | global_settings.ff_rewind_accel = config_block[0x1b]; | ||
381 | |||
382 | memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); | 377 | memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); |
383 | 378 | ||
384 | if (config_block[0x24] != 0xFF) | 379 | if (config_block[0x24] != 0xFF) |
@@ -424,7 +419,6 @@ void settings_reset(void) { | |||
424 | global_settings.total_uptime = 0; | 419 | global_settings.total_uptime = 0; |
425 | global_settings.scroll_speed = 8; | 420 | global_settings.scroll_speed = 8; |
426 | global_settings.show_hidden_files = false; | 421 | global_settings.show_hidden_files = false; |
427 | global_settings.ff_rewind = DEFAULT_FF_REWIND_SETTING; | ||
428 | global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; | 422 | global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; |
429 | global_settings.resume_index = -1; | 423 | global_settings.resume_index = -1; |
430 | global_settings.resume_offset = -1; | 424 | global_settings.resume_offset = -1; |
diff --git a/apps/settings.h b/apps/settings.h index b67af46bd7..831a70a3bc 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -63,7 +63,6 @@ struct user_settings | |||
63 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ | 63 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ |
64 | int scroll_speed; /* long texts scrolling speed: 1-20 */ | 64 | int scroll_speed; /* long texts scrolling speed: 1-20 */ |
65 | bool playlist_shuffle; | 65 | bool playlist_shuffle; |
66 | int ff_rewind; /* FF/Rewind step size (in seconds) */ | ||
67 | int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ | 66 | int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ |
68 | int disk_spindown; /* time until disk spindown, in seconds (0=off) */ | 67 | int disk_spindown; /* time until disk spindown, in seconds (0=off) */ |
69 | 68 | ||
@@ -115,7 +114,6 @@ extern struct user_settings global_settings; | |||
115 | #define DEFAULT_POWEROFF_SETTING 0 | 114 | #define DEFAULT_POWEROFF_SETTING 0 |
116 | #define DEFAULT_BACKLIGHT_SETTING 5 | 115 | #define DEFAULT_BACKLIGHT_SETTING 5 |
117 | #define DEFAULT_WPS_DISPLAY 0 | 116 | #define DEFAULT_WPS_DISPLAY 0 |
118 | #define DEFAULT_FF_REWIND_SETTING 2 | ||
119 | #define DEFAULT_FF_REWIND_ACCEL_SETTING 3 | 117 | #define DEFAULT_FF_REWIND_ACCEL_SETTING 3 |
120 | 118 | ||
121 | #endif /* __SETTINGS_H__ */ | 119 | #endif /* __SETTINGS_H__ */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index ffc6f6aab9..1c073b10d5 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -165,13 +165,6 @@ static Menu timedate_set(void) | |||
165 | } | 165 | } |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | static Menu ff_rewind(void) | ||
169 | { | ||
170 | set_int("[FF/Rewind Step Size]", "s", &global_settings.ff_rewind, | ||
171 | NULL, 1, 1, 254 ); | ||
172 | return MENU_OK; | ||
173 | } | ||
174 | |||
175 | static Menu spindown(void) | 168 | static Menu spindown(void) |
176 | { | 169 | { |
177 | set_int("[Disk spindown]", "s", &global_settings.disk_spindown, | 170 | set_int("[Disk spindown]", "s", &global_settings.disk_spindown, |
@@ -183,9 +176,10 @@ static Menu ff_rewind_accel(void) | |||
183 | { | 176 | { |
184 | char* names[] = { "off ", "2x/1s ", "2x/2s ", "2x/3s ", | 177 | char* names[] = { "off ", "2x/1s ", "2x/2s ", "2x/3s ", |
185 | "2x/4s ", "2x/5s ", "2x/6s ", "2x/7s ", | 178 | "2x/4s ", "2x/5s ", "2x/6s ", "2x/7s ", |
186 | "2x/8s ", "2x/9s ", "2x/10s" }; | 179 | "2x/8s ", "2x/9s ", "2x/10s", "2x/11s", |
187 | set_option("[FF/Rewind Accel]", &global_settings.ff_rewind_accel, | 180 | "2x/12s", "2x/13s", "2x/14s", "2x/15s", }; |
188 | names, 11 ); | 181 | set_option("[FF/rewind accel]", &global_settings.ff_rewind_accel, |
182 | names, 16 ); | ||
189 | return MENU_OK; | 183 | return MENU_OK; |
190 | } | 184 | } |
191 | 185 | ||
@@ -209,8 +203,7 @@ Menu settings_menu(void) | |||
209 | { "Time/Date", timedate_set }, | 203 | { "Time/Date", timedate_set }, |
210 | #endif | 204 | #endif |
211 | { "Show hidden files", show_hidden_files }, | 205 | { "Show hidden files", show_hidden_files }, |
212 | { "FF/Rewind", ff_rewind }, | 206 | { "FF/rewind accel", ff_rewind_accel }, |
213 | { "FF/Rewind Accel", ff_rewind_accel }, | ||
214 | { "Resume", resume }, | 207 | { "Resume", resume }, |
215 | { "Disk spindown", spindown }, | 208 | { "Disk spindown", spindown }, |
216 | }; | 209 | }; |
diff --git a/apps/wps.c b/apps/wps.c index 55afd4da73..7e7597cf6f 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "ajf.h" | 44 | #include "ajf.h" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #define FF_REWIND_MIN_STEP 1000 /* minimum ff/rewind step is 1 second */ | ||
47 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ | 48 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ |
48 | /* 3% of 30min file == 54s step size */ | 49 | /* 3% of 30min file == 54s step size */ |
49 | 50 | ||
@@ -884,7 +885,7 @@ int wps_show(void) | |||
884 | ff_rewind = true; | 885 | ff_rewind = true; |
885 | ff_rewind_max_step = | 886 | ff_rewind_max_step = |
886 | id3->length * FF_REWIND_MAX_PERCENT / 100; | 887 | id3->length * FF_REWIND_MAX_PERCENT / 100; |
887 | ff_rewind_step = global_settings.ff_rewind*1000; | 888 | ff_rewind_step = FF_REWIND_MIN_STEP; |
888 | if (ff_rewind_step > ff_rewind_max_step) | 889 | if (ff_rewind_step > ff_rewind_max_step) |
889 | ff_rewind_step = ff_rewind_max_step; | 890 | ff_rewind_step = ff_rewind_max_step; |
890 | ff_rewind_count = -ff_rewind_step; | 891 | ff_rewind_count = -ff_rewind_step; |
@@ -933,7 +934,7 @@ int wps_show(void) | |||
933 | ff_rewind = true; | 934 | ff_rewind = true; |
934 | ff_rewind_max_step = | 935 | ff_rewind_max_step = |
935 | id3->length * FF_REWIND_MAX_PERCENT / 100; | 936 | id3->length * FF_REWIND_MAX_PERCENT / 100; |
936 | ff_rewind_step = global_settings.ff_rewind*1000; | 937 | ff_rewind_step = FF_REWIND_MIN_STEP; |
937 | if (ff_rewind_step > ff_rewind_max_step) | 938 | if (ff_rewind_step > ff_rewind_max_step) |
938 | ff_rewind_step = ff_rewind_max_step; | 939 | ff_rewind_step = ff_rewind_max_step; |
939 | ff_rewind_count = ff_rewind_step; | 940 | ff_rewind_count = ff_rewind_step; |