mirror of
https://git.wetfence.xyz/RandyTheSilly/jellyPod.git
synced 2026-10-26 23:39:56 -04:00
Add on-watch track listing
This commit is contained in:
1 parent
5507ef52ea
commit
1f8d19ed3a
3 files changed
+45
-13
No files matched your search
+11
-7
@@ -11,7 +11,8 @@ typedef enum {
|
||||
} NavScope;
|
||||
|
||||
// constants
|
||||
#define MAX_MENU_ITEMS 2048
|
||||
#define MAX_ARTISTS 2048 // TODO paginate or push as high as possible
|
||||
#define MAX_TRACKS_PER_ALBUM 255
|
||||
#define BAR_HEIGHT 20
|
||||
#ifdef PBL_RECT
|
||||
#define MARGIN_X 4
|
||||
@@ -36,8 +37,8 @@ static MenuLayer *s_menu_layer;
|
||||
// globals
|
||||
static bool s_pkjs_ready = false;
|
||||
static NavScope s_current_menu_scope = NAV_SCOPE_MAIN;
|
||||
static const char *s_current_menu_vanity[MAX_MENU_ITEMS];
|
||||
// static uint16_t s_current_menu_seq_ids[MAX_MENU_ITEMS];
|
||||
static const char *s_current_menu_vanity[MAX_ARTISTS];
|
||||
static uint16_t s_current_menu_seq_ids[MAX_TRACKS_PER_ALBUM];
|
||||
static uint16_t s_menu_items_count = 0;
|
||||
|
||||
// resources
|
||||
@@ -60,7 +61,11 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
// handle incoming menu list items
|
||||
Tuple *t_new_scope = dict_find(iter, MESSAGE_KEY_BIDIR_MENU_NAV_SCOPE);
|
||||
if (t_new_scope) {
|
||||
for (uint16_t i = 0; i < MAX_MENU_ITEMS; i++) {
|
||||
for (uint16_t i = 0; i < MAX_ARTISTS; i++) {
|
||||
Tuple *t_seq_ids = dict_find(iter, MESSAGE_KEY_IN_SEQ_ID_LIST + i);
|
||||
if (t_seq_ids) {
|
||||
s_current_menu_seq_ids[i] = t_seq_ids->value->uint16;
|
||||
}
|
||||
Tuple *t_vanity = dict_find(iter, MESSAGE_KEY_IN_VANITY_LIST + i);
|
||||
if (t_vanity) {
|
||||
s_current_menu_vanity[i] = t_vanity->value->cstring;
|
||||
@@ -133,10 +138,10 @@ static void menu_select_click(struct MenuLayer *menu_layer, MenuIndex *clicked_i
|
||||
}
|
||||
return;
|
||||
case NAV_SCOPE_SEARCH:
|
||||
to_pkjs_scope_change(NAV_SCOPE_ARTISTS, &clicked_index->row);
|
||||
break;
|
||||
case NAV_SCOPE_ARTISTS:
|
||||
case NAV_SCOPE_ALBUMS:
|
||||
to_pkjs_scope_change(s_current_menu_scope + 1, &clicked_index->row);
|
||||
break;
|
||||
case NAV_SCOPE_ALBUM_TRACKS:
|
||||
default:
|
||||
return;
|
||||
@@ -157,7 +162,6 @@ static void main_window_load() {
|
||||
|
||||
s_menu_layer = menu_layer_create(s_menu_grect);
|
||||
menu_layer_set_callbacks(s_menu_layer, NULL, (MenuLayerCallbacks){.get_num_rows = menu_get_num_rows, .draw_row = menu_draw_row, .select_click = menu_select_click, .selection_changed = menu_selection_changed});
|
||||
menu_layer_pad_bottom_enable(s_menu_layer, false);
|
||||
menu_layer_set_click_config_onto_window(s_menu_layer, s_main_window);
|
||||
#ifdef PBL_ROUND
|
||||
menu_layer_set_center_focused(s_menu_layer, false);
|
||||
|
||||
Reference in new issue
Block a user