forked from flipperdevices/flipperzero-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "nfc_playlist.h" | ||
#include "scences/view_playlist_content.h" | ||
|
||
void nfc_playlist_view_playlist_content_scene_on_enter(void* context) { | ||
NfcPlaylist* nfc_playlist = context; | ||
|
||
Storage* storage = furi_record_open(RECORD_STORAGE); | ||
File* file = storage_file_alloc(storage); | ||
uint8_t buffer[8000]; | ||
FuriString* playlist_content = furi_string_alloc(); | ||
|
||
storage_file_open(file, furi_string_get_cstr(nfc_playlist->settings.file_path), FSAM_READ, FSOM_OPEN_EXISTING); | ||
uint16_t read_count = storage_file_read(file, buffer, 8000); | ||
|
||
for(uint16_t i = 0; i < read_count; i++) { | ||
furi_string_push_back(playlist_content, buffer[i]); | ||
} | ||
|
||
widget_add_text_scroll_element(nfc_playlist->widget, 4, 4, 124, 60, furi_string_get_cstr(playlist_content)); | ||
widget_add_frame_element(nfc_playlist->widget, 0, 0, 128, 64, 0); | ||
|
||
furi_string_free(playlist_content); | ||
storage_file_close(file); | ||
storage_file_free(file); | ||
furi_record_close(RECORD_STORAGE); | ||
|
||
view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_ViewPlaylistContent); | ||
} | ||
|
||
bool nfc_playlist_view_playlist_content_scene_on_event(void* context, SceneManagerEvent event) { | ||
UNUSED(context); | ||
UNUSED(event); | ||
return false; | ||
} | ||
|
||
void nfc_playlist_view_playlist_content_scene_on_exit(void* context) { | ||
NfcPlaylist* nfc_playlist = context; | ||
widget_reset(nfc_playlist->widget); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
#include <furi.h> | ||
#include <gui/view_dispatcher.h> | ||
#include <gui/scene_manager.h> | ||
#include <gui/modules/widget.h> | ||
#include <storage/storage.h> | ||
|
||
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); |