|
@@ -2,78 +2,6 @@
|
|
|
|
|
|
|
|
#include "../diskop.h"
|
|
#include "../diskop.h"
|
|
|
|
|
|
|
|
-void return_from_keyboard_callback(void *ctx)
|
|
|
|
|
-{
|
|
|
|
|
- FlizzerTrackerApp *tracker = (FlizzerTrackerApp *)ctx;
|
|
|
|
|
-
|
|
|
|
|
- if(!tracker->is_loading && !tracker->is_saving)
|
|
|
|
|
- {
|
|
|
|
|
- uint8_t string_length = 0;
|
|
|
|
|
- char *string = NULL;
|
|
|
|
|
-
|
|
|
|
|
- if (tracker->focus == EDIT_SONGINFO && tracker->mode == PATTERN_VIEW)
|
|
|
|
|
- {
|
|
|
|
|
- switch (tracker->selected_param)
|
|
|
|
|
- {
|
|
|
|
|
- case SI_SONGNAME:
|
|
|
|
|
- {
|
|
|
|
|
- string_length = MUS_SONG_NAME_LEN;
|
|
|
|
|
- string = (char *)&tracker->song.song_name;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- case SI_INSTRUMENTNAME:
|
|
|
|
|
- {
|
|
|
|
|
- string_length = MUS_INST_NAME_LEN;
|
|
|
|
|
- string = (char *)&tracker->song.instrument[tracker->current_instrument]->name;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (tracker->focus == EDIT_INSTRUMENT && tracker->mode == INST_EDITOR_VIEW)
|
|
|
|
|
- {
|
|
|
|
|
- switch (tracker->selected_param)
|
|
|
|
|
- {
|
|
|
|
|
- case INST_INSTRUMENTNAME:
|
|
|
|
|
- {
|
|
|
|
|
- string_length = MUS_INST_NAME_LEN;
|
|
|
|
|
- string = (char *)&tracker->song.instrument[tracker->current_instrument]->name;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (string == NULL || string_length == 0)
|
|
|
|
|
- return;
|
|
|
|
|
-
|
|
|
|
|
- for (uint8_t i = 0; i < string_length; i++) // I tinyfied the font by deleting lowercase chars, and I don't like the lowercase chars of any 3x5 pixels font
|
|
|
|
|
- {
|
|
|
|
|
- string[i] = toupper(string[i]);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- view_dispatcher_switch_to_view(tracker->view_dispatcher, VIEW_TRACKER);
|
|
|
|
|
-
|
|
|
|
|
- if(tracker->is_saving)
|
|
|
|
|
- {
|
|
|
|
|
- tracker->filepath = furi_string_alloc();
|
|
|
|
|
- furi_string_cat_printf(tracker->filepath, "%s/%s%s", FLIZZER_TRACKER_FOLDER, tracker->filename, SONG_FILE_EXT);
|
|
|
|
|
-
|
|
|
|
|
- if(storage_file_exists(tracker->storage, furi_string_get_cstr(tracker->filepath)))
|
|
|
|
|
- {
|
|
|
|
|
- view_dispatcher_switch_to_view(tracker->view_dispatcher, VIEW_FILE_OVERWRITE);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- FlizzerTrackerEvent event = {.type = EventTypeSaveSong, .input = {0}, .period = 0};
|
|
|
|
|
- furi_message_queue_put(tracker->event_queue, &event, FuriWaitForever);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
void edit_songinfo_param(FlizzerTrackerApp *tracker, uint8_t selected_param, int8_t delta)
|
|
void edit_songinfo_param(FlizzerTrackerApp *tracker, uint8_t selected_param, int8_t delta)
|
|
|
{
|
|
{
|
|
|
if (!(tracker->current_digit))
|
|
if (!(tracker->current_digit))
|