Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
PBValue Class Reference

#include <MIDI_Inputs/PBValue.hpp>

Detailed Description

Class that listens for MIDI Pitch Bend events on a single address and saves their value.

Examples
Pitch-Bend-Value.ino.

Definition at line 13 of file PBValue.hpp.

Inheritance diagram for PBValue:
Collaboration diagram for PBValue:

Data access

uint16_t getValue () const override
 Get the most recent MIDI value that was received.

Enabling and disabling updatables

void enable ()
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
void disable ()
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
bool isEnabled () const
 Check if this updatable is enabled.
void moveDown ()
 Move down this element in the list.

Detecting changes

bool getDirty () const
 Check if the value was updated since the last time the dirty flag was cleared.
void clearDirty ()
 Clear the dirty flag.

Public Types

using Matcher = PitchBendMIDIMatcher
using MessageType

Public Member Functions

 PBValue (MIDIChannelCable address)
void reset () override
 Reset all values to zero.
bool updateWith (MessageType midimsg) override
 Receive a new MIDI message and update the internal state.
virtual void begin ()
 Initialize the input element.
virtual void update ()
 Update the value of the input element. Used for decaying VU meters etc.

Static Public Member Functions

static bool updateAllWith (MessageType midimsg)
 Update all.
static void updateAll ()
 Update all.
static void beginAll ()
 Begin all.
static void resetAll ()
 Reset all.

Protected Member Functions

void handleUpdate (typename Matcher::Result match) override

Protected Attributes

PitchBendMIDIMatcher matcher
MIDIInputElement< Type > * next
MIDIInputElement< Type > * previous
bool dirty = true

Static Protected Attributes

static DoublyLinkedList< MIDIInputElement< Type > > updatables

Private Attributes

uint16_t value = 0

Member Typedef Documentation

◆ Matcher

Definition at line 17 of file PBValue.hpp.

◆ MessageType

using MessageType
inherited

Definition at line 93 of file MIDIInputElement.hpp.

Constructor & Destructor Documentation

◆ PBValue()

PBValue ( MIDIChannelCable address)
inline
Parameters
addressThe address to listen to.

Definition at line 21 of file PBValue.hpp.

Member Function Documentation

◆ handleUpdate()

void handleUpdate ( typename Matcher::Result match)
inlineoverrideprotectedvirtual

◆ getValue()

uint16_t getValue ( ) const
inlineoverridevirtual

Get the most recent MIDI value that was received.

Implements IValue14.

Examples
Pitch-Bend-Value.ino.

Definition at line 34 of file PBValue.hpp.

◆ reset()

void reset ( )
inlineoverridevirtual

Reset all values to zero.

Reimplemented from MIDIInputElement< Type >.

Definition at line 39 of file PBValue.hpp.

◆ updateWith()

bool updateWith ( MessageType midimsg)
inlineoverridevirtualinherited

Receive a new MIDI message and update the internal state.

Implements MIDIInputElement< Type >.

Definition at line 95 of file MIDIInputElement.hpp.

◆ begin()

virtual void begin ( )
inlinevirtualinherited

Initialize the input element.

Definition at line 34 of file MIDIInputElement.hpp.

◆ update()

virtual void update ( )
inlinevirtualinherited

Update the value of the input element. Used for decaying VU meters etc.

Definition at line 40 of file MIDIInputElement.hpp.

◆ updateAllWith()

bool updateAllWith ( MessageType midimsg)
inlinestaticinherited

Update all.

Definition at line 46 of file MIDIInputElement.hpp.

◆ updateAll()

void updateAll ( )
inlinestaticinherited

Update all.

Definition at line 57 of file MIDIInputElement.hpp.

◆ beginAll()

void beginAll ( )
inlinestaticinherited

Begin all.

Definition at line 62 of file MIDIInputElement.hpp.

◆ resetAll()

void resetAll ( )
inlinestaticinherited

Reset all.

Definition at line 67 of file MIDIInputElement.hpp.

◆ enable()

void enable ( )
inlineinherited

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 96 of file Updatable.hpp.

◆ disable()

void disable ( )
inlineinherited

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 106 of file Updatable.hpp.

◆ isEnabled()

bool isEnabled ( ) const
inlineinherited

Check if this updatable is enabled.

Note
Assumes that the updatable is not added to a different linked list by the user.

Definition at line 120 of file Updatable.hpp.

◆ moveDown()

void moveDown ( )
inlineinherited

Move down this element in the list.

Definition at line 147 of file Updatable.hpp.

◆ getDirty()

bool getDirty ( ) const
inlineinherited

Check if the value was updated since the last time the dirty flag was cleared.

Examples
Pitch-Bend-Value.ino.

Definition at line 40 of file InterfaceMIDIInputElements.hpp.

◆ clearDirty()

void clearDirty ( )
inlineinherited

Clear the dirty flag.

Examples
Pitch-Bend-Value.ino.

Definition at line 42 of file InterfaceMIDIInputElements.hpp.

Member Data Documentation

◆ value

uint16_t value = 0
private

Definition at line 45 of file PBValue.hpp.

◆ matcher

PitchBendMIDIMatcher matcher
protectedinherited

Definition at line 105 of file MIDIInputElement.hpp.

◆ updatables

DoublyLinkedList<MIDIInputElement< Type >> updatables
staticprotectedinherited

Definition at line 152 of file Updatable.hpp.

◆ next

MIDIInputElement< Type >* next
protectedinherited

Definition at line 320 of file LinkedList.hpp.

◆ previous

MIDIInputElement< Type >* previous
protectedinherited

Definition at line 321 of file LinkedList.hpp.

◆ dirty

bool dirty = true
protectedinherited

Definition at line 49 of file InterfaceMIDIInputElements.hpp.


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