1 /*
2  * Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
3  *
4  * This file is part of Zrythm
5  *
6  * Zrythm is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Zrythm is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Affero General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 /**
21  * \file
22  *
23  * MIDI ruler.
24  */
25 
26 #ifndef __GUI_WIDGETS_EDITOR_RULER_H__
27 #define __GUI_WIDGETS_EDITOR_RULER_H__
28 
29 #include "gui/widgets/ruler.h"
30 #include "utils/ui.h"
31 
32 #include <gtk/gtk.h>
33 
34 /**
35  * @addtogroup widgets
36  *
37  * @{
38  */
39 
40 #define EDITOR_RULER MW_CLIP_EDITOR_INNER->ruler
41 
42 /**
43  * Called from RulerWidget to draw the markers
44  * specific to the editor, such as region loop
45  * points.
46  */
47 void
48 editor_ruler_widget_draw_markers (
49   RulerWidget * self);
50 
51 /**
52  * Called from ruler drag begin.
53  */
54 void
55 editor_ruler_on_drag_begin_no_marker_hit (
56   RulerWidget * self,
57   gdouble             start_x,
58   gdouble             start_y);
59 
60 void
61 editor_ruler_on_drag_update (
62   RulerWidget * self,
63   gdouble             offset_x,
64   gdouble             offset_y);
65 
66 void
67 editor_ruler_on_drag_end (
68   RulerWidget * self);
69 
70 int
71 editor_ruler_get_regions_in_range (
72   RulerWidget * self,
73   double        x_start,
74   double        x_end,
75   ZRegion **    regions);
76 
77 /**
78  * @}
79  */
80 
81 #endif
82