Synth.cpp
 All Data Structures Namespaces Files Functions Variables Macros
Public Member Functions | Data Fields
Key Class Reference

#include <synth.h>

Inheritance diagram for Key:
Inheritance graph
[legend]
Collaboration diagram for Key:
Collaboration graph
[legend]

Public Member Functions

 Key ()
 
void check (void)
 
void keydown (void)
 
void keyup (void)
 

Data Fields

uint32_t id
 
uint32_t state
 
uint32_t count
 
int8_t pitch
 
IVoicevoice
 

Detailed Description

Representation of a key on the keyboard. Handles keyboard scanning and issuing keydown/keyup events to an ISynth instance.

Definition at line 278 of file synth.h.

Constructor & Destructor Documentation

Key::Key ( )
inline

Definition at line 301 of file synth.h.

Member Function Documentation

void Key::check ( void  )

Checks to see if this key is being pressed/touched. Debounces using a hysteresis state machine.

Definition at line 330 of file synth.cpp.

Here is the call graph for this function:

void Key::keydown ( void  )

Default keydown behavior is to call keydown on the current synth and pass it the pitch. This behavior can be overridden.

Definition at line 360 of file synth.cpp.

Referenced by check().

Here is the call graph for this function:

Here is the caller graph for this function:

void Key::keyup ( void  )

Default keyup behavior is to call keyup on the current synth and pass it the pitch. This behavior can be overridden.

Definition at line 366 of file synth.cpp.

Referenced by check().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

uint32_t Key::count

This counter is used for hysteresis (debouncing).

Definition at line 291 of file synth.h.

Referenced by check(), and Key().

uint32_t Key::id

A numerical index of this key, used to identify it for keyboard scanning.

Definition at line 283 of file synth.h.

Referenced by setup().

int8_t Key::pitch

An integer, increments for each half-tone in pitch.

Definition at line 295 of file synth.h.

Referenced by keydown(), keyup(), and setup().

uint32_t Key::state

1 if the key is pressed/touched, 0 otherwise.

Definition at line 287 of file synth.h.

Referenced by check(), Key(), and FunctionKey::keydown().

IVoice* Key::voice

The voice being used to sound this key.

Definition at line 299 of file synth.h.

Referenced by Key().


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