Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ruler.h File Reference

Ruler parent class. More...

#include "utils/ui.h"
#include <gtk/gtk.h>
Include dependency graph for ruler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RulerWidget
 

Macros

#define RW_RULER_MARKER_SIZE   8
 
#define RW_CUE_MARKER_HEIGHT   12
 
#define RW_CUE_MARKER_WIDTH   7
 
#define RW_PLAYHEAD_TRIANGLE_WIDTH   12
 
#define RW_PLAYHEAD_TRIANGLE_HEIGHT   8
 
#define RW_RANGE_HEIGHT_DIVISOR   4
 
#define RW_HEIGHT   42
 
#define RW_SCROLL_SPEED   48
 Mouse wheel scroll speed (number of pixels).
 
#define RW_PX_TO_HIDE_BEATS   40.0
 Minimum number of pixels between beat lines.
 
#define RULER_WIDGET_TYPE   (ruler_widget_get_type ())
 
#define DEFAULT_PX_PER_TICK   0.03
 Pixels to draw between each beat, before being adjusted for zoom.
 
#define SPACE_BEFORE_START   10
 Pixels to put before 1st bar.
 
#define SPACE_BEFORE_START_F   10.f
 
#define SPACE_BEFORE_START_D   10.0
 
#define RULER_ZOOM_LEVEL_MULTIPLIER   1.28
 Multiplier when zooming in/out.
 
#define MIN_ZOOM_LEVEL   0.04
 
#define MAX_ZOOM_LEVEL   1800.
 

Enumerations

enum  RWTarget {
  RW_TARGET_PLAYHEAD , RW_TARGET_LOOP_START , RW_TARGET_LOOP_END , RW_TARGET_PUNCH_IN ,
  RW_TARGET_PUNCH_OUT , RW_TARGET_CLIP_START , RW_TARGET_RANGE , RW_TARGET_LOOP_RANGE
}
 The ruler widget target acting upon. More...
 
enum  RulerWidgetType { RULER_WIDGET_TYPE_TIMELINE , RULER_WIDGET_TYPE_EDITOR }
 
enum  RulerWidgetRangeType { RW_RANGE_START , RW_RANGE_FULL , RW_RANGE_END }
 Range type. More...
 

Functions

bool ruler_widget_set_zoom_level (RulerWidget *self, double zoom_level)
 Sets zoom level and disables/enables buttons accordingly.
 
double ruler_widget_get_zoom_level (RulerWidget *self)
 Gets the zoom level associated with this RulerWidget from the backend.
 
void ruler_widget_handle_horizontal_zoom (RulerWidget *self, double *x_pos, double dy)
 Handle horizontal zoom.
 
int ruler_widget_get_beat_interval (RulerWidget *self)
 Returns the beat interval for drawing vertical lines.
 
int ruler_widget_get_sixteenth_interval (RulerWidget *self)
 Returns the sixteenth interval for drawing vertical lines.
 
int ruler_widget_get_10sec_interval (RulerWidget *self)
 Returns the 10 sec interval.
 
int ruler_widget_get_sec_interval (RulerWidget *self)
 Returns the sec interval.
 
bool ruler_widget_is_range_hit (RulerWidget *self, RulerWidgetRangeType type, double x, double y)
 
bool ruler_widget_is_loop_range_hit (RulerWidget *self, RulerWidgetRangeType type, double x, double y)
 Whether the loop range is hit.
 
void ruler_widget_px_to_pos (RulerWidget *self, double px, Position *pos, bool has_padding)
 
int ruler_widget_pos_to_px (RulerWidget *self, Position *pos, int use_padding)
 
EditorSettingsruler_widget_get_editor_settings (RulerWidget *self)
 Gets the pointer to the EditorSettings associated with the arranger this ruler is for.
 
void ruler_widget_get_visible_rect (RulerWidget *self, GdkRectangle *rect)
 Fills in the visible rectangle.
 
int ruler_widget_get_playhead_px (RulerWidget *self, bool after_loops)
 Returns the playhead's x coordinate in absolute coordinates.
 
void ruler_widget_refresh (RulerWidget *self)
 

Detailed Description

Ruler parent class.

Definition in file ruler.h.

Macro Definition Documentation

◆ RULER_WIDGET_TYPE

#define RULER_WIDGET_TYPE   (ruler_widget_get_type ())

Definition at line 36 of file ruler.h.

◆ RW_CUE_MARKER_HEIGHT

#define RW_CUE_MARKER_HEIGHT   12

Definition at line 20 of file ruler.h.

◆ RW_CUE_MARKER_WIDTH

#define RW_CUE_MARKER_WIDTH   7

Definition at line 21 of file ruler.h.

◆ RW_HEIGHT

#define RW_HEIGHT   42

Definition at line 26 of file ruler.h.

◆ RW_PLAYHEAD_TRIANGLE_HEIGHT

#define RW_PLAYHEAD_TRIANGLE_HEIGHT   8

Definition at line 23 of file ruler.h.

◆ RW_PLAYHEAD_TRIANGLE_WIDTH

#define RW_PLAYHEAD_TRIANGLE_WIDTH   12

Definition at line 22 of file ruler.h.

◆ RW_PX_TO_HIDE_BEATS

#define RW_PX_TO_HIDE_BEATS   40.0

Minimum number of pixels between beat lines.

Definition at line 34 of file ruler.h.

◆ RW_RANGE_HEIGHT_DIVISOR

#define RW_RANGE_HEIGHT_DIVISOR   4

Definition at line 24 of file ruler.h.

◆ RW_RULER_MARKER_SIZE

#define RW_RULER_MARKER_SIZE   8

Definition at line 19 of file ruler.h.

◆ RW_SCROLL_SPEED

#define RW_SCROLL_SPEED   48

Mouse wheel scroll speed (number of pixels).

Definition at line 29 of file ruler.h.