Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
piano_roll_keys.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2021, 2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
9
10#ifndef __GUI_WIDGETS_PIANO_ROLL_KEYS_H__
11#define __GUI_WIDGETS_PIANO_ROLL_KEYS_H__
12
13#include "gui/backend/gtk_widgets/gtk_wrapper.h"
14
15#define PIANO_ROLL_KEYS_WIDGET_TYPE (piano_roll_keys_widget_get_type ())
16G_DECLARE_FINAL_TYPE (
17 PianoRollKeysWidget,
18 piano_roll_keys_widget,
19 Z,
20 PIANO_ROLL_KEYS_WIDGET,
21 GtkWidget)
22
23
28
29#define MW_PIANO_ROLL_KEYS MW_MIDI_EDITOR_SPACE->piano_roll_keys
30
35typedef struct _PianoRollKeysWidget
36{
37 GtkWidget parent_instance;
38
40 int start_key;
41
43 int last_key;
44
46 int last_hovered_key;
47
53 int last_mid_note;
54
60 int note_pressed;
61
67 int note_released;
68
71 double px_per_key;
72
74 double total_key_px;
75
76 GtkGestureClick * click;
77
79 PangoLayout * layout;
80
82 GtkPopoverMenu * popover_menu;
83} PianoRollKeysWidget;
84
89int
90piano_roll_keys_widget_get_font_size (PianoRollKeysWidget * self);
91
92void
93piano_roll_keys_widget_refresh (PianoRollKeysWidget * self);
94
95void
96piano_roll_keys_widget_redraw_note (PianoRollKeysWidget * self, int note);
97
98void
99piano_roll_keys_widget_redraw_full (PianoRollKeysWidget * self);
100
101void
102piano_roll_keys_widget_setup (PianoRollKeysWidget * self);
103
104int
105piano_roll_keys_widget_get_key_from_y (PianoRollKeysWidget * self, double y);
106
110
111#endif
int piano_roll_keys_widget_get_font_size(PianoRollKeysWidget *self)
Returns the appropriate font size based on the current pixels (height) per key.