|
| PositionProxy (QObject *parent=nullptr, const Position *pos=nullptr, bool realtime_updateable=false) |
|
signed_frame_t | getFrames () const |
|
void | setFrames (signed_frame_t frames) |
|
Q_SIGNAL void | framesChanged () |
|
double | getTicks () const |
|
void | setTicks (double ticks) |
|
Q_SIGNAL void | ticksChanged () |
|
Position | get_position () const |
|
Q_INVOKABLE void | addTicks (double ticks) |
|
Q_INVOKABLE QString | getStringDisplay (const zrythm::engine::session::Transport *transport, const zrythm::dsp::TempoMapWrapper *tempo_map) const |
|
void | set_frames_rtsafe (signed_frame_t frames, dsp::TicksPerFrame ticks_per_frame) |
|
void | set_ticks_rtsafe (double ticks, dsp::FramesPerTick frames_per_tick) |
|
void | update_from_ticks_rtsafe (dsp::FramesPerTick frames_per_tick) |
|
void | update_from_frames_rtsafe (dsp::TicksPerFrame ticks_per_frame) |
|
void | set_position_rtsafe (const Position &pos) |
|
void | add_frames_rtsafe (signed_frame_t frames, dsp::TicksPerFrame ticks_per_frame) |
|
bool | processUpdates () override |
| Process pending updates from real-time thread.
|
|
| Position (const char *str, int beats_per_bar, int sixteenths_per_beat, FramesPerTick frames_per_tick) |
| Parses a position from the given string.
|
|
| Position (double ticks, dsp::FramesPerTick frames_per_tick) |
| Construct from total number of ticks.
|
|
| Position (signed_frame_t frames, TicksPerFrame ticks_per_frame) |
| Construct from total number of frames.
|
|
void | zero () |
|
signed_frame_t | get_total_frames () const |
| Getter.
|
|
double | get_total_ticks () const |
| Getter.
|
|
bool | ticks_equal (const Position &other) const |
|
bool | is_positive () const |
|
bool | is_between_frames_excluding_2nd (signed_frame_t f1, signed_frame_t f2) const |
| Whether the position starts on or after f1 and before f2 (ie, the position is between f1 and f2 , exclusive of f2).
|
|
bool | is_between_excl_2nd (const Position &start, const Position &end) const |
| Returns if the position is after or equal to start and before end .
|
|
bool | is_between_incl_2nd (const Position &start, const Position &end) const |
| Returns if the position is after or equal to start and before or equal to end (ie, inclusive of end ).
|
|
bool | is_between_excl_both (const Position &start, const Position &end) const |
|
bool | is_between_excl_1st_incl_2nd (const Position &start, const Position &end) const |
|
void | set_to_bar (int bar, int ticks_per_bar, dsp::FramesPerTick frames_per_tick) |
| Sets position to given bar.
|
|
void | add_frames (signed_frame_t frames, TicksPerFrame ticks_per_frame) |
| Adds the frames to the position and updates the rest of the fields, and makes sure the frames are still accurate.
|
|
void | from_seconds (double secs, sample_rate_t sample_rate, TicksPerFrame ticks_per_frame) |
| Converts seconds to position and puts the result in the given Position.
|
|
void | from_frames (const signed_frame_t frames, TicksPerFrame ticks_per_frame) |
|
void | from_ticks (double ticks, dsp::FramesPerTick frames_per_tick) |
| Sets position to the given total tick count.
|
|
void | from_ms (const double ms, sample_rate_t sample_rate, TicksPerFrame ticks_per_frame) |
|
void | from_bars (int bars, int ticks_per_bar, dsp::FramesPerTick frames_per_tick) |
|
void | add_bars (int bars, int ticks_per_bar, dsp::FramesPerTick frames_per_tick) |
|
void | add_beats (int beats, int ticks_per_beat, dsp::FramesPerTick frames_per_tick) |
|
void | add_sixteenths (int sixteenths, dsp::FramesPerTick frames_per_tick) |
|
void | add_ticks (double ticks, dsp::FramesPerTick frames_per_tick) |
|
signed_ms_t | to_ms (sample_rate_t sample_rate) const |
| Returns the Position in milliseconds.
|
|
void | add_ms (double ms, sample_rate_t sample_rate, TicksPerFrame ticks_per_frame) |
|
void | add_minutes (int mins, sample_rate_t sample_rate, TicksPerFrame ticks_per_frame) |
|
void | add_seconds (signed_sec_t seconds, sample_rate_t sample_rate, TicksPerFrame ticks_per_frame) |
|
void | update_ticks_from_frames (TicksPerFrame ticks_per_frame) |
| Updates ticks.
|
|
void | update_frames_from_ticks (FramesPerTick frames_per_tick) |
| Updates frames.
|
|
void | set_to_midway_pos (const Position &start_pos, const Position &end_pos, FramesPerTick frames_per_tick) |
| Sets the position to the midway point between the two given positions.
|
|
std::string | to_string (int beats_per_bar, int sixteenths_per_beat, FramesPerTick frames_per_tick, int decimal_places=4) const |
| Creates a string in the form of "0.0.0.0" from the given position.
|
|
void | to_string (int beats_per_bar, int sixteenths_per_beat, FramesPerTick frames_per_tick, char *buf, int decimal_places=4) const |
|
void | print (int beats_per_bar, int sixteenths_per_beat, FramesPerTick frames_per_tick) const |
| Prints the Position in the "0.0.0.0" form.
|
|
int | get_total_bars (bool include_current, int ticks_per_bar, FramesPerTick frames_per_tick) const |
| Returns the total number of beats.
|
|
int | get_total_beats (bool include_current, int beats_per_bar, int ticks_per_beat, FramesPerTick frames_per_tick) const |
| Returns the total number of beats.
|
|
int | get_total_sixteenths (bool include_current, dsp::FramesPerTick frames_per_tick) const |
| Returns the total number of sixteenths not including the current one.
|
|
void | change_sign () |
| Changes the sign of the position.
|
|
int | get_bars (bool start_at_one, int ticks_per_bar) const |
| Gets the bars of the position.
|
|
int | get_beats (bool start_at_one, int beats_per_bar, int ticks_per_beat) const |
| Gets the beats of the position.
|
|
int | get_sixteenths (bool start_at_one, int beats_per_bar, int sixteenths_per_beat, FramesPerTick frames_per_tick) const |
| Gets the sixteenths of the position.
|
|
double | get_ticks_part (FramesPerTick frames_per_tick) const |
| Gets the ticks of the position.
|
|
void | set_to_position (const Position &pos) |
|
Position & | get_closest_position (Position &p1, Position &p2) const |
| Returns the closest position.
|
|
QML-friendly position representation with real-time safety.
Exposes Position functionality as Q_PROPERTYs with change notifications. Supports atomic updates from real-time threads when realtime_updateable=true.
Definition at line 32 of file position_proxy.h.