|
|
@ -4121,48 +4121,75 @@ void UI_func_drum_volume(uint8_t param) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UI_func_drum_pan(uint8_t param) { |
|
|
|
void _UI_func_drum_pan_display(bool mode) { |
|
|
|
char temp[8]; |
|
|
|
char temp1[10]; |
|
|
|
|
|
|
|
char temp2[10]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(temp1, 0, sizeof(temp1)); |
|
|
|
|
|
|
|
memset(temp2, 0, sizeof(temp2)); |
|
|
|
|
|
|
|
if (configuration.drums.drum_pan[activesample] > 25) |
|
|
|
|
|
|
|
display.show(0, 14, 4, ">>"); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] > 10) |
|
|
|
|
|
|
|
display.show(0, 14, 4, "> "); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] > 0) |
|
|
|
|
|
|
|
display.show(0, 14, 4, ">="); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] < -25) |
|
|
|
|
|
|
|
display.show(0, 14, 4, "<<"); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] < -10) |
|
|
|
|
|
|
|
display.show(0, 14, 4, " <"); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] < 0) |
|
|
|
|
|
|
|
display.show(0, 14, 4, "=<"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
display.show(0, 14, 4, "=="); |
|
|
|
|
|
|
|
if (mode == false) { |
|
|
|
|
|
|
|
snprintf_P(temp1, sizeof(temp1), PSTR("[%02d]"), activesample + 1); |
|
|
|
|
|
|
|
snprintf_P(temp2, sizeof(temp2), PSTR(" %02d "), abs(configuration.drums.drum_pan[activesample])); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
snprintf_P(temp1, sizeof(temp1), PSTR(" %02d "), activesample + 1); |
|
|
|
|
|
|
|
snprintf_P(temp2, sizeof(temp2), PSTR("[%02d]"), abs(configuration.drums.drum_pan[activesample])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
display.show(1, 0, 4, temp1); |
|
|
|
|
|
|
|
display.show(1, 4, 8, basename(drum_config[activesample].name)); |
|
|
|
|
|
|
|
display.show(1, 12, 4, temp2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
memset(temp, 0, sizeof(temp)); |
|
|
|
void UI_func_drum_pan(uint8_t param) { |
|
|
|
|
|
|
|
static bool mode; |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
display.setCursor(0, 0); |
|
|
|
display.setCursor(0, 0); |
|
|
|
display.print("Drum Panorama"); |
|
|
|
display.print("Drum Panorama"); |
|
|
|
if (configuration.drums.drum_pan[activesample] > 0) |
|
|
|
_UI_func_drum_pan_display(mode); |
|
|
|
display.show(0, 14, 4, " >"); |
|
|
|
|
|
|
|
else if (configuration.drums.drum_pan[activesample] < 0) |
|
|
|
|
|
|
|
display.show(0, 14, 4, "<"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
display.show(0, 14, 4, "=="); |
|
|
|
|
|
|
|
snprintf_P(temp, sizeof(temp), PSTR("[%02d]"), activesample + 1); |
|
|
|
|
|
|
|
display.show(1, 0, 4, temp); |
|
|
|
|
|
|
|
display.show(1, 4, 9, basename(drum_config[activesample].name)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { |
|
|
|
if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) { |
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
mode = !mode; |
|
|
|
|
|
|
|
} else if (LCDML.BT_checkDown()) { |
|
|
|
|
|
|
|
if (mode == false) |
|
|
|
activesample = (activesample + ENCODER[ENC_R].speed()) % (NUM_DRUMSET_CONFIG - 1); |
|
|
|
activesample = (activesample + ENCODER[ENC_R].speed()) % (NUM_DRUMSET_CONFIG - 1); |
|
|
|
else if (LCDML.BT_checkUp()) { |
|
|
|
else |
|
|
|
|
|
|
|
configuration.drums.drum_pan[activesample] = constrain(++configuration.drums.drum_pan[activesample], DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX); |
|
|
|
|
|
|
|
} else if (LCDML.BT_checkUp()) { |
|
|
|
|
|
|
|
if (mode == false) { |
|
|
|
uint8_t temp_encoder = ENCODER[ENC_R].speed(); |
|
|
|
uint8_t temp_encoder = ENCODER[ENC_R].speed(); |
|
|
|
if (activesample - temp_encoder < 0) |
|
|
|
if (activesample - temp_encoder < 0) |
|
|
|
activesample = NUM_DRUMSET_CONFIG - (abs(activesample - temp_encoder)) - 1; |
|
|
|
activesample = NUM_DRUMSET_CONFIG - (abs(activesample - temp_encoder)) - 1; |
|
|
|
else |
|
|
|
else |
|
|
|
activesample -= temp_encoder; |
|
|
|
activesample -= temp_encoder; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
configuration.drums.drum_pan[activesample] = constrain(--configuration.drums.drum_pan[activesample], DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (configuration.drums.drum_pan[activesample] > 0) |
|
|
|
|
|
|
|
display.show(0, 14, 4, " >"); |
|
|
|
// Display and set values
|
|
|
|
else if (configuration.drums.drum_pan[activesample] < 0) |
|
|
|
_UI_func_drum_pan_display(mode); |
|
|
|
display.show(0, 14, 4, "<"); |
|
|
|
|
|
|
|
else |
|
|
|
//configuration.drums.drum_pan[i] = mapfloat(drum_config[i].pan, 0.0, 1.0, DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX);
|
|
|
|
display.show(0, 14, 4, "=="); |
|
|
|
|
|
|
|
snprintf_P(temp, sizeof(temp), PSTR("[%02d]"), activesample + 1); |
|
|
|
|
|
|
|
display.show(1, 0, 4, temp); |
|
|
|
|
|
|
|
display.show(1, 4, 9, basename(drum_config[activesample].name)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|