Vital
Loading...
Searching...
No Matches
vital::StringLayout Class Reference

Manages a keyboard layout mapping for a computer keyboard used as a MIDI input device. More...

#include <synth_types.h>

Inheritance diagram for vital::StringLayout:
SynthComputerKeyboard

Public Member Functions

 StringLayout ()
 Constructs a StringLayout with no keys and an empty layout.
 
std::wstring getLayout ()
 Retrieves the current keyboard layout (a wstring of character-to-note mappings).
 
void setLayout (const std::wstring &layout)
 Sets the current keyboard layout.
 
wchar_t getUpKey ()
 Gets the character assigned to increase the octave.
 
void setUpKey (wchar_t up_key)
 Sets the character assigned to increase the octave.
 
wchar_t getDownKey ()
 Gets the character assigned to decrease the octave.
 
void setDownKey (wchar_t down_key)
 Sets the character assigned to decrease the octave.
 

Protected Attributes

std::wstring layout_
 The mapping of keys to notes.
 
int up_key_
 The key code (wchar_t) for octave up.
 
int down_key_
 The key code (wchar_t) for octave down.
 

Detailed Description

Manages a keyboard layout mapping for a computer keyboard used as a MIDI input device.

StringLayout stores a layout of characters that map to notes, and keys to shift the octave up or down.

Constructor & Destructor Documentation

◆ StringLayout()

vital::StringLayout::StringLayout ( )
inline

Constructs a StringLayout with no keys and an empty layout.

Member Function Documentation

◆ getDownKey()

wchar_t vital::StringLayout::getDownKey ( )
inline

Gets the character assigned to decrease the octave.

Returns
The down key character.

◆ getLayout()

std::wstring vital::StringLayout::getLayout ( )
inline

Retrieves the current keyboard layout (a wstring of character-to-note mappings).

Returns
The layout as a wstring.

◆ getUpKey()

wchar_t vital::StringLayout::getUpKey ( )
inline

Gets the character assigned to increase the octave.

Returns
The up key character.

◆ setDownKey()

void vital::StringLayout::setDownKey ( wchar_t down_key)
inline

Sets the character assigned to decrease the octave.

Parameters
down_keyThe character for octave down.

◆ setLayout()

void vital::StringLayout::setLayout ( const std::wstring & layout)
inline

Sets the current keyboard layout.

Parameters
layoutThe new keyboard layout.

◆ setUpKey()

void vital::StringLayout::setUpKey ( wchar_t up_key)
inline

Sets the character assigned to increase the octave.

Parameters
up_keyThe character for octave up.

Member Data Documentation

◆ down_key_

int vital::StringLayout::down_key_
protected

The key code (wchar_t) for octave down.

◆ layout_

std::wstring vital::StringLayout::layout_
protected

The mapping of keys to notes.

◆ up_key_

int vital::StringLayout::up_key_
protected

The key code (wchar_t) for octave up.


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