Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Music player, picopass: assets integration (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: hedger <[email protected]>
Co-authored-by: あく <[email protected]>
  • Loading branch information
3 people authored Aug 22, 2023
1 parent fca2fde commit 1cce06c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ App(
fap_description="An app to play RTTL music files",
fap_icon_assets="icons",
fap_libs=["music_worker"],
fap_file_assets="files"
)
6 changes: 6 additions & 0 deletions files/Marble_Machine.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Filetype: Flipper Music Format
Version: 0
BPM: 130
Duration: 8
Octave: 5
Notes: E6, P, E, B, 4P, E, A, G, A, E, B, P, G, A, D6, 4P, D, B, 4P, D, A, G, A, D, F#, P, G, A, D6, 4P, F#, B, 4P, F#, D6, C6, B, F#, A, P, G, F#, E, P, C, E, B, B4, C, D, D6, C6, B, F#, A, P, G, A, E6, 4P, E, B, 4P, E, A, G, A, E, B, P, G, A, D6, 4P, D, B, 4P, D, A, G, A, D, F#, P, G, A, D6, 4P, F#, B, 4P, F#, D6, C6, B, F#, A, P, G, F#, E, P, C, E, B, B4, C, D, D6, C6, B, F#, A, P, G, A, E6
8 changes: 8 additions & 0 deletions music_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define TAG "MusicPlayer"

#define MUSIC_PLAYER_APP_EXTENSION "*"
#define MUSIC_PLAYER_EXAMPLE_FILE "Marble_Machine.fmf"

#define MUSIC_PLAYER_SEMITONE_HISTORY_SIZE 4

Expand Down Expand Up @@ -308,6 +309,13 @@ int32_t music_player_app(void* p) {
Storage* storage = furi_record_open(RECORD_STORAGE);
storage_common_migrate(
storage, EXT_PATH("music_player"), STORAGE_APP_DATA_PATH_PREFIX);

if(!storage_common_exists(storage, APP_DATA_PATH(MUSIC_PLAYER_EXAMPLE_FILE))) {
storage_common_copy(
storage,
APP_ASSETS_PATH(MUSIC_PLAYER_EXAMPLE_FILE),
APP_DATA_PATH(MUSIC_PLAYER_EXAMPLE_FILE));
}
furi_record_close(RECORD_STORAGE);

furi_string_set(file_path, STORAGE_APP_DATA_PATH_PREFIX);
Expand Down

0 comments on commit 1cce06c

Please sign in to comment.