A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1use async_graphql::*;
2use rockbox_sys as rb;
3use serde::{Deserialize, Serialize};
4
5use super::{
6 compressor_settings::CompressorSettings, eq_band_setting::EqBandSetting,
7 replaygain_settings::ReplaygainSettings,
8};
9
10#[derive(Default, Clone, Serialize, Deserialize)]
11pub struct UserSettings {
12 pub music_dir: String,
13 pub volume: i32,
14 pub balance: i32,
15 pub bass: i32,
16 pub treble: i32,
17 pub channel_config: i32,
18 pub stereo_width: i32,
19
20 pub bass_cutoff: i32,
21 pub treble_cutoff: i32,
22
23 pub crossfade: i32,
24 pub crossfade_fade_in_delay: i32,
25 pub crossfade_fade_out_delay: i32,
26 pub crossfade_fade_in_duration: i32,
27 pub crossfade_fade_out_duration: i32,
28 pub crossfade_fade_out_mixmode: i32,
29
30 // Replaygain
31 pub replaygain_settings: ReplaygainSettings,
32
33 // Crossfeed
34 pub crossfeed: i32,
35 pub crossfeed_direct_gain: u32,
36 pub crossfeed_cross_gain: u32,
37 pub crossfeed_hf_attenuation: u32,
38 pub crossfeed_hf_cutoff: u32,
39
40 // EQ
41 pub eq_enabled: bool,
42 pub eq_precut: u32,
43 pub eq_band_settings: Vec<EqBandSetting>,
44
45 // Misc. swcodec
46 pub beep: i32,
47 pub keyclick: i32,
48 pub keyclick_repeats: i32,
49 pub dithering_enabled: bool,
50 pub timestretch_enabled: bool,
51
52 // Misc options
53 pub list_accel_start_delay: i32,
54 pub list_accel_wait: i32,
55
56 pub touchpad_sensitivity: i32,
57 pub touchpad_deadzone: i32,
58
59 pub pause_rewind: i32,
60 pub unplug_mode: i32,
61 pub unplug_autoresume: bool,
62
63 pub timeformat: i32,
64 pub disk_spindown: i32,
65 pub buffer_margin: i32,
66
67 pub dirfilter: i32,
68 pub show_filename_ext: i32,
69 pub default_codepage: i32,
70 pub hold_lr_for_scroll_in_list: bool,
71 pub play_selected: bool,
72 pub single_mode: i32,
73 pub party_mode: bool,
74 pub cuesheet: bool,
75 pub car_adapter_mode: bool,
76 pub car_adapter_mode_delay: i32,
77 pub start_in_screen: i32,
78 pub ff_rewind_min_step: i32,
79 pub ff_rewind_accel: i32,
80
81 pub peak_meter_release: i32,
82 pub peak_meter_hold: i32,
83 pub peak_meter_clip_hold: i32,
84 pub peak_meter_dbfs: bool,
85 pub peak_meter_min: i32,
86 pub peak_meter_max: i32,
87
88 pub wps_file: String,
89 pub sbs_file: String,
90 pub lang_file: String,
91 pub playlist_catalog_dir: String,
92 pub skip_length: i32,
93 pub max_files_in_dir: i32,
94 pub max_files_in_playlist: i32,
95 pub volume_type: i32,
96 pub battery_display: i32,
97 pub show_icons: bool,
98 pub statusbar: i32,
99
100 pub scrollbar: i32,
101 pub scrollbar_width: i32,
102
103 pub list_line_padding: i32,
104 pub list_separator_height: i32,
105 pub list_separator_color: i32,
106
107 pub browse_current: bool,
108 pub scroll_paginated: bool,
109 pub list_wraparound: bool,
110 pub list_order: i32,
111 pub scroll_speed: i32,
112 pub bidir_limit: i32,
113 pub scroll_delay: i32,
114 pub scroll_step: i32,
115
116 pub autoloadbookmark: i32,
117 pub autocreatebookmark: i32,
118 pub autoupdatebookmark: bool,
119 pub usemrb: i32,
120
121 pub dircache: bool,
122 pub tagcache_ram: i32,
123 pub tagcache_autoupdate: bool,
124 pub autoresume_enable: bool,
125 pub autoresume_automatic: i32,
126 pub autoresume_paths: String,
127 pub runtimedb: bool,
128 pub tagcache_scan_paths: String,
129 pub tagcache_db_path: String,
130 pub backdrop_file: String,
131
132 pub bg_color: i32,
133 pub fg_color: i32,
134 pub lss_color: i32,
135 pub lse_color: i32,
136 pub lst_color: i32,
137 pub colors_file: String,
138
139 pub browser_default: i32,
140
141 pub repeat_mode: i32,
142 pub next_folder: i32,
143 pub constrain_next_folder: bool,
144 pub recursive_dir_insert: i32,
145 pub fade_on_stop: bool,
146 pub playlist_shuffle: bool,
147 pub warnon_erase_dynplaylist: bool,
148 pub keep_current_track_on_replace_playlist: bool,
149 pub show_shuffled_adding_options: bool,
150 pub show_queue_options: i32,
151 pub album_art: i32,
152 pub rewind_across_tracks: bool,
153
154 pub playlist_viewer_icons: bool,
155 pub playlist_viewer_indices: bool,
156 pub playlist_viewer_track_display: i32,
157
158 pub talk_menu: bool,
159 pub talk_dir: i32,
160 pub talk_dir_clip: bool,
161 pub talk_file: i32,
162 pub talk_file_clip: bool,
163 pub talk_filetype: bool,
164 pub talk_battery_level: bool,
165 pub talk_mixer_amp: i32,
166
167 pub sort_case: bool,
168 pub sort_dir: i32,
169 pub sort_file: i32,
170 pub interpret_numbers: i32,
171
172 pub poweroff: i32,
173 pub battery_capacity: i32,
174 pub battery_type: i32,
175 pub spdif_enable: bool,
176 pub usb_charging: i32,
177
178 pub contrast: i32,
179 pub invert: bool,
180 pub flip_display: bool,
181 pub cursor_style: i32,
182 pub screen_scroll_step: i32,
183 pub show_path_in_browser: i32,
184 pub offset_out_of_view: bool,
185 pub disable_mainmenu_scrolling: bool,
186 pub icon_file: String,
187 pub viewers_icon_file: String,
188 pub font_file: String,
189 pub glyphs_to_cache: i32,
190 pub kbd_file: String,
191 pub backlight_timeout: i32,
192 pub caption_backlight: bool,
193 pub bl_filter_first_keypress: bool,
194 pub backlight_timeout_plugged: i32,
195 pub bt_selective_softlock_actions: bool,
196 pub bt_selective_softlock_actions_mask: i32,
197 pub bl_selective_actions: bool,
198 pub bl_selective_actions_mask: i32,
199 pub backlight_on_button_hold: i32,
200 pub lcd_sleep_after_backlight_off: i32,
201 pub brightness: i32,
202
203 pub speaker_mode: i32,
204 pub prevent_skip: bool,
205
206 pub touch_mode: i32,
207
208 pub pitch_mode_semitone: bool,
209 pub pitch_mode_timestretch: bool,
210
211 pub usb_hid: bool,
212 pub usb_keypad_mode: i32,
213
214 pub usb_skip_first_drive: bool,
215
216 pub player_name: String,
217
218 pub compressor_settings: CompressorSettings,
219
220 pub sleeptimer_duration: i32,
221 pub sleeptimer_on_startup: bool,
222 pub keypress_restarts_sleeptimer: bool,
223
224 pub show_shutdown_message: bool,
225
226 pub hotkey_wps: i32,
227 pub hotkey_tree: i32,
228
229 pub resume_rewind: i32,
230
231 pub depth_3d: i32,
232
233 pub roll_off: i32,
234
235 pub power_mode: i32,
236
237 pub keyclick_hardware: bool,
238
239 pub start_directory: String,
240 pub root_menu_customized: bool,
241 pub shortcuts_replaces_qs: bool,
242
243 pub play_frequency: i32,
244 pub volume_limit: i32,
245
246 pub volume_adjust_mode: i32,
247 pub volume_adjust_norm_steps: i32,
248
249 pub surround_enabled: i32,
250 pub surround_balance: i32,
251 pub surround_fx1: i32,
252 pub surround_fx2: i32,
253 pub surround_method2: bool,
254 pub surround_mix: i32,
255
256 pub pbe: i32,
257 pub pbe_precut: i32,
258
259 pub afr_enabled: i32,
260
261 pub governor: i32,
262 pub stereosw_mode: i32,
263}
264
265#[Object]
266impl UserSettings {
267 async fn music_dir(&self) -> &str {
268 &self.music_dir
269 }
270
271 async fn volume(&self) -> i32 {
272 self.volume
273 }
274
275 async fn balance(&self) -> i32 {
276 self.balance
277 }
278
279 async fn bass(&self) -> i32 {
280 self.bass
281 }
282
283 async fn treble(&self) -> i32 {
284 self.treble
285 }
286
287 async fn channel_config(&self) -> i32 {
288 self.channel_config
289 }
290
291 async fn stereo_width(&self) -> i32 {
292 self.stereo_width
293 }
294
295 async fn bass_cutoff(&self) -> i32 {
296 self.bass_cutoff
297 }
298
299 async fn treble_cutoff(&self) -> i32 {
300 self.treble_cutoff
301 }
302
303 async fn crossfade(&self) -> i32 {
304 self.crossfade
305 }
306
307 async fn crossfade_fade_in_delay(&self) -> i32 {
308 self.crossfade_fade_in_delay
309 }
310
311 async fn crossfade_fade_out_delay(&self) -> i32 {
312 self.crossfade_fade_out_delay
313 }
314
315 async fn crossfade_fade_in_duration(&self) -> i32 {
316 self.crossfade_fade_in_duration
317 }
318
319 async fn crossfade_fade_out_duration(&self) -> i32 {
320 self.crossfade_fade_out_duration
321 }
322
323 async fn crossfade_fade_out_mixmode(&self) -> i32 {
324 self.crossfade_fade_out_mixmode
325 }
326
327 async fn replaygain_settings(&self) -> ReplaygainSettings {
328 self.replaygain_settings.clone()
329 }
330
331 async fn crossfeed(&self) -> i32 {
332 self.crossfeed
333 }
334
335 async fn crossfeed_direct_gain(&self) -> u32 {
336 self.crossfeed_direct_gain
337 }
338
339 async fn crossfeed_cross_gain(&self) -> u32 {
340 self.crossfeed_cross_gain
341 }
342
343 async fn crossfeed_hf_attenuation(&self) -> u32 {
344 self.crossfeed_hf_attenuation
345 }
346
347 async fn crossfeed_hf_cutoff(&self) -> u32 {
348 self.crossfeed_hf_cutoff
349 }
350
351 async fn eq_enabled(&self) -> bool {
352 self.eq_enabled
353 }
354
355 async fn eq_precut(&self) -> u32 {
356 self.eq_precut
357 }
358
359 async fn eq_band_settings(&self) -> Vec<EqBandSetting> {
360 self.eq_band_settings.clone()
361 }
362
363 async fn beep(&self) -> i32 {
364 self.beep
365 }
366
367 async fn keyclick(&self) -> i32 {
368 self.keyclick
369 }
370
371 async fn keyclick_repeats(&self) -> i32 {
372 self.keyclick_repeats
373 }
374
375 async fn dithering_enabled(&self) -> bool {
376 self.dithering_enabled
377 }
378
379 async fn timestretch_enabled(&self) -> bool {
380 self.timestretch_enabled
381 }
382
383 async fn list_accel_start_delay(&self) -> i32 {
384 self.list_accel_start_delay
385 }
386
387 async fn list_accel_wait(&self) -> i32 {
388 self.list_accel_wait
389 }
390
391 async fn touchpad_sensitivity(&self) -> i32 {
392 self.touchpad_sensitivity
393 }
394
395 async fn touchpad_deadzone(&self) -> i32 {
396 self.touchpad_deadzone
397 }
398
399 async fn pause_rewind(&self) -> i32 {
400 self.pause_rewind
401 }
402
403 async fn unplug_mode(&self) -> i32 {
404 self.unplug_mode
405 }
406
407 async fn unplug_autoresume(&self) -> bool {
408 self.unplug_autoresume
409 }
410
411 async fn timeformat(&self) -> i32 {
412 self.timeformat
413 }
414
415 async fn disk_spindown(&self) -> i32 {
416 self.disk_spindown
417 }
418
419 async fn buffer_margin(&self) -> i32 {
420 self.buffer_margin
421 }
422
423 async fn dirfilter(&self) -> i32 {
424 self.dirfilter
425 }
426
427 async fn show_filename_ext(&self) -> i32 {
428 self.show_filename_ext
429 }
430
431 async fn default_codepage(&self) -> i32 {
432 self.default_codepage
433 }
434
435 async fn hold_lr_for_scroll_in_list(&self) -> bool {
436 self.hold_lr_for_scroll_in_list
437 }
438
439 async fn play_selected(&self) -> bool {
440 self.play_selected
441 }
442
443 async fn single_mode(&self) -> i32 {
444 self.single_mode
445 }
446
447 async fn party_mode(&self) -> bool {
448 self.party_mode
449 }
450
451 async fn cuesheet(&self) -> bool {
452 self.cuesheet
453 }
454
455 async fn car_adapter_mode(&self) -> bool {
456 self.car_adapter_mode
457 }
458
459 async fn car_adapter_mode_delay(&self) -> i32 {
460 self.car_adapter_mode_delay
461 }
462
463 async fn start_in_screen(&self) -> i32 {
464 self.start_in_screen
465 }
466
467 async fn ff_rewind_min_step(&self) -> i32 {
468 self.ff_rewind_min_step
469 }
470
471 async fn ff_rewind_accel(&self) -> i32 {
472 self.ff_rewind_accel
473 }
474
475 async fn peak_meter_release(&self) -> i32 {
476 self.peak_meter_release
477 }
478
479 async fn peak_meter_hold(&self) -> i32 {
480 self.peak_meter_hold
481 }
482
483 async fn peak_meter_clip_hold(&self) -> i32 {
484 self.peak_meter_clip_hold
485 }
486
487 async fn peak_meter_dbfs(&self) -> bool {
488 self.peak_meter_dbfs
489 }
490
491 async fn peak_meter_min(&self) -> i32 {
492 self.peak_meter_min
493 }
494
495 async fn peak_meter_max(&self) -> i32 {
496 self.peak_meter_max
497 }
498
499 async fn wps_file(&self) -> &str {
500 &self.wps_file
501 }
502
503 async fn sbs_file(&self) -> &str {
504 &self.sbs_file
505 }
506
507 async fn lang_file(&self) -> &str {
508 &self.lang_file
509 }
510
511 async fn playlist_catalog_dir(&self) -> &str {
512 &self.playlist_catalog_dir
513 }
514
515 async fn skip_length(&self) -> i32 {
516 self.skip_length
517 }
518
519 async fn max_files_in_dir(&self) -> i32 {
520 self.max_files_in_dir
521 }
522
523 async fn max_files_in_playlist(&self) -> i32 {
524 self.max_files_in_playlist
525 }
526
527 async fn volume_type(&self) -> i32 {
528 self.volume_type
529 }
530
531 async fn battery_display(&self) -> i32 {
532 self.battery_display
533 }
534
535 async fn show_icons(&self) -> bool {
536 self.show_icons
537 }
538
539 async fn statusbar(&self) -> i32 {
540 self.statusbar
541 }
542
543 async fn scrollbar(&self) -> i32 {
544 self.scrollbar
545 }
546
547 async fn scrollbar_width(&self) -> i32 {
548 self.scrollbar_width
549 }
550
551 async fn list_line_padding(&self) -> i32 {
552 self.list_line_padding
553 }
554
555 async fn list_separator_height(&self) -> i32 {
556 self.list_separator_height
557 }
558
559 async fn list_separator_color(&self) -> i32 {
560 self.list_separator_color
561 }
562
563 async fn browse_current(&self) -> bool {
564 self.browse_current
565 }
566
567 async fn scroll_paginated(&self) -> bool {
568 self.scroll_paginated
569 }
570
571 async fn list_wraparound(&self) -> bool {
572 self.list_wraparound
573 }
574
575 async fn list_order(&self) -> i32 {
576 self.list_order
577 }
578
579 async fn scroll_speed(&self) -> i32 {
580 self.scroll_speed
581 }
582
583 async fn bidir_limit(&self) -> i32 {
584 self.bidir_limit
585 }
586
587 async fn scroll_delay(&self) -> i32 {
588 self.scroll_delay
589 }
590
591 async fn scroll_step(&self) -> i32 {
592 self.scroll_step
593 }
594
595 async fn autoloadbookmark(&self) -> i32 {
596 self.autoloadbookmark
597 }
598
599 async fn autocreatebookmark(&self) -> i32 {
600 self.autocreatebookmark
601 }
602
603 async fn autoupdatebookmark(&self) -> bool {
604 self.autoupdatebookmark
605 }
606
607 async fn usemrb(&self) -> i32 {
608 self.usemrb
609 }
610
611 async fn dircache(&self) -> bool {
612 self.dircache
613 }
614
615 async fn tagcache_ram(&self) -> i32 {
616 self.tagcache_ram
617 }
618
619 async fn tagcache_autoupdate(&self) -> bool {
620 self.tagcache_autoupdate
621 }
622
623 async fn autoresume_enable(&self) -> bool {
624 self.autoresume_enable
625 }
626
627 async fn autoresume_automatic(&self) -> i32 {
628 self.autoresume_automatic
629 }
630
631 async fn autoresume_paths(&self) -> &str {
632 &self.autoresume_paths
633 }
634
635 async fn runtimedb(&self) -> bool {
636 self.runtimedb
637 }
638
639 async fn tagcache_scan_paths(&self) -> &str {
640 &self.tagcache_scan_paths
641 }
642
643 async fn tagcache_db_path(&self) -> &str {
644 &self.tagcache_db_path
645 }
646
647 async fn backdrop_file(&self) -> &str {
648 &self.backdrop_file
649 }
650
651 async fn bg_color(&self) -> i32 {
652 self.bg_color
653 }
654
655 async fn fg_color(&self) -> i32 {
656 self.fg_color
657 }
658
659 async fn lss_color(&self) -> i32 {
660 self.lss_color
661 }
662
663 async fn lse_color(&self) -> i32 {
664 self.lse_color
665 }
666
667 async fn lst_color(&self) -> i32 {
668 self.lst_color
669 }
670
671 async fn colors_file(&self) -> &str {
672 &self.colors_file
673 }
674
675 async fn browser_default(&self) -> i32 {
676 self.browser_default
677 }
678
679 async fn repeat_mode(&self) -> i32 {
680 self.repeat_mode
681 }
682
683 async fn next_folder(&self) -> i32 {
684 self.next_folder
685 }
686
687 async fn constrain_next_folder(&self) -> bool {
688 self.constrain_next_folder
689 }
690
691 async fn recursive_dir_insert(&self) -> i32 {
692 self.recursive_dir_insert
693 }
694
695 async fn fade_on_stop(&self) -> bool {
696 self.fade_on_stop
697 }
698
699 async fn playlist_shuffle(&self) -> bool {
700 self.playlist_shuffle
701 }
702
703 async fn warnon_erase_dynplaylist(&self) -> bool {
704 self.warnon_erase_dynplaylist
705 }
706
707 async fn keep_current_track_on_replace_playlist(&self) -> bool {
708 self.keep_current_track_on_replace_playlist
709 }
710
711 async fn show_shuffled_adding_options(&self) -> bool {
712 self.show_shuffled_adding_options
713 }
714
715 async fn show_queue_options(&self) -> i32 {
716 self.show_queue_options
717 }
718
719 async fn album_art(&self) -> i32 {
720 self.album_art
721 }
722
723 async fn rewind_across_tracks(&self) -> bool {
724 self.rewind_across_tracks
725 }
726
727 async fn playlist_viewer_icons(&self) -> bool {
728 self.playlist_viewer_icons
729 }
730
731 async fn playlist_viewer_indices(&self) -> bool {
732 self.playlist_viewer_indices
733 }
734
735 async fn playlist_viewer_track_display(&self) -> i32 {
736 self.playlist_viewer_track_display
737 }
738
739 async fn talk_menu(&self) -> bool {
740 self.talk_menu
741 }
742
743 async fn talk_dir(&self) -> i32 {
744 self.talk_dir
745 }
746
747 async fn talk_dir_clip(&self) -> bool {
748 self.talk_dir_clip
749 }
750
751 async fn talk_file(&self) -> i32 {
752 self.talk_file
753 }
754
755 async fn talk_file_clip(&self) -> bool {
756 self.talk_file_clip
757 }
758
759 async fn talk_filetype(&self) -> bool {
760 self.talk_filetype
761 }
762
763 async fn talk_battery_level(&self) -> bool {
764 self.talk_battery_level
765 }
766
767 async fn talk_mixer_amp(&self) -> i32 {
768 self.talk_mixer_amp
769 }
770
771 async fn sort_case(&self) -> bool {
772 self.sort_case
773 }
774
775 async fn sort_dir(&self) -> i32 {
776 self.sort_dir
777 }
778
779 async fn sort_file(&self) -> i32 {
780 self.sort_file
781 }
782
783 async fn interpret_numbers(&self) -> i32 {
784 self.interpret_numbers
785 }
786
787 async fn poweroff(&self) -> i32 {
788 self.poweroff
789 }
790
791 async fn battery_capacity(&self) -> i32 {
792 self.battery_capacity
793 }
794
795 async fn battery_type(&self) -> i32 {
796 self.battery_type
797 }
798
799 async fn spdif_enable(&self) -> bool {
800 self.spdif_enable
801 }
802
803 async fn usb_charging(&self) -> i32 {
804 self.usb_charging
805 }
806
807 async fn contrast(&self) -> i32 {
808 self.contrast
809 }
810
811 async fn invert(&self) -> bool {
812 self.invert
813 }
814
815 async fn flip_display(&self) -> bool {
816 self.flip_display
817 }
818
819 async fn cursor_style(&self) -> i32 {
820 self.cursor_style
821 }
822
823 async fn screen_scroll_step(&self) -> i32 {
824 self.screen_scroll_step
825 }
826
827 async fn show_path_in_browser(&self) -> i32 {
828 self.show_path_in_browser
829 }
830
831 async fn offset_out_of_view(&self) -> bool {
832 self.offset_out_of_view
833 }
834
835 async fn disable_mainmenu_scrolling(&self) -> bool {
836 self.disable_mainmenu_scrolling
837 }
838
839 async fn icon_file(&self) -> &str {
840 &self.icon_file
841 }
842
843 async fn viewers_icon_file(&self) -> &str {
844 &self.viewers_icon_file
845 }
846
847 async fn font_file(&self) -> &str {
848 &self.font_file
849 }
850
851 async fn glyphs_to_cache(&self) -> i32 {
852 self.glyphs_to_cache
853 }
854
855 async fn kbd_file(&self) -> &str {
856 &self.kbd_file
857 }
858
859 async fn backlight_timeout(&self) -> i32 {
860 self.backlight_timeout
861 }
862
863 async fn caption_backlight(&self) -> bool {
864 self.caption_backlight
865 }
866
867 async fn bl_filter_first_keypress(&self) -> bool {
868 self.bl_filter_first_keypress
869 }
870
871 async fn backlight_timeout_plugged(&self) -> i32 {
872 self.backlight_timeout_plugged
873 }
874
875 async fn bt_selective_softlock_actions(&self) -> bool {
876 self.bt_selective_softlock_actions
877 }
878
879 async fn bt_selective_softlock_actions_mask(&self) -> i32 {
880 self.bt_selective_softlock_actions_mask
881 }
882
883 async fn bl_selective_actions(&self) -> bool {
884 self.bl_selective_actions
885 }
886
887 async fn bl_selective_actions_mask(&self) -> i32 {
888 self.bl_selective_actions_mask
889 }
890
891 async fn backlight_on_button_hold(&self) -> i32 {
892 self.backlight_on_button_hold
893 }
894
895 async fn lcd_sleep_after_backlight_off(&self) -> i32 {
896 self.lcd_sleep_after_backlight_off
897 }
898
899 async fn brightness(&self) -> i32 {
900 self.brightness
901 }
902
903 async fn speaker_mode(&self) -> i32 {
904 self.speaker_mode
905 }
906
907 async fn prevent_skip(&self) -> bool {
908 self.prevent_skip
909 }
910
911 async fn touch_mode(&self) -> i32 {
912 self.touch_mode
913 }
914
915 async fn pitch_mode_semitone(&self) -> bool {
916 self.pitch_mode_semitone
917 }
918
919 async fn pitch_mode_timestretch(&self) -> bool {
920 self.pitch_mode_timestretch
921 }
922
923 async fn usb_hid(&self) -> bool {
924 self.usb_hid
925 }
926
927 async fn usb_keypad_mode(&self) -> i32 {
928 self.usb_keypad_mode
929 }
930
931 async fn usb_skip_first_drive(&self) -> bool {
932 self.usb_skip_first_drive
933 }
934
935 async fn player_name(&self) -> &str {
936 &self.player_name
937 }
938
939 async fn compressor_settings(&self) -> CompressorSettings {
940 self.compressor_settings.clone()
941 }
942
943 async fn sleeptimer_duration(&self) -> i32 {
944 self.sleeptimer_duration
945 }
946
947 async fn sleeptimer_on_startup(&self) -> bool {
948 self.sleeptimer_on_startup
949 }
950
951 async fn keypress_restarts_sleeptimer(&self) -> bool {
952 self.keypress_restarts_sleeptimer
953 }
954
955 async fn show_shutdown_message(&self) -> bool {
956 self.show_shutdown_message
957 }
958
959 async fn hotkey_wps(&self) -> i32 {
960 self.hotkey_wps
961 }
962
963 async fn hotkey_tree(&self) -> i32 {
964 self.hotkey_tree
965 }
966
967 async fn resume_rewind(&self) -> i32 {
968 self.resume_rewind
969 }
970
971 async fn depth_3d(&self) -> i32 {
972 self.depth_3d
973 }
974
975 async fn roll_off(&self) -> i32 {
976 self.roll_off
977 }
978
979 async fn power_mode(&self) -> i32 {
980 self.power_mode
981 }
982
983 async fn keyclick_hardware(&self) -> bool {
984 self.keyclick_hardware
985 }
986
987 async fn start_directory(&self) -> &str {
988 &self.start_directory
989 }
990
991 async fn root_menu_customized(&self) -> bool {
992 self.root_menu_customized
993 }
994
995 async fn shortcuts_replaces_qs(&self) -> bool {
996 self.shortcuts_replaces_qs
997 }
998
999 async fn play_frequency(&self) -> i32 {
1000 self.play_frequency
1001 }
1002
1003 async fn volume_limit(&self) -> i32 {
1004 self.volume_limit
1005 }
1006
1007 async fn volume_adjust_mode(&self) -> i32 {
1008 self.volume_adjust_mode
1009 }
1010
1011 async fn volume_adjust_norm_steps(&self) -> i32 {
1012 self.volume_adjust_norm_steps
1013 }
1014
1015 async fn surround_enabled(&self) -> i32 {
1016 self.surround_enabled
1017 }
1018
1019 async fn surround_balance(&self) -> i32 {
1020 self.surround_balance
1021 }
1022
1023 async fn surround_fx1(&self) -> i32 {
1024 self.surround_fx1
1025 }
1026
1027 async fn surround_fx2(&self) -> i32 {
1028 self.surround_fx2
1029 }
1030
1031 async fn surround_method2(&self) -> bool {
1032 self.surround_method2
1033 }
1034
1035 async fn surround_mix(&self) -> i32 {
1036 self.surround_mix
1037 }
1038
1039 async fn pbe(&self) -> i32 {
1040 self.pbe
1041 }
1042
1043 async fn pbe_precut(&self) -> i32 {
1044 self.pbe_precut
1045 }
1046
1047 async fn afr_enabled(&self) -> i32 {
1048 self.afr_enabled
1049 }
1050
1051 async fn governor(&self) -> i32 {
1052 self.governor
1053 }
1054
1055 async fn stereosw_mode(&self) -> i32 {
1056 self.stereosw_mode
1057 }
1058}
1059
1060impl From<rb::types::user_settings::UserSettings> for UserSettings {
1061 fn from(settings: rb::types::user_settings::UserSettings) -> Self {
1062 Self {
1063 music_dir: settings.music_dir,
1064 volume: 0,
1065 balance: settings.balance,
1066 bass: settings.bass,
1067 treble: settings.treble,
1068 channel_config: settings.channel_config,
1069 stereo_width: settings.stereo_width,
1070 bass_cutoff: settings.bass_cutoff,
1071 treble_cutoff: settings.treble_cutoff,
1072 crossfade: settings.crossfade,
1073 crossfade_fade_in_delay: settings.crossfade_fade_in_delay,
1074 crossfade_fade_out_delay: settings.crossfade_fade_out_delay,
1075 crossfade_fade_in_duration: settings.crossfade_fade_in_duration,
1076 crossfade_fade_out_duration: settings.crossfade_fade_out_duration,
1077 crossfade_fade_out_mixmode: settings.crossfade_fade_out_mixmode,
1078 replaygain_settings: ReplaygainSettings::from(settings.replaygain_settings),
1079 crossfeed: settings.crossfeed,
1080 crossfeed_direct_gain: settings.crossfeed_direct_gain,
1081 crossfeed_cross_gain: settings.crossfeed_cross_gain,
1082 crossfeed_hf_attenuation: settings.crossfeed_hf_attenuation,
1083 crossfeed_hf_cutoff: settings.crossfeed_hf_cutoff,
1084 eq_enabled: settings.eq_enabled,
1085 eq_precut: settings.eq_precut,
1086 eq_band_settings: settings
1087 .eq_band_settings
1088 .into_iter()
1089 .map(|band| band.into())
1090 .collect(),
1091 beep: settings.beep,
1092 keyclick: settings.keyclick,
1093 keyclick_repeats: settings.keyclick_repeats,
1094 dithering_enabled: settings.dithering_enabled,
1095 timestretch_enabled: settings.timestretch_enabled,
1096 list_accel_start_delay: settings.list_accel_start_delay,
1097 list_accel_wait: settings.list_accel_wait,
1098 touchpad_sensitivity: settings.touchpad_sensitivity,
1099 touchpad_deadzone: settings.touchpad_deadzone,
1100 pause_rewind: settings.pause_rewind,
1101 unplug_mode: settings.unplug_mode,
1102 unplug_autoresume: settings.unplug_autoresume,
1103 timeformat: settings.timeformat,
1104 disk_spindown: settings.disk_spindown,
1105 buffer_margin: settings.buffer_margin,
1106 dirfilter: settings.dirfilter,
1107 show_filename_ext: settings.show_filename_ext,
1108 default_codepage: settings.default_codepage,
1109 hold_lr_for_scroll_in_list: settings.hold_lr_for_scroll_in_list,
1110 play_selected: settings.play_selected,
1111 single_mode: settings.single_mode,
1112 party_mode: settings.party_mode,
1113 cuesheet: settings.cuesheet,
1114 car_adapter_mode: settings.car_adapter_mode,
1115 car_adapter_mode_delay: settings.car_adapter_mode_delay,
1116 start_in_screen: settings.start_in_screen,
1117 ff_rewind_min_step: settings.ff_rewind_min_step,
1118 ff_rewind_accel: settings.ff_rewind_accel,
1119 peak_meter_release: settings.peak_meter_release,
1120 peak_meter_hold: settings.peak_meter_hold,
1121 peak_meter_clip_hold: settings.peak_meter_clip_hold,
1122 peak_meter_dbfs: settings.peak_meter_dbfs,
1123 peak_meter_min: settings.peak_meter_min,
1124 peak_meter_max: settings.peak_meter_max,
1125 wps_file: settings.wps_file,
1126 sbs_file: settings.sbs_file,
1127 lang_file: settings.lang_file,
1128 playlist_catalog_dir: settings.playlist_catalog_dir,
1129 skip_length: settings.skip_length,
1130 max_files_in_dir: settings.max_files_in_dir,
1131 max_files_in_playlist: settings.max_files_in_playlist,
1132 volume_type: settings.volume_type,
1133 battery_display: settings.battery_display,
1134 show_icons: settings.show_icons,
1135 statusbar: settings.statusbar,
1136 scrollbar: settings.scrollbar,
1137 scrollbar_width: settings.scrollbar_width,
1138 list_line_padding: settings.list_line_padding,
1139 list_separator_height: settings.list_separator_height,
1140 list_separator_color: settings.list_separator_color,
1141 browse_current: settings.browse_current,
1142 scroll_paginated: settings.scroll_paginated,
1143 list_wraparound: settings.list_wraparound,
1144 list_order: settings.list_order,
1145 scroll_speed: settings.scroll_speed,
1146 bidir_limit: settings.bidir_limit,
1147 scroll_delay: settings.scroll_delay,
1148 scroll_step: settings.scroll_step,
1149 autoloadbookmark: settings.autoloadbookmark,
1150 autocreatebookmark: settings.autocreatebookmark,
1151 autoupdatebookmark: settings.autoupdatebookmark,
1152 usemrb: settings.usemrb,
1153 dircache: settings.dircache,
1154 tagcache_ram: settings.tagcache_ram,
1155 tagcache_autoupdate: settings.tagcache_autoupdate,
1156 autoresume_enable: settings.autoresume_enable,
1157 autoresume_automatic: settings.autoresume_automatic,
1158 autoresume_paths: settings.autoresume_paths,
1159 runtimedb: settings.runtimedb,
1160 tagcache_scan_paths: settings.tagcache_scan_paths,
1161 tagcache_db_path: settings.tagcache_db_path,
1162 backdrop_file: settings.backdrop_file,
1163 bg_color: settings.bg_color,
1164 fg_color: settings.fg_color,
1165 lss_color: settings.lss_color,
1166 lse_color: settings.lse_color,
1167 lst_color: settings.lst_color,
1168 colors_file: settings.colors_file,
1169 browser_default: settings.browser_default,
1170 repeat_mode: settings.repeat_mode,
1171 next_folder: settings.next_folder,
1172 constrain_next_folder: settings.constrain_next_folder,
1173 recursive_dir_insert: settings.recursive_dir_insert,
1174 fade_on_stop: settings.fade_on_stop,
1175 playlist_shuffle: settings.playlist_shuffle,
1176 warnon_erase_dynplaylist: settings.warnon_erase_dynplaylist,
1177 keep_current_track_on_replace_playlist: settings.keep_current_track_on_replace_playlist,
1178 show_shuffled_adding_options: settings.show_shuffled_adding_options,
1179 show_queue_options: settings.show_queue_options,
1180 album_art: settings.album_art,
1181 rewind_across_tracks: settings.rewind_across_tracks,
1182 playlist_viewer_icons: settings.playlist_viewer_icons,
1183 playlist_viewer_indices: settings.playlist_viewer_indices,
1184 playlist_viewer_track_display: settings.playlist_viewer_track_display,
1185 talk_menu: settings.talk_menu,
1186 talk_dir: settings.talk_dir,
1187 talk_dir_clip: settings.talk_dir_clip,
1188 talk_file: settings.talk_file,
1189 talk_file_clip: settings.talk_file_clip,
1190 talk_filetype: settings.talk_filetype,
1191 talk_battery_level: settings.talk_battery_level,
1192 talk_mixer_amp: settings.talk_mixer_amp,
1193 sort_case: settings.sort_case,
1194 sort_dir: settings.sort_dir,
1195 sort_file: settings.sort_file,
1196 interpret_numbers: settings.interpret_numbers,
1197 poweroff: settings.poweroff,
1198 battery_capacity: settings.battery_capacity,
1199 battery_type: settings.battery_type,
1200 spdif_enable: settings.spdif_enable,
1201 usb_charging: settings.usb_charging,
1202 contrast: settings.contrast,
1203 invert: settings.invert,
1204 flip_display: settings.flip_display,
1205 cursor_style: settings.cursor_style,
1206 screen_scroll_step: settings.screen_scroll_step,
1207 show_path_in_browser: settings.show_path_in_browser,
1208 offset_out_of_view: settings.offset_out_of_view,
1209 disable_mainmenu_scrolling: settings.disable_mainmenu_scrolling,
1210 icon_file: settings.icon_file,
1211 viewers_icon_file: settings.viewers_icon_file,
1212 font_file: settings.font_file,
1213 glyphs_to_cache: settings.glyphs_to_cache,
1214 kbd_file: settings.kbd_file,
1215 backlight_timeout: settings.backlight_timeout,
1216 caption_backlight: settings.caption_backlight,
1217 bl_filter_first_keypress: settings.bl_filter_first_keypress,
1218 backlight_timeout_plugged: settings.backlight_timeout_plugged,
1219 bt_selective_softlock_actions: settings.bt_selective_softlock_actions,
1220 bt_selective_softlock_actions_mask: settings.bt_selective_softlock_actions_mask,
1221 bl_selective_actions: settings.bl_selective_actions,
1222 bl_selective_actions_mask: settings.bl_selective_actions_mask,
1223 backlight_on_button_hold: settings.backlight_on_button_hold,
1224 lcd_sleep_after_backlight_off: settings.lcd_sleep_after_backlight_off,
1225 brightness: settings.brightness,
1226 speaker_mode: settings.speaker_mode,
1227 prevent_skip: settings.prevent_skip,
1228 touch_mode: settings.touch_mode,
1229 pitch_mode_semitone: settings.pitch_mode_semitone,
1230 pitch_mode_timestretch: settings.pitch_mode_timestretch,
1231 usb_hid: settings.usb_hid,
1232 usb_keypad_mode: settings.usb_keypad_mode,
1233 usb_skip_first_drive: settings.usb_skip_first_drive,
1234 player_name: settings.player_name,
1235 compressor_settings: CompressorSettings::from(settings.compressor_settings),
1236 sleeptimer_duration: settings.sleeptimer_duration,
1237 sleeptimer_on_startup: settings.sleeptimer_on_startup,
1238 keypress_restarts_sleeptimer: settings.keypress_restarts_sleeptimer,
1239 show_shutdown_message: settings.show_shutdown_message,
1240 hotkey_wps: settings.hotkey_wps,
1241 hotkey_tree: settings.hotkey_tree,
1242 resume_rewind: settings.resume_rewind,
1243 depth_3d: settings.depth_3d,
1244 roll_off: settings.roll_off,
1245 power_mode: settings.power_mode,
1246 keyclick_hardware: settings.keyclick_hardware,
1247 start_directory: settings.start_directory,
1248 root_menu_customized: settings.root_menu_customized,
1249 shortcuts_replaces_qs: settings.shortcuts_replaces_qs,
1250 play_frequency: settings.play_frequency,
1251 volume_limit: settings.volume_limit,
1252 volume_adjust_mode: settings.volume_adjust_mode,
1253 volume_adjust_norm_steps: settings.volume_adjust_norm_steps,
1254 surround_enabled: settings.surround_enabled,
1255 surround_balance: settings.surround_balance,
1256 surround_fx1: settings.surround_fx1,
1257 surround_fx2: settings.surround_fx2,
1258 surround_method2: settings.surround_method2,
1259 surround_mix: settings.surround_mix,
1260 pbe: settings.pbe,
1261 pbe_precut: settings.pbe_precut,
1262 afr_enabled: settings.afr_enabled,
1263 governor: settings.governor,
1264 stereosw_mode: settings.stereosw_mode,
1265 }
1266 }
1267}