JUCE
|
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... | |
Functions available in the LittleFoot language.
enum ControlType |
enum ControlMode |
Control mode for use with initControl.
Enumerator | |
---|---|
toggle | |
togglePulse | |
gate | |
trigger | |
cycle | |
incDec | |
triState |
Reads and returns the value of a single byte from the heap.
byteIndex | the index (in bytes) of the byte to read |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
Reads 4 bytes from the heap and returns the value as an integer.
byteIndex | the index (in bytes) of the start of the 4 bytes to read |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
Reads a sequence of bits from the heap and returns the value as an integer.
startBitIndex | the index (in bits) of the start of the sequence of bits to read |
numBits | how many bits to read |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
Writes a single byte to the heap.
byteIndex | the index (in bytes) of the byte to set |
newValue | the new value to set this byte to |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
Writes 4 bytes to the heap.
byteIndex | the index (in bytes) of the start of the 4 bytes to set |
newValue | the new value to set the 4 bytes to |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
Returns the smaller of two integer values.
a | The first parameter |
b | The second parameter |
The | minimum of a and b |
Referenced by approximatelyEqual(), BlocksProtocol::HostPacketDecoder< Handler >::handleConfigMessage(), BlockConfigManager::handleConfigUpdateMessage(), dsp::SIMDRegister< Type >::min(), Rectangle< ValueType >::Rectangle, BlockConfigManager::setItemMin(), and BlockConfigManager::ConfigDescription::toConfigMetaData().
float min | ( | float | a, |
float | b | ||
) |
Returns the smaller of two floating point values.
a | The first parameter |
b | The second parameter |
The | minimum of a and b |
Returns the larger of two integer values.
a | The first parameter |
b | The second parameter |
The | maximum of a and b |
Referenced by String::appendCharPointer(), approximatelyEqual(), BlocksProtocol::HostPacketDecoder< Handler >::handleConfigMessage(), BlockConfigManager::handleConfigUpdateMessage(), dsp::SIMDRegister< Type >::max(), dsp::AudioBlock< const SampleType >::process(), Rectangle< ValueType >::Rectangle, BlockConfigManager::setItemMax(), String::toDecimalStringWithSignificantFigures(), and truncatePositiveToUnsignedInt().
float max | ( | float | a, |
float | b | ||
) |
Returns the larger of two floating point values.
a | The first parameter |
b | The second parameter |
The | maximum of a and b |
Constrains an integer value to keep it within a given range.
lowerLimit | the minimum value to return |
upperLimit | the maximum value to return |
valueToConstrain | the value to try to return |
float clamp | ( | float | lowerLimit, |
float | upperLimit, | ||
float | valueToConstrain | ||
) |
Constrains a floating point value to keep it within a given range.
lowerLimit | the minimum value to return |
upperLimit | the maximum value to return |
valueToConstrain | the value to try to return |
Returns the absolute value of an integer value.
arg | The argument to compute the absolute value of |
either | -arg if arg is negative or arg if arg is positive |
Referenced by approximatelyEqual(), NormalisableRange< float >::convertFrom0to1(), NormalisableRange< float >::convertTo0to1(), UnitTest::expectWithinAbsoluteError(), AnimatedPositionBehaviours::ContinuousWithMomentum::getNextPosition(), AnimatedPositionBehaviours::SnapToPageBoundaries::isStopped(), isWithin(), and SmoothedValue< Type >::setStepSize().
float abs | ( | float | arg | ) |
Returns the absolute value of a floating point value.
arg | The argument to compute the absolute value of |
either | -arg if arg is negative or arg if arg is positive |
float map | ( | float | value, |
float | sourceMin, | ||
float | sourceMax, | ||
float | destMin, | ||
float | destMax | ||
) |
Remaps a value from a source range to a target range.
value | the value within the source range to map |
sourceMin | the minimum value of the source range |
sourceMax | the maximum value of the source range |
destMin | the minimum value of the destination range |
destMax | the maximum value of the destination range |
Referenced by MemoryMappedAudioFormatReader::getNumBytesUsed(), and HeavyweightLeakedObjectDetector< OwnerClass >::~HeavyweightLeakedObjectDetector().
float map | ( | float | value, |
float | sourceMin, | ||
float | sourceMax | ||
) |
Remaps a value from a source range to the range 0 - 1.0.
value | the value within the source range to map |
sourceMin | the minimum value of the source range |
sourceMax | the maximum value of the source range |
Performs a modulo operation (can cope with the dividend being negative).
The divisor must be greater than zero.
float getRandomFloat | ( | ) |
Returns a random floating-point number.
Returns a random integer, limited to a given range.
int getMillisecondCounter | ( | ) |
Returns the number of milliseconds since a fixed event (usually system startup).
Referenced by Time::toMilliseconds().
int getTimeInCurrentFunctionCall | ( | ) |
Returns the length of time spent in the current function call in milliseconds.
void log | ( | int | data | ) |
Logs an integer value to the console.
data | The 32 bit signed integer to log to the topology as an integer |
Referenced by NormalisableRange< float >::convertFrom0to1(), NormalisableRange< float >::setSkewForCentre(), and SmoothedValue< Type >::setStepSize().
void logHex | ( | int | data | ) |
Logs a hexadecimal value to the console.
data | The 32 bit signed integer to log to the topology as a hexidecimal int |
void sendMIDI | ( | int | byte0 | ) |
Sends a 1-byte short midi message.
Sends a key-down message.
channel | the midi channel, in the range 0 to 15 |
noteNumber | the key number, in the range 0 to 127 |
velocity | the velocity, in the range 0 to 127 |
Sends a key-up message.
channel | the midi channel, in the range 0 to 15 |
noteNumber | the key number, in the range 0 to 127 |
velocity | the velocity, in the range 0 to 127 |
Sends an aftertouch message.
channel | the midi channel, in the range 0 to 15 |
noteNumber | the key number, in the range 0 to 127 |
level | the amount of aftertouch, in the range 0 to 127 |
Sends a controller message.
channel | the midi channel, in the range 0 to 15 |
controller | the type of controller |
value | the controller value |
Sends a pitch bend message.
channel | the midi channel, in the range 0 to 15 |
position | the wheel position, in the range 0 to 16383 |
Sends a channel-pressure change event.
channel | the midi channel, in the range 0 to 15 |
pressure | the pressure, in the range 0 to 127 |
Sets the MIDI channel range.
useMPE | whether to use MPE mode |
lowChannel | the lowest MIDI channel |
highChannel | the highest MIDI channel |
Assigns a MIDI channel to a note number.
noteNumber | the note number to assign the channel to |
Deassigns a channel from a note number.
noteNumber | the note number to deassign |
channel | the MIDI channel |
int getControlChannel | ( | ) |
Returns the channel that is being used for control messages.
void useMPEDuplicateFilter | ( | bool | active | ) |
Sets whether duplicate notes should be filtered out when MPE is enabled.
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().
void handleButtonDown | ( | int | index | ) |
Called when a button is pushed.
index | the index of the button that was pushed |
void handleButtonUp | ( | int | index | ) |
Called when a button is released.
index | the index of the button that was released |
void onControlPress | ( | int | buttonIndex | ) |
Call this when a control block button is pressed to trigger the buttons default behaviour.
buttonIndex | the index of the button |
void onControlRelease | ( | int | buttonIndex | ) |
Call this when a control block button is released to trigger the buttons default behaviour.
buttonIndex | the index of the button |
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.
index | the touch index, which will stay constant for each finger as it is tracked |
x | the X position of this touch on the device, in block units starting from 0 (left) |
y | the Y position of this touch on the device, in block units starting from 0 (top) |
z | the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard) |
vz | the rate at which pressure is currently changing, measured in units/second |
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.
index | the touch index, which will stay constant for each finger as it is tracked |
x | the X position of this touch on the device, in block units starting from 0 (left) |
y | the Y position of this touch on the device, in block units starting from 0 (top) |
z | the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard) |
vz | the rate at which pressure is currently changing, measured in units/second |
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.
index | the touch index, which will stay constant for each finger as it is tracked |
x | the X position of this touch on the device, in block units starting from 0 (left) |
y | the Y position of this touch on the device, in block units starting from 0 (top) |
z | the current pressure of this touch, in the range 0.0 (no pressure) to 1.0 (very hard) |
vz | the rate at which pressure is currently changing, measured in units/second |
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().
Called when a block receives a message.
Combines a set of 8-bit ARGB values into a 32-bit colour and returns the result.
alpha | The alpha in range 0 - 255 inclusive |
red | The red in range 0 - 255 inclusive |
green | The green in range 0 - 255 inclusive |
blue | The blue in range 0 - 255 inclusive |
Blends the overlaid ARGB colour onto the base one and returns the new colour.
baseColour | the colour to blend on to |
overlaidColour | The colour to blend in to the baseColour |
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.
void clearDisplay | ( | ) |
Clears the display and sets all the LEDs to black.
void clearDisplay | ( | int | rgb | ) |
Clears the display and sets all the LEDs to a specified colour.
rgb | the colour to use (0xff...) |
Sets a pixel to a specified colour with full alpha.
rgb | the colour to use (0xff...) |
x | the x coordinate of the pixel to fill |
y | the y coordinate of the pixel to fill |
Blends the current pixel colour with a specified colour.
argb | the colour to use |
x | the x coordinate of the pixel to blend |
y | the y coordinate of the pixel to blend |
Fills a rectangle on the display with a specified colour.
rgb | the colour to use (0xff...) |
x | the x coordinate of the rectangle to draw |
y | the y coordinate of the rectangle to draw |
width | the width of the rectangle to draw |
height | the height of the rectangle to draw |
Blends a rectangle on the display with a specified colour.
argb | the colour to use |
x | the x coordinate of the rectangle to blend |
y | the y coordinate of the rectangle to blend |
width | the width of the rectangle to blend |
height | the height of the rectangle to blend |
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.
colourNW | the colour to use in the north west corner of the rectangle |
colourNE | the colour to use in the north east corner of the rectangle |
colourSE | the colour to use in the south east corner of the rectangle |
colourSW | the colour to use in the south west corner of the rectangle |
x | the x coordinate of the rectangle |
y | the y coordinate of the rectangle |
width | the width of the rectangle |
height | the height of the rectangle |
void blendCircle | ( | int | argb, |
float | xCentre, | ||
float | yCentre, | ||
float | radius, | ||
bool | fill | ||
) |
Blends a circle on the display with a specified colour.
argb | the colour to use |
xCentre | the x position of the circle's centre in block units |
yCentre | the y position of the circle's centre in block units |
radius | the radius of the circle in block units |
fill | if true then the circle will be filled, if false the circle will be an outline |
Draws a number on the display.
value | the number to draw between 0 and 99 |
colour | the colour to use |
x | the x coordinate to use |
y | the y coordinate to use |
int getFirmwareVersion | ( | ) |
Returns the current firmware version of this block.
float getBatteryLevel | ( | ) |
Returns the battery level of this block, between 0 and 1.0.
bool isBatteryCharging | ( | ) |
Returns true if this block's battery is charging.
void setStatusOverlayActive | ( | bool | active | ) |
Sets whether status overlays should be displayed on this block.
void setPowerSavingEnabled | ( | bool | enabled | ) |
Sets whether power saving mode should be enabled on this block.
Returns the type of the block with a given ID.
Sends a message to the block with the specified ID.
This will be processed in the handleMessage() callback.
blockID | the ID of the block to send this message to |
param1 | the first chunk of data to send |
param2 | the second chunk of data to send |
param3 | the third chunk of data to send |
Sends a message to the host.
To receive this the host will need to implement the Block::ProgramEventListener::handleProgramEvent() method.
param1 | the first chunk of data to send |
param2 | the second chunk of data to send |
param3 | the third chunk of data to send |
void addPressurePoint | ( | int | argb, |
float | touchX, | ||
float | touchY, | ||
float | touchZ | ||
) |
Draws a pressure point with a specified colour and pressure.
argb | the colour to use |
touchX | the x position of the touch in block units |
touchY | the y position of the touch in block units |
touchZ | the pressure value of the touch |
void drawPressureMap | ( | ) |
Draws the pressure map on the display.
void fadePressureMap | ( | ) |
Fades the pressure map on the display.
void linkBlockIDtoController | ( | int | blockID | ) |
Links a another block to this control block.
blockID | the ID of the block to link |
void repaintControl | ( | ) |
Repaints the control block display.
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.
buttonIndex | the index of the button to initialise |
modeToUse | the mode to use for this button |
outputType | the control type to use |
val | the current value to set this button to |
min | the minimum value for this button |
max | the maximum value for this button |
index | the item index |
onColourToUse | the colour to use when this button is on |
offColourToUse | the colour to use when this button is off |
void handleTouchAsSeaboard | ( | int | touchIndex | ) |
Forces a touch event to be handled as seaboard playing.
touchIndex | the index of the touch event |
int getNumBlocksInTopology | ( | ) |
Returns the number of blocks in the current topology.
Returns the ID of a block at a given index in the topology.
index | The index of the block to find in the topology |
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.
bool isConnectedToHost | ( | ) |
Returns true if this block is connected to the host computer, this can be directly or through connections to other blocks.
Returns the ID of a block connected to a specified port on this block.
int getPortToMaster | ( | ) |
Returns the port number that is connected to the master block.
Returns 0xFF if there is no port connected to master.
int getHorizontalDistFromMaster | ( | ) |
Returns the horizontal distance between this block and the master block in block units.
int getVerticalDistFromMaster | ( | ) |
Returns the vertical distance between this block and the master block in block units.
int getAngleFromMaster | ( | ) |
Returns the angle of this block relative to the master block in degrees.
void setAutoRotate | ( | bool | enabled | ) |
Sets whether this block should auto-rotate when its angle relative to the master block changes.
int getClusterIndex | ( | ) |
Returns the index of this block in the current cluster.
int getClusterWidth | ( | ) |
Returns how many blocks wide the current cluster is.
int getClusterHeight | ( | ) |
Returns how many blocks high the current cluster is.
int getClusterXpos | ( | ) |
Returns the x index of this block in the current cluster.
int getClusterYpos | ( | ) |
Returns the y index of this block in the current cluster.
int getNumBlocksInCurrentCluster | ( | ) |
Returns the number of blocks in the current cluster.
Returns the block ID for a block in the current cluster.
index | the cluster index of the block to get the ID of |
bool isMasterInCurrentCluster | ( | ) |
Returns true if the master block is in the current cluster.
Returns current value of one of the local config items.
item | the config item to get (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
Sets the current value of one of the local config items.
item | the config item to set the value of (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
value | the value to set the config to |
Sets the local config of a block to the config item of a remote block.
longAddress | the address of the remote block |
item | the config item (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
Sets the config of a remote block.
longAddress | the address of the remote block |
item | the config item (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
value | the value to set the config to |
Sets the range of one of the local config items.
item | the config item to set the range of (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
min | the minimum value this config item should use |
max | the maximum value this config item should use |
void setLocalConfigActiveState | ( | int | item, |
bool | isActive, | ||
bool | saveToFlash | ||
) |
Sets whether a local config item should be active.
item | the config item to set active (see ConfigItemId enum in juce_BlocksProtocolDefinitions.h) |
isActive | sets whether the config should be active or not |
saveToFlash | if true then this config item will be saved to the flash memory of the block |