mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-17 00:44:19 +00:00
BLOCKS: Add LUMI
This commit is contained in:
parent
0b8beb7f93
commit
138ef9ff1f
5 changed files with 64 additions and 9 deletions
|
|
@ -46,7 +46,8 @@ public:
|
|||
loopBlock, /**< Loop control block type. */
|
||||
developerControlBlock, /**< Developer control block type. */
|
||||
touchBlock, /**< Touch control block type. */
|
||||
seaboardBlock /**< Seaboard block type. */
|
||||
seaboardBlock, /**< Seaboard block type. */
|
||||
lumiKeysBlock /**< LUMI Keys block type */
|
||||
};
|
||||
|
||||
/** The Block class is reference-counted, so always use a Block::Ptr when
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ struct BlockConfigManager
|
|||
"Highest",
|
||||
"Lowest",
|
||||
"Disabled" }, playGroup },
|
||||
{ zTrackingMode, 1, 0, 4, false, "Pressure Tracking Mode", ConfigType::options, { "Multi-Channel",
|
||||
{ zTrackingMode, 1, 0, 4, false, "Pressure Tracking Mode", ConfigType::options, { "Poly Aftertouch",
|
||||
"Last Played",
|
||||
"Highest",
|
||||
"Lowest",
|
||||
|
|
|
|||
|
|
@ -33,12 +33,13 @@ struct BlockDataSheet
|
|||
{
|
||||
BlockDataSheet (const BlocksProtocol::BlockSerialNumber& serial) : serialNumber (serial)
|
||||
{
|
||||
if (serialNumber.isPadBlock()) initialiseForPadBlock2x2();
|
||||
if (serialNumber.isLiveBlock()) initialiseForControlBlockLive();
|
||||
if (serialNumber.isLoopBlock()) initialiseForControlBlockLoop();
|
||||
if (serialNumber.isDevCtrlBlock()) initialiseForControlBlockDeveloper();
|
||||
if (serialNumber.isTouchBlock()) initialiseForControlBlockTouch();
|
||||
if (serialNumber.isSeaboardBlock()) initialiseForSeaboardBlock();
|
||||
if (serialNumber.isPadBlock()) initialiseForPadBlock2x2();
|
||||
if (serialNumber.isLiveBlock()) initialiseForControlBlockLive();
|
||||
if (serialNumber.isLoopBlock()) initialiseForControlBlockLoop();
|
||||
if (serialNumber.isDevCtrlBlock()) initialiseForControlBlockDeveloper();
|
||||
if (serialNumber.isTouchBlock()) initialiseForControlBlockTouch();
|
||||
if (serialNumber.isSeaboardBlock()) initialiseForSeaboardBlock();
|
||||
if (serialNumber.isLumiKeysBlock()) initialiseForLumiKeysBlock();
|
||||
}
|
||||
|
||||
Block::ConnectionPort convertPortIndexToConnectorPort (BlocksProtocol::ConnectorPort port) const noexcept
|
||||
|
|
@ -225,6 +226,40 @@ private:
|
|||
addModeButton();
|
||||
}
|
||||
|
||||
void initialiseForLumiKeysBlock()
|
||||
{
|
||||
apiType = Block::Type::lumiKeysBlock;
|
||||
|
||||
description = "LUMI Keys BLOCK (6x3)";
|
||||
|
||||
widthUnits = 6;
|
||||
heightUnits = 3;
|
||||
|
||||
lightGridWidth = 0;
|
||||
lightGridHeight = 0;
|
||||
numKeywaves = 24;
|
||||
|
||||
addButtons (ControlButton::ButtonFunction::mode, 0.2f, 0.2f,
|
||||
ControlButton::ButtonFunction::down, 0.6f, 0.2f,
|
||||
ControlButton::ButtonFunction::up, 1.0f, 0.2f);
|
||||
|
||||
addPortsSW (Block::ConnectionPort::DeviceEdge::west, 2);
|
||||
addPortsNE (Block::ConnectionPort::DeviceEdge::north, 4);
|
||||
addPortsNE (Block::ConnectionPort::DeviceEdge::east, 2);
|
||||
|
||||
hasTouchSurface = true;
|
||||
programAndHeapSize = BlocksProtocol::padBlockProgramAndHeapSize;
|
||||
|
||||
defaultConfig.add ({ mode, 0, 0, 3, false,
|
||||
"Color Mode", ConfigType::options,
|
||||
{ "Multi-color Mode",
|
||||
"Single Color Mode",
|
||||
"Piano Mode",
|
||||
"Night Mode"
|
||||
},
|
||||
BlockConfigManager::playGroup });
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void addStatusLED (const char* name, float x, float y)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ struct BlockSerialNumber : public BlockStringData<16>
|
|||
if (c == 0)
|
||||
return false;
|
||||
|
||||
return isAnyControlBlock() || isPadBlock() || isSeaboardBlock();
|
||||
return isAnyControlBlock() || isPadBlock() || isSeaboardBlock() || isLumiKeysBlock();
|
||||
}
|
||||
|
||||
bool isPadBlock() const noexcept { return hasPrefix ("LPB") || hasPrefix ("LPM"); }
|
||||
|
|
@ -194,6 +194,7 @@ struct BlockSerialNumber : public BlockStringData<16>
|
|||
bool isDevCtrlBlock() const noexcept { return hasPrefix ("DCB"); }
|
||||
bool isTouchBlock() const noexcept { return hasPrefix ("TCB"); }
|
||||
bool isSeaboardBlock() const noexcept { return hasPrefix ("SBB"); }
|
||||
bool isLumiKeysBlock() const noexcept { return hasPrefix ("LKB"); }
|
||||
|
||||
bool isAnyControlBlock() const noexcept { return isLiveBlock() || isLoopBlock() || isDevCtrlBlock() || isTouchBlock(); }
|
||||
|
||||
|
|
|
|||
|
|
@ -537,6 +537,24 @@ private:
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
else if (block->getType() == Block::lumiKeysBlock)
|
||||
{
|
||||
if (edge == Block::ConnectionPort::DeviceEdge::north)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0 : return 0;
|
||||
case 1 : return 2;
|
||||
case 2 : return 3;
|
||||
case 3 : return 5;
|
||||
default : jassertfalse;
|
||||
}
|
||||
}
|
||||
else if (edge == Block::ConnectionPort::DeviceEdge::south)
|
||||
{
|
||||
jassertfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (edge == Block::ConnectionPort::DeviceEdge::south)
|
||||
return block->getWidth() - (index + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue