Просмотр исходного кода

Merge pull request #7 from acegoal07/file-select

File select
acegoal07 2 лет назад
Родитель
Сommit
b861e0e98b
10 измененных файлов с 173 добавлено и 88 удалено
  1. 1 1
      README.md
  2. 1 1
      application.fam
  3. 15 5
      nfc_playlist.c
  4. 9 1
      nfc_playlist.h
  5. 2 1
      nfc_playlist_i.h
  6. 73 74
      scences/emulation.c
  7. 34 0
      scences/file_select.c
  8. 10 0
      scences/file_select.h
  9. 26 3
      scences/main_menu.c
  10. 2 2
      scences/settings.c

+ 1 - 1
README.md

@@ -12,5 +12,5 @@ To set the playlist you need to create a file in ext/apps_data/nfc_playlist call
 This app was design, built and tested using the <a href="https://github.com/Flipper-XFW/Xtreme-Firmware">Xtreme firmware</a> i don't see why it wont work with other firmwares but do keep this in mind when building it with FBT/uFBT
 
 ## Ideas
-- [ ] Add the ability to change playlist
+- [x] Add the ability to change playlist
 - [ ] Make it so changed settings are saved (maybe make it so settings can be specified for each playlist changing the settings based on the playlist selected)

+ 1 - 1
application.fam

@@ -8,7 +8,7 @@ App(
     fap_category="NFC",
     fap_author="@acegoal07",
     fap_weburl="https://github.com/acegoal07/FlipperZero_NFC_Playlist/tree/main",
-    fap_version="1.0",
+    fap_version="1.1",
     fap_icon="icon.png",
     fap_private_libs=[
         Lib(

+ 15 - 5
nfc_playlist.c

@@ -4,19 +4,22 @@
 static void (*const nfc_playlist_scene_on_enter_handlers[])(void*) = {
     nfc_playlist_main_menu_scene_on_enter,
     nfc_playlist_settings_scene_on_enter,
-    nfc_playlist_emulation_scene_on_enter
+    nfc_playlist_emulation_scene_on_enter,
+    nfc_playlist_file_select_scene_on_enter
 };
 
 static bool (*const nfc_playlist_scene_on_event_handlers[])(void*, SceneManagerEvent) = {
     nfc_playlist_main_menu_scene_on_event,
     nfc_playlist_settings_scene_on_event,
-    nfc_playlist_emulation_scene_on_event
+    nfc_playlist_emulation_scene_on_event,
+    nfc_playlist_file_select_scene_on_event
 };
 
 static void (*const nfc_playlist_scene_on_exit_handlers[])(void*) = {
     nfc_playlist_main_menu_scene_on_exit,
     nfc_playlist_settings_scene_on_exit,
-    nfc_playlist_emulation_scene_on_exit
+    nfc_playlist_emulation_scene_on_exit,
+    nfc_playlist_file_select_scene_on_exit
 };
 
 static const SceneManagerHandlers nfc_playlist_scene_manager_handlers = {
@@ -48,6 +51,10 @@ static NfcPlaylist* nfc_playlist_alloc() {
 
     nfc_playlist->variable_item_list = variable_item_list_alloc();
     nfc_playlist->submenu = submenu_alloc();
+    nfc_playlist->base_file_path = furi_string_alloc_set_str("/ext/apps_data/nfc_playlist/");
+    nfc_playlist->file_path = nfc_playlist->base_file_path;
+    nfc_playlist->file_selected = false;
+    nfc_playlist->file_browser = file_browser_alloc(nfc_playlist->file_path);
     nfc_playlist->popup = popup_alloc();
     nfc_playlist->emulate_timeout = default_emulate_timeout;
     nfc_playlist->emulate_delay = default_emulate_delay;
@@ -59,10 +66,9 @@ static NfcPlaylist* nfc_playlist_alloc() {
     view_dispatcher_set_navigation_event_callback(nfc_playlist->view_dispatcher, nfc_playlist_back_event_callback);
 
     view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Menu, submenu_get_view(nfc_playlist->submenu));
-
     view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Settings, variable_item_list_get_view(nfc_playlist->variable_item_list));
-
     view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Popup, popup_get_view(nfc_playlist->popup));
+    view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileSelect, file_browser_get_view(nfc_playlist->file_browser));
 
     return nfc_playlist;
 }
@@ -73,11 +79,15 @@ static void nfc_playlist_free(NfcPlaylist* nfc_playlist) {
     view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Menu);
     view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Settings);
     view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Popup);
+    view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileSelect);
     view_dispatcher_free(nfc_playlist->view_dispatcher);
     variable_item_list_free(nfc_playlist->variable_item_list);
     submenu_free(nfc_playlist->submenu);
+    file_browser_free(nfc_playlist->file_browser);
     popup_free(nfc_playlist->popup);
     furi_record_close(RECORD_NOTIFICATION);
+    furi_string_free(nfc_playlist->base_file_path);
+    furi_string_free(nfc_playlist->file_path);
     free(nfc_playlist);
 }
 

+ 9 - 1
nfc_playlist.h

@@ -8,19 +8,23 @@
 #include <gui/modules/popup.h>
 #include <gui/modules/variable_item_list.h>
 #include <gui/modules/submenu.h>
+#include <gui/modules/file_browser.h>
 #include <notification/notification_messages.h>
 #include <nfc_playlist_worker.h>
+#include <assets_icons.h>
 
 typedef enum {
    NfcPlaylistView_Menu,
    NfcPlaylistView_Settings,
-   NfcPlaylistView_Popup
+   NfcPlaylistView_Popup,
+   NfcPlaylistView_FileSelect
 } NfcPlayScenesView;
 
 typedef enum {
    NfcPlaylistScene_MainMenu,
    NfcPlaylistScene_Settings,
    NfcPlaylistScene_EmulatingPopup,
+   NfcPlaylistScene_FileSelect,
    NfcPlaylistScene_count
 } NfcPlaylistScene;
 
@@ -28,6 +32,7 @@ typedef struct {
    SceneManager* scene_manager;
    ViewDispatcher* view_dispatcher;
    VariableItemList* variable_item_list;
+   FileBrowser* file_browser;
    Submenu* submenu;
    Popup* popup;
    NotificationApp* notification;
@@ -36,6 +41,9 @@ typedef struct {
    uint8_t emulate_timeout;
    uint8_t emulate_delay;
    bool emulate_led_indicator;
+   FuriString* base_file_path;
+   FuriString* file_path;
+   bool file_selected;
 } NfcPlaylist;
 
 static const int options_emulate_timeout[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };

+ 2 - 1
nfc_playlist_i.h

@@ -2,4 +2,5 @@
 
 #include "scences/main_menu.h"
 #include "scences/settings.h"
-#include "scences/emulation.h"
+#include "scences/emulation.h"
+#include "scences/file_select.h"

+ 73 - 74
scences/emulation.c

@@ -21,7 +21,6 @@ bool nfc_playlist_emulation_scene_on_event(void* context, SceneManagerEvent even
         default:
             break;
     }
-
     return false;
 }
 
@@ -36,8 +35,7 @@ void nfc_playlist_emulation_scene_on_exit(void* context) {
 void nfc_playlist_emulation_setup(void* context) {
     NfcPlaylist* nfc_playlist = context;
 
-    nfc_playlist->thread = furi_thread_alloc_ex(
-        "NfcPlaylistEmulationWorker", 8192, nfc_playlist_emulation_task, nfc_playlist);
+    nfc_playlist->thread = furi_thread_alloc_ex("NfcPlaylistEmulationWorker", 8192, nfc_playlist_emulation_task, nfc_playlist);
     nfc_playlist->nfc_playlist_worker = nfc_playlist_worker_alloc();
 }
 
@@ -71,95 +69,96 @@ int32_t nfc_playlist_emulation_task(void* context) {
     view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Popup);
 
     // Read file
-    if(file_stream_open(stream, APP_DATA_PATH("playlist.txt"), FSAM_READ, FSOM_OPEN_EXISTING)) {
+    if(file_stream_open(stream, furi_string_get_cstr(nfc_playlist->file_path), FSAM_READ, FSOM_OPEN_EXISTING)) {
         EmulationState = NfcPlaylistEmulationState_Emulating;
         int file_position = 0;
-        // read the file line by line and print the text
         while(stream_read_line(stream, line) && EmulationState == NfcPlaylistEmulationState_Emulating) {
-            if (options_emulate_delay[nfc_playlist->emulate_delay] > 0) {
-                if (file_position > 0) {
-                    popup_set_header(nfc_playlist->popup, "Delaying", 64, 10, AlignCenter, AlignTop);
-                    start_error_blink(nfc_playlist);
-                    int time_counter_delay_ms = (options_emulate_delay[nfc_playlist->emulate_delay] * 1000);
-                    do {
-                        char display_text[10];
-                        snprintf(display_text, 10, "%ds", (time_counter_delay_ms/1000));
-                        popup_set_text(nfc_playlist->popup, display_text, 64, 50, AlignCenter, AlignTop);
-                        furi_delay_ms(500);
-                        time_counter_delay_ms -= 500;
-                    } while(time_counter_delay_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating);
-                } else {
-                    file_position++;
+            if (strlen(furi_string_get_cstr(line)) > 1) {
+                if (options_emulate_delay[nfc_playlist->emulate_delay] > 0) {
+                    if (file_position > 0) {
+                        popup_set_header(nfc_playlist->popup, "Delaying", 64, 10, AlignCenter, AlignTop);
+                        start_error_blink(nfc_playlist);
+                        int time_counter_delay_ms = (options_emulate_delay[nfc_playlist->emulate_delay] * 1000);
+                        do {
+                            char display_text[10];
+                            snprintf(display_text, 10, "%ds", (time_counter_delay_ms/1000));
+                            popup_set_text(nfc_playlist->popup, display_text, 64, 50, AlignCenter, AlignTop);
+                            furi_delay_ms(500);
+                            time_counter_delay_ms -= 500;
+                        } while(time_counter_delay_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating);
+                    } else {
+                        file_position++;
+                    }
                 }
-            }
 
-            if (EmulationState != NfcPlaylistEmulationState_Emulating) {
-                break;
-            }
+                if (EmulationState != NfcPlaylistEmulationState_Emulating) {
+                    break;
+                }
 
-            char* file_path = (char*)furi_string_get_cstr(line);
-            char* file_name;
-            if (strchr(file_path, '/') != NULL) {
-                file_name = &strrchr(file_path, '/')[1];
-            } else {
-                file_name = file_path;
-            }
-            char const* file_ext = &strrchr(file_path, '.')[1];
-            int time_counter_ms = (options_emulate_timeout[nfc_playlist->emulate_timeout] * 1000);
-
-            if (storage_file_exists(storage, file_path) == false) {
-                char popup_header_text[(18 + strlen(file_name))];
-                snprintf(popup_header_text, (18 + strlen(file_name)), "%s\n%s", "ERROR not found:", file_name);
-                popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
-                start_error_blink(nfc_playlist);
-                while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
-                    char popup_text[9];
-                    snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
-                    popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
-                    furi_delay_ms(500);
-                    time_counter_ms -= 500;
+                char* file_path = (char*)furi_string_get_cstr(line);
+                char* file_name;
+                if (strchr(file_path, '/') != NULL) {
+                    file_name = &strrchr(file_path, '/')[1];
+                } else {
+                    file_name = file_path;
                 }
-            }
+                char const* file_ext = &strrchr(file_path, '.')[1];
+                int time_counter_ms = (options_emulate_timeout[nfc_playlist->emulate_timeout] * 1000);
 
-            else if (strcasestr(file_ext, "nfc") == NULL) {
-                char popup_header_text[(21 + strlen(file_name))];
-                snprintf(popup_header_text, (21 + strlen(file_name)), "%s\n%s", "ERROR invalid file:", file_name);
-                popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
-                start_error_blink(nfc_playlist);
-                while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
-                    char popup_text[9];
-                    snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
-                    popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
-                    furi_delay_ms(500);
-                    time_counter_ms -= 500;
+                if (storage_file_exists(storage, file_path) == false) {
+                    char popup_header_text[(18 + strlen(file_name))];
+                    snprintf(popup_header_text, (18 + strlen(file_name)), "%s\n%s", "ERROR not found:", file_name);
+                    popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
+                    start_error_blink(nfc_playlist);
+                    while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
+                        char popup_text[9];
+                        snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
+                        popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
+                        furi_delay_ms(500);
+                        time_counter_ms -= 500;
+                    }
                 }
-            }
 
-            else {
-                char popup_header_text[(12 + strlen(file_name))];
-                snprintf(popup_header_text, (12 + strlen(file_name)), "%s\n%s", "Emulating:", file_name);
-                popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
-                nfc_playlist_worker_set_nfc_data(nfc_playlist->nfc_playlist_worker, file_path);
-                nfc_playlist_worker_start(nfc_playlist->nfc_playlist_worker);
-                start_normal_blink(nfc_playlist);
-                while(nfc_playlist_worker_is_emulating(nfc_playlist->nfc_playlist_worker) && time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
-                    char popup_text[9];
-                    snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
-                    popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
-                    furi_delay_ms(500);
-                    time_counter_ms -= 500;
+                else if (strcasestr(file_ext, "nfc") == NULL) {
+                    char popup_header_text[(21 + strlen(file_name))];
+                    snprintf(popup_header_text, (21 + strlen(file_name)), "%s\n%s", "ERROR invalid file:", file_name);
+                    popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
+                    start_error_blink(nfc_playlist);
+                    while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
+                        char popup_text[9];
+                        snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
+                        popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
+                        furi_delay_ms(500);
+                        time_counter_ms -= 500;
+                    }
+                }
+
+                else {
+                    char popup_header_text[(12 + strlen(file_name))];
+                    snprintf(popup_header_text, (12 + strlen(file_name)), "%s\n%s", "Emulating:", file_name);
+                    popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
+                    nfc_playlist_worker_set_nfc_data(nfc_playlist->nfc_playlist_worker, file_path);
+                    nfc_playlist_worker_start(nfc_playlist->nfc_playlist_worker);
+                    start_normal_blink(nfc_playlist);
+                    while(nfc_playlist_worker_is_emulating(nfc_playlist->nfc_playlist_worker) && time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
+                        char popup_text[9];
+                        snprintf(popup_text, 9, "%ds", (time_counter_ms/1000));
+                        popup_set_text(nfc_playlist->popup, popup_text, 64, 50, AlignCenter, AlignTop);
+                        furi_delay_ms(500);
+                        time_counter_ms -= 500;
+                    }
+                    nfc_playlist_worker_stop(nfc_playlist->nfc_playlist_worker);
                 }
-                nfc_playlist_worker_stop(nfc_playlist->nfc_playlist_worker);
             }
         }
         popup_reset(nfc_playlist->popup);
         popup_set_header(nfc_playlist->popup, EmulationState == NfcPlaylistEmulationState_Canceled ? "Emulation stopped" : "Emulation finished", 64, 10, AlignCenter, AlignTop);
         popup_set_text(nfc_playlist->popup, "Press back", 64, 50, AlignCenter, AlignTop);
         stop_blink(nfc_playlist);
-        EmulationState = NfcPlaylistEmulationState_Stopped;
+        EmulationState = NfcPlaylistEmulationState_Stopped;    
     } else {
-        popup_set_header(nfc_playlist->popup, "Error:", 64, 10, AlignCenter, AlignTop);
-        popup_set_text(nfc_playlist->popup, "Failed to open file\n/ext/apps_data/nfc_playlist/playlist.txt", 64, 25, AlignCenter, AlignTop);
+        popup_set_header(nfc_playlist->popup, "Failed to open playlist", 64, 10, AlignCenter, AlignTop);
+        popup_set_text(nfc_playlist->popup, "Press back", 64, 50, AlignCenter, AlignTop);
     }
     // Free/close resources
     furi_string_free(line);

+ 34 - 0
scences/file_select.c

@@ -0,0 +1,34 @@
+#include "nfc_playlist.h"
+#include "scences/file_select.h"
+
+void nfc_playlist_file_select_menu_callback(void* context) {
+   NfcPlaylist* nfc_playlist = context;
+   scene_manager_previous_scene(nfc_playlist->scene_manager);
+}
+
+void nfc_playlist_file_select_scene_on_enter(void* context) {
+   NfcPlaylist* nfc_playlist = context;
+   file_browser_configure(
+      nfc_playlist->file_browser,
+      ".txt",
+      furi_string_get_cstr(nfc_playlist->base_file_path),
+      true,
+      true,
+      &I_sub1_10px,
+      false);
+   view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileSelect);
+   file_browser_set_callback(nfc_playlist->file_browser, nfc_playlist_file_select_menu_callback, nfc_playlist);
+   file_browser_start(nfc_playlist->file_browser, nfc_playlist->base_file_path);
+}
+
+bool nfc_playlist_file_select_scene_on_event(void* context, SceneManagerEvent event) {
+   UNUSED(event);
+   UNUSED(context);
+   bool consumed = false;
+   return consumed;
+}
+
+void nfc_playlist_file_select_scene_on_exit(void* context) {
+   NfcPlaylist* nfc_playlist = context;
+   file_browser_stop(nfc_playlist->file_browser);
+}

+ 10 - 0
scences/file_select.h

@@ -0,0 +1,10 @@
+#pragma once
+#include <furi.h>
+#include <gui/gui.h>
+#include <gui/view_dispatcher.h>
+#include <gui/scene_manager.h>
+#include <gui/modules/file_browser.h>
+
+void nfc_playlist_file_select_scene_on_enter(void* context);
+bool nfc_playlist_file_select_scene_on_event(void* context, SceneManagerEvent event);
+void nfc_playlist_file_select_scene_on_exit(void* context);

+ 26 - 3
scences/main_menu.c

@@ -3,20 +3,25 @@
 
 typedef enum {
     NfcPlaylistEvent_ShowEmulatingPopup,
+    NfcPlaylistEvent_ShowFileSelect,
     NfcPlaylistEvent_ShowSettings
 } NfcPlaylistMainMenuEvent;
 
 typedef enum {
     NfcPlaylistMenuSelection_Start,
+    NfcPlaylistMenuSelection_FileSelect,
     NfcPlaylistMenuSelection_Settings
 } NfcPlaylistMenuSelection;
 
-static void nfc_playlist_menu_callback(void* context, uint32_t index) {
+void nfc_playlist_main_menu_menu_callback(void* context, uint32_t index) {
     NfcPlaylist* nfc_playlist = context;
     switch(index) {
         case NfcPlaylistMenuSelection_Start:
             scene_manager_handle_custom_event(nfc_playlist->scene_manager, NfcPlaylistEvent_ShowEmulatingPopup);
             break;
+        case NfcPlaylistMenuSelection_FileSelect:
+            scene_manager_handle_custom_event(nfc_playlist->scene_manager, NfcPlaylistEvent_ShowFileSelect);
+            break;
         case NfcPlaylistMenuSelection_Settings:
             scene_manager_handle_custom_event(nfc_playlist->scene_manager, NfcPlaylistEvent_ShowSettings);
             break;
@@ -27,20 +32,34 @@ static void nfc_playlist_menu_callback(void* context, uint32_t index) {
 
 void nfc_playlist_main_menu_scene_on_enter(void* context) {
     NfcPlaylist* nfc_playlist = context;
+
+    if (!nfc_playlist->file_selected) {
+        nfc_playlist->file_selected = true;
+        scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_FileSelect);
+        return;
+    }
+
     submenu_set_header(nfc_playlist->submenu, "NFC Playlist");
 
     submenu_add_item(
         nfc_playlist->submenu,
         "Start",
         NfcPlaylistMenuSelection_Start,
-        nfc_playlist_menu_callback,
+        nfc_playlist_main_menu_menu_callback,
+        nfc_playlist);
+
+    submenu_add_item(
+        nfc_playlist->submenu,
+        "Select playlist",
+        NfcPlaylistMenuSelection_FileSelect,
+        nfc_playlist_main_menu_menu_callback,
         nfc_playlist);
 
     submenu_add_item(
         nfc_playlist->submenu,
         "Settings",
         NfcPlaylistMenuSelection_Settings,
-        nfc_playlist_menu_callback,
+        nfc_playlist_main_menu_menu_callback,
         nfc_playlist);
 
     view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Menu);
@@ -56,6 +75,10 @@ bool nfc_playlist_main_menu_scene_on_event(void* context, SceneManagerEvent even
                     scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_EmulatingPopup);
                     consumed = true;
                     break;
+                case NfcPlaylistEvent_ShowFileSelect:
+                    scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_FileSelect);
+                    consumed = true;
+                    break;
                 case NfcPlaylistEvent_ShowSettings:
                     scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_Settings);
                     consumed = true;

+ 2 - 2
scences/settings.c

@@ -8,7 +8,7 @@ typedef enum {
     NfcPlaylistSettings_Reset
 } NfcPlaylistMenuSelection;
 
-static void nfc_playlist_menu_callback(void* context, uint32_t index) {
+static void nfc_playlist_settings_menu_callback(void* context, uint32_t index) {
     NfcPlaylist* nfc_playlist = context;
     switch(index) {
         case NfcPlaylistSettings_Reset:
@@ -103,7 +103,7 @@ void nfc_playlist_settings_scene_on_enter(void* context) {
 
     variable_item_list_add(nfc_playlist->variable_item_list, "Reset settings", 0, NULL, NULL);
 
-    variable_item_list_set_enter_callback(nfc_playlist->variable_item_list, nfc_playlist_menu_callback, nfc_playlist);
+    variable_item_list_set_enter_callback(nfc_playlist->variable_item_list, nfc_playlist_settings_menu_callback, nfc_playlist);
     view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Settings);
 }