Dateien hochladen nach „“

pull/78/head^2
positionhigh 4 years ago
parent fd730aedc3
commit 3158dca838
  1. 2
      MicroDexed.ino
  2. 48
      UI.hpp
  3. 4
      config.h
  4. 22
      dexed_sd.cpp

@ -301,7 +301,7 @@ void create_audio_drum_chain(uint8_t instance_id)
}
#endif
StaticJsonDocument<JSON_BUFFER> data_json;
//StaticJsonDocument<JSON_BUFFER> data_json;
uint8_t sd_card = 0;
Sd2Card card;
SdVolume volume;

@ -6626,7 +6626,7 @@ void UI_func_save_performance(uint8_t param)
void UI_func_load_voiceconfig(uint8_t param)
{
#if NUMDEXED > 1
#if NUM_DEXED > 1
static int8_t selected_instance_id;
#else
uint8_t selected_instance_id = 0;
@ -6644,7 +6644,7 @@ void UI_func_load_voiceconfig(uint8_t param)
lcd.setCursor(0, 0);
lcd.print(F("Load VoiceCfg SD"));
#if NUMDEXED > 1
#if NUM_DEXED > 1
mode = 0;
lcd.setCursor(0, 1);
lcd.print(F("Instance [0]"));
@ -6663,29 +6663,33 @@ void UI_func_load_voiceconfig(uint8_t param)
if (LCDML.BT_checkDown())
{
if (mode == 0)
selected_instance_id = (selected_instance_id + 1) % 2;
selected_instance_id = 1;
//selected_instance_id = (selected_instance_id + 1) % 2;
else if (mode == 1)
configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX);
}
else if (LCDML.BT_checkUp())
{
if (mode == 0)
selected_instance_id = (selected_instance_id - 1) % 2;
//selected_instance_id = (selected_instance_id - 1) % 2;
selected_instance_id = 0;
else if (mode == 1)
configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX);
}
else if (LCDML.BT_checkEnter())
{
mode = 0xff;
lcd.setCursor(0, 1);
if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false)
lcd.print("Does not exist. ");
else
lcd.print("Done. ");
if (mode > 0) {
mode = 0xff;
lcd.setCursor(0, 1);
if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false)
lcd.print("Does not exist. ");
else
lcd.print("Done. ");
delay(MESSAGE_WAIT_TIME);
delay(MESSAGE_WAIT_TIME);
LCDML.FUNC_goBackToMenu();
LCDML.FUNC_goBackToMenu();
} else mode = 1;
}
if (mode == 0)
@ -6727,7 +6731,7 @@ void UI_func_load_voiceconfig(uint8_t param)
void UI_func_save_voiceconfig(uint8_t param)
{
#if NUMDEXED > 1
#if NUM_DEXED > 1
static int8_t selected_instance_id;
#else
uint8_t selected_instance_id = 0;
@ -6748,7 +6752,7 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.setCursor(0, 0);
lcd.print(F("Save VoiceCfg SD"));
#if NUMDEXED > 1
#if NUM_DEXED > 1
mode = 0;
lcd.setCursor(0, 1);
lcd.print(F("Instance [0]"));
@ -6773,7 +6777,8 @@ void UI_func_save_voiceconfig(uint8_t param)
if (LCDML.BT_checkDown())
{
if (mode == 0)
selected_instance_id = (selected_instance_id + 1) % 2;
selected_instance_id = 1;
// selected_instance_id = (selected_instance_id +1) % 2;
else if (mode == 1)
configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX);
else
@ -6782,7 +6787,8 @@ void UI_func_save_voiceconfig(uint8_t param)
else if (LCDML.BT_checkUp())
{
if (mode == 0)
selected_instance_id = (selected_instance_id - 1) % 2;
selected_instance_id = 0;
//selected_instance_id = (selected_instance_id - 1) % 2;
else if (mode == 1)
configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX);
else
@ -6796,7 +6802,7 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.setCursor(0, 1);
lcd.print(F("Overwrite: [ ]"));
}
else
else if (mode > 0 )
{
mode = 0xff;
if (overwrite == false || yesno == true)
@ -6822,12 +6828,18 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.print(tmp);
}
}
else {
mode = 1;
lcd.setCursor(4, 1);
lcd.print(" ");
}
}
if (mode == 0)
{
lcd.setCursor(10, 1);
lcd.print(configuration.performance.voiceconfig_number[selected_instance_id]);
//lcd.print(configuration.performance.voiceconfig_number[selected_instance_id]);
lcd.print(selected_instance_id);
}
else if (mode == 1)
{

@ -630,9 +630,9 @@
#define EQ_7_MAX 10
#define EQ_7_DEFAULT 0
// Buffer for load/save configuration as JSON
// Buffer size for load/save configuration as JSON
#define JSON_BUFFER 8192
#define JSON_BUFFER_SIZE 8192
// Internal configuration structure
typedef struct dexed_s {

@ -38,7 +38,7 @@ extern void check_configuration_dexed(uint8_t instance_id);
extern void check_configuration_performance(void);
extern void check_configuration_fx(void);
extern void sequencer();
extern StaticJsonDocument<JSON_BUFFER> data_json;
//extern StaticJsonDocument<JSON_BUFFER> data_json;
extern uint8_t seq_chain_lenght;
extern uint8_t seq_data[10][16];
extern uint8_t seq_vel[10][16];
@ -433,7 +433,7 @@ bool load_sd_voiceconfig_json(int8_t vc, uint8_t instance_id)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, vc);
// first check if file exists...
@ -525,7 +525,7 @@ bool save_sd_voiceconfig_json(uint8_t vc, uint8_t instance_id)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, vc);
#ifdef DEBUG
@ -612,6 +612,7 @@ bool load_sd_fx_json(int8_t fx)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, fx);
@ -704,7 +705,7 @@ bool save_sd_fx_json(uint8_t fx)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, fx);
#ifdef DEBUG
@ -781,6 +782,7 @@ bool load_sd_seq_drumsettings_json(uint8_t number)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%s%d-d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, number);
@ -849,7 +851,7 @@ bool save_sd_seq_drumsettings_json(uint8_t number)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%s%d-d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, number);
#ifdef DEBUG
@ -905,7 +907,7 @@ bool save_sd_seq_json(uint8_t seq_number)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, seq_number);
#ifdef DEBUG
@ -1023,6 +1025,7 @@ bool load_sd_seq_json(uint8_t seq_number)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%s%d.json", SEQ_CONFIG_PATH, SEQ_CONFIG_NAME, seq_number);
@ -1166,6 +1169,7 @@ bool load_sd_performance_json(int8_t p)
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, p);
@ -1239,11 +1243,12 @@ bool save_sd_performance_json(uint8_t p)
char filename[FILENAME_LEN];
p = constrain(p, 0, MAX_PERFORMANCE);
sprintf(filename, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, p);
if (sd_card > 0)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
#ifdef DEBUG
Serial.print(F("Saving performance config as JSON"));
Serial.print(p);
@ -1262,7 +1267,8 @@ bool save_sd_performance_json(uint8_t p)
Serial.print(configuration.performance.fx_number);
Serial.println(F(" does not exists, creating one."));
#endif
save_sd_performance_json(configuration.performance.fx_number);
//save_sd_performance_json(configuration.performance.fx_number);
save_sd_fx_json(configuration.performance.fx_number);
}
for (uint8_t i = 0; i < MAX_DEXED; i++)
{

Loading…
Cancel
Save