The Tooba
 All Data Structures Namespaces Files Functions Variables Macros Pages
Public Member Functions | Data Fields
Key Class Reference

#include <key.h>

Collaboration diagram for Key:
Collaboration graph
[legend]

Public Member Functions

 Key ()
 
uint32_t check (void)
 

Data Fields

uint32_t id
 
uint32_t state
 
uint32_t count
 
float pitch
 
Voicevoice
 

Detailed Description

Representation of a key on the keyboard. Handles keyboard scanning and voice assignment.

Definition at line 11 of file key.h.

Constructor & Destructor Documentation

Key::Key ( )
inline

Definition at line 35 of file key.h.

Member Function Documentation

uint32_t Key::check ( void  )

Capacitively checks to see if this key is being touched.

Returns
RC charge time, in arbitrary units

Definition at line 8 of file key.cpp.

Here is the call graph for this function:

Field Documentation

uint32_t Key::count

This counter is used for hysteresis (debouncing).

Definition at line 24 of file key.h.

Referenced by check().

uint32_t Key::id

A numerical index of this key, used to address it in the analog mux array.

Definition at line 16 of file key.h.

Referenced by setup().

float Key::pitch

This is actually a frequency, not a pitch.

Todo:
Replace this with a pointer to a Pitch instance. (Need a Pitch class.)

Definition at line 29 of file key.h.

Referenced by check(), and setup().

uint32_t Key::state

1 if the key is touched, 0 otherwise.

Definition at line 20 of file key.h.

Referenced by check().

Voice* Key::voice

The voice being used to sound this key.

Todo:
Move this pointer to the Pitch class, when it exists.

Definition at line 34 of file key.h.

Referenced by check().


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