Skip to content

Commit

Permalink
Adds delay features to randomizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Quixotic7 committed Mar 1, 2024
1 parent 3485801 commit e03aec3
Show file tree
Hide file tree
Showing 9 changed files with 404 additions and 115 deletions.
1 change: 1 addition & 0 deletions OMX-27-firmware/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const uint32_t secs2micros = 1000000;
const char *mfxOffMsg = "MidiFX are Off";
const char *mfxArpEditMsg = "Arp Edit";
const char *exitMsg = "Exit";
const char *paramOffMsg = "OFF";

const char *modes[] = {"MI", "DRUM", "CH", "S1", "S2", "GR", "EL", "OM"};
const char *macromodes[] = {"Off", "M8", "NRN", "DEL"};
Expand Down
1 change: 1 addition & 0 deletions OMX-27-firmware/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ extern const int PPQ;
extern const char *mfxOffMsg;
extern const char *mfxArpEditMsg;
extern const char *exitMsg;
extern const char *paramOffMsg;

extern const char *modes[];
extern const char *macromodes[];
Expand Down
73 changes: 73 additions & 0 deletions OMX-27-firmware/src/hardware/omx_disp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ OmxDisp::OmxDisp()
{
}



void OmxDisp::setup()
{
initializeDisplay();
Expand Down Expand Up @@ -246,6 +248,77 @@ void OmxDisp::clearLegends()
useLegendString[3] = false;
}

bool OmxDisp::validateLegendIndex(uint8_t index)
{
if(index >= 4)
{
Serial.println("ERROR: Param index out of range!");
return false;
}
return true;
}



void OmxDisp::setLegend(uint8_t index, const char *label, int value)
{
if (validateLegendIndex(index))
{
legends[index] = label;
legendVals[index] = value;
}
}
void OmxDisp::setLegend(uint8_t index, const char *label, bool isOff, int value)
{
if (isOff)
{
setLegend(index, label, paramOffMsg);
}
else
{
setLegend(index, label, value);
}
}
void OmxDisp::setLegend(uint8_t index, const char *label, const char *text)
{
if (validateLegendIndex(index))
{
legends[index] = label;
legendText[index] = text;
}
}
void OmxDisp::setLegend(uint8_t index, const char* label, bool isOff, const char* text)
{
if (isOff)
{
setLegend(index, label, paramOffMsg);
}
else
{
setLegend(index, label, text);
}
}
void OmxDisp::setLegend(uint8_t index, const char *label, String text)
{
if (validateLegendIndex(index))
{
legends[index] = label;
useLegendString[index] = true;
legendString[index] = text;
}
}
void OmxDisp::setLegend(uint8_t index, const char *label, bool isOff, String text)
{
if(isOff)
{
setLegend(index, label, paramOffMsg);
}
else
{
setLegend(index, label, text);
}
}

void OmxDisp::dispGenericMode(int selected)
{
if (isMessageActive())
Expand Down
10 changes: 10 additions & 0 deletions OMX-27-firmware/src/hardware/omx_disp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class OmxDisp
{
public:
// Should make into function

const char *legends[4] = {"", "", "", ""};
int legendVals[4] = {0, 0, 0, 0};
int dispPage = 0;
Expand Down Expand Up @@ -80,6 +81,13 @@ class OmxDisp
void bumpDisplayTimer();

void clearLegends();
void setLegend(uint8_t index, const char* label, int value);
void setLegend(uint8_t index, const char* label, bool isOff, int value);
void setLegend(uint8_t index, const char* label, const char* text);
void setLegend(uint8_t index, const char* label, bool isOff, const char* text);
void setLegend(uint8_t index, const char* label, String text);
void setLegend(uint8_t index, const char* label, bool isOff, String text);

void setSubmode(int submode);

void UpdateMessageTextTimer();
Expand Down Expand Up @@ -111,6 +119,8 @@ class OmxDisp
void renderMessage();

void dispChordBalance();

bool validateLegendIndex(uint8_t index);
};

extern OmxDisp omxDisp;
Loading

0 comments on commit e03aec3

Please sign in to comment.