JUCE
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
juce::Block Class Referenceabstract

Represents an individual BLOCKS device. More...

+ Inheritance diagram for juce::Block:

Classes

struct  ConnectionPort
 These are the edge-connectors that a device may have. More...
 
struct  DataInputPortListener
 Interface for objects listening to input data port. More...
 

Public Types

enum  Type {
  unknown = 0, lightPadBlock, liveBlock, loopBlock,
  developerControlBlock
}
 The different block types. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< Block >
 The Block class is reference-counted, so always use a Block::Ptr when you are keeping references to them. More...
 
using Array = juce::ReferenceCountedArray< Block >
 The Block class is reference-counted, so Block::Array is useful when you are storing lists of them. More...
 
using UID = uint64
 
using Timestamp = uint32
 This type is used for timestamping events. More...
 

Public Member Functions

virtual ~Block ()
 Destructor. More...
 
virtual Type getType () const =0
 Returns the type of this device. More...
 
virtual juce::String getDeviceDescription () const =0
 Returns a human-readable description of this device type. More...
 
virtual float getBatteryLevel () const =0
 Returns the battery level in the range 0.0 to 1.0. More...
 
virtual bool isBatteryCharging () const =0
 Returns true if the battery is charging. More...
 
virtual bool isConnected () const =0
 Returns true if this block is connected and active. More...
 
virtual bool isMasterBlock () const =0
 Returns true if this block is directly connected to the application, as opposed to only being connected to a different block via a connection port. More...
 
virtual int getWidth () const =0
 Returns the width of the device in logical device units. More...
 
virtual int getHeight () const =0
 Returns the height of the device in logical device units. More...
 
virtual bool isHardwareBlock () const =0
 Returns true if the device is a physical hardware block (i.e. More...
 
virtual float getMillimetersPerUnit () const =0
 Returns the length of one logical device unit as physical millimeters. More...
 
virtual LEDGridgetLEDGrid () const =0
 If this block has a grid of LEDs, this will return an object to control it. More...
 
virtual LEDRowgetLEDRow () const =0
 If this block has a row of LEDs, this will return an object to control it. More...
 
virtual juce::Array< StatusLight * > getStatusLights () const =0
 If this block has any status LEDs, this will return an array of objects to control them. More...
 
virtual TouchSurfacegetTouchSurface () const =0
 If this block has a pressure-sensitive surface, this will return an object to access its data. More...
 
virtual juce::Array< ControlButton * > getButtons () const =0
 If this block has any control buttons, this will return an array of objects to control them. More...
 
virtual bool supportsGraphics () const =0
 This returns true if the block supports generating graphics by drawing into a JUCE Graphics context. More...
 
virtual juce::Array< ConnectionPortgetPorts () const =0
 Returns a list of the connectors that this device has. More...
 
virtual void addDataInputPortListener (DataInputPortListener *)
 Adds a new listener of data input port. More...
 
virtual void removeDataInputPortListener (DataInputPortListener *)
 Removes a listener of data input port. More...
 
virtual void sendMessage (const void *messageData, size_t messageSize)=0
 Sends a message to the block. More...
 

Public Attributes

const juce::String serialNumber
 The Block's serial number. More...
 
const UID uid
 This Block's UID. More...
 

Protected Member Functions

 Block (const juce::String &serialNumberToUse)
 

Protected Attributes

juce::ListenerList< DataInputPortListenerdataInputPortListeners
 

Detailed Description

Represents an individual BLOCKS device.

Member Typedef Documentation

§ Ptr

using juce::Block::Ptr = juce::ReferenceCountedObjectPtr<Block>

The Block class is reference-counted, so always use a Block::Ptr when you are keeping references to them.

§ Array

using juce::Block::Array = juce::ReferenceCountedArray<Block>

The Block class is reference-counted, so Block::Array is useful when you are storing lists of them.

§ UID

§ Timestamp

This type is used for timestamping events.

It represents a number of milliseconds since the block device was booted.

Member Enumeration Documentation

§ Type

The different block types.

See also
Block::getType()
Enumerator
unknown 
lightPadBlock 
liveBlock 
loopBlock 
developerControlBlock 

Constructor & Destructor Documentation

§ ~Block()

virtual juce::Block::~Block ( )
virtual

Destructor.

§ Block()

juce::Block::Block ( const juce::String &  serialNumberToUse)
protected

Member Function Documentation

§ getType()

virtual Type juce::Block::getType ( ) const
pure virtual

Returns the type of this device.

See also
Block::Type

§ getDeviceDescription()

virtual juce::String juce::Block::getDeviceDescription ( ) const
pure virtual

Returns a human-readable description of this device type.

§ getBatteryLevel()

virtual float juce::Block::getBatteryLevel ( ) const
pure virtual

Returns the battery level in the range 0.0 to 1.0.

§ isBatteryCharging()

virtual bool juce::Block::isBatteryCharging ( ) const
pure virtual

Returns true if the battery is charging.

§ isConnected()

virtual bool juce::Block::isConnected ( ) const
pure virtual

Returns true if this block is connected and active.

§ isMasterBlock()

virtual bool juce::Block::isMasterBlock ( ) const
pure virtual

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

See also
ConnectionPort

§ getWidth()

virtual int juce::Block::getWidth ( ) const
pure virtual

Returns the width of the device in logical device units.

§ getHeight()

virtual int juce::Block::getHeight ( ) const
pure virtual

Returns the height of the device in logical device units.

§ isHardwareBlock()

virtual bool juce::Block::isHardwareBlock ( ) const
pure virtual

Returns true if the device is a physical hardware block (i.e.

not a virtual block).

§ getMillimetersPerUnit()

virtual float juce::Block::getMillimetersPerUnit ( ) const
pure virtual

Returns the length of one logical device unit as physical millimeters.

§ getLEDGrid()

virtual LEDGrid* juce::Block::getLEDGrid ( ) const
pure virtual

If this block has a grid of LEDs, this will return an object to control it.

Note that the pointer that is returned belongs to this object, and the caller must neither delete it or use it after the lifetime of this Block object has finished. If there are no LEDs, then this method will return nullptr.

§ getLEDRow()

virtual LEDRow* juce::Block::getLEDRow ( ) const
pure virtual

If this block has a row of LEDs, this will return an object to control it.

Note that the pointer that is returned belongs to this object, and the caller must neither delete it or use it after the lifetime of this Block object has finished. If there are no LEDs, then this method will return nullptr.

§ getStatusLights()

virtual juce::Array<StatusLight*> juce::Block::getStatusLights ( ) const
pure virtual

If this block has any status LEDs, this will return an array of objects to control them.

Note that the objects in the array belong to this Block object, and the caller must neither delete them or use them after the lifetime of this Block object has finished.

§ getTouchSurface()

virtual TouchSurface* juce::Block::getTouchSurface ( ) const
pure virtual

If this block has a pressure-sensitive surface, this will return an object to access its data.

Note that the pointer returned does is owned by this object, and the caller must neither delete it or use it after the lifetime of this Block object has finished. If the device is not touch-sensitive, then this method will return nullptr.

§ getButtons()

virtual juce::Array<ControlButton*> juce::Block::getButtons ( ) const
pure virtual

If this block has any control buttons, this will return an array of objects to control them.

Note that the objects in the array belong to this Block object, and the caller must neither delete them or use them after the lifetime of this Block object has finished.

§ supportsGraphics()

virtual bool juce::Block::supportsGraphics ( ) const
pure virtual

This returns true if the block supports generating graphics by drawing into a JUCE Graphics context.

This should only be true for virtual on-screen blocks; hardware blocks will instead use the LED Grid for visuals.

§ getPorts()

virtual juce::Array<ConnectionPort> juce::Block::getPorts ( ) const
pure virtual

Returns a list of the connectors that this device has.

§ addDataInputPortListener()

virtual void juce::Block::addDataInputPortListener ( DataInputPortListener )
virtual

Adds a new listener of data input port.

§ removeDataInputPortListener()

virtual void juce::Block::removeDataInputPortListener ( DataInputPortListener )
virtual

Removes a listener of data input port.

§ sendMessage()

virtual void juce::Block::sendMessage ( const void *  messageData,
size_t  messageSize 
)
pure virtual

Sends a message to the block.

Member Data Documentation

§ serialNumber

const juce::String juce::Block::serialNumber

The Block's serial number.

§ uid

const UID juce::Block::uid

This Block's UID.

This will be globally unique, and remains constant for a particular device.

§ dataInputPortListeners

juce::ListenerList<DataInputPortListener> juce::Block::dataInputPortListeners
protected

The documentation for this class was generated from the following file: