Bladeren bron

SubGHz Playlist: Port changes from firmware

- Improved icon
- Different folder path
- Load from command argument
Willy-JL 1 jaar geleden
bovenliggende
commit
bae8713488

+ 1 - 1
subghz_playlist/application.fam

@@ -6,7 +6,7 @@ App(
     requires=["storage", "gui", "dialogs", "subghz"],
     stack_size=2 * 1024,
     order=14,
-    fap_icon="playlist_10px.png",
+    fap_icon="subplaylist_10px.png",
     fap_category="Sub-GHz",
     fap_icon_assets="images",
     fap_author="@darmiel",

+ 5 - 6
subghz_playlist/playlist.c

@@ -22,7 +22,6 @@
 #include "playlist_file.h"
 #include "canvas_helper.h"
 
-#define PLAYLIST_FOLDER "/ext/subplaylist"
 #define PLAYLIST_EXT ".txt"
 #define TAG "Playlist"
 
@@ -723,9 +722,7 @@ void playlist_free(Playlist* app) {
     free(app);
 }
 
-int32_t playlist_app(void* p) {
-    UNUSED(p);
-
+int32_t playlist_app(char* p) {
     // create playlist folder
     {
         Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -743,11 +740,13 @@ int32_t playlist_app(void* p) {
     furi_hal_power_suppress_charge_enter();
 
     // select playlist file
-    {
+    if(p && strlen(p)) {
+        furi_string_set(app->file_path, p);
+    } else {
         DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
         DialogsFileBrowserOptions browser_options;
         dialog_file_browser_set_basic_options(&browser_options, PLAYLIST_EXT, &I_sub1_10px);
-        browser_options.hide_ext = false;
+        browser_options.base_path = PLAYLIST_FOLDER;
 
         const bool res =
             dialog_file_browser_show(dialogs, app->file_path, app->file_path, &browser_options);

BIN
subghz_playlist/playlist_10px.png


+ 2 - 0
subghz_playlist/playlist_file.h

@@ -4,4 +4,6 @@
 
 #include <storage/storage.h>
 
+#define PLAYLIST_FOLDER EXT_PATH("subghz/playlist")
+
 int playlist_count_playlist_items(Storage* storage, const char* file_path);

BIN
subghz_playlist/subplaylist_10px.png