Snap/grid information.
More...
#include <src/dsp/snap_grid.h>
|
|
void | snapAdaptiveChanged () |
|
void | snapToGridChanged () |
|
void | snapToEventsChanged () |
|
void | keepOffsetChanged () |
|
void | sixteenthsVisibleChanged () |
|
void | beatsVisibleChanged () |
|
void | snapNoteLengthChanged () |
|
void | snapNoteTypeChanged () |
|
void | lengthTypeChanged () |
|
void | snapChanged () |
|
|
| SnapGrid (const TempoMap &tempo_map, utils::NoteLength default_note_length, LastObjectLengthProvider last_object_length_provider, QObject *parent=nullptr) |
| bool | snapAdaptive () const |
|
void | setSnapAdaptive (bool adaptive) |
| bool | snapToGrid () const |
|
void | setSnapToGrid (bool snap) |
| bool | snapToEvents () const |
|
void | setSnapToEvents (bool snap) |
| bool | keepOffset () const |
|
void | setKeepOffset (bool keep) |
| bool | sixteenthsVisible () const |
|
void | setSixteenthsVisible (bool visible) |
| bool | beatsVisible () const |
|
void | setBeatsVisible (bool visible) |
| utils::NoteLength | snapNoteLength () const |
|
void | setSnapNoteLength (utils::NoteLength length) |
| utils::NoteType | snapNoteType () const |
|
void | setSnapNoteType (utils::NoteType type) |
| NoteLengthType | lengthType () const |
|
void | setLengthType (NoteLengthType type) |
|
QString | snapString () const |
| Q_INVOKABLE double | snapWithoutStartTicks (double ticks) |
| Q_INVOKABLE double | snapWithStartTicks (double ticks, double startTicks) |
|
Q_INVOKABLE double | nextSnapPoint (double ticks) const |
|
Q_INVOKABLE double | prevSnapPoint (double ticks) const |
|
Q_INVOKABLE double | closestSnapPoint (double ticks) const |
|
Q_INVOKABLE double | snapTicks (int64_t ticks) const |
|
Q_INVOKABLE double | defaultTicks (int64_t ticks) const |
| units::precise_tick_t | snap (units::precise_tick_t ticks, std::optional< units::precise_tick_t > start_ticks=std::nullopt) const |
|
void | set_event_callback (SnapEventCallback callback) |
| void | set_last_object_length_callback (LastObjectLengthProvider callback) |
|
void | clear_callbacks () |
|
| void | to_json (nlohmann::json &j, const SnapGrid &p) |
| void | from_json (const nlohmann::json &j, SnapGrid &p) |
Snap/grid information.
Definition at line 21 of file snap_grid.h.
◆ LastObjectLengthProvider
| using zrythm::dsp::SnapGrid::LastObjectLengthProvider = std::function<double ()> |
◆ SnapEventCallback
| using zrythm::dsp::SnapGrid::SnapEventCallback |
Initial value:
std::function<std::vector<double> (double start_ticks, double end_ticks)>
Definition at line 52 of file snap_grid.h.
◆ NoteLengthType
| Enumerator |
|---|
| Link | Link length with snap setting.
|
| LastObject | Use last created object's length.
|
| Custom | Custom length.
|
Definition at line 39 of file snap_grid.h.
◆ beatsVisible()
| bool zrythm::dsp::SnapGrid::beatsVisible |
( |
| ) |
const |
|
inline |
◆ get_ticks_from_length_and_type()
| constexpr int zrythm::dsp::SnapGrid::get_ticks_from_length_and_type |
( |
utils::NoteLength | length, |
|
|
utils::NoteType | type, |
|
|
int | ticks_per_bar, |
|
|
int | ticks_per_beat ) |
|
inlinestaticconstexpr |
◆ keepOffset()
| bool zrythm::dsp::SnapGrid::keepOffset |
( |
| ) |
const |
|
inline |
◆ lengthType()
◆ set_last_object_length_callback()
| void zrythm::dsp::SnapGrid::set_last_object_length_callback |
( |
LastObjectLengthProvider | callback | ) |
|
|
inline |
◆ sixteenthsVisible()
| bool zrythm::dsp::SnapGrid::sixteenthsVisible |
( |
| ) |
const |
|
inline |
◆ snap()
| units::precise_tick_t zrythm::dsp::SnapGrid::snap |
( |
units::precise_tick_t | ticks, |
|
|
std::optional< units::precise_tick_t > | start_ticks = std::nullopt ) const |
- Parameters
-
| ticks | |
| start_ticks | Used when "keep offset" is enabled. |
◆ snapAdaptive()
| bool zrythm::dsp::SnapGrid::snapAdaptive |
( |
| ) |
const |
|
inline |
◆ snapNoteLength()
| utils::NoteLength zrythm::dsp::SnapGrid::snapNoteLength |
( |
| ) |
const |
|
inline |
◆ snapNoteType()
◆ snapToEvents()
| bool zrythm::dsp::SnapGrid::snapToEvents |
( |
| ) |
const |
|
inline |
◆ snapToGrid()
| bool zrythm::dsp::SnapGrid::snapToGrid |
( |
| ) |
const |
|
inline |
◆ snapWithoutStartTicks()
| Q_INVOKABLE double zrythm::dsp::SnapGrid::snapWithoutStartTicks |
( |
double | ticks | ) |
|
|
inline |
◆ snapWithStartTicks()
| Q_INVOKABLE double zrythm::dsp::SnapGrid::snapWithStartTicks |
( |
double | ticks, |
|
|
double | startTicks ) |
|
inline |
◆ from_json
| void from_json |
( |
const nlohmann::json & | j, |
|
|
SnapGrid & | p ) |
|
friend |
◆ to_json
| void to_json |
( |
nlohmann::json & | j, |
|
|
const SnapGrid & | p ) |
|
friend |
◆ beatsVisible
| bool zrythm::dsp::SnapGrid::beatsVisible |
|
readwrite |
◆ keepOffset
| bool zrythm::dsp::SnapGrid::keepOffset |
|
readwrite |
◆ lengthType
◆ sixteenthsVisible
| bool zrythm::dsp::SnapGrid::sixteenthsVisible |
|
readwrite |
◆ snapAdaptive
| bool zrythm::dsp::SnapGrid::snapAdaptive |
|
readwrite |
◆ snapNoteLength
| zrythm::utils::NoteLength zrythm::dsp::SnapGrid::snapNoteLength |
|
readwrite |
◆ snapNoteType
◆ snapString
| QString zrythm::dsp::SnapGrid::snapString |
|
read |
◆ snapToEvents
| bool zrythm::dsp::SnapGrid::snapToEvents |
|
readwrite |
◆ snapToGrid
| bool zrythm::dsp::SnapGrid::snapToGrid |
|
readwrite |
The documentation for this class was generated from the following file: