Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
midi_arranger.h
1// SPDX-FileCopyrightText: © 2018-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_MIDI_ARRANGER_H__
5#define __GUI_WIDGETS_MIDI_ARRANGER_H__
6
7#include "dsp/position.h"
8#include "gui/backend/tool.h"
10
11#include <gtk/gtk.h>
12
13typedef struct _ArrangerWidget ArrangerWidget;
14typedef struct MidiNote MidiNote;
15typedef struct SnapGrid SnapGrid;
16typedef struct AutomationPoint AutomationPoint;
17typedef struct Channel Channel;
18
25#define MW_MIDI_ARRANGER (MW_MIDI_EDITOR_SPACE->arranger)
26
30//int
31//midi_arranger_widget_get_note_at_y (double y);
32
37void
39 ArrangerWidget * self,
40 Position * pos,
41 int note,
42 ZRegion * region);
43
57int
59 ArrangerWidget * self,
60 Position * pos,
61 bool dry_run);
62
76int
78 ArrangerWidget * self,
79 Position * pos,
80 bool dry_run);
81
88void
90 ArrangerWidget * self,
91 int pitch);
92
97void
99
105int
107
111gboolean
113
123void
125
133GMenu *
135 ArrangerWidget * self,
136 GMenu * menu,
137 double x,
138 double y);
139
140void
141midi_arranger_handle_vertical_zoom_action (
142 ArrangerWidget * self,
143 bool zoom_in);
144
148void
150 ArrangerWidget * self,
151 GtkEventControllerScroll * scroll_controller,
152 double dy);
153
158#endif
Arranger base widget.
void midi_arranger_widget_create_note(ArrangerWidget *self, Position *pos, int note, ZRegion *region)
Returns the note value (0-127) at y.
gboolean midi_arranger_unlisten_notes_source_func(gpointer user_data)
To be used as a source function to unlisten notes.
GMenu * midi_arranger_widget_gen_context_menu(ArrangerWidget *self, GMenu *menu, double x, double y)
Generate a context menu at x, y.
void midi_arranger_listen_notes(ArrangerWidget *self, bool listen)
Listen to the currently selected notes.
int midi_arranger_calc_deltamax_for_note_movement(int y_delta)
Called on move items_y setup.
int midi_arranger_widget_snap_midi_notes_r(ArrangerWidget *self, Position *pos, bool dry_run)
Called during drag_update in the parent when resizing the selection.
int midi_arranger_widget_snap_midi_notes_l(ArrangerWidget *self, Position *pos, bool dry_run)
Called during drag_update in the parent when resizing the selection.
void midi_arranger_widget_reset_transients(ArrangerWidget *self)
Resets the transient of each note in the arranger.
void midi_arranger_widget_set_hovered_note(ArrangerWidget *self, int pitch)
Sets the currently hovered note and queues a redraw if it changed.
void midi_arranger_handle_vertical_zoom_scroll(ArrangerWidget *self, GtkEventControllerScroll *scroll_controller, double dy)
Handle ctrl+shift+scroll.
Position struct and API.
The arranger widget is a canvas that draws all the arranger objects it contains.
Definition arranger.h:113
An automation point inside an AutomationTrack.
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Definition channel.h:63
A MIDI note inside a ZRegion shown in the piano roll.
Definition midi_note.h:50
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:137
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:78