Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
piano_keyboard.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: © 2020-2022 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
13#ifndef __GUI_WIDGETS_PIANO_KEYBOARD_H__
14#define __GUI_WIDGETS_PIANO_KEYBOARD_H__
15
16#include <stdbool.h>
17
18#include <gtk/gtk.h>
19
20#define PIANO_KEYBOARD_WIDGET_TYPE (piano_keyboard_widget_get_type ())
21G_DECLARE_FINAL_TYPE (
23 piano_keyboard_widget,
24 Z,
25 PIANO_KEYBOARD_WIDGET,
26 GtkDrawingArea)
27
28typedef struct ChordDescriptor ChordDescriptor;
29
39typedef struct _PianoKeyboardWidget
40{
41 GtkDrawingArea parent_instance;
42
45
48
49 int pressed_keys[128];
50 int num_pressed_keys;
51
55
58
61
63 GtkOrientation orientation;
64
68
69 bool for_chord;
70
72
77piano_keyboard_widget_new (GtkOrientation orientation);
78
79void
80piano_keyboard_widget_refresh (PianoKeyboardWidget * self);
81
87
92#endif
PianoKeyboardWidget * piano_keyboard_widget_new_for_chord_key(const int chord_idx)
Creates a piano keyboard widget.
PianoKeyboardWidget * piano_keyboard_widget_new(GtkOrientation orientation)
Creates a piano keyboard widget.
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
Piano Keyboard widget.
int num_keys
Number of visible keys (1-128).
int chord_idx
Chord index, if this widget is for a chord key.
GtkOrientation orientation
Horizontal/vertical.
bool scrollable
When true, start key can change and when false the keys are fixed.
bool editable
Whether clicking on keys "enables" them.
bool playable
Whether clicking on keys plays them.