Skip to content

Commit

Permalink
refactor LumatoneApplicationState::doSendChangesToDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jan 6, 2024
1 parent 6f3d01a commit 04494e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions Source/lumatone_editor_library/data/application_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int LumatoneApplicationState::getMidiOutputIndex() const
return controller->getMidiOutputIndex();
}

bool LumatoneApplicationState::sendSysExToDevice() const
bool LumatoneApplicationState::doSendChangesToDevice() const
{
return connectionState == ConnectionState::ONLINE;
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void LumatoneApplicationState::setCompleteConfig(const LumatoneLayout &layoutIn)
{
LumatoneState::setCompleteConfig(layoutIn);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendCurrentCompleteConfig();
}
Expand All @@ -190,7 +190,7 @@ void LumatoneApplicationState::setLayout(const LumatoneLayout &layoutIn)
{
LumatoneState::setLayout(layoutIn);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendCompleteMapping(layoutIn);
}
Expand All @@ -202,7 +202,7 @@ void LumatoneApplicationState::setBoard(const LumatoneBoard &boardIn, int boardI
{
LumatoneState::setBoard(boardIn, boardId);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendAllParamsOfBoard(boardId, &boardIn);
}
Expand All @@ -214,7 +214,7 @@ void LumatoneApplicationState::setKey(const LumatoneKey &keyIn, int boardId, int
{
LumatoneState::setKey(keyIn, boardId, keyIndex);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendKeyParam(boardId, keyIndex, keyIn);
}
Expand All @@ -226,7 +226,7 @@ void LumatoneApplicationState::setKeyConfig(const LumatoneKey& keyIn, int boardI
{
LumatoneState::setKeyConfig(keyIn, boardId, keyIndex);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendKeyConfig(boardId, keyIndex, keyIn);
}
Expand All @@ -239,7 +239,7 @@ void LumatoneApplicationState::setKeyColour(juce::Colour colour, int boardId, in
{
LumatoneState::setKeyColour(colour, boardId, keyIndex);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendKeyColourConfig(boardId, keyIndex, colour);
}
Expand Down Expand Up @@ -279,7 +279,7 @@ void LumatoneApplicationState::setAftertouchEnabled(bool enabled)
{
LumatoneState::setAftertouchEnabled(enabled);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->setAftertouchEnabled(enabled);
}
Expand All @@ -291,7 +291,7 @@ void LumatoneApplicationState::setLightOnKeyStrokes(bool enabled)
{
LumatoneState::setLightOnKeyStrokes(enabled);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendLightOnKeyStrokes(enabled);
}
Expand All @@ -303,7 +303,7 @@ void LumatoneApplicationState::setInvertExpression(bool invert)
{
LumatoneState::setInvertExpression(invert);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendInvertFootController(invert);
}
Expand All @@ -315,7 +315,7 @@ void LumatoneApplicationState::setInvertSustain(bool invert)
{
LumatoneState::setInvertSustain(invert);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->invertSustainPedal(invert);
}
Expand All @@ -327,7 +327,7 @@ void LumatoneApplicationState::setExpressionSensitivity(juce::uint8 sensitivity)
{
LumatoneState::setExpressionSensitivity(sensitivity);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendExpressionPedalSensivity(sensitivity);
}
Expand All @@ -339,7 +339,7 @@ void LumatoneApplicationState::setConfigTable(LumatoneConfigTable::TableType typ
{
LumatoneState::setConfigTable(type, table);

if (sendSysExToDevice())
if (doSendChangesToDevice())
{
controller->sendTableConfig(type, table.velocityValues);
}
Expand All @@ -351,7 +351,7 @@ void LumatoneApplicationState::setConfigTable(LumatoneConfigTable::TableType typ
//{
// LumatoneState::setVelocityIntervalTable(tableIn);
//
// if (sendSysExToDevice())
// if (doSendChangesToDevice())
// {
// controller->setVelocityIntervalTable(tableIn);
// }
Expand All @@ -361,7 +361,7 @@ void LumatoneApplicationState::setConfigTable(LumatoneConfigTable::TableType typ
//{
// LumatoneState::setNoteVelocityTable(tableIn);
//
// if (sendSysExToDevice())
// if (doSendChangesToDevice())
// {
// controller->setNoteVelocityTable(tableIn);
// }
Expand All @@ -371,7 +371,7 @@ void LumatoneApplicationState::setConfigTable(LumatoneConfigTable::TableType typ
//{
// LumatoneState::setAftertouchTable(tableIn);
//
// if (sendSysExToDevice())
// if (doSendChangesToDevice())
// {
// controller->setAftertouchTable(tableIn);
// }
Expand All @@ -381,7 +381,7 @@ void LumatoneApplicationState::setConfigTable(LumatoneConfigTable::TableType typ
//{
// LumatoneState::setLumatouchTable(tableIn);
//
// if (sendSysExToDevice())
// if (doSendChangesToDevice())
// {
// controller->setLumatouchTable(tableIn);
// }
Expand Down
2 changes: 1 addition & 1 deletion Source/lumatone_editor_library/data/application_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class LumatoneApplicationState : public LumatoneState
int getMidiInputIndex() const;
int getMidiOutputIndex() const;

virtual bool sendSysExToDevice() const;
virtual bool doSendChangesToDevice() const;

// Context Methods
bool isContextSet() const { return contextIsSet; }
Expand Down

0 comments on commit 04494e2

Please sign in to comment.