Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
piano_roll_keys.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2019-2021, 2023 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
12#ifndef __GUI_WIDGETS_PIANO_ROLL_KEYS_H__
13#define __GUI_WIDGETS_PIANO_ROLL_KEYS_H__
14
15#include <gtk/gtk.h>
16
17#define PIANO_ROLL_KEYS_WIDGET_TYPE (piano_roll_keys_widget_get_type ())
18G_DECLARE_FINAL_TYPE (
19 PianoRollKeysWidget,
20 piano_roll_keys_widget,
21 Z,
22 PIANO_ROLL_KEYS_WIDGET,
23 GtkWidget)
24
25
31#define MW_PIANO_ROLL_KEYS MW_MIDI_EDITOR_SPACE->piano_roll_keys
32
37typedef struct _PianoRollKeysWidget
38{
39 GtkWidget parent_instance;
40
42 int start_key;
43
45 int last_key;
46
48 int last_hovered_key;
49
55 int last_mid_note;
56
62 int note_pressed;
63
69 int note_released;
70
73 double px_per_key;
74
76 double total_key_px;
77
78 GtkGestureClick * click;
79
81 PangoLayout * layout;
82
84 GtkPopoverMenu * popover_menu;
85} PianoRollKeysWidget;
86
91int
92piano_roll_keys_widget_get_font_size (PianoRollKeysWidget * self);
93
94void
95piano_roll_keys_widget_refresh (PianoRollKeysWidget * self);
96
97void
98piano_roll_keys_widget_redraw_note (PianoRollKeysWidget * self, int note);
99
100void
101piano_roll_keys_widget_redraw_full (PianoRollKeysWidget * self);
102
103void
104piano_roll_keys_widget_setup (PianoRollKeysWidget * self);
105
106int
107piano_roll_keys_widget_get_key_from_y (PianoRollKeysWidget * self, double y);
108
113#endif
int piano_roll_keys_widget_get_font_size(PianoRollKeysWidget *self)
Returns the appropriate font size based on the current pixels (height) per key.