Browse Source

BLOCKS API: Added some functionality (not yet supported in public firmware!)

tags/2021-05-28
jules 9 years ago
parent
commit
05888a09fa
3 changed files with 11 additions and 1 deletions
  1. +3
    -0
      modules/juce_blocks_basics/blocks/juce_LEDGrid.h
  2. +2
    -1
      modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h
  3. +6
    -0
      modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp

+ 3
- 0
modules/juce_blocks_basics/blocks/juce_LEDGrid.h View File

@@ -132,6 +132,9 @@ public:
/** Gets a byte from the heap. */
virtual uint8 getDataByte (size_t offset) = 0;
/** Sets the current program as the block's default state. */
virtual void saveProgramAsDefault() = 0;
//==============================================================================
struct Renderer
{


+ 2
- 1
modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h View File

@@ -183,7 +183,8 @@ enum DeviceCommands
requestTopologyMessage = 0x01,
endAPIMode = 0x02,
ping = 0x03,
debugMode = 0x04
debugMode = 0x04,
saveProgramAsDefault = 0x05
};
using DeviceCommand = IntegerWithBitSize<9>;


+ 6
- 0
modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp View File

@@ -1162,6 +1162,11 @@ struct PhysicalTopologySource::Internal
}
}
void saveProgramAsDefault()
{
sendCommandMessage (BlocksProtocol::saveProgramAsDefault);
}
void handleSharedDataACK (uint32 packetCounter) noexcept
{
pingFromDevice();
@@ -1644,6 +1649,7 @@ struct PhysicalTopologySource::Internal
Program* getProgram() const override { return program.get(); }
void sendProgramEvent (const ProgramEventMessage& m) override { blockImpl.sendProgramEvent (m); }
void saveProgramAsDefault() override { blockImpl.saveProgramAsDefault(); }
void setDataByte (size_t offset, uint8 value) override { blockImpl.setDataByte (offset, value); }
void setDataBytes (size_t offset, const void* data, size_t num) override { blockImpl.setDataBytes (offset, data, num); }
void setDataBits (uint32 startBit, uint32 numBits, uint32 value) override { blockImpl.setDataBits (startBit, numBits, value); }


Loading…
Cancel
Save