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.

skin_engine: Make pressing the setting bar touch region work

might need some tweaking, but works.

Change-Id: I0784cd4fe9996531da6cc275491ff3b4e83cdbcf

+41 -1
+1
apps/action.h
··· 254 254 ACTION_TOUCH_SCROLLBAR, 255 255 ACTION_TOUCH_VOLUME, 256 256 ACTION_TOUCH_SOFTLOCK, 257 + ACTION_TOUCH_SETTING, 257 258 #endif 258 259 259 260 /* USB HID codes */
+18
apps/gui/option_select.c
··· 600 600 val_to_selection(setting, oldvalue, count, val, &function); 601 601 return true; 602 602 } 603 + 604 + #ifdef HAVE_TOUCHSCREEN 605 + void update_setting_value_from_touch(int setting_id, int selection) 606 + { 607 + const struct settings_list *setting = &settings[setting_id]; 608 + int new_val = selection_to_val(setting, selection); 609 + int var_type = setting->flags&F_T_MASK; 610 + 611 + if (var_type == F_T_INT || var_type == F_T_UINT) 612 + { 613 + *(int*)setting->setting = new_val; 614 + } 615 + else if (var_type == F_T_BOOL) 616 + { 617 + *(bool*)setting->setting = new_val ? true : false; 618 + } 619 + } 620 + #endif
+3
apps/gui/option_select.h
··· 49 49 int option_value_as_int(const struct settings_list *setting); 50 50 51 51 int get_setting_info_for_bar(int setting_id, int *count, int *val); 52 + #ifdef HAVE_TOUCHSCREEN 53 + void update_setting_value_from_touch(int setting_id, int selection); 54 + #endif 52 55 53 56 #endif /* _GUI_OPTION_SELECT_H_ */
+5 -1
apps/gui/skin_engine/skin_parser.c
··· 1091 1091 1092 1092 #ifdef HAVE_TOUCHSCREEN 1093 1093 if (!suppress_touchregion && 1094 - (token->type == SKIN_TOKEN_VOLUMEBAR || token->type == SKIN_TOKEN_PROGRESSBAR)) 1094 + (token->type == SKIN_TOKEN_VOLUMEBAR || 1095 + token->type == SKIN_TOKEN_PROGRESSBAR || 1096 + token->type == SKIN_TOKEN_SETTINGBAR)) 1095 1097 { 1096 1098 struct touchregion *region = skin_buffer_alloc(sizeof(*region)); 1097 1099 struct skin_token_list *item; ··· 1102 1104 1103 1105 if (token->type == SKIN_TOKEN_VOLUMEBAR) 1104 1106 region->action = ACTION_TOUCH_VOLUME; 1107 + else if (token->type == SKIN_TOKEN_SETTINGBAR) 1108 + region->action = ACTION_TOUCH_SETTING; 1105 1109 else 1106 1110 region->action = ACTION_TOUCH_SCROLLBAR; 1107 1111
+14
apps/gui/skin_engine/skin_touchsupport.c
··· 104 104 { 105 105 case ACTION_TOUCH_SCROLLBAR: 106 106 case ACTION_TOUCH_VOLUME: 107 + case ACTION_TOUCH_SETTING: 107 108 if (edge_offset) 108 109 { 109 110 struct progressbar *bar = ··· 282 283 option_select_next_val(rep_setting, false, true); 283 284 audio_flush_and_reload_tracks(); 284 285 returncode = ACTION_REDRAW; 286 + } 287 + break; 288 + case ACTION_TOUCH_SETTING: 289 + { 290 + struct progressbar *bar = 291 + SKINOFFSETTOPTR(skin_buffer, temp->bar); 292 + if (bar && edge_offset) 293 + { 294 + int val, count; 295 + get_setting_info_for_bar(bar->setting_id, &count, &val); 296 + val = *edge_offset * count / 100; 297 + update_setting_value_from_touch(bar->setting_id, val); 298 + } 285 299 } 286 300 break; 287 301 }