This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES > Class Template Reference

#include <Transposer.hpp>

Inheritance diagram for Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >:
Collaboration diagram for Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >:

Public Member Functions

 Transposer (int8_t step=1)
 
setting_t getSelection () const override
 Get the current transposition offset. More...
 
void select (setting_t bankSetting) override
 Select the given bank setting. More...
 
setting_t getInitialSelection () const
 
void setInitialSelection (setting_t initialSelection)
 
uint8_t getTracksPerBank () const
 Get the number of tracks per bank. More...
 
uint8_t getOffset () const
 Get the offset (number of banks times the index of the selected bank) More...
 

Static Public Member Functions

constexpr static uint8_t getNumberOfBanks ()
 Get the number of Banks. More...
 
static setting_t validateSetting (setting_t setting)
 

Static Public Attributes

static constexpr setting_t N = MAXIMUM_SEMITONES - MINIMUM_SEMITONES + 1
 

Private Member Functions

void add (BankableMIDIInput< N > *bankable)
 Add a BankableMIDIInput to the bank. More...
 
void remove (BankableMIDIInput< N > *bankable)
 Remove a BankableMIDIInput from the bank. More...
 

Private Attributes

DoublyLinkedList< BankableMIDIInput< N > > inputBankables
 A linked list of all BankableMIDIInput elements that have been added to this bank, and that should be updated when the bank setting changes. More...
 
setting_t initialSelection
 
uint8_t tracksPerBank
 
setting_t bankSetting
 

Detailed Description

template<int8_t MINIMUM_SEMITONES, int8_t MAXIMUM_SEMITONES>
class Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >

Examples
Transposer.ino.

Definition at line 10 of file Transposer.hpp.

Constructor & Destructor Documentation

◆ Transposer()

template<int8_t MINIMUM_SEMITONES, int8_t MAXIMUM_SEMITONES>
Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >::Transposer ( int8_t  step = 1)
inline

Definition at line 12 of file Transposer.hpp.

Member Function Documentation

◆ getSelection()

template<int8_t MINIMUM_SEMITONES, int8_t MAXIMUM_SEMITONES>
setting_t Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >::getSelection ( ) const
inlineoverridevirtual

Get the current transposition offset.

Todo:
The return type is a uint8_t, but it can be negative. This is not an issue, because the result will be the same, since the addition will just overflow and truncate, but it's not really clean.

Reimplemented from OutputBank.

Definition at line 26 of file Transposer.hpp.

◆ select()

void Bank< N >::select ( setting_t  bankSetting)
overridevirtualinherited

Select the given bank setting.

All BankableMIDIInputs will be updated.

Parameters
bankSettingThe new setting to select.

Implements Selectable< N >.

Definition at line 160 of file Bank.hpp.

◆ getNumberOfBanks()

constexpr static uint8_t Bank< N >::getNumberOfBanks ( )
inlinestaticconstexprinherited

Get the number of Banks.

Examples
Transposer.ino.

Definition at line 107 of file Bank.hpp.

◆ add()

void Bank< N >::add ( BankableMIDIInput< N > *  bankable)
privateinherited

Add a BankableMIDIInput to the bank.

This method is called in the BankableMIDIInput constructor.

Parameters
bankableThe BankableMIDIInput to be added.

Definition at line 150 of file Bank.hpp.

◆ remove()

void Bank< N >::remove ( BankableMIDIInput< N > *  bankable)
privateinherited

Remove a BankableMIDIInput from the bank.

This method is called in the BankableMIDIInput destructor.

Parameters
bankableThe BankableMIDIInput to be removed.

Definition at line 155 of file Bank.hpp.

◆ validateSetting()

template<setting_t N>
static setting_t Selectable< N >::validateSetting ( setting_t  setting)
inlinestaticinherited

Definition at line 19 of file Selectable.hpp.

◆ getInitialSelection()

template<setting_t N>
setting_t Selectable< N >::getInitialSelection ( ) const
inlineinherited

Definition at line 33 of file Selectable.hpp.

◆ setInitialSelection()

template<setting_t N>
void Selectable< N >::setInitialSelection ( setting_t  initialSelection)
inlineinherited

Definition at line 35 of file Selectable.hpp.

◆ getTracksPerBank()

uint8_t OutputBank::getTracksPerBank ( ) const
inlineinherited

Get the number of tracks per bank.

This is the number of addresses/tracks to skip for each bank setting.

Definition at line 55 of file Bank.hpp.

◆ getOffset()

uint8_t OutputBank::getOffset ( ) const
inlineinherited

Get the offset (number of banks times the index of the selected bank)

Definition at line 61 of file Bank.hpp.

Member Data Documentation

◆ N

template<int8_t MINIMUM_SEMITONES, int8_t MAXIMUM_SEMITONES>
constexpr setting_t Transposer< MINIMUM_SEMITONES, MAXIMUM_SEMITONES >::N = MAXIMUM_SEMITONES - MINIMUM_SEMITONES + 1
staticconstexpr

Definition at line 31 of file Transposer.hpp.

◆ inputBankables

DoublyLinkedList<BankableMIDIInput<N> > Bank< N >::inputBankables
privateinherited

A linked list of all BankableMIDIInput elements that have been added to this bank, and that should be updated when the bank setting changes.

The list is updated automatically when BankableMIDIInput elements are created or destroyed.

Definition at line 138 of file Bank.hpp.

◆ initialSelection

template<setting_t N>
setting_t Selectable< N >::initialSelection
privateinherited

Definition at line 40 of file Selectable.hpp.

◆ tracksPerBank

uint8_t OutputBank::tracksPerBank
privateinherited

Definition at line 64 of file Bank.hpp.

◆ bankSetting

setting_t OutputBank::bankSetting
privateinherited

Definition at line 65 of file Bank.hpp.


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