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_UNDERSCORED (ArrangerWrapperWidget);
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_wrapper->child)
26
31void
33 ArrangerWidget * self,
34 Position * pos,
35 int note,
36 ZRegion * region);
37
51int
53 ArrangerWidget * self,
54 Position * pos,
55 bool dry_run);
56
70int
72 ArrangerWidget * self,
73 Position * pos,
74 bool dry_run);
75
82void
84
89void
91
97int
99
103gboolean
105
115void
117
125GMenu *
127 ArrangerWidget * self,
128 GMenu * menu,
129 double x,
130 double y);
131
132void
133midi_arranger_handle_vertical_zoom_action (ArrangerWidget * self, bool zoom_in);
134
138void
140 ArrangerWidget * self,
141 GtkEventControllerScroll * scroll_controller,
142 double dy);
143
148#endif
Arranger base widget.
void midi_arranger_widget_create_note(ArrangerWidget *self, Position *pos, int note, ZRegion *region)
Called on drag begin in parent when background is double clicked (i.e., a note is created).
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:108
Wraps the arranger widget in a box with scrollbars.
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:61
A MIDI note inside a ZRegion shown in the piano roll.
Definition midi_note.h:49
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:126
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:72