added subghz-playlist to main application menu

This commit is contained in:
jbohack
2023-01-05 13:06:32 -05:00
parent e0d1fa4b34
commit 4f19b0f559
19 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
#include <furi.h>
#include <storage/storage.h>
#include <flipper_format/flipper_format_i.h>
int playlist_count_playlist_items(Storage* storage, const char* file_path) {
FlipperFormat* format = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(format, file_path)) {
return -1;
}
int count = 0;
FuriString* data;
data = furi_string_alloc();
while(flipper_format_read_string(format, "sub", data)) {
++count;
}
flipper_format_file_close(format);
flipper_format_free(format);
furi_string_free(data);
return count;
}