Module xPlayPos

Extended play-position which support fractional time (between lines) .

How to use

-- create an instance of the class
local pos = xPlayPos()

-- call update() when idle to track playback
pos:update()

-- ask for the position (normal SongPos object)
pos:get()

-- ask for the expanded position (table)
pos:get_fractional()

Functions

get_line () Getters/Setters
update () Class Methods
set (pos)
get () return a valid object for SongPos comparison operators
get_fractional ()
has_changed (pos)
maintain_position (pos) look for when we enter a 'beat' in the global timeline
__eq (other) Metamethods - see also xSongPos

Fields

self.last_beat_pos int, SongPos, last position where a beat started
self.line int
self.sequence int


Functions

get_line ()
Getters/Setters
update ()
Class Methods call as often as possible to maintain/track position
set (pos)

Parameters:

  • pos (SongPos)
get ()
return a valid object for SongPos comparison operators

Returns:

  1. SongPos
  2. table (like SongPos but with extra 'fraction' field)
get_fractional ()

Returns:

  1. table (like SongPos but with extra 'fraction' field)
  2. boolean
has_changed (pos)

Parameters:

  • pos SongPos

Returns:

    boolean
maintain_position (pos)
look for when we enter a 'beat' in the global timeline

Parameters:

  • pos within the first line of a "song beat"?
__eq (other)
Metamethods - see also xSongPos [[ __eq sets handler for '==', '~='

Parameters:

  • other

Fields

self.last_beat_pos
int, SongPos, last position where a beat started
self.line
int
self.sequence
int
generated by LDoc 1.4.2