JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::BlocksProtocol Namespace Reference

Classes

struct  BlockSerialNumber
 Structure describing a block's serial number. More...
 
struct  BlockStringData
 Structure for generic block data. More...
 
struct  DeviceConnection
 Structure for the device connection. More...
 
struct  DeviceName
 Structure used for the device name. More...
 
struct  DeviceStatus
 Structure for the device status. More...
 
struct  DeviceVersion
 Structure for the device version. More...
 
struct  HostPacketBuilder
 Helper class for constructing a packet for sending to a BLOCKS device. More...
 
struct  HostPacketDecoder
 Parses data packets from a BLOCKS device, and translates them into callbacks on a handler object. More...
 
struct  IntegerWithBitSize
 Helper class to define an integer with a specific bit size. More...
 
struct  Packed7BitArrayBuilder
 This helper class allocates a block of 7-bit bytes and can push sequences of bits into it. More...
 
struct  Packed7BitArrayReader
 This helper class reads from a block of 7-bit bytes as sequences of bits. More...
 
struct  TouchPosition
 The coordinates of a touch. More...
 
struct  TouchVelocity
 The velocities for each dimension of a touch. More...
 

Typedefs

using BatteryCharging = IntegerWithBitSize< 1 >
 Battery charger connection flag. More...
 
using BatteryLevel = IntegerWithBitSize< 5 >
 Battery charge level. More...
 
using BlockName = BlockStringData< 33 >
 
using ByteCountFew = IntegerWithBitSize< 4 >
 
using ByteCountMany = IntegerWithBitSize< 8 >
 
using ByteSequenceContinues = IntegerWithBitSize< 1 >
 
using ByteValue = IntegerWithBitSize< 8 >
 
using ConfigCommand = IntegerWithBitSize< 4 >
 
using ConfigItemIndex = IntegerWithBitSize< 8 >
 
using ConfigItemValue = IntegerWithBitSize< 32 >
 
using ConnectionCount = IntegerWithBitSize< 8 >
 
using ConnectorPort = IntegerWithBitSize< 5 >
 ConnectorPort is an index, starting at 0 for the leftmost port on the top edge, and going clockwise. More...
 
using ControlButtonID = IntegerWithBitSize< 12 >
 An ID for a control-block button type. More...
 
using DataChangeCommand = IntegerWithBitSize< 3 >
 
using DeviceCommand = IntegerWithBitSize< 9 >
 
using DeviceCount = IntegerWithBitSize< 7 >
 
using FirmwareUpdateACKCode = IntegerWithBitSize< 7 >
 
using FirmwareUpdateACKDetail = IntegerWithBitSize< 32 >
 
using FirmwareUpdatePacketSize = IntegerWithBitSize< 7 >
 
using MessageType = IntegerWithBitSize< 7 >
 This is the first item in a BLOCKS message, identifying the message type. More...
 
using PacketCounter = IntegerWithBitSize< 10 >
 
using PacketIndex = IntegerWithBitSize< 16 >
 
using PacketTimestamp = IntegerWithBitSize< 32 >
 A timestamp for a packet, in milliseconds since device boot-up. More...
 
using PacketTimestampOffset = IntegerWithBitSize< 5 >
 This relative timestamp is for use inside a packet, and it represents a number of milliseconds that should be added to the packet's timestamp. More...
 
using ProtocolVersion = IntegerWithBitSize< 8 >
 
using RotaryDialAngle = IntegerWithBitSize< 14 >
 
using RotaryDialDelta = IntegerWithBitSize< 14 >
 
using RotaryDialIndex = IntegerWithBitSize< 7 >
 
using TopologyIndex = uint8
 This is a type of index identifier used to refer to a block within a group. More...
 
using TouchIndex = IntegerWithBitSize< 5 >
 The index of a touch, i.e. More...
 
using VersionNumber = BlockStringData< 21 >
 

Enumerations

enum  BitSizes {
  topologyMessageHeader = MessageType::bits + ProtocolVersion::bits + DeviceCount::bits + ConnectionCount::bits,
  topologyDeviceInfo = sizeof (BlockSerialNumber) * 7 + BatteryLevel::bits + BatteryCharging::bits,
  topologyConnectionInfo = topologyIndexBits + ConnectorPort::bits + topologyIndexBits + ConnectorPort::bits,
  typeDeviceAndTime = MessageType::bits + PacketTimestampOffset::bits,
  touchMessage = typeDeviceAndTime + TouchIndex::bits + TouchPosition::bits,
  touchMessageWithVelocity = touchMessage + TouchVelocity::bits,
  programEventMessage = MessageType::bits + 32 * numProgramMessageInts,
  programEventMessage = 0x28,
  programEventMessage = 0x03,
  packetACK = MessageType::bits + PacketCounter::bits,
  packetACK = 0x02,
  firmwareUpdateACK = MessageType::bits + FirmwareUpdateACKCode::bits + FirmwareUpdateACKDetail::bits,
  firmwareUpdateACK = 0x03,
  controlButtonMessage = typeDeviceAndTime + ControlButtonID::bits,
  configSetMessage = MessageType::bits + ConfigCommand::bits + ConfigItemIndex::bits + ConfigItemValue::bits,
  configRespMessage = MessageType::bits + ConfigCommand::bits + ConfigItemIndex::bits + (ConfigItemValue::bits * 3),
  configSyncEndMessage = MessageType::bits + ConfigCommand::bits
}
 Contains the number of bits required to encode various items in the packets. More...
 
enum  ConfigCommands {
  setConfig = 0x00,
  requestConfig = 0x01,
  requestFactorySync = 0x02,
  requestUserSync = 0x03,
  updateConfig = 0x04,
  updateUserConfig = 0x05,
  setConfigState = 0x06,
  factorySyncEnd = 0x07,
  clusterConfigSync = 0x08,
  factorySyncReset = 0x09
}
 
enum  ConfigItemId {
  midiStartChannel = 0,
  midiEndChannel = 1,
  midiUseMPE = 2,
  pitchBendRange = 3,
  octave = 4,
  transpose = 5,
  slideCC = 6,
  slideMode = 7,
  octaveTopology = 8,
  midiChannelRange = 9,
  MPEZone = 40,
  velocitySensitivity = 10,
  glideSensitivity = 11,
  slideSensitivity = 12,
  pressureSensitivity = 13,
  liftSensitivity = 14,
  fixedVelocity = 15,
  fixedVelocityValue = 16,
  pianoMode = 17,
  glideLock = 18,
  glideLockEnable = 19,
  mode = 20,
  volume = 21,
  scale = 22,
  hideMode = 23,
  chord = 24,
  arpPattern = 25,
  tempo = 26,
  xTrackingMode = 30,
  yTrackingMode = 31,
  zTrackingMode = 32,
  gammaCorrection = 33,
  user0 = 64,
  user1 = 65,
  user2 = 66,
  user3 = 67,
  user4 = 68,
  user5 = 69,
  user6 = 70,
  user7 = 71,
  user8 = 72,
  user9 = 73,
  user10 = 74,
  user11 = 75,
  user12 = 76,
  user13 = 77,
  user14 = 78,
  user15 = 79,
  user16 = 80,
  user17 = 81,
  user18 = 82,
  user19 = 83,
  user20 = 84,
  user21 = 85,
  user22 = 86,
  user23 = 87,
  user24 = 88,
  user25 = 89,
  user26 = 90,
  user27 = 91,
  user28 = 92,
  user29 = 93,
  user30 = 94,
  user31 = 95
}
 Configuration Item Identifiers. More...
 
enum  DataChangeCommands {
  endOfPacket = 0,
  endOfChanges = 1,
  skipBytesFew = 2,
  skipBytesMany = 3,
  setSequenceOfBytes = 4,
  setFewBytesWithValue = 5,
  setFewBytesWithLastValue = 6,
  setManyBytesWithValue = 7
}
 
enum  DeviceCommands {
  beginAPIMode = 0x00,
  requestTopologyMessage = 0x01,
  endAPIMode = 0x02,
  ping = 0x03,
  debugMode = 0x04,
  saveProgramAsDefault = 0x05
}
 
enum  MessageFromDevice {
  MessageFromDevice::deviceTopology = 0x01,
  packetACK = 0x02,
  firmwareUpdateACK = 0x03,
  MessageFromDevice::deviceTopologyExtend = 0x04,
  MessageFromDevice::deviceTopologyEnd = 0x05,
  MessageFromDevice::deviceVersion = 0x06,
  MessageFromDevice::deviceName = 0x07,
  MessageFromDevice::touchStart = 0x10,
  MessageFromDevice::touchMove = 0x11,
  MessageFromDevice::touchEnd = 0x12,
  MessageFromDevice::touchStartWithVelocity = 0x13,
  MessageFromDevice::touchMoveWithVelocity = 0x14,
  MessageFromDevice::touchEndWithVelocity = 0x15,
  MessageFromDevice::configMessage = 0x18,
  MessageFromDevice::controlButtonDown = 0x20,
  MessageFromDevice::controlButtonUp = 0x21,
  programEventMessage = 0x28,
  MessageFromDevice::logMessage = 0x30
}
 Messages that a device may send to the host. More...
 
enum  MessageFromHost {
  MessageFromHost::deviceCommandMessage = 0x01,
  MessageFromHost::sharedDataChange = 0x02,
  programEventMessage = 0x03,
  MessageFromHost::firmwareUpdatePacket = 0x04,
  MessageFromHost::configMessage = 0x10,
  MessageFromHost::factoryReset = 0x11,
  MessageFromHost::blockReset = 0x12,
  MessageFromHost::setName = 0x20
}
 Messages that the host may send to a device. More...
 

Functions

static uint8 calculatePacketChecksum (const uint8 *data, uint32 size) noexcept
 

Variables

static constexpr uint32 apiModeHostPingTimeoutMs = 5000
 
static constexpr uint8 configMaxOptions = 8
 
static constexpr uint8 configOptionNameLength = 16
 
static constexpr uint8 configUserConfigNameLength = 32
 
static constexpr uint32 controlBlockProgramAndHeapSize = 3000
 
static constexpr uint32 controlBlockStackSize = 800
 
static constexpr uint32 currentProtocolVersion = 1
 This value is incremented when the format of the API changes in a way which breaks compatibility. More...
 
static constexpr const char * ledProgramLittleFootFunctions []
 
static constexpr uint8 maxBlocksInTopologyPacket = 6
 
static constexpr uint8 maxConfigIndex = uint8 (ConfigItemId::user0) + numberOfUserConfigs
 
static constexpr uint8 maxConnectionsInTopologyPacket = 24
 
static constexpr uint8 numberOfUserConfigs = 32
 
static constexpr uint32 numProgramMessageInts = 3
 
static constexpr uint32 padBlockProgramAndHeapSize = 7200
 
static constexpr uint32 padBlockStackSize = 800
 
static const uint8 roliSysexHeader [] = { 0xf0, 0x00, 0x21, 0x10, 0x77 }
 All sysex messages to or from a BLOCKS device begin with these header bytes. More...
 
static constexpr int topologyIndexBits = 7
 
static constexpr TopologyIndex topologyIndexForBroadcast = 63
 Use this value as the index if you want a message to be sent to all devices in the group. More...
 

Typedef Documentation

◆ BatteryCharging

Battery charger connection flag.

◆ BatteryLevel

Battery charge level.

◆ BlockName

◆ ByteCountFew

◆ ByteCountMany

◆ ByteSequenceContinues

◆ ByteValue

◆ ConfigCommand

◆ ConfigItemIndex

◆ ConfigItemValue

◆ ConnectionCount

◆ ConnectorPort

ConnectorPort is an index, starting at 0 for the leftmost port on the top edge, and going clockwise.

◆ ControlButtonID

An ID for a control-block button type.

◆ DataChangeCommand

◆ DeviceCommand

◆ DeviceCount

◆ FirmwareUpdateACKCode

◆ FirmwareUpdateACKDetail

◆ FirmwareUpdatePacketSize

◆ MessageType

This is the first item in a BLOCKS message, identifying the message type.

◆ PacketCounter

◆ PacketIndex

◆ PacketTimestamp

A timestamp for a packet, in milliseconds since device boot-up.

◆ PacketTimestampOffset

This relative timestamp is for use inside a packet, and it represents a number of milliseconds that should be added to the packet's timestamp.

◆ ProtocolVersion

◆ RotaryDialAngle

◆ RotaryDialDelta

◆ RotaryDialIndex

◆ TopologyIndex

This is a type of index identifier used to refer to a block within a group.

It refers to the index of a device in the list of devices that was most recently sent via a topology change message (It's not a global UID for a block unit). NB: to send a message to all devices, pass the getDeviceIndexForBroadcast() value.

◆ TouchIndex

The index of a touch, i.e.

finger number.

◆ VersionNumber

Enumeration Type Documentation

◆ BitSizes

Contains the number of bits required to encode various items in the packets.

Enumerator
topologyMessageHeader 
topologyDeviceInfo 
topologyConnectionInfo 
typeDeviceAndTime 
touchMessage 
touchMessageWithVelocity 
programEventMessage 
programEventMessage 
programEventMessage 
packetACK 
packetACK 
firmwareUpdateACK 
firmwareUpdateACK 
controlButtonMessage 
configSetMessage 
configRespMessage 
configSyncEndMessage 

◆ ConfigCommands

Enumerator
setConfig 
requestConfig 
requestFactorySync 
requestUserSync 
updateConfig 
updateUserConfig 
setConfigState 
factorySyncEnd 
clusterConfigSync 
factorySyncReset 

◆ ConfigItemId

Configuration Item Identifiers.

Enumerator
midiStartChannel 
midiEndChannel 
midiUseMPE 
pitchBendRange 
octave 
transpose 
slideCC 
slideMode 
octaveTopology 
midiChannelRange 
MPEZone 
velocitySensitivity 
glideSensitivity 
slideSensitivity 
pressureSensitivity 
liftSensitivity 
fixedVelocity 
fixedVelocityValue 
pianoMode 
glideLock 
glideLockEnable 
mode 
volume 
scale 
hideMode 
chord 
arpPattern 
tempo 
xTrackingMode 
yTrackingMode 
zTrackingMode 
gammaCorrection 
user0 
user1 
user2 
user3 
user4 
user5 
user6 
user7 
user8 
user9 
user10 
user11 
user12 
user13 
user14 
user15 
user16 
user17 
user18 
user19 
user20 
user21 
user22 
user23 
user24 
user25 
user26 
user27 
user28 
user29 
user30 
user31 

◆ DataChangeCommands

Enumerator
endOfPacket 
endOfChanges 
skipBytesFew 
skipBytesMany 
setSequenceOfBytes 
setFewBytesWithValue 
setFewBytesWithLastValue 
setManyBytesWithValue 

◆ DeviceCommands

Enumerator
beginAPIMode 
requestTopologyMessage 
endAPIMode 
ping 
debugMode 
saveProgramAsDefault 

◆ MessageFromDevice

Messages that a device may send to the host.

Enumerator
deviceTopology 
packetACK 
firmwareUpdateACK 
deviceTopologyExtend 
deviceTopologyEnd 
deviceVersion 
deviceName 
touchStart 
touchMove 
touchEnd 
touchStartWithVelocity 
touchMoveWithVelocity 
touchEndWithVelocity 
configMessage 
controlButtonDown 
controlButtonUp 
programEventMessage 
logMessage 

◆ MessageFromHost

Messages that the host may send to a device.

Enumerator
deviceCommandMessage 
sharedDataChange 
programEventMessage 
firmwareUpdatePacket 
configMessage 
factoryReset 
blockReset 
setName 

Function Documentation

◆ calculatePacketChecksum()

static uint8 juce::BlocksProtocol::calculatePacketChecksum ( const uint8 data,
uint32  size 
)
staticnoexcept

Variable Documentation

◆ apiModeHostPingTimeoutMs

constexpr uint32 juce::BlocksProtocol::apiModeHostPingTimeoutMs = 5000
static

◆ configMaxOptions

constexpr uint8 juce::BlocksProtocol::configMaxOptions = 8
static

◆ configOptionNameLength

constexpr uint8 juce::BlocksProtocol::configOptionNameLength = 16
static

◆ configUserConfigNameLength

constexpr uint8 juce::BlocksProtocol::configUserConfigNameLength = 32
static

◆ controlBlockProgramAndHeapSize

constexpr uint32 juce::BlocksProtocol::controlBlockProgramAndHeapSize = 3000
static

◆ controlBlockStackSize

constexpr uint32 juce::BlocksProtocol::controlBlockStackSize = 800
static

◆ currentProtocolVersion

constexpr uint32 juce::BlocksProtocol::currentProtocolVersion = 1
static

This value is incremented when the format of the API changes in a way which breaks compatibility.

Referenced by juce::BlocksProtocol::HostPacketDecoder< Handler >::handleTopology(), and juce::BlocksProtocol::HostPacketDecoder< Handler >::handleTopologyEnd().

◆ ledProgramLittleFootFunctions

constexpr const char* juce::BlocksProtocol::ledProgramLittleFootFunctions[]
static

◆ maxBlocksInTopologyPacket

constexpr uint8 juce::BlocksProtocol::maxBlocksInTopologyPacket = 6
static

◆ maxConfigIndex

constexpr uint8 juce::BlocksProtocol::maxConfigIndex = uint8 (ConfigItemId::user0) + numberOfUserConfigs
static

◆ maxConnectionsInTopologyPacket

constexpr uint8 juce::BlocksProtocol::maxConnectionsInTopologyPacket = 24
static

◆ numberOfUserConfigs

constexpr uint8 juce::BlocksProtocol::numberOfUserConfigs = 32
static

◆ numProgramMessageInts

◆ padBlockProgramAndHeapSize

constexpr uint32 juce::BlocksProtocol::padBlockProgramAndHeapSize = 7200
static

◆ padBlockStackSize

constexpr uint32 juce::BlocksProtocol::padBlockStackSize = 800
static

◆ roliSysexHeader

const uint8 juce::BlocksProtocol::roliSysexHeader[] = { 0xf0, 0x00, 0x21, 0x10, 0x77 }
static

All sysex messages to or from a BLOCKS device begin with these header bytes.

The next byte that follows indicates the device index within the topology, where the 0x40 bit is set for device->host messages, and clear for host->device messages. The lower 6 bits contain the topology index of the destination or source device.

◆ topologyIndexBits

◆ topologyIndexForBroadcast

constexpr TopologyIndex juce::BlocksProtocol::topologyIndexForBroadcast = 63
static

Use this value as the index if you want a message to be sent to all devices in the group.