JUCE
Enumerations | Functions
LittleFoot Functions

Functions available in the LittleFoot language. More...

Enumerations

enum  ControlType { internalConfig = 0, midiCC, sysex }
 Control type for use with initControl. More...
 
enum  ControlMode {
  toggle = 0, togglePulse, gate, trigger,
  cycle, incDec, triState
}
 Control mode for use with initControl. More...
 

Functions

int getHeapByte (int byteIndex)
 Reads and returns the value of a single byte from the heap. More...
 
int getHeapInt (int byteIndex)
 Reads 4 bytes from the heap and returns the value as an integer. More...
 
int getHeapBits (int startBitIndex, int numBits)
 Reads a sequence of bits from the heap and returns the value as an integer. More...
 
void setHeapByte (int byteIndex, int newValue)
 Writes a single byte to the heap. More...
 
void setHeapInt (int byteIndex, int newValue)
 Writes 4 bytes to the heap. More...
 
int min (int a, int b)
 Returns the smaller of two integer values. More...
 
float min (float a, float b)
 Returns the smaller of two floating point values. More...
 
int max (int a, int b)
 Returns the larger of two integer values. More...
 
float max (float a, float b)
 Returns the larger of two floating point values. More...
 
int clamp (int lowerLimit, int upperLimit, int valueToConstrain)
 Constrains an integer value to keep it within a given range. More...
 
float clamp (float lowerLimit, float upperLimit, float valueToConstrain)
 Constrains a floating point value to keep it within a given range. More...
 
int abs (int arg)
 Returns the absolute value of an integer value. More...
 
float abs (float arg)
 Returns the absolute value of a floating point value. More...
 
float map (float value, float sourceMin, float sourceMax, float destMin, float destMax)
 Remaps a value from a source range to a target range. More...
 
float map (float value, float sourceMin, float sourceMax)
 Remaps a value from a source range to the range 0 - 1.0. More...
 
int mod (int dividend, int divisor)
 Performs a modulo operation (can cope with the dividend being negative). More...
 
float getRandomFloat ()
 Returns a random floating-point number. More...
 
int getRandomInt (int maxValue)
 Returns a random integer, limited to a given range. More...
 
int getMillisecondCounter ()
 Returns the number of milliseconds since a fixed event (usually system startup). More...
 
int getTimeInCurrentFunctionCall ()
 Returns the length of time spent in the current function call in milliseconds. More...
 
void log (int data)
 Logs an integer value to the console. More...
 
void logHex (int data)
 Logs a hexadecimal value to the console. More...
 
void sendMIDI (int byte0)
 Sends a 1-byte short midi message. More...
 
void sendMIDI (int byte0, int byte1)
 Sends a 2-byte short midi message. More...
 
void sendMIDI (int byte0, int byte1, int byte2)
 Sends a 3-byte short midi message. More...
 
void sendNoteOn (int channel, int noteNumber, int velocity)
 Sends a key-down message. More...
 
void sendNoteOff (int channel, int noteNumber, int velocity)
 Sends a key-up message. More...
 
void sendAftertouch (int channel, int noteNumber, int level)
 Sends an aftertouch message. More...
 
void sendCC (int channel, int controller, int value)
 Sends a controller message. More...
 
void sendPitchBend (int channel, int position)
 Sends a pitch bend message. More...
 
void sendChannelPressure (int channel, int pressure)
 Sends a channel-pressure change event. More...
 
void setChannelRange (bool useMPE, int lowChannel, int highChannel)
 Sets the MIDI channel range. More...
 
int assignChannel (int noteNumber)
 Assigns a MIDI channel to a note number. More...
 
void deassignChannel (int noteNumber, int channel)
 Deassigns a channel from a note number. More...
 
int getControlChannel ()
 Returns the channel that is being used for control messages. More...
 
void useMPEDuplicateFilter (bool active)
 Sets whether duplicate notes should be filtered out when MPE is enabled. More...
 
void repaint ()
 Use this method to draw the display. More...
 
void handleButtonDown (int index)
 Called when a button is pushed. More...
 
void handleButtonUp (int index)
 Called when a button is released. More...
 
void onControlPress (int buttonIndex)
 Call this when a control block button is pressed to trigger the buttons default behaviour. More...
 
void onControlRelease (int buttonIndex)
 Call this when a control block button is released to trigger the buttons default behaviour. More...
 
void touchStart (int index, float x, float y, float z, float vz)
 Called when a touch event starts. More...
 
void touchMove (int index, float x, float y, float z, float vz)
 Called when a touch event moves. More...
 
void touchEnd (int index, float x, float y, float z, float vz)
 Called when a touch event ends. More...
 
void initialise ()
 Called when a program is loaded onto the block and is about to start. More...
 
void handleMIDI (int byte0, int byte1, int byte2)
 Called when a block receives a MIDI message. More...
 
void handleMessage (int param1, int param2, int param3)
 Called when a block receives a message. More...
 
int makeARGB (int alpha, int red, int green, int blue)
 Combines a set of 8-bit ARGB values into a 32-bit colour and returns the result. More...
 
int blendARGB (int baseColour, int overlaidColour)
 Blends the overlaid ARGB colour onto the base one and returns the new colour. More...
 
void displayBatteryLevel ()
 Displays an animation indicating the current battery level of this block. More...
 
void clearDisplay ()
 Clears the display and sets all the LEDs to black. More...
 
void clearDisplay (int rgb)
 Clears the display and sets all the LEDs to a specified colour. More...
 
void fillPixel (int rgb, int x, int y)
 Sets a pixel to a specified colour with full alpha. More...
 
void blendPixel (int argb, int x, int y)
 Blends the current pixel colour with a specified colour. More...
 
void fillRect (int rgb, int x, int y, int width, int height)
 Fills a rectangle on the display with a specified colour. More...
 
void blendRect (int argb, int x, int y, int width, int height)
 Blends a rectangle on the display with a specified colour. More...
 
void blendGradientRect (int colourNW, int colourNE, int colourSE, int colourSW, int x, int y, int width, int height)
 Fills a rectangle on the display with four corner colours blended together. More...
 
void blendCircle (int argb, float xCentre, float yCentre, float radius, bool fill)
 Blends a circle on the display with a specified colour. More...
 
void drawNumber (int value, int colour, int x, int y)
 Draws a number on the display. More...
 
int getFirmwareVersion ()
 Returns the current firmware version of this block. More...
 
float getBatteryLevel ()
 Returns the battery level of this block, between 0 and 1.0. More...
 
bool isBatteryCharging ()
 Returns true if this block's battery is charging. More...
 
void setStatusOverlayActive (bool active)
 Sets whether status overlays should be displayed on this block. More...
 
void setPowerSavingEnabled (bool enabled)
 Sets whether power saving mode should be enabled on this block. More...
 
int getBlockTypeForID (int blockID)
 Returns the type of the block with a given ID. More...
 
void sendMessageToBlock (int blockID, int param1, int param2, int param3)
 Sends a message to the block with the specified ID. More...
 
void sendMessageToHost (int param1, int param2, int param3)
 Sends a message to the host. More...
 
void addPressurePoint (int argb, float touchX, float touchY, float touchZ)
 Draws a pressure point with a specified colour and pressure. More...
 
void drawPressureMap ()
 Draws the pressure map on the display. More...
 
void fadePressureMap ()
 Fades the pressure map on the display. More...
 
void linkBlockIDtoController (int blockID)
 Links a another block to this control block. More...
 
void repaintControl ()
 Repaints the control block display. More...
 
void initControl (int buttonIndex, int modeToUse, int outputType, int val, int min, int max, int index, int onColourToUse, int offColourToUse)
 Initialises one of the control block buttons. More...
 
void handleTouchAsSeaboard (int touchIndex)
 Forces a touch event to be handled as seaboard playing. More...
 
int getNumBlocksInTopology ()
 Returns the number of blocks in the current topology. More...
 
int getBlockIDForIndex (int index)
 Returns the ID of a block at a given index in the topology. More...
 
bool isMasterBlock ()
 Returns true if this block is directly connected to the host, as opposed to only being connected to a different block via a connection port. More...
 
bool isConnectedToHost ()
 Returns true if this block is connected to the host computer, this can be directly or through connections to other blocks. More...
 
int getBlockIDOnPort (int port)
 Returns the ID of a block connected to a specified port on this block. More...
 
int getPortToMaster ()
 Returns the port number that is connected to the master block. More...
 
int getHorizontalDistFromMaster ()
 Returns the horizontal distance between this block and the master block in block units. More...
 
int getVerticalDistFromMaster ()
 Returns the vertical distance between this block and the master block in block units. More...
 
int getAngleFromMaster ()
 Returns the angle of this block relative to the master block in degrees. More...
 
void setAutoRotate (bool enabled)
 Sets whether this block should auto-rotate when its angle relative to the master block changes. More...
 
int getClusterIndex ()
 Returns the index of this block in the current cluster. More...
 
int getClusterWidth ()
 Returns how many blocks wide the current cluster is. More...
 
int getClusterHeight ()
 Returns how many blocks high the current cluster is. More...
 
int getClusterXpos ()
 Returns the x index of this block in the current cluster. More...
 
int getClusterYpos ()
 Returns the y index of this block in the current cluster. More...
 
int getNumBlocksInCurrentCluster ()
 Returns the number of blocks in the current cluster. More...
 
int getBlockIdForBlockInCluster (int index)
 Returns the block ID for a block in the current cluster. More...
 
bool isMasterInCurrentCluster ()
 Returns true if the master block is in the current cluster. More...
 
int getLocalConfig (int item)
 Returns current value of one of the local config items. More...
 
void setLocalConfig (int item, int value)
 Sets the current value of one of the local config items. More...
 
void requestRemoteConfig (int longAddress, int item)
 Sets the local config of a block to the config item of a remote block. More...
 
void setRemoteConfig (int longAddress, int item, int value)
 Sets the config of a remote block. More...
 
void setLocalConfigItemRange (int item, int min, int max)
 Sets the range of one of the local config items. More...
 
void setLocalConfigActiveState (int item, bool isActive, bool saveToFlash)
 Sets whether a local config item should be active. More...
 

Detailed Description

Functions available in the LittleFoot language.

Enumeration Type Documentation

◆ ControlType

Control type for use with initControl.

See also
initControl
Enumerator
internalConfig 
midiCC 
sysex 

◆ ControlMode

Control mode for use with initControl.

See also
initControl
Enumerator
toggle 
togglePulse 
gate 
trigger 
cycle 
incDec 
triState 

Function Documentation

◆ getHeapByte()

int getHeapByte ( int  byteIndex)

Reads and returns the value of a single byte from the heap.

Parameters
byteIndexthe index (in bytes) of the byte to read
Returns
the value of the byte

Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().

◆ getHeapInt()

int getHeapInt ( int  byteIndex)

Reads 4 bytes from the heap and returns the value as an integer.

Parameters
byteIndexthe index (in bytes) of the start of the 4 bytes to read
Returns
the value of the 4 bytes as an integer

Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().

◆ getHeapBits()

int getHeapBits ( int  startBitIndex,
int  numBits 
)

Reads a sequence of bits from the heap and returns the value as an integer.

Parameters
startBitIndexthe index (in bits) of the start of the sequence of bits to read
numBitshow many bits to read
Returns
the value of the sequence of bits as an integer

Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().

◆ setHeapByte()

void setHeapByte ( int  byteIndex,
int  newValue 
)

Writes a single byte to the heap.

Parameters
byteIndexthe index (in bytes) of the byte to set
newValuethe new value to set this byte to

Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().

◆ setHeapInt()

void setHeapInt ( int  byteIndex,
int  newValue 
)

Writes 4 bytes to the heap.

Parameters
byteIndexthe index (in bytes) of the start of the 4 bytes to set
newValuethe new value to set the 4 bytes to

Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().

◆ min() [1/2]

int min ( int  a,
int  b 
)

◆ min() [2/2]

float min ( float  a,
float  b 
)

Returns the smaller of two floating point values.

Parameters
aThe first parameter
bThe second parameter
Return values
Theminimum of a and b

◆ max() [1/2]

int max ( int  a,
int  b 
)

◆ max() [2/2]

float max ( float  a,
float  b 
)

Returns the larger of two floating point values.

Parameters
aThe first parameter
bThe second parameter
Return values
Themaximum of a and b

◆ clamp() [1/2]

int clamp ( int  lowerLimit,
int  upperLimit,
int  valueToConstrain 
)

Constrains an integer value to keep it within a given range.

Parameters
lowerLimitthe minimum value to return
upperLimitthe maximum value to return
valueToConstrainthe value to try to return
Returns
the closest value to valueToConstrain which lies between lowerLimit and upperLimit (inclusive)

◆ clamp() [2/2]

float clamp ( float  lowerLimit,
float  upperLimit,
float  valueToConstrain 
)

Constrains a floating point value to keep it within a given range.

Parameters
lowerLimitthe minimum value to return
upperLimitthe maximum value to return
valueToConstrainthe value to try to return
Returns
the closest value to valueToConstrain which lies between lowerLimit and upperLimit (inclusive)

◆ abs() [1/2]

int abs ( int  arg)

◆ abs() [2/2]

float abs ( float  arg)

Returns the absolute value of a floating point value.

Parameters
argThe argument to compute the absolute value of
Return values
either-arg if arg is negative or arg if arg is positive

◆ map() [1/2]

float map ( float  value,
float  sourceMin,
float  sourceMax,
float  destMin,
float  destMax 
)

Remaps a value from a source range to a target range.

Parameters
valuethe value within the source range to map
sourceMinthe minimum value of the source range
sourceMaxthe maximum value of the source range
destMinthe minimum value of the destination range
destMaxthe maximum value of the destination range
Returns
the original value mapped to the destination range

Referenced by MemoryMappedAudioFormatReader::getNumBytesUsed(), and HeavyweightLeakedObjectDetector< OwnerClass >::~HeavyweightLeakedObjectDetector().

◆ map() [2/2]

float map ( float  value,
float  sourceMin,
float  sourceMax 
)

Remaps a value from a source range to the range 0 - 1.0.

Parameters
valuethe value within the source range to map
sourceMinthe minimum value of the source range
sourceMaxthe maximum value of the source range
Returns
the original value mapped to the range 0 - 1.0

◆ mod()

int mod ( int  dividend,
int  divisor 
)

Performs a modulo operation (can cope with the dividend being negative).

The divisor must be greater than zero.

Returns
the result of the modulo operation

◆ getRandomFloat()

float getRandomFloat ( )

Returns a random floating-point number.

Returns
a random value in the range 0 (inclusive) to 1.0 (exclusive)

◆ getRandomInt()

int getRandomInt ( int  maxValue)

Returns a random integer, limited to a given range.

Returns
a random integer between 0 (inclusive) and maxValue (exclusive).

◆ getMillisecondCounter()

int getMillisecondCounter ( )

Returns the number of milliseconds since a fixed event (usually system startup).

Returns
a monotonically increasing value which is unaffected by changes to the system clock. It should be accurate to within a few millisecseconds.

Referenced by Time::toMilliseconds().

◆ getTimeInCurrentFunctionCall()

int getTimeInCurrentFunctionCall ( )

Returns the length of time spent in the current function call in milliseconds.

Returns
the length of time spent in the current function call in milliseconds.

◆ log()

void log ( int  data)

Logs an integer value to the console.

Parameters
dataThe 32 bit signed integer to log to the topology as an integer

Referenced by NormalisableRange< float >::convertFrom0to1(), NormalisableRange< float >::setSkewForCentre(), and SmoothedValue< Type >::setStepSize().

◆ logHex()

void logHex ( int  data)

Logs a hexadecimal value to the console.

Parameters
dataThe 32 bit signed integer to log to the topology as a hexidecimal int

◆ sendMIDI() [1/3]

void sendMIDI ( int  byte0)

Sends a 1-byte short midi message.

◆ sendMIDI() [2/3]

void sendMIDI ( int  byte0,
int  byte1 
)

Sends a 2-byte short midi message.

◆ sendMIDI() [3/3]

void sendMIDI ( int  byte0,
int  byte1,
int  byte2 
)

Sends a 3-byte short midi message.

◆ sendNoteOn()

void sendNoteOn ( int  channel,
int  noteNumber,
int  velocity 
)

Sends a key-down message.

Parameters
channelthe midi channel, in the range 0 to 15
noteNumberthe key number, in the range 0 to 127
velocitythe velocity, in the range 0 to 127

◆ sendNoteOff()

void sendNoteOff ( int  channel,
int  noteNumber,
int  velocity 
)

Sends a key-up message.

Parameters
channelthe midi channel, in the range 0 to 15
noteNumberthe key number, in the range 0 to 127
velocitythe velocity, in the range 0 to 127

◆ sendAftertouch()

void sendAftertouch ( int  channel,
int  noteNumber,
int  level 
)

Sends an aftertouch message.

Parameters
channelthe midi channel, in the range 0 to 15
noteNumberthe key number, in the range 0 to 127
levelthe amount of aftertouch, in the range 0 to 127

◆ sendCC()

void sendCC ( int  channel,
int  controller,
int  value 
)

Sends a controller message.

Parameters
channelthe midi channel, in the range 0 to 15
controllerthe type of controller
valuethe controller value

◆ sendPitchBend()

void sendPitchBend ( int  channel,
int  position 
)

Sends a pitch bend message.

Parameters
channelthe midi channel, in the range 0 to 15
positionthe wheel position, in the range 0 to 16383

◆ sendChannelPressure()

void sendChannelPressure ( int  channel,
int  pressure 
)

Sends a channel-pressure change event.

Parameters
channelthe midi channel, in the range 0 to 15
pressurethe pressure, in the range 0 to 127

◆ setChannelRange()

void setChannelRange ( bool  useMPE,
int  lowChannel,
int  highChannel 
)

Sets the MIDI channel range.

Parameters
useMPEwhether to use MPE mode
lowChannelthe lowest MIDI channel
highChannelthe highest MIDI channel

◆ assignChannel()

int assignChannel ( int  noteNumber)

Assigns a MIDI channel to a note number.

Parameters
noteNumberthe note number to assign the channel to
Returns
the MIDI channel that has been assigned

◆ deassignChannel()

void deassignChannel ( int  noteNumber,
int  channel 
)

Deassigns a channel from a note number.

Parameters
noteNumberthe note number to deassign
channelthe MIDI channel

◆ getControlChannel()

int getControlChannel ( )

Returns the channel that is being used for control messages.

Returns
the channel that is being used for control messages. (If MPE is enabled then this will be the first channel.)

◆ useMPEDuplicateFilter()

void useMPEDuplicateFilter ( bool  active)

Sets whether duplicate notes should be filtered out when MPE is enabled.

◆ repaint()

void repaint ( )

Use this method to draw the display.

The block will call this approximately 25 times per second.

Referenced by Component::findParentComponentOfClass(), and ComponentPeer::getConstrainer().

◆ handleButtonDown()

void handleButtonDown ( int  index)

Called when a button is pushed.

Parameters
indexthe index of the button that was pushed

◆ handleButtonUp()

void handleButtonUp ( int  index)

Called when a button is released.

Parameters
indexthe index of the button that was released

◆ onControlPress()

void onControlPress ( int  buttonIndex)

Call this when a control block button is pressed to trigger the buttons default behaviour.

Parameters
buttonIndexthe index of the button
Note
Requires >= 0.2.5 firmware
Only valid with a control block
See also
initControl onControlRelease

◆ onControlRelease()

void onControlRelease ( int  buttonIndex)

Call this when a control block button is released to trigger the buttons default behaviour.

Parameters
buttonIndexthe index of the button
Note
Requires >= 0.2.5 firmware
Only valid with a control block
See also
initControl onControlPress

◆ touchStart()

void touchStart ( int  index,
float  x,
float  y,
float  z,
float  vz 
)

Called when a touch event starts.

Block units follow the number of DNA connectors on the side of the device. For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.

Parameters
indexthe touch index, which will stay constant for each finger as it is tracked
xthe X position of this touch on the device, in block units starting from 0 (left)
ythe Y position of this touch on the device, in block units starting from 0 (top)
zthe current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
vzthe rate at which pressure is currently changing, measured in units/second

◆ touchMove()

void touchMove ( int  index,
float  x,
float  y,
float  z,
float  vz 
)

Called when a touch event moves.

Block units follow the number of DNA connectors on the side of the device. For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.

Parameters
indexthe touch index, which will stay constant for each finger as it is tracked
xthe X position of this touch on the device, in block units starting from 0 (left)
ythe Y position of this touch on the device, in block units starting from 0 (top)
zthe current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
vzthe rate at which pressure is currently changing, measured in units/second

◆ touchEnd()

void touchEnd ( int  index,
float  x,
float  y,
float  z,
float  vz 
)

Called when a touch event ends.

Block units follow the number of DNA connectors on the side of the device. For instance, a Lightpad Block is 2x2 and a Control Block is 2x1.

Parameters
indexthe touch index, which will stay constant for each finger as it is tracked
xthe X position of this touch on the device, in block units starting from 0 (left)
ythe Y position of this touch on the device, in block units starting from 0 (top)
zthe current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard)
vzthe rate at which pressure is currently changing, measured in units/second

◆ initialise()

void initialise ( )

Called when a program is loaded onto the block and is about to start.

Do any setup here.

Referenced by UnitTest::getCategory(), OpenGLAppComponent::getFrameCounter(), JUCEApplicationBase::getInstance(), and SharedResourcePointer< SharedObjectType >::getReferenceCount().

◆ handleMIDI()

void handleMIDI ( int  byte0,
int  byte1,
int  byte2 
)

Called when a block receives a MIDI message.

◆ handleMessage()

void handleMessage ( int  param1,
int  param2,
int  param3 
)

Called when a block receives a message.

See also
sendMessageToBlock

◆ makeARGB()

int makeARGB ( int  alpha,
int  red,
int  green,
int  blue 
)

Combines a set of 8-bit ARGB values into a 32-bit colour and returns the result.

Returns
a 32-bit colour
Parameters
alphaThe alpha in range 0 - 255 inclusive
redThe red in range 0 - 255 inclusive
greenThe green in range 0 - 255 inclusive
blueThe blue in range 0 - 255 inclusive

◆ blendARGB()

int blendARGB ( int  baseColour,
int  overlaidColour 
)

Blends the overlaid ARGB colour onto the base one and returns the new colour.

Parameters
baseColourthe colour to blend on to
overlaidColourThe colour to blend in to the baseColour
Returns
The blended colour

◆ displayBatteryLevel()

void displayBatteryLevel ( )

Displays an animation indicating the current battery level of this block.

A control block will light up its top LEDs indicating battery level and a lightpad block will draw the battery level on the display.

Note
Requires >= 0.2.5 firmware

◆ clearDisplay() [1/2]

void clearDisplay ( )

Clears the display and sets all the LEDs to black.

◆ clearDisplay() [2/2]

void clearDisplay ( int  rgb)

Clears the display and sets all the LEDs to a specified colour.

Parameters
rgbthe colour to use (0xff...)

◆ fillPixel()

void fillPixel ( int  rgb,
int  x,
int  y 
)

Sets a pixel to a specified colour with full alpha.

Parameters
rgbthe colour to use (0xff...)
xthe x coordinate of the pixel to fill
ythe y coordinate of the pixel to fill

◆ blendPixel()

void blendPixel ( int  argb,
int  x,
int  y 
)

Blends the current pixel colour with a specified colour.

Parameters
argbthe colour to use
xthe x coordinate of the pixel to blend
ythe y coordinate of the pixel to blend

◆ fillRect()

void fillRect ( int  rgb,
int  x,
int  y,
int  width,
int  height 
)

Fills a rectangle on the display with a specified colour.

Parameters
rgbthe colour to use (0xff...)
xthe x coordinate of the rectangle to draw
ythe y coordinate of the rectangle to draw
widththe width of the rectangle to draw
heightthe height of the rectangle to draw

◆ blendRect()

void blendRect ( int  argb,
int  x,
int  y,
int  width,
int  height 
)

Blends a rectangle on the display with a specified colour.

Parameters
argbthe colour to use
xthe x coordinate of the rectangle to blend
ythe y coordinate of the rectangle to blend
widththe width of the rectangle to blend
heightthe height of the rectangle to blend

◆ blendGradientRect()

void blendGradientRect ( int  colourNW,
int  colourNE,
int  colourSE,
int  colourSW,
int  x,
int  y,
int  width,
int  height 
)

Fills a rectangle on the display with four corner colours blended together.

Parameters
colourNWthe colour to use in the north west corner of the rectangle
colourNEthe colour to use in the north east corner of the rectangle
colourSEthe colour to use in the south east corner of the rectangle
colourSWthe colour to use in the south west corner of the rectangle
xthe x coordinate of the rectangle
ythe y coordinate of the rectangle
widththe width of the rectangle
heightthe height of the rectangle

◆ blendCircle()

void blendCircle ( int  argb,
float  xCentre,
float  yCentre,
float  radius,
bool  fill 
)

Blends a circle on the display with a specified colour.

Parameters
argbthe colour to use
xCentrethe x position of the circle's centre in block units
yCentrethe y position of the circle's centre in block units
radiusthe radius of the circle in block units
fillif true then the circle will be filled, if false the circle will be an outline
Note
Requires >= 0.2.5 firmware

◆ drawNumber()

void drawNumber ( int  value,
int  colour,
int  x,
int  y 
)

Draws a number on the display.

Parameters
valuethe number to draw between 0 and 99
colourthe colour to use
xthe x coordinate to use
ythe y coordinate to use

◆ getFirmwareVersion()

int getFirmwareVersion ( )

Returns the current firmware version of this block.

Returns
The firmware version of the form 0xMJMIRV (where MJ = Major, MI = Minor, RV = Revision)
Note
Requires >= 0.2.5 firmware

◆ getBatteryLevel()

float getBatteryLevel ( )

Returns the battery level of this block, between 0 and 1.0.

Returns
the battery level of this block, between 0 and 1.0.
Note
Requires >= 0.2.5 firmware

◆ isBatteryCharging()

bool isBatteryCharging ( )

Returns true if this block's battery is charging.

Returns
true if this block's battery is charging
Note
Requires >= 0.2.5 firmware

◆ setStatusOverlayActive()

void setStatusOverlayActive ( bool  active)

Sets whether status overlays should be displayed on this block.

Note
Requires >= 0.2.5 firmware

◆ setPowerSavingEnabled()

void setPowerSavingEnabled ( bool  enabled)

Sets whether power saving mode should be enabled on this block.

Note
Requires >= 0.2.5 firmware

◆ getBlockTypeForID()

int getBlockTypeForID ( int  blockID)

Returns the type of the block with a given ID.

Returns
an enum indicating the type of block
See also
Block::Type
Note
Requires >= 0.2.5 firmware

◆ sendMessageToBlock()

void sendMessageToBlock ( int  blockID,
int  param1,
int  param2,
int  param3 
)

Sends a message to the block with the specified ID.

This will be processed in the handleMessage() callback.

Parameters
blockIDthe ID of the block to send this message to
param1the first chunk of data to send
param2the second chunk of data to send
param3the third chunk of data to send

◆ sendMessageToHost()

void sendMessageToHost ( int  param1,
int  param2,
int  param3 
)

Sends a message to the host.

To receive this the host will need to implement the Block::ProgramEventListener::handleProgramEvent() method.

Parameters
param1the first chunk of data to send
param2the second chunk of data to send
param3the third chunk of data to send

◆ addPressurePoint()

void addPressurePoint ( int  argb,
float  touchX,
float  touchY,
float  touchZ 
)

Draws a pressure point with a specified colour and pressure.

Parameters
argbthe colour to use
touchXthe x position of the touch in block units
touchYthe y position of the touch in block units
touchZthe pressure value of the touch

◆ drawPressureMap()

void drawPressureMap ( )

Draws the pressure map on the display.

◆ fadePressureMap()

void fadePressureMap ( )

Fades the pressure map on the display.

◆ linkBlockIDtoController()

void linkBlockIDtoController ( int  blockID)

Links a another block to this control block.

Parameters
blockIDthe ID of the block to link
Note
Requires >= 0.2.5 firmware
Only valid with a control block

◆ repaintControl()

void repaintControl ( )

Repaints the control block display.

Note
Requires >= 0.2.5 firmware
Only valid with a control block

◆ initControl()

void initControl ( int  buttonIndex,
int  modeToUse,
int  outputType,
int  val,
int  min,
int  max,
int  index,
int  onColourToUse,
int  offColourToUse 
)

Initialises one of the control block buttons.

Parameters
buttonIndexthe index of the button to initialise
modeToUsethe mode to use for this button
See also
ControlMode
Parameters
outputTypethe control type to use
See also
ControlType
Parameters
valthe current value to set this button to
minthe minimum value for this button
maxthe maximum value for this button
indexthe item index
onColourToUsethe colour to use when this button is on
offColourToUsethe colour to use when this button is off
Note
Requires >= 0.2.5 firmware
Only valid with a control block

◆ handleTouchAsSeaboard()

void handleTouchAsSeaboard ( int  touchIndex)

Forces a touch event to be handled as seaboard playing.

Parameters
touchIndexthe index of the touch event
Note
Requires >= 0.2.5 firmware
Only valid on a Seaboard

◆ getNumBlocksInTopology()

int getNumBlocksInTopology ( )

Returns the number of blocks in the current topology.

Note
Requires >= 0.2.5 firmware

◆ getBlockIDForIndex()

int getBlockIDForIndex ( int  index)

Returns the ID of a block at a given index in the topology.

Parameters
indexThe index of the block to find in the topology
Returns
int The id of the block
Note
Requires >= 0.2.5 firmware

◆ isMasterBlock()

bool isMasterBlock ( )

Returns true if this block is directly connected to the host, as opposed to only being connected to a different block via a connection port.

Note
Requires >= 0.2.5 firmware

◆ isConnectedToHost()

bool isConnectedToHost ( )

Returns true if this block is connected to the host computer, this can be directly or through connections to other blocks.

Note
Requires >= 0.2.5 firmware

◆ getBlockIDOnPort()

int getBlockIDOnPort ( int  port)

Returns the ID of a block connected to a specified port on this block.

Note
Requires >= 0.2.5 firmware

◆ getPortToMaster()

int getPortToMaster ( )

Returns the port number that is connected to the master block.

Returns 0xFF if there is no port connected to master.

Returns
the port number that is connected to the master block. Returns 0xFF if there is no port connected to master.
Note
Requires >= 0.2.5 firmware

◆ getHorizontalDistFromMaster()

int getHorizontalDistFromMaster ( )

Returns the horizontal distance between this block and the master block in block units.

Note
Requires >= 0.2.5 firmware

◆ getVerticalDistFromMaster()

int getVerticalDistFromMaster ( )

Returns the vertical distance between this block and the master block in block units.

Note
Requires >= 0.2.5 firmware

◆ getAngleFromMaster()

int getAngleFromMaster ( )

Returns the angle of this block relative to the master block in degrees.

Note
Requires >= 0.2.5 firmware

◆ setAutoRotate()

void setAutoRotate ( bool  enabled)

Sets whether this block should auto-rotate when its angle relative to the master block changes.

Note
Requires >= 0.2.5 firmware

◆ getClusterIndex()

int getClusterIndex ( )

Returns the index of this block in the current cluster.

Note
Requires >= 0.2.5 firmware

◆ getClusterWidth()

int getClusterWidth ( )

Returns how many blocks wide the current cluster is.

Returns
the width of the cluster (note that a single block will return 1 here)
Note
Requires >= 0.2.5 firmware

◆ getClusterHeight()

int getClusterHeight ( )

Returns how many blocks high the current cluster is.

Returns
the height of the cluster (note that a single block will return 1 here)
Note
Requires >= 0.2.5 firmware

◆ getClusterXpos()

int getClusterXpos ( )

Returns the x index of this block in the current cluster.

Returns
int The cluster x position. (0, 0) is considered to be the top left block
Note
Requires >= 0.2.5 firmware

◆ getClusterYpos()

int getClusterYpos ( )

Returns the y index of this block in the current cluster.

Returns
int The cluster x position. (0, 0) is considered to be the top left block
Note
Requires >= 0.2.5 firmware

◆ getNumBlocksInCurrentCluster()

int getNumBlocksInCurrentCluster ( )

Returns the number of blocks in the current cluster.

Returns
the number of blocks in the current cluster.
Note
Requires >= 0.2.5 firmware

◆ getBlockIdForBlockInCluster()

int getBlockIdForBlockInCluster ( int  index)

Returns the block ID for a block in the current cluster.

Parameters
indexthe cluster index of the block to get the ID of
Note
Requires >= 0.2.5 firmware

◆ isMasterInCurrentCluster()

bool isMasterInCurrentCluster ( )

Returns true if the master block is in the current cluster.

Note
Requires >= 0.2.5 firmware

◆ getLocalConfig()

int getLocalConfig ( int  item)

Returns current value of one of the local config items.

Parameters
itemthe config item to get (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
Note
Requires >= 0.2.5 firmware

◆ setLocalConfig()

void setLocalConfig ( int  item,
int  value 
)

Sets the current value of one of the local config items.

Parameters
itemthe config item to set the value of (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
valuethe value to set the config to
Note
Requires >= 0.2.5 firmware

◆ requestRemoteConfig()

void requestRemoteConfig ( int  longAddress,
int  item 
)

Sets the local config of a block to the config item of a remote block.

Parameters
longAddressthe address of the remote block
itemthe config item (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
Note
Requires >= 0.2.5 firmware

◆ setRemoteConfig()

void setRemoteConfig ( int  longAddress,
int  item,
int  value 
)

Sets the config of a remote block.

Parameters
longAddressthe address of the remote block
itemthe config item (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
valuethe value to set the config to
Note
Requires >= 0.2.5 firmware

◆ setLocalConfigItemRange()

void setLocalConfigItemRange ( int  item,
int  min,
int  max 
)

Sets the range of one of the local config items.

Parameters
itemthe config item to set the range of (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
minthe minimum value this config item should use
maxthe maximum value this config item should use
Note
Requires >= 0.2.5 firmware

◆ setLocalConfigActiveState()

void setLocalConfigActiveState ( int  item,
bool  isActive,
bool  saveToFlash 
)

Sets whether a local config item should be active.

Parameters
itemthe config item to set active (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h)
isActivesets whether the config should be active or not
saveToFlashif true then this config item will be saved to the flash memory of the block
Note
Requires >= 0.2.5 firmware