From 8ad052b916d9056286a53d288485ad63f4db92ff Mon Sep 17 00:00:00 2001 From: acegoal07 Date: Thu, 11 Apr 2024 14:57:08 +0100 Subject: [PATCH 1/2] new scene manager - This is to make adding new scenes easier and also to reduce how many files there are in the source code of the app --- application.fam | 3 - lib/led/nfc_playlist_led.c | 42 --------- lib/led/nfc_playlist_led.h | 11 --- nfc_playlist.c | 90 +++++++++---------- nfc_playlist.h | 33 +++---- nfc_playlist_i.h | 11 --- scenes/confirm_delete.h | 10 --- scenes/emulation.h | 20 ----- scenes/file_edit.h | 17 ---- scenes/file_rename.h | 10 --- scenes/main_menu.h | 23 ----- scenes/name_new_file.h | 10 --- scenes/nfc_playlist_scene.c | 30 +++++++ scenes/nfc_playlist_scene.h | 29 ++++++ scenes/nfc_playlist_scene_config.h | 10 +++ ....c => nfc_playlist_scene_confirm_delete.c} | 3 +- ...ation.c => nfc_playlist_scene_emulation.c} | 9 +- ..._edit.c => nfc_playlist_scene_file_edit.c} | 11 ++- ...ame.c => nfc_playlist_scene_file_rename.c} | 3 +- ..._menu.c => nfc_playlist_scene_main_menu.c} | 17 +++- ...e.c => nfc_playlist_scene_name_new_file.c} | 3 +- ...lect.c => nfc_playlist_scene_nfc_select.c} | 5 +- ...c => nfc_playlist_scene_playlist_select.c} | 3 +- ...ttings.c => nfc_playlist_scene_settings.c} | 10 ++- ...fc_playlist_scene_view_playlist_content.c} | 5 +- scenes/nfc_select.h | 12 --- scenes/playlist_select.h | 9 -- scenes/settings.h | 16 ---- scenes/view_playlist_content.h | 12 --- 29 files changed, 177 insertions(+), 290 deletions(-) delete mode 100644 lib/led/nfc_playlist_led.c delete mode 100644 lib/led/nfc_playlist_led.h delete mode 100644 nfc_playlist_i.h delete mode 100644 scenes/confirm_delete.h delete mode 100644 scenes/emulation.h delete mode 100644 scenes/file_edit.h delete mode 100644 scenes/file_rename.h delete mode 100644 scenes/main_menu.h delete mode 100644 scenes/name_new_file.h create mode 100644 scenes/nfc_playlist_scene.c create mode 100644 scenes/nfc_playlist_scene.h create mode 100644 scenes/nfc_playlist_scene_config.h rename scenes/{confirm_delete.c => nfc_playlist_scene_confirm_delete.c} (97%) rename scenes/{emulation.c => nfc_playlist_scene_emulation.c} (97%) rename scenes/{file_edit.c => nfc_playlist_scene_file_edit.c} (91%) rename scenes/{file_rename.c => nfc_playlist_scene_file_rename.c} (97%) rename scenes/{main_menu.c => nfc_playlist_scene_main_menu.c} (87%) rename scenes/{name_new_file.c => nfc_playlist_scene_name_new_file.c} (96%) rename scenes/{nfc_select.c => nfc_playlist_scene_nfc_select.c} (97%) rename scenes/{playlist_select.c => nfc_playlist_scene_playlist_select.c} (95%) rename scenes/{settings.c => nfc_playlist_scene_settings.c} (96%) rename scenes/{view_playlist_content.c => nfc_playlist_scene_view_playlist_content.c} (95%) delete mode 100644 scenes/nfc_select.h delete mode 100644 scenes/playlist_select.h delete mode 100644 scenes/settings.h delete mode 100644 scenes/view_playlist_content.h diff --git a/application.fam b/application.fam index 74c9c673690..f969f9dc50d 100644 --- a/application.fam +++ b/application.fam @@ -14,8 +14,5 @@ App( Lib( name="worker", ), - Lib( - name="led", - ), ], ) diff --git a/lib/led/nfc_playlist_led.c b/lib/led/nfc_playlist_led.c deleted file mode 100644 index 6411f185335..00000000000 --- a/lib/led/nfc_playlist_led.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "nfc_playlist_led.h" - -NotificationMessage blink_message_normal = { - .type = NotificationMessageTypeLedBlinkStart, - .data.led_blink.color = LightBlue | LightGreen, - .data.led_blink.on_time = 10, - .data.led_blink.period = 100 -}; -const NotificationSequence blink_sequence_normal = { - &blink_message_normal, - &message_do_not_reset, - NULL -}; - -NotificationMessage blink_message_error = { - .type = NotificationMessageTypeLedBlinkStart, - .data.led_blink.color = LightRed, - .data.led_blink.on_time = 10, - .data.led_blink.period = 100 -}; - -const NotificationSequence blink_sequence_error = { - &blink_message_error, - &message_do_not_reset, - NULL -}; - -void start_blink(NfcPlaylist* nfc_playlist, int state) { - if (nfc_playlist->settings.emulate_led_indicator) { - if (state == NfcPlaylistLedState_Normal) { - notification_message_block(nfc_playlist->notification, &blink_sequence_normal); - } else if (state == NfcPlaylistLedState_Error) { - notification_message_block(nfc_playlist->notification, &blink_sequence_error); - } - } -} - -void stop_blink(NfcPlaylist* nfc_playlist) { - if (nfc_playlist->settings.emulate_led_indicator) { - notification_message_block(nfc_playlist->notification, &sequence_blink_stop); - } -} \ No newline at end of file diff --git a/lib/led/nfc_playlist_led.h b/lib/led/nfc_playlist_led.h deleted file mode 100644 index 5864ccad322..00000000000 --- a/lib/led/nfc_playlist_led.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include <../../nfc_playlist.h> -#include - -typedef enum NfcPlaylistLedState { - NfcPlaylistLedState_Normal, - NfcPlaylistLedState_Error -} NfcPlaylistLedState; - -void start_blink(NfcPlaylist* nfc_playlist, int state); -void stop_blink(NfcPlaylist* nfc_playlist); \ No newline at end of file diff --git a/nfc_playlist.c b/nfc_playlist.c index acbe6216dc9..9151a7e852c 100644 --- a/nfc_playlist.c +++ b/nfc_playlist.c @@ -1,51 +1,4 @@ #include "nfc_playlist.h" -#include "nfc_playlist_i.h" - -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_playlist_select_scene_on_enter, - nfc_playlist_file_edit_scene_on_enter, - nfc_playlist_file_rename_scene_on_enter, - nfc_playlist_confirm_delete_scene_on_enter, - nfc_playlist_view_playlist_content_scene_on_enter, - nfc_playlist_nfc_select_scene_on_enter, - nfc_playlist_name_new_file_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_playlist_select_scene_on_event, - nfc_playlist_file_edit_scene_on_event, - nfc_playlist_file_rename_scene_on_event, - nfc_playlist_confirm_delete_scene_on_event, - nfc_playlist_view_playlist_content_scene_on_event, - nfc_playlist_nfc_select_scene_on_event, - nfc_playlist_name_new_file_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_playlist_select_scene_on_exit, - nfc_playlist_file_edit_scene_on_exit, - nfc_playlist_file_rename_scene_on_exit, - nfc_playlist_confirm_delete_scene_on_exit, - nfc_playlist_view_playlist_content_scene_on_exit, - nfc_playlist_nfc_select_scene_on_exit, - nfc_playlist_name_new_file_scene_on_exit -}; - -static const SceneManagerHandlers nfc_playlist_scene_manager_handlers = { - .on_enter_handlers = nfc_playlist_scene_on_enter_handlers, - .on_event_handlers = nfc_playlist_scene_on_event_handlers, - .on_exit_handlers = nfc_playlist_scene_on_exit_handlers, - .scene_num = NfcPlaylistScene_count -}; static bool nfc_playlist_custom_callback(void* context, uint32_t custom_event) { furi_assert(context); @@ -62,7 +15,7 @@ static bool nfc_playlist_back_event_callback(void* context) { static NfcPlaylist* nfc_playlist_alloc() { NfcPlaylist* nfc_playlist = malloc(sizeof(NfcPlaylist)); furi_assert(nfc_playlist); - nfc_playlist->scene_manager = scene_manager_alloc(&nfc_playlist_scene_manager_handlers, nfc_playlist); + nfc_playlist->scene_manager = scene_manager_alloc(&nfc_playlist_scene_handlers, nfc_playlist); nfc_playlist->view_dispatcher = view_dispatcher_alloc(); view_dispatcher_enable_queue(nfc_playlist->view_dispatcher); nfc_playlist->variable_item_list = variable_item_list_alloc(); @@ -161,4 +114,45 @@ int32_t nfc_playlist_main(void* p) { nfc_playlist_free(nfc_playlist); return 0; +} + +NotificationMessage blink_message_normal = { + .type = NotificationMessageTypeLedBlinkStart, + .data.led_blink.color = LightBlue | LightGreen, + .data.led_blink.on_time = 10, + .data.led_blink.period = 100 +}; +const NotificationSequence blink_sequence_normal = { + &blink_message_normal, + &message_do_not_reset, + NULL +}; + +NotificationMessage blink_message_error = { + .type = NotificationMessageTypeLedBlinkStart, + .data.led_blink.color = LightRed, + .data.led_blink.on_time = 10, + .data.led_blink.period = 100 +}; + +const NotificationSequence blink_sequence_error = { + &blink_message_error, + &message_do_not_reset, + NULL +}; + +void start_blink(NfcPlaylist* nfc_playlist, int state) { + if (nfc_playlist->settings.emulate_led_indicator) { + if (state == NfcPlaylistLedState_Normal) { + notification_message_block(nfc_playlist->notification, &blink_sequence_normal); + } else if (state == NfcPlaylistLedState_Error) { + notification_message_block(nfc_playlist->notification, &blink_sequence_error); + } + } +} + +void stop_blink(NfcPlaylist* nfc_playlist) { + if (nfc_playlist->settings.emulate_led_indicator) { + notification_message_block(nfc_playlist->notification, &sequence_blink_stop); + } } \ No newline at end of file diff --git a/nfc_playlist.h b/nfc_playlist.h index 5ccedfdbf7a..8c66aa3060d 100644 --- a/nfc_playlist.h +++ b/nfc_playlist.h @@ -19,7 +19,14 @@ #include -#include +#include + +#include +#include + +#include "lib/worker/nfc_playlist_worker.h" + +#include "scenes/nfc_playlist_scene.h" typedef enum { NfcPlaylistView_Menu, @@ -34,20 +41,6 @@ typedef enum { NfcPlaylistView_NameNewFile } NfcPlayScenesView; -typedef enum { - NfcPlaylistScene_MainMenu, - NfcPlaylistScene_Settings, - NfcPlaylistScene_EmulatingPopup, - NfcPlaylistScene_PlaylistSelect, - NfcPlaylistScene_FileEdit, - NfcPlaylistScene_FileRename, - NfcPlaylistScene_ConfirmDelete, - NfcPlaylistScene_ViewPlaylistContent, - NfcPlaylistScene_NfcSelect, - NfcPlaylistScene_NameNewFile, - NfcPlaylistScene_count -} NfcPlaylistScene; - typedef struct { FuriString* file_path; bool playlist_selected; @@ -81,4 +74,12 @@ static const int default_emulate_delay = 0; static const bool default_emulate_led_indicator = true; #define PLAYLIST_LOCATION "/ext/apps_data/nfc_playlist/" -#define PLAYLIST_DIR "/ext/apps_data/nfc_playlist" \ No newline at end of file +#define PLAYLIST_DIR "/ext/apps_data/nfc_playlist" + +typedef enum NfcPlaylistLedState { + NfcPlaylistLedState_Normal, + NfcPlaylistLedState_Error +} NfcPlaylistLedState; + +void start_blink(NfcPlaylist* nfc_playlist, int state); +void stop_blink(NfcPlaylist* nfc_playlist); \ No newline at end of file diff --git a/nfc_playlist_i.h b/nfc_playlist_i.h deleted file mode 100644 index fbfa9612564..00000000000 --- a/nfc_playlist_i.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include "scenes/main_menu.h" -#include "scenes/settings.h" -#include "scenes/emulation.h" -#include "scenes/playlist_select.h" -#include "scenes/file_edit.h" -#include "scenes/file_rename.h" -#include "scenes/confirm_delete.h" -#include "scenes/view_playlist_content.h" -#include "scenes/nfc_select.h" -#include "scenes/name_new_file.h" \ No newline at end of file diff --git a/scenes/confirm_delete.h b/scenes/confirm_delete.h deleted file mode 100644 index 6a990db97f2..00000000000 --- a/scenes/confirm_delete.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -void nfc_playlist_confirm_delete_scene_on_enter(void* context); -bool nfc_playlist_confirm_delete_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_confirm_delete_scene_on_exit(void* context); \ No newline at end of file diff --git a/scenes/emulation.h b/scenes/emulation.h deleted file mode 100644 index 6ec765aac78..00000000000 --- a/scenes/emulation.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void nfc_playlist_emulation_scene_on_enter(void* context); -bool nfc_playlist_emulation_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_emulation_scene_on_exit(void* context); - -typedef enum NfcPlaylistEmulationState { - NfcPlaylistEmulationState_Emulating, - NfcPlaylistEmulationState_Stopped, - NfcPlaylistEmulationState_Canceled -} NfcPlaylistEmulationState; \ No newline at end of file diff --git a/scenes/file_edit.h b/scenes/file_edit.h deleted file mode 100644 index 43578343221..00000000000 --- a/scenes/file_edit.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include -#include -#include -#include - -void nfc_playlist_file_edit_scene_on_enter(void* context); -bool nfc_playlist_file_edit_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_file_edit_scene_on_exit(void* context); - -typedef enum { - NfcPlaylistMenuSelection_CreatePlaylist, - NfcPlaylistMenuSelection_DeletePlaylist, - NfcPlaylistMenuSelection_RenamePlaylist, - NfcPlaylistMenuSelection_ViewPlaylistContent, - NfcPlaylistMenuSelection_AddNfcItem -} NfcPlaylistFileEditMenuSelection; \ No newline at end of file diff --git a/scenes/file_rename.h b/scenes/file_rename.h deleted file mode 100644 index b4ff8aa23e3..00000000000 --- a/scenes/file_rename.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -void nfc_playlist_file_rename_scene_on_enter(void* context); -bool nfc_playlist_file_rename_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_file_rename_scene_on_exit(void* context); \ No newline at end of file diff --git a/scenes/main_menu.h b/scenes/main_menu.h deleted file mode 100644 index a74c4c6e769..00000000000 --- a/scenes/main_menu.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include -#include -#include -#include - -void nfc_playlist_main_menu_scene_on_enter(void* context); -bool nfc_playlist_main_menu_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_main_menu_scene_on_exit(void* context); - -typedef enum { - NfcPlaylistEvent_ShowEmulatingPopup, - NfcPlaylistEvent_ShowPlaylistSelect, - NfcPlaylistEvent_ShowFileEdit, - NfcPlaylistEvent_ShowSettings -} NfcPlaylistMainMenuEvent; - -typedef enum { - NfcPlaylistMenuSelection_Start, - NfcPlaylistMenuSelection_PlaylistSelect, - NfcPlaylistMenuSelection_FileEdit, - NfcPlaylistMenuSelection_Settings -} NfcPlaylistMainMenuMenuSelection; \ No newline at end of file diff --git a/scenes/name_new_file.h b/scenes/name_new_file.h deleted file mode 100644 index d0a061a539a..00000000000 --- a/scenes/name_new_file.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -void nfc_playlist_name_new_file_scene_on_enter(void* context); -bool nfc_playlist_name_new_file_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_name_new_file_scene_on_exit(void* context); \ No newline at end of file diff --git a/scenes/nfc_playlist_scene.c b/scenes/nfc_playlist_scene.c new file mode 100644 index 00000000000..aed28723565 --- /dev/null +++ b/scenes/nfc_playlist_scene.c @@ -0,0 +1,30 @@ +#include "nfc_playlist_scene.h" + +// Generate scene on_enter handlers definition +#define ADD_SCENE(prefix, name, id) prefix##_##name##_scene_on_enter, +void (*const nfc_playlist_on_enter_handlers[])(void*) = { +#include "nfc_playlist_scene_config.h" +}; +#undef ADD_SCENE + +// Generate scene on_event handlers array +#define ADD_SCENE(prefix, name, id) prefix##_##name##_scene_on_event, +bool (*const nfc_playlist_on_event_handlers[])(void* context, SceneManagerEvent event) = { +#include "nfc_playlist_scene_config.h" +}; +#undef ADD_SCENE + +// Generate scene on_exit handlers array +#define ADD_SCENE(prefix, name, id) prefix##_##name##_scene_on_exit, +void (*const nfc_playlist_on_exit_handlers[])(void* context) = { +#include "nfc_playlist_scene_config.h" +}; +#undef ADD_SCENE + +// Initialize scene handlers configuration structure +const SceneManagerHandlers nfc_playlist_scene_handlers = { + .on_enter_handlers = nfc_playlist_on_enter_handlers, + .on_event_handlers = nfc_playlist_on_event_handlers, + .on_exit_handlers = nfc_playlist_on_exit_handlers, + .scene_num = NfcPlaylistScene_Count, +}; \ No newline at end of file diff --git a/scenes/nfc_playlist_scene.h b/scenes/nfc_playlist_scene.h new file mode 100644 index 00000000000..e2d90753089 --- /dev/null +++ b/scenes/nfc_playlist_scene.h @@ -0,0 +1,29 @@ +#pragma once + +#include + +// Generate scene id and total number +#define ADD_SCENE(prefix, name, id) NfcPlaylistScene_##id, +typedef enum { +#include "nfc_playlist_scene_config.h" + NfcPlaylistScene_Count +} NfcPlaylistScene; +#undef ADD_SCENE + +extern const SceneManagerHandlers nfc_playlist_scene_handlers; + +// Generate scene on_enter handlers declaration +#define ADD_SCENE(prefix, name, id) void prefix##_##name##_scene_on_enter(void*); +#include "nfc_playlist_scene_config.h" +#undef ADD_SCENE + +// Generate scene on_event handlers declaration +#define ADD_SCENE(prefix, name, id) \ + bool prefix##_##name##_scene_on_event(void* context, SceneManagerEvent event); +#include "nfc_playlist_scene_config.h" +#undef ADD_SCENE + +// Generate scene on_exit handlers declaration +#define ADD_SCENE(prefix, name, id) void prefix##_##name##_scene_on_exit(void* context); +#include "nfc_playlist_scene_config.h" +#undef ADD_SCENE \ No newline at end of file diff --git a/scenes/nfc_playlist_scene_config.h b/scenes/nfc_playlist_scene_config.h new file mode 100644 index 00000000000..e77695f0655 --- /dev/null +++ b/scenes/nfc_playlist_scene_config.h @@ -0,0 +1,10 @@ +ADD_SCENE(nfc_playlist, confirm_delete, ConfirmDelete) +ADD_SCENE(nfc_playlist, emulation, EmulatingPopup) +ADD_SCENE(nfc_playlist, file_edit, FileEdit) +ADD_SCENE(nfc_playlist, file_rename, FileRename) +ADD_SCENE(nfc_playlist, main_menu, MainMenu) +ADD_SCENE(nfc_playlist, name_new_file, NameNewFile) +ADD_SCENE(nfc_playlist, nfc_select, NfcSelect) +ADD_SCENE(nfc_playlist, playlist_select, PlaylistSelect) +ADD_SCENE(nfc_playlist, settings, Settings) +ADD_SCENE(nfc_playlist, view_playlist_content, ViewPlaylistContent) \ No newline at end of file diff --git a/scenes/confirm_delete.c b/scenes/nfc_playlist_scene_confirm_delete.c similarity index 97% rename from scenes/confirm_delete.c rename to scenes/nfc_playlist_scene_confirm_delete.c index e01d67c5d5b..2b48e5f3bb9 100644 --- a/scenes/confirm_delete.c +++ b/scenes/nfc_playlist_scene_confirm_delete.c @@ -1,5 +1,4 @@ -#include "nfc_playlist.h" -#include "scenes/confirm_delete.h" +#include "../nfc_playlist.h" void nfc_playlist_confirm_delete_menu_callback(GuiButtonType result, InputType type, void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/emulation.c b/scenes/nfc_playlist_scene_emulation.c similarity index 97% rename from scenes/emulation.c rename to scenes/nfc_playlist_scene_emulation.c index 978e795339f..4f77796b234 100644 --- a/scenes/emulation.c +++ b/scenes/nfc_playlist_scene_emulation.c @@ -1,5 +1,10 @@ -#include "nfc_playlist.h" -#include "scenes/emulation.h" +#include "../nfc_playlist.h" + +typedef enum NfcPlaylistEmulationState { + NfcPlaylistEmulationState_Emulating, + NfcPlaylistEmulationState_Stopped, + NfcPlaylistEmulationState_Canceled +} NfcPlaylistEmulationState; NfcPlaylistEmulationState EmulationState = NfcPlaylistEmulationState_Stopped; diff --git a/scenes/file_edit.c b/scenes/nfc_playlist_scene_file_edit.c similarity index 91% rename from scenes/file_edit.c rename to scenes/nfc_playlist_scene_file_edit.c index e3d35a2effa..25849ee60f0 100644 --- a/scenes/file_edit.c +++ b/scenes/nfc_playlist_scene_file_edit.c @@ -1,5 +1,12 @@ -#include "nfc_playlist.h" -#include "scenes/file_edit.h" +#include "../nfc_playlist.h" + +typedef enum { + NfcPlaylistMenuSelection_CreatePlaylist, + NfcPlaylistMenuSelection_DeletePlaylist, + NfcPlaylistMenuSelection_RenamePlaylist, + NfcPlaylistMenuSelection_ViewPlaylistContent, + NfcPlaylistMenuSelection_AddNfcItem +} NfcPlaylistFileEditMenuSelection; void nfc_playlist_file_edit_menu_callback(void* context, uint32_t index) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/file_rename.c b/scenes/nfc_playlist_scene_file_rename.c similarity index 97% rename from scenes/file_rename.c rename to scenes/nfc_playlist_scene_file_rename.c index 3ded301c663..c5f1c53757b 100644 --- a/scenes/file_rename.c +++ b/scenes/nfc_playlist_scene_file_rename.c @@ -1,5 +1,4 @@ -#include "nfc_playlist.h" -#include "scenes/file_rename.h" +#include "../nfc_playlist.h" void nfc_playlist_file_rename_menu_callback(void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/main_menu.c b/scenes/nfc_playlist_scene_main_menu.c similarity index 87% rename from scenes/main_menu.c rename to scenes/nfc_playlist_scene_main_menu.c index c744937a2ae..d39a6fa880e 100644 --- a/scenes/main_menu.c +++ b/scenes/nfc_playlist_scene_main_menu.c @@ -1,5 +1,18 @@ -#include "nfc_playlist.h" -#include "scenes/main_menu.h" +#include "../nfc_playlist.h" + +typedef enum { + NfcPlaylistEvent_ShowEmulatingPopup, + NfcPlaylistEvent_ShowPlaylistSelect, + NfcPlaylistEvent_ShowFileEdit, + NfcPlaylistEvent_ShowSettings +} NfcPlaylistMainMenuEvent; + +typedef enum { + NfcPlaylistMenuSelection_Start, + NfcPlaylistMenuSelection_PlaylistSelect, + NfcPlaylistMenuSelection_FileEdit, + NfcPlaylistMenuSelection_Settings +} NfcPlaylistMainMenuMenuSelection; void nfc_playlist_main_menu_menu_callback(void* context, uint32_t index) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/name_new_file.c b/scenes/nfc_playlist_scene_name_new_file.c similarity index 96% rename from scenes/name_new_file.c rename to scenes/nfc_playlist_scene_name_new_file.c index 20c7e592e35..1746dd3c009 100644 --- a/scenes/name_new_file.c +++ b/scenes/nfc_playlist_scene_name_new_file.c @@ -1,5 +1,4 @@ -#include "nfc_playlist.h" -#include "scenes/name_new_file.h" +#include "../nfc_playlist.h" void nfc_playlist_name_new_file_menu_callback(void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/nfc_select.c b/scenes/nfc_playlist_scene_nfc_select.c similarity index 97% rename from scenes/nfc_select.c rename to scenes/nfc_playlist_scene_nfc_select.c index 3698cc29fa6..59af5374ef2 100644 --- a/scenes/nfc_select.c +++ b/scenes/nfc_playlist_scene_nfc_select.c @@ -1,5 +1,6 @@ -#include "nfc_playlist.h" -#include "scenes/nfc_select.h" +#include "../nfc_playlist.h" + +#define MAX_PLAYLIST_SIZE 1000 void nfc_playlist_nfc_select_menu_callback(void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/playlist_select.c b/scenes/nfc_playlist_scene_playlist_select.c similarity index 95% rename from scenes/playlist_select.c rename to scenes/nfc_playlist_scene_playlist_select.c index 9b169b608db..5631eb83c6b 100644 --- a/scenes/playlist_select.c +++ b/scenes/nfc_playlist_scene_playlist_select.c @@ -1,5 +1,4 @@ -#include "nfc_playlist.h" -#include "scenes/playlist_select.h" +#include "../nfc_playlist.h" void nfc_playlist_playlist_select_menu_callback(void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/settings.c b/scenes/nfc_playlist_scene_settings.c similarity index 96% rename from scenes/settings.c rename to scenes/nfc_playlist_scene_settings.c index 27b2dde3791..7ea1bcb7720 100644 --- a/scenes/settings.c +++ b/scenes/nfc_playlist_scene_settings.c @@ -1,5 +1,11 @@ -#include "nfc_playlist.h" -#include "scenes/settings.h" +#include "../nfc_playlist.h" + +typedef enum { + NfcPlaylistSettings_Timeout, + NfcPlaylistSettings_Delay, + NfcPlaylistSettings_LedIndicator, + NfcPlaylistSettings_Reset +} NfcPlaylistSettingsMenuSelection; void nfc_playlist_settings_menu_callback(void* context, uint32_t index) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/view_playlist_content.c b/scenes/nfc_playlist_scene_view_playlist_content.c similarity index 95% rename from scenes/view_playlist_content.c rename to scenes/nfc_playlist_scene_view_playlist_content.c index 14cba39516c..d30bb5c2e37 100644 --- a/scenes/view_playlist_content.c +++ b/scenes/nfc_playlist_scene_view_playlist_content.c @@ -1,5 +1,6 @@ -#include "nfc_playlist.h" -#include "scenes/view_playlist_content.h" +#include "../nfc_playlist.h" + +#define MAX_PLAYLIST_SIZE 1000 void nfc_playlist_view_playlist_content_scene_on_enter(void* context) { NfcPlaylist* nfc_playlist = context; diff --git a/scenes/nfc_select.h b/scenes/nfc_select.h deleted file mode 100644 index 3c179327633..00000000000 --- a/scenes/nfc_select.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -void nfc_playlist_nfc_select_scene_on_enter(void* context); -bool nfc_playlist_nfc_select_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_nfc_select_scene_on_exit(void* context); - -#define MAX_PLAYLIST_SIZE 1000 \ No newline at end of file diff --git a/scenes/playlist_select.h b/scenes/playlist_select.h deleted file mode 100644 index 0d22363a241..00000000000 --- a/scenes/playlist_select.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include -#include -#include -#include - -void nfc_playlist_playlist_select_scene_on_enter(void* context); -bool nfc_playlist_playlist_select_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_playlist_select_scene_on_exit(void* context); \ No newline at end of file diff --git a/scenes/settings.h b/scenes/settings.h deleted file mode 100644 index ecb8a933caf..00000000000 --- a/scenes/settings.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include -#include -#include -#include - -void nfc_playlist_settings_scene_on_enter(void* context); -bool nfc_playlist_settings_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_settings_scene_on_exit(void* context); - -typedef enum { - NfcPlaylistSettings_Timeout, - NfcPlaylistSettings_Delay, - NfcPlaylistSettings_LedIndicator, - NfcPlaylistSettings_Reset -} NfcPlaylistSettingsMenuSelection; \ No newline at end of file diff --git a/scenes/view_playlist_content.h b/scenes/view_playlist_content.h deleted file mode 100644 index 45c28be0ef3..00000000000 --- a/scenes/view_playlist_content.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -void nfc_playlist_view_playlist_content_scene_on_enter(void* context); -bool nfc_playlist_view_playlist_content_scene_on_event(void* context, SceneManagerEvent event); -void nfc_playlist_view_playlist_content_scene_on_exit(void* context); - -#define MAX_PLAYLIST_SIZE 1000 \ No newline at end of file From cd66660cd20780010d313667ea6a7baf043703be Mon Sep 17 00:00:00 2001 From: acegoal07 Date: Thu, 11 Apr 2024 15:06:04 +0100 Subject: [PATCH 2/2] Further cut backs --- nfc_playlist.c | 40 +++++++++---------- nfc_playlist.h | 13 ------ scenes/nfc_playlist_scene_config.h | 2 +- scenes/nfc_playlist_scene_confirm_delete.c | 2 +- scenes/nfc_playlist_scene_emulation.c | 2 +- scenes/nfc_playlist_scene_file_edit.c | 2 +- scenes/nfc_playlist_scene_file_rename.c | 2 +- scenes/nfc_playlist_scene_main_menu.c | 8 ++-- scenes/nfc_playlist_scene_name_new_file.c | 2 +- scenes/nfc_playlist_scene_nfc_select.c | 2 +- scenes/nfc_playlist_scene_playlist_select.c | 2 +- scenes/nfc_playlist_scene_settings.c | 2 +- ...nfc_playlist_scene_view_playlist_content.c | 2 +- 13 files changed, 34 insertions(+), 47 deletions(-) diff --git a/nfc_playlist.c b/nfc_playlist.c index 9151a7e852c..05fa6a5c724 100644 --- a/nfc_playlist.c +++ b/nfc_playlist.c @@ -39,16 +39,16 @@ static NfcPlaylist* nfc_playlist_alloc() { view_dispatcher_set_event_callback_context(nfc_playlist->view_dispatcher, nfc_playlist); view_dispatcher_set_custom_event_callback(nfc_playlist->view_dispatcher, nfc_playlist_custom_callback); 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_PlaylistSelect, file_browser_get_view(nfc_playlist->playlist_file_browser)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileEdit, submenu_get_view(nfc_playlist->submenu)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileRename, text_input_get_view(nfc_playlist->text_input)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ConfirmDelete, widget_get_view(nfc_playlist->widget)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ViewPlaylistContent, widget_get_view(nfc_playlist->widget)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_NfcSelect, file_browser_get_view(nfc_playlist->nfc_file_browser)); - view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_NameNewFile, text_input_get_view(nfc_playlist->text_input)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_MainMenu, submenu_get_view(nfc_playlist->submenu)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Settings, variable_item_list_get_view(nfc_playlist->variable_item_list)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Emulation, popup_get_view(nfc_playlist->popup)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_PlaylistSelect, file_browser_get_view(nfc_playlist->playlist_file_browser)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileEdit, submenu_get_view(nfc_playlist->submenu)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileRename, text_input_get_view(nfc_playlist->text_input)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ConfirmDelete, widget_get_view(nfc_playlist->widget)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ViewPlaylistContent, widget_get_view(nfc_playlist->widget)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_NfcSelect, file_browser_get_view(nfc_playlist->nfc_file_browser)); + view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_NameNewFile, text_input_get_view(nfc_playlist->text_input)); Storage* storage = furi_record_open(RECORD_STORAGE); if (!storage_common_exists(storage, PLAYLIST_DIR)) { @@ -62,16 +62,16 @@ static NfcPlaylist* nfc_playlist_alloc() { static void nfc_playlist_free(NfcPlaylist* nfc_playlist) { furi_assert(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_PlaylistSelect); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileEdit); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileRename); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ConfirmDelete); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ViewPlaylistContent); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_NfcSelect); - view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistView_NameNewFile); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_MainMenu); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Settings); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Emulation); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_PlaylistSelect); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileEdit); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileRename); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ConfirmDelete); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ViewPlaylistContent); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_NfcSelect); + view_dispatcher_remove_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_NameNewFile); scene_manager_free(nfc_playlist->scene_manager); view_dispatcher_free(nfc_playlist->view_dispatcher); diff --git a/nfc_playlist.h b/nfc_playlist.h index 8c66aa3060d..ec7d1323ba4 100644 --- a/nfc_playlist.h +++ b/nfc_playlist.h @@ -28,19 +28,6 @@ #include "scenes/nfc_playlist_scene.h" -typedef enum { - NfcPlaylistView_Menu, - NfcPlaylistView_Settings, - NfcPlaylistView_Popup, - NfcPlaylistView_PlaylistSelect, - NfcPlaylistView_FileEdit, - NfcPlaylistView_FileRename, - NfcPlaylistView_ConfirmDelete, - NfcPlaylistView_ViewPlaylistContent, - NfcPlaylistView_NfcSelect, - NfcPlaylistView_NameNewFile -} NfcPlayScenesView; - typedef struct { FuriString* file_path; bool playlist_selected; diff --git a/scenes/nfc_playlist_scene_config.h b/scenes/nfc_playlist_scene_config.h index e77695f0655..c111f6235db 100644 --- a/scenes/nfc_playlist_scene_config.h +++ b/scenes/nfc_playlist_scene_config.h @@ -1,5 +1,5 @@ ADD_SCENE(nfc_playlist, confirm_delete, ConfirmDelete) -ADD_SCENE(nfc_playlist, emulation, EmulatingPopup) +ADD_SCENE(nfc_playlist, emulation, Emulation) ADD_SCENE(nfc_playlist, file_edit, FileEdit) ADD_SCENE(nfc_playlist, file_rename, FileRename) ADD_SCENE(nfc_playlist, main_menu, MainMenu) diff --git a/scenes/nfc_playlist_scene_confirm_delete.c b/scenes/nfc_playlist_scene_confirm_delete.c index 2b48e5f3bb9..09a40356a69 100644 --- a/scenes/nfc_playlist_scene_confirm_delete.c +++ b/scenes/nfc_playlist_scene_confirm_delete.c @@ -21,7 +21,7 @@ void nfc_playlist_confirm_delete_scene_on_enter(void* context) { furi_string_free(temp_str); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ConfirmDelete); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ConfirmDelete); } bool nfc_playlist_confirm_delete_scene_on_event(void* context, SceneManagerEvent event) { diff --git a/scenes/nfc_playlist_scene_emulation.c b/scenes/nfc_playlist_scene_emulation.c index 4f77796b234..e7611650e1a 100644 --- a/scenes/nfc_playlist_scene_emulation.c +++ b/scenes/nfc_playlist_scene_emulation.c @@ -16,7 +16,7 @@ int32_t nfc_playlist_emulation_task(void* context) { popup_reset(nfc_playlist->popup); popup_set_context(nfc_playlist->popup, nfc_playlist); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Popup); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Emulation); if (file_stream_open(stream, furi_string_get_cstr(nfc_playlist->settings.file_path), FSAM_READ, FSOM_OPEN_EXISTING)) { EmulationState = NfcPlaylistEmulationState_Emulating; diff --git a/scenes/nfc_playlist_scene_file_edit.c b/scenes/nfc_playlist_scene_file_edit.c index 25849ee60f0..ad11ed8d504 100644 --- a/scenes/nfc_playlist_scene_file_edit.c +++ b/scenes/nfc_playlist_scene_file_edit.c @@ -61,7 +61,7 @@ void nfc_playlist_file_edit_scene_on_enter(void* context) { furi_string_empty(nfc_playlist->settings.file_path), "No\nplaylist\nselected"); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileEdit); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileEdit); } bool nfc_playlist_file_edit_scene_on_event(void* context, SceneManagerEvent event) { diff --git a/scenes/nfc_playlist_scene_file_rename.c b/scenes/nfc_playlist_scene_file_rename.c index c5f1c53757b..b31ad71e5af 100644 --- a/scenes/nfc_playlist_scene_file_rename.c +++ b/scenes/nfc_playlist_scene_file_rename.c @@ -31,7 +31,7 @@ void nfc_playlist_file_rename_scene_on_enter(void* context) { text_input_set_header_text(nfc_playlist->text_input, "Enter new file name"); text_input_set_minimum_length(nfc_playlist->text_input, 1); text_input_set_result_callback(nfc_playlist->text_input, nfc_playlist_file_rename_menu_callback, nfc_playlist, nfc_playlist->text_input_output, 50, true); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileRename); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileRename); } bool nfc_playlist_file_rename_scene_on_event(void* context, SceneManagerEvent event) { diff --git a/scenes/nfc_playlist_scene_main_menu.c b/scenes/nfc_playlist_scene_main_menu.c index d39a6fa880e..d9d6a691cd2 100644 --- a/scenes/nfc_playlist_scene_main_menu.c +++ b/scenes/nfc_playlist_scene_main_menu.c @@ -1,7 +1,7 @@ #include "../nfc_playlist.h" typedef enum { - NfcPlaylistEvent_ShowEmulatingPopup, + NfcPlaylistEvent_ShowEmulation, NfcPlaylistEvent_ShowPlaylistSelect, NfcPlaylistEvent_ShowFileEdit, NfcPlaylistEvent_ShowSettings @@ -61,7 +61,7 @@ void nfc_playlist_main_menu_scene_on_enter(void* context) { NfcPlaylistMenuSelection_Settings, nfc_playlist_main_menu_menu_callback, nfc_playlist); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Menu); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_MainMenu); } bool nfc_playlist_main_menu_scene_on_event(void* context, SceneManagerEvent event) { @@ -69,8 +69,8 @@ bool nfc_playlist_main_menu_scene_on_event(void* context, SceneManagerEvent even bool consumed = false; if (event.type == SceneManagerEventTypeCustom) { switch(event.event) { - case NfcPlaylistEvent_ShowEmulatingPopup: - scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_EmulatingPopup); + case NfcPlaylistEvent_ShowEmulation: + scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_Emulation); consumed = true; break; case NfcPlaylistEvent_ShowPlaylistSelect: diff --git a/scenes/nfc_playlist_scene_name_new_file.c b/scenes/nfc_playlist_scene_name_new_file.c index 1746dd3c009..29da2684555 100644 --- a/scenes/nfc_playlist_scene_name_new_file.c +++ b/scenes/nfc_playlist_scene_name_new_file.c @@ -24,7 +24,7 @@ void nfc_playlist_name_new_file_scene_on_enter(void* context) { text_input_set_header_text(nfc_playlist->text_input, "Enter file name"); text_input_set_minimum_length(nfc_playlist->text_input, 1); text_input_set_result_callback(nfc_playlist->text_input, nfc_playlist_name_new_file_menu_callback, nfc_playlist, nfc_playlist->text_input_output, 50, true); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileRename); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_FileRename); } bool nfc_playlist_name_new_file_scene_on_event(void* context, SceneManagerEvent event) { diff --git a/scenes/nfc_playlist_scene_nfc_select.c b/scenes/nfc_playlist_scene_nfc_select.c index 59af5374ef2..f726755a20a 100644 --- a/scenes/nfc_playlist_scene_nfc_select.c +++ b/scenes/nfc_playlist_scene_nfc_select.c @@ -42,7 +42,7 @@ void nfc_playlist_nfc_select_scene_on_enter(void* context) { true, &I_Nfc_10px, true); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_PlaylistSelect); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_PlaylistSelect); file_browser_set_callback(nfc_playlist->playlist_file_browser, nfc_playlist_nfc_select_menu_callback, nfc_playlist); FuriString* tmp_str = furi_string_alloc_set_str("/ext/nfc/"); file_browser_start(nfc_playlist->playlist_file_browser, tmp_str); diff --git a/scenes/nfc_playlist_scene_playlist_select.c b/scenes/nfc_playlist_scene_playlist_select.c index 5631eb83c6b..f43a3d1b4ff 100644 --- a/scenes/nfc_playlist_scene_playlist_select.c +++ b/scenes/nfc_playlist_scene_playlist_select.c @@ -17,7 +17,7 @@ void nfc_playlist_playlist_select_scene_on_enter(void* context) { true, &I_Nfc_10px, true); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_PlaylistSelect); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_PlaylistSelect); file_browser_set_callback(nfc_playlist->playlist_file_browser, nfc_playlist_playlist_select_menu_callback, nfc_playlist); FuriString* tmp_str = furi_string_alloc_set_str(PLAYLIST_LOCATION); file_browser_start(nfc_playlist->playlist_file_browser, tmp_str); diff --git a/scenes/nfc_playlist_scene_settings.c b/scenes/nfc_playlist_scene_settings.c index 7ea1bcb7720..25776702c96 100644 --- a/scenes/nfc_playlist_scene_settings.c +++ b/scenes/nfc_playlist_scene_settings.c @@ -80,7 +80,7 @@ void nfc_playlist_settings_scene_on_enter(void* context) { variable_item_set_current_value_text(credits, "Credits"); 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); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_Settings); furi_string_free(tmp_str); } diff --git a/scenes/nfc_playlist_scene_view_playlist_content.c b/scenes/nfc_playlist_scene_view_playlist_content.c index d30bb5c2e37..d48e84cd2a2 100644 --- a/scenes/nfc_playlist_scene_view_playlist_content.c +++ b/scenes/nfc_playlist_scene_view_playlist_content.c @@ -24,7 +24,7 @@ void nfc_playlist_view_playlist_content_scene_on_enter(void* context) { storage_file_free(file); furi_record_close(RECORD_STORAGE); - view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ViewPlaylistContent); + view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistScene_ViewPlaylistContent); } bool nfc_playlist_view_playlist_content_scene_on_event(void* context, SceneManagerEvent event) {