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

Snap/grid information. More...

#include <stdbool.h>
#include "dsp/position.h"
#include <glib/gi18n.h>
Include dependency graph for snap_grid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SnapGrid
 

Macros

#define SNAP_GRID_TIMELINE   (PROJECT->snap_grid_timeline)
 
#define SNAP_GRID_EDITOR   (PROJECT->snap_grid_editor)
 
#define SNAP_GRID_IS_EDITOR(sg)   (SNAP_GRID_EDITOR == sg)
 
#define SNAP_GRID_IS_TIMELINE(sg)   (SNAP_GRID_TIMELINE == sg)
 
#define SNAP_GRID_ANY_SNAP(sg)   (sg->snap_to_grid || sg->snap_to_events)
 
#define SNAP_GRID_DEFAULT_MAX_BAR   10000
 

Enumerations

enum  NoteLength {
  NOTE_LENGTH_BAR , NOTE_LENGTH_BEAT , NOTE_LENGTH_2_1 , NOTE_LENGTH_1_1 ,
  NOTE_LENGTH_1_2 , NOTE_LENGTH_1_4 , NOTE_LENGTH_1_8 , NOTE_LENGTH_1_16 ,
  NOTE_LENGTH_1_32 , NOTE_LENGTH_1_64 , NOTE_LENGTH_1_128
}
 
enum  NoteType { NOTE_TYPE_NORMAL , NOTE_TYPE_DOTTED , NOTE_TYPE_TRIPLET }
 
enum  NoteLengthType { NOTE_LENGTH_LINK , NOTE_LENGTH_LAST_OBJECT , NOTE_LENGTH_CUSTOM }
 
enum  SnapGridType { SNAP_GRID_TYPE_TIMELINE , SNAP_GRID_TYPE_EDITOR }
 Snap grid type. More...
 

Functions

const char ** note_length_get_strings (void)
 
const char * note_length_to_str (NoteLength len)
 
const char ** note_type_get_strings (void)
 
const char * note_type_to_str (NoteType type)
 
void snap_grid_init (SnapGrid *self, SnapGridType type, NoteLength note_length, bool adaptive)
 
int snap_grid_get_ticks_from_length_and_type (NoteLength length, NoteType type)
 
NONNULL int snap_grid_get_snap_ticks (const SnapGrid *self)
 Gets a snap point's length in ticks.
 
NONNULL double snap_grid_get_snap_frames (const SnapGrid *self)
 
int snap_grid_get_default_ticks (SnapGrid *self)
 Gets a the default length in ticks.
 
char * snap_grid_stringize_length_and_type (NoteLength note_length, NoteType note_type)
 Returns the grid intensity as a human-readable string.
 
char * snap_grid_stringize (SnapGrid *self)
 Returns the grid intensity as a human-readable string.
 
NONNULL bool snap_grid_get_nearby_snap_point (Position *ret_pos, const SnapGrid *const self, const Position *pos, const bool return_prev)
 Returns the next or previous SnapGrid point.
 
SnapGridsnap_grid_clone (SnapGrid *src)
 
SnapGridsnap_grid_new (void)
 
void snap_grid_free (SnapGrid *self)
 

Detailed Description

Snap/grid information.

Definition in file snap_grid.h.