From 0fb3e4dc09e36003b2f3ad345d5bef3223bf6711 Mon Sep 17 00:00:00 2001 From: positionhigh Date: Wed, 18 Aug 2021 13:44:50 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI.hpp | 5 +---- config.h | 2 ++ dexed_sd.cpp | 26 +++++++++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/UI.hpp b/UI.hpp index ca120ee..83950c2 100644 --- a/UI.hpp +++ b/UI.hpp @@ -6636,8 +6636,7 @@ void UI_func_load_voiceconfig(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - char tmp[10]; - + selected_instance_id = 0; encoderDir[ENC_R].reset(); @@ -6743,8 +6742,6 @@ void UI_func_save_voiceconfig(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - char tmp[FILENAME_LEN]; - yesno = false; selected_instance_id = 0; diff --git a/config.h b/config.h index 53e2431..2612482 100644 --- a/config.h +++ b/config.h @@ -634,6 +634,8 @@ #define JSON_BUFFER_SIZE 8192 +#define JSON_BUFFER 1024 //This line put back to resolve a merge conflict. this line should be removed + // Internal configuration structure typedef struct dexed_s { uint8_t lowest_note; diff --git a/dexed_sd.cpp b/dexed_sd.cpp index b34651a..87cca51 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -52,6 +52,7 @@ extern int seq_transpose; extern int seq_tempo_ms ; extern int seq_bpm; extern bool arp_play_basenote; +extern bool seq_running; extern uint8_t arp_speed; extern uint8_t arp_lenght; extern uint8_t arp_style; @@ -979,6 +980,7 @@ bool save_sd_seq_json(uint8_t seq_number) data_json["chord_key_ammount"] = seq_chord_key_ammount; data_json["seq_oct_shift"] = seq_oct_shift; data_json["seq_element_shift"] = seq_element_shift; + data_json["performance"] = configuration.sys.performance_number; for (uint8_t i = 0; i < sizeof(seq_track_type); i++) { data_json["track_type"][i] = seq_track_type[i]; @@ -1046,7 +1048,7 @@ bool load_sd_seq_json(uint8_t seq_number) deserializeJson(data_json, json); json.close(); - + AudioInterrupts(); #ifdef DEBUG Serial.println(F("Read JSON data:")); @@ -1093,7 +1095,6 @@ bool load_sd_seq_json(uint8_t seq_number) for (uint8_t i = 0; i < sizeof(seq_inst_dexed); i++) { seq_inst_dexed[i] = data_json["seq_inst_dexed"][i]; } - count = 0; seq_tempo_ms = data_json["seq_tempo_ms"] ; seq_bpm = data_json["seq_bpm"]; @@ -1108,10 +1109,15 @@ bool load_sd_seq_json(uint8_t seq_number) seq_chord_key_ammount = data_json["chord_key_ammount"]; seq_oct_shift = data_json["seq_oct_shift"]; seq_element_shift = data_json["seq_element_shift"]; + configuration.sys.performance_number = data_json["performance"]; + load_sd_performance_json(configuration.sys.performance_number); + if (seq_running) + timer1.begin(sequencer, seq_tempo_ms / 2); + else + timer1.begin(sequencer, seq_tempo_ms / 2, false); return (true); - } #ifdef DEBUG else @@ -1138,7 +1144,7 @@ bool check_sd_seq_exists(uint8_t number) return (false); number = constrain(number, 0, 99); - + AudioNoInterrupts(); if (sd_card > 0) { char filename[FILENAME_LEN]; @@ -1146,14 +1152,20 @@ bool check_sd_seq_exists(uint8_t number) sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, number); // check if file exists... - AudioNoInterrupts(); + if (SD.exists(filename)) { + AudioInterrupts(); return (true); - } else return (false); + } else + { + AudioInterrupts(); + return (false); + } } else + { AudioInterrupts(); return (false); - AudioInterrupts(); + } } /******************************************************************************