AgsGui.Piano

g AgsGui.Piano AgsGui.Piano GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable->AgsGui.Piano Gtk.Widget->AgsGui.Piano

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Orientable (2)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

key_code_to_note (key_code)

class

new (orientation, key_width, key_height)

get_active_key (active_key_count)

get_base_key_code ()

get_base_note ()

get_button_state ()

get_key_count ()

get_key_height ()

get_key_width ()

key_clicked (note, key_code)

key_pressed (note, key_code)

key_released (note, key_code)

set_base_key_code (base_key_code)

set_base_note (base_note)

set_button_state (button_state)

set_key_count (key_count)

set_key_height (key_height)

set_key_width (key_width)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

do_key_clicked (note, key_code)

do_key_pressed (note, key_code)

do_key_released (note, key_code)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.Orientable (1)

Name

Type

Flags

Short Description

base-key-code

int

r/w

The base key code

base-note

str

r/w

The base note to use as lower

key-count

int

r/w

The count of keys to draw

key-height

int

r/w

The key height to use for drawing

key-width

int

r/w

The key width to use for drawing

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

key-clicked

The ::key-clicked signal notifies about key clicked.

key-pressed

The ::key-pressed signal notifies about key pressed.

key-released

The ::key-released signal notifies about key released.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

active_key

int

r

active_key_count

int

r

base_key_code

int

r

base_note

str

r

button_state

AgsGui.PianoButtonState

r

current_key

int

r

cursor_position

int

r

flags

AgsGui.PianoFlags

r

font_size

int

r

key_count

int

r

key_height

int

r

key_width

int

r

orientation

Gtk.Orientation

r

widget

Gtk.Widget

r

Class Details

class AgsGui.Piano(**kwargs)
Bases:

Gtk.Widget, Gtk.Orientable

Abstract:

No

Structure:

AgsGui.PianoClass

classmethod key_code_to_note(key_code)
Parameters:

key_code (int) – the key code

Returns:

the note as string

Return type:

str

Get note from key code.

New in version 3.0.0.

classmethod new(orientation, key_width, key_height)
Parameters:
Returns:

the new AgsGui.Piano instance

Return type:

AgsGui.Piano

Create a new instance of AgsGui.Piano.

New in version 3.0.0.

get_active_key(active_key_count)
Parameters:

active_key_count (int) – return location of count of active keys

Returns:

the active keys as int array

Return type:

int

Get active keys.

New in version 3.0.0.

get_base_key_code()
Returns:

the base key code

Return type:

int

Get base key code of self.

New in version 3.2.0.

get_base_note()
Returns:

the base note

Return type:

str

Get base note of self.

New in version 3.2.0.

get_button_state()
Returns:

the button state

Return type:

int

Get mouse button state of self.

New in version 3.6.6.

get_key_count()
Returns:

the key count

Return type:

int

Get key count of self.

New in version 3.2.0.

get_key_height()
Returns:

the key height

Return type:

int

Get key height of self.

New in version 3.2.0.

get_key_width()
Returns:

the key width

Return type:

int

Get key width of self.

New in version 3.2.0.

key_clicked(note, key_code)
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-clicked event.

New in version 3.0.0.

key_pressed(note, key_code)
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-pressed event.

New in version 3.0.0.

key_released(note, key_code)
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-released event.

New in version 3.0.0.

set_base_key_code(base_key_code)
Parameters:

base_key_code (int) – the base key code

Set base key code of self.

New in version 3.2.0.

set_base_note(base_note)
Parameters:

base_note (str) – the base note

Set base note of self.

New in version 3.2.0.

set_button_state(button_state)
Parameters:

button_state (int) – the AgsGui.PianoButtonState-enum

Set button_state of self.

New in version 3.6.6.

set_key_count(key_count)
Parameters:

key_count (int) – the key count

Set key count of self.

New in version 3.2.0.

set_key_height(key_height)
Parameters:

key_height (int) – the key width

Set key width of self.

New in version 3.2.0.

set_key_width(key_width)
Parameters:

key_width (int) – the base note

Set key width of self.

New in version 3.2.0.

do_key_clicked(note, key_code) virtual
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-clicked event.

New in version 3.0.0.

do_key_pressed(note, key_code) virtual
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-pressed event.

New in version 3.0.0.

do_key_released(note, key_code) virtual
Parameters:
  • note (str) – the string representation of key

  • key_code (int) – the key code

Emits ::key-released event.

New in version 3.0.0.

Signal Details

AgsGui.Piano.signals.key_clicked(piano, note, key_code)
Signal Name:

key-clicked

Flags:

RUN_LAST

Parameters:
  • piano (AgsGui.Piano) – The object which received the signal

  • note (str) – the note as string

  • key_code (int) – the numeric representation of the note

The ::key-clicked signal notifies about key clicked.

New in version 3.0.0.

AgsGui.Piano.signals.key_pressed(piano, note, key_code)
Signal Name:

key-pressed

Flags:

RUN_LAST

Parameters:
  • piano (AgsGui.Piano) – The object which received the signal

  • note (str) – the note as string

  • key_code (int) – the numeric representation of the note

The ::key-pressed signal notifies about key pressed.

New in version 3.0.0.

AgsGui.Piano.signals.key_released(piano, note, key_code)
Signal Name:

key-released

Flags:

RUN_LAST

Parameters:
  • piano (AgsGui.Piano) – The object which received the signal

  • note (str) – the note as string

  • key_code (int) – the numeric representation of the note

The ::key-released signal notifies about key released.

New in version 3.0.0.

Property Details

AgsGui.Piano.props.base_key_code
Name:

base-key-code

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The base key code.

New in version 3.0.0.

AgsGui.Piano.props.base_note
Name:

base-note

Type:

str

Default Value:

'C,,'

Flags:

READABLE, WRITABLE

The base note to use as lower.

New in version 3.0.0.

AgsGui.Piano.props.key_count
Name:

key-count

Type:

int

Default Value:

128

Flags:

READABLE, WRITABLE

The count of keys to be drawn.

New in version 3.0.0.

AgsGui.Piano.props.key_height
Name:

key-height

Type:

int

Default Value:

14

Flags:

READABLE, WRITABLE

The key height to use for drawing a key.

New in version 3.0.0.

AgsGui.Piano.props.key_width
Name:

key-width

Type:

int

Default Value:

60

Flags:

READABLE, WRITABLE

The key width to use for drawing a key.

New in version 3.0.0.