Require a scroll up to access scoped shuffle buttons (play sequentially by default)
This commit is contained in:
1 parent
cd4f5eebb1
commit
ee33a57962
2 files changed
+19
-5
No files matched your search
@@ -21,6 +21,8 @@ I made `jellyPod` to suite my tastes. Everything listed below is non-negotiable
|
||||
- The next album is chosen by release date and the next artist is chosen alphanumerically
|
||||
- Shuffle at every scope
|
||||
- You can easily shuffle artists, albums (from a given artist), or all tracks
|
||||
- Shuffle buttons for single discographies/albums are hidden: scroll up to find them
|
||||
- This makes playing sequentially the default
|
||||
- Multi-client/device support
|
||||
- `jellyPod` is not just a remote for your phone
|
||||
- The client to control is determined by your most recently active session under your Jellyfin user
|
||||
|
||||
+17
-5
@@ -68,6 +68,17 @@ static const char *get_current_scope_subscope() {
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t get_scope_shuffle_row_count(NavScope scope) {
|
||||
switch (scope) {
|
||||
case NAV_SCOPE_ALBUMS:
|
||||
return 2;
|
||||
case NAV_SCOPE_ALBUM_TRACKS:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////// PKJS //////////////////////
|
||||
|
||||
static void outbox_failed_handler(DictionaryIterator *iter, AppMessageResult reason, void *context) {
|
||||
@@ -118,6 +129,11 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
snprintf(s_nav_history.last_subscope[s_current_menu_scope], sizeof(s_nav_history.last_subscope[s_current_menu_scope]), "%s", subscope);
|
||||
}
|
||||
}
|
||||
// require the user to scroll up to reach shuffle rows
|
||||
uint16_t shuffle_rows = get_scope_shuffle_row_count(s_current_menu_scope);
|
||||
if (scroll_row < shuffle_rows) {
|
||||
scroll_row = shuffle_rows;
|
||||
}
|
||||
s_nav_history.scroll_row[s_current_menu_scope] = scroll_row;
|
||||
menu_layer_reload_data(s_menu_layer);
|
||||
menu_layer_set_selected_index(s_menu_layer, MenuIndex(0, scroll_row), MenuRowAlignTop, false);
|
||||
@@ -238,12 +254,8 @@ static uint16_t menu_get_num_rows(MenuLayer *menu_layer, uint16_t section_index,
|
||||
switch (s_current_menu_scope) {
|
||||
case NAV_SCOPE_MAIN:
|
||||
return 4;
|
||||
case NAV_SCOPE_ALBUMS:
|
||||
return s_menu_items_count + 2; // account for shuffle buttons insertion
|
||||
case NAV_SCOPE_ALBUM_TRACKS:
|
||||
return s_menu_items_count + 1; // account for shuffle button insertion
|
||||
default:
|
||||
return s_menu_items_count;
|
||||
return s_menu_items_count + get_scope_shuffle_row_count(s_current_menu_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user