Ardour  9.0-pre0-822-g12e3bc5c20
APianoKeyboard Class Reference

#include <pianokeyboard.h>

Inheritance diagram for APianoKeyboard:
[legend]

Classes

struct  PKNote
 

Public Member Functions

 APianoKeyboard ()
 
 ~APianoKeyboard ()
 
void sustain_press ()
 
void sustain_release ()
 
void set_note_on (int note)
 
void set_note_off (int note)
 
void reset ()
 
void set_grand_piano_highlight (bool enabled)
 
void set_annotate_layout (bool enabled)
 
void set_annotate_octave (bool enabled)
 
void set_monophonic (bool monophonic)
 
void set_octave (int octave)
 
void set_octave_range (int octave_range)
 
void set_keyboard_layout (PianoKeyBindings::Layout layout)
 
void set_velocities (int min_vel, int max_vel, int key_vel)
 

Public Attributes

sigc::signal< void, int, int > NoteOn
 
sigc::signal< void, int > NoteOff
 
sigc::signal< void > Rest
 
sigc::signal< void, bool > SustainChanged
 
sigc::signal< void, int, bool > PitchBend
 
sigc::signal< void, int > SetVelocity
 
sigc::signal< void, bool > SwitchOctave
 

Protected Member Functions

bool on_key_press_event (GdkEventKey *)
 
bool on_key_release_event (GdkEventKey *)
 
bool on_button_press_event (GdkEventButton *)
 
bool on_button_release_event (GdkEventButton *)
 
bool on_motion_notify_event (GdkEventMotion *)
 
bool on_expose_event (GdkEventExpose *)
 
void on_size_request (Gtk::Requisition *)
 
void on_size_allocate (Gtk::Allocation &)
 

Private Member Functions

void annotate_layout (cairo_t *cr, int note) const
 
void annotate_note (cairo_t *cr, int note) const
 
void draw_note (cairo_t *cr, int note) const
 
void queue_note_draw (int note)
 
bool handle_fixed_keys (GdkEventKey *)
 
void press_key (int key, int vel)
 
void release_key (int key)
 
void stop_sustained_notes ()
 
void stop_unsustained_notes ()
 
int get_note_for_xy (int x, int y) const
 
int get_velocity_for_note_at_y (int note, int y) const
 
int is_black (int key) const
 
double black_key_left_shift (int key) const
 
void recompute_dimensions ()
 

Private Attributes

bool _sustain_new_notes
 
bool _highlight_grand_piano_range
 
bool _annotate_layout
 
bool _annotate_octave
 
int _octave
 
int _octave_range
 
int _note_being_pressed_using_mouse
 
int _min_note
 
int _max_note
 
int _last_key
 
bool _monophonic
 
int _min_velocity
 
int _max_velocity
 
int _key_velocity
 
PKNote _notes [(128)]
 
PianoKeyBindings _keyboard_layout
 
std::map< std::string, int > _note_stack
 
PangoFontDescription * _font_cue
 
PangoFontDescription * _font_octave
 

Detailed Description

Definition at line 30 of file pianokeyboard.h.

Constructor & Destructor Documentation

◆ APianoKeyboard()

APianoKeyboard::APianoKeyboard ( )

◆ ~APianoKeyboard()

APianoKeyboard::~APianoKeyboard ( )

Member Function Documentation

◆ annotate_layout()

void APianoKeyboard::annotate_layout ( cairo_t *  cr,
int  note 
) const
private

◆ annotate_note()

void APianoKeyboard::annotate_note ( cairo_t *  cr,
int  note 
) const
private

◆ black_key_left_shift()

double APianoKeyboard::black_key_left_shift ( int  key) const
private

◆ draw_note()

void APianoKeyboard::draw_note ( cairo_t *  cr,
int  note 
) const
private

◆ get_note_for_xy()

int APianoKeyboard::get_note_for_xy ( int  x,
int  y 
) const
private

◆ get_velocity_for_note_at_y()

int APianoKeyboard::get_velocity_for_note_at_y ( int  note,
int  y 
) const
private

◆ handle_fixed_keys()

bool APianoKeyboard::handle_fixed_keys ( GdkEventKey *  )
private

◆ is_black()

int APianoKeyboard::is_black ( int  key) const
private

◆ on_button_press_event()

bool APianoKeyboard::on_button_press_event ( GdkEventButton *  )
protected

◆ on_button_release_event()

bool APianoKeyboard::on_button_release_event ( GdkEventButton *  )
protected

◆ on_expose_event()

bool APianoKeyboard::on_expose_event ( GdkEventExpose *  )
protected

◆ on_key_press_event()

bool APianoKeyboard::on_key_press_event ( GdkEventKey *  )
protected

◆ on_key_release_event()

bool APianoKeyboard::on_key_release_event ( GdkEventKey *  )
protected

◆ on_motion_notify_event()

bool APianoKeyboard::on_motion_notify_event ( GdkEventMotion *  )
protected

◆ on_size_allocate()

void APianoKeyboard::on_size_allocate ( Gtk::Allocation &  )
protected

◆ on_size_request()

void APianoKeyboard::on_size_request ( Gtk::Requisition *  )
protected

◆ press_key()

void APianoKeyboard::press_key ( int  key,
int  vel 
)
private

◆ queue_note_draw()

void APianoKeyboard::queue_note_draw ( int  note)
private

◆ recompute_dimensions()

void APianoKeyboard::recompute_dimensions ( )
private

◆ release_key()

void APianoKeyboard::release_key ( int  key)
private

◆ reset()

void APianoKeyboard::reset ( )

◆ set_annotate_layout()

void APianoKeyboard::set_annotate_layout ( bool  enabled)

◆ set_annotate_octave()

void APianoKeyboard::set_annotate_octave ( bool  enabled)

◆ set_grand_piano_highlight()

void APianoKeyboard::set_grand_piano_highlight ( bool  enabled)

◆ set_keyboard_layout()

void APianoKeyboard::set_keyboard_layout ( PianoKeyBindings::Layout  layout)

◆ set_monophonic()

void APianoKeyboard::set_monophonic ( bool  monophonic)

◆ set_note_off()

void APianoKeyboard::set_note_off ( int  note)

◆ set_note_on()

void APianoKeyboard::set_note_on ( int  note)

◆ set_octave()

void APianoKeyboard::set_octave ( int  octave)

◆ set_octave_range()

void APianoKeyboard::set_octave_range ( int  octave_range)

◆ set_velocities()

void APianoKeyboard::set_velocities ( int  min_vel,
int  max_vel,
int  key_vel 
)

◆ stop_sustained_notes()

void APianoKeyboard::stop_sustained_notes ( )
private

◆ stop_unsustained_notes()

void APianoKeyboard::stop_unsustained_notes ( )
private

◆ sustain_press()

void APianoKeyboard::sustain_press ( )

◆ sustain_release()

void APianoKeyboard::sustain_release ( )

Member Data Documentation

◆ _annotate_layout

bool APianoKeyboard::_annotate_layout
private

Definition at line 114 of file pianokeyboard.h.

◆ _annotate_octave

bool APianoKeyboard::_annotate_octave
private

Definition at line 115 of file pianokeyboard.h.

◆ _font_cue

PangoFontDescription* APianoKeyboard::_font_cue
private

Definition at line 133 of file pianokeyboard.h.

◆ _font_octave

PangoFontDescription* APianoKeyboard::_font_octave
private

Definition at line 134 of file pianokeyboard.h.

◆ _highlight_grand_piano_range

bool APianoKeyboard::_highlight_grand_piano_range
private

Definition at line 113 of file pianokeyboard.h.

◆ _key_velocity

int APianoKeyboard::_key_velocity
private

Definition at line 125 of file pianokeyboard.h.

◆ _keyboard_layout

PianoKeyBindings APianoKeyboard::_keyboard_layout
private

Definition at line 129 of file pianokeyboard.h.

◆ _last_key

int APianoKeyboard::_last_key
private

Definition at line 121 of file pianokeyboard.h.

◆ _max_note

int APianoKeyboard::_max_note
private

Definition at line 120 of file pianokeyboard.h.

◆ _max_velocity

int APianoKeyboard::_max_velocity
private

Definition at line 124 of file pianokeyboard.h.

◆ _min_note

int APianoKeyboard::_min_note
private

Definition at line 119 of file pianokeyboard.h.

◆ _min_velocity

int APianoKeyboard::_min_velocity
private

Definition at line 123 of file pianokeyboard.h.

◆ _monophonic

bool APianoKeyboard::_monophonic
private

Definition at line 122 of file pianokeyboard.h.

◆ _note_being_pressed_using_mouse

int APianoKeyboard::_note_being_pressed_using_mouse
private

Definition at line 118 of file pianokeyboard.h.

◆ _note_stack

std::map<std::string, int> APianoKeyboard::_note_stack
private

Definition at line 130 of file pianokeyboard.h.

◆ _notes

PKNote APianoKeyboard::_notes[(128)]
private

Definition at line 127 of file pianokeyboard.h.

◆ _octave

int APianoKeyboard::_octave
private

Definition at line 116 of file pianokeyboard.h.

◆ _octave_range

int APianoKeyboard::_octave_range
private

Definition at line 117 of file pianokeyboard.h.

◆ _sustain_new_notes

bool APianoKeyboard::_sustain_new_notes
private

Definition at line 112 of file pianokeyboard.h.

◆ NoteOff

sigc::signal<void, int> APianoKeyboard::NoteOff

Definition at line 37 of file pianokeyboard.h.

◆ NoteOn

sigc::signal<void, int, int> APianoKeyboard::NoteOn

Definition at line 36 of file pianokeyboard.h.

◆ PitchBend

sigc::signal<void, int, bool> APianoKeyboard::PitchBend

Definition at line 40 of file pianokeyboard.h.

◆ Rest

sigc::signal<void> APianoKeyboard::Rest

Definition at line 38 of file pianokeyboard.h.

◆ SetVelocity

sigc::signal<void, int> APianoKeyboard::SetVelocity

Definition at line 41 of file pianokeyboard.h.

◆ SustainChanged

sigc::signal<void,bool> APianoKeyboard::SustainChanged

Definition at line 39 of file pianokeyboard.h.

◆ SwitchOctave

sigc::signal<void, bool> APianoKeyboard::SwitchOctave

Definition at line 42 of file pianokeyboard.h.


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