summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c22
-rw-r--r--apps/settings.h1
2 files changed, 18 insertions, 5 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 771e21affc..76b0cc5088 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -69,13 +69,14 @@ offset abs
690x0c 0x20 <poweroff timer byte> 690x0c 0x20 <poweroff timer byte>
700x0d 0x21 <resume settings byte> 700x0d 0x21 <resume settings byte>
710x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden, 710x0e 0x22 <shuffle,mp3filter,sort_case,discharge,statusbar,show_hidden,
72 browse_current> 72 scroll bar>
730x0f 0x23 <scroll speed> 730x0f 0x23 <scroll speed>
740x10 0x24 <ff/rewind min step, acceleration rate> 740x10 0x24 <ff/rewind min step, acceleration rate>
750x11 0x25 <AVC, channel config> 750x11 0x25 <AVC, channel config>
760x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> 760x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume>
770x16 0x2a <(int) Byte offset into resume file> 770x16 0x2a <(int) Byte offset into resume file>
780x1a 0x2e <time until disk spindown> 780x1a 0x2e <time until disk spindown>
790x1b 0x2f <browse current, play selected>
79 80
80 <all unused space filled with 0xff> 81 <all unused space filled with 0xff>
81 82
@@ -268,8 +269,7 @@ int settings_save( void )
268 ((global_settings.discharge & 1) << 3) | 269 ((global_settings.discharge & 1) << 3) |
269 ((global_settings.statusbar & 1) << 4) | 270 ((global_settings.statusbar & 1) << 4) |
270 ((global_settings.show_hidden_files & 1) << 5) | 271 ((global_settings.show_hidden_files & 1) << 5) |
271 ((global_settings.scrollbar & 1) << 6) | 272 ((global_settings.scrollbar & 1) << 6));
272 ((global_settings.browse_current & 1) << 7));
273 273
274 config_block[0xf] = (unsigned char)(global_settings.scroll_speed << 3); 274 config_block[0xf] = (unsigned char)(global_settings.scroll_speed << 3);
275 275
@@ -278,10 +278,15 @@ int settings_save( void )
278 (global_settings.ff_rewind_accel & 15)); 278 (global_settings.ff_rewind_accel & 15));
279 config_block[0x11] = (unsigned char)(global_settings.avc || 279 config_block[0x11] = (unsigned char)(global_settings.avc ||
280 global_settings.channel_config << 2); 280 global_settings.channel_config << 2);
281 config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
282 281
283 memcpy(&config_block[0x12], &global_settings.resume_index, 4); 282 memcpy(&config_block[0x12], &global_settings.resume_index, 4);
284 memcpy(&config_block[0x16], &global_settings.resume_offset, 4); 283 memcpy(&config_block[0x16], &global_settings.resume_offset, 4);
284
285 config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
286 config_block[0x1b] = (unsigned char)
287 (((global_settings.browse_current & 1)) |
288 ((global_settings.play_selected & 1) << 1));
289
285 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4); 290 memcpy(&config_block[0xF8], &global_settings.resume_seed, 4);
286 291
287 memcpy(&config_block[0x24], &global_settings.total_uptime, 4); 292 memcpy(&config_block[0x24], &global_settings.total_uptime, 4);
@@ -359,7 +364,8 @@ void settings_load(void)
359 global_settings.statusbar = (config_block[0xe] >> 4) & 1; 364 global_settings.statusbar = (config_block[0xe] >> 4) & 1;
360 global_settings.show_hidden_files = (config_block[0xe] >> 5) & 1; 365 global_settings.show_hidden_files = (config_block[0xe] >> 5) & 1;
361 global_settings.scrollbar = (config_block[0xe] >> 6) & 1; 366 global_settings.scrollbar = (config_block[0xe] >> 6) & 1;
362 global_settings.browse_current = (config_block[0xe] >> 7) & 1; 367 /* Don't use the last bit, it must be unused to detect
368 an uninitialized entry */
363 } 369 }
364 370
365 c = config_block[0xf] >> 3; 371 c = config_block[0xf] >> 3;
@@ -386,6 +392,11 @@ void settings_load(void)
386 if (config_block[0x1a] != 0xFF) 392 if (config_block[0x1a] != 0xFF)
387 global_settings.disk_spindown = config_block[0x1a]; 393 global_settings.disk_spindown = config_block[0x1a];
388 394
395 if (config_block[0x1b] != 0xFF) {
396 global_settings.browse_current = (config_block[0x1b]) & 1;
397 global_settings.play_selected = (config_block[0x1b] >> 1) & 1;
398 }
399
389 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); 400 memcpy(&global_settings.resume_seed, &config_block[0xF8], 4);
390 401
391 if (config_block[0x24] != 0xFF) 402 if (config_block[0x24] != 0xFF)
@@ -595,6 +606,7 @@ void settings_reset(void) {
595 global_settings.resume_offset = -1; 606 global_settings.resume_offset = -1;
596 global_settings.disk_spindown = 5; 607 global_settings.disk_spindown = 5;
597 global_settings.browse_current = false; 608 global_settings.browse_current = false;
609 global_settings.play_selected = true;
598} 610}
599 611
600 612
diff --git a/apps/settings.h b/apps/settings.h
index 6ed0b167f4..d03a5f688e 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -81,6 +81,7 @@ struct user_settings
81 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ 81 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
82 int scroll_speed; /* long texts scrolling speed: 1-30 */ 82 int scroll_speed; /* long texts scrolling speed: 1-30 */
83 bool playlist_shuffle; 83 bool playlist_shuffle;
84 bool play_selected; /* Plays selected file even in shuffle mode */
84 int ff_rewind_min_step; /* FF/Rewind minimum step size */ 85 int ff_rewind_min_step; /* FF/Rewind minimum step size */
85 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ 86 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
86 int disk_spindown; /* time until disk spindown, in seconds (0=off) */ 87 int disk_spindown; /* time until disk spindown, in seconds (0=off) */