Documentation ¶
Index ¶
- type TimeLine
- func (t *TimeLine) AddTimeSignature(num, denom uint8)
- func (t *TimeLine) Backup()
- func (t *TimeLine) FinishPlanned()
- func (t *TimeLine) Forward(nbars, num, denom uint32)
- func (t *TimeLine) GetDelta() int32
- func (t *TimeLine) Plan(nbars, num, denom uint32, callback func(delta int32))
- func (t *TimeLine) Reset()
- func (t *TimeLine) Restore()
- func (t *TimeLine) Ticks(num, denom uint32) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimeLine ¶
type TimeLine struct {
// contains filtered or unexported fields
}
func New ¶
func New(ticks smf.MetricTicks) *TimeLine
func (*TimeLine) AddTimeSignature ¶
AddTimeSignature adds the given timesignature at the current cursor position
func (*TimeLine) Backup ¶ added in v1.10.5
func (t *TimeLine) Backup()
Backup saves a backup of cursor, lastDelta and plannedCallbacks
func (*TimeLine) FinishPlanned ¶ added in v1.9.1
func (t *TimeLine) FinishPlanned()
func (*TimeLine) Forward ¶
Forward checks the bar where the cursor currently is and goes nbars ahead and moves the cursor to the start of that bar. It then moves the cursor forward within the target bar for the given ratio of whole notes.
func (*TimeLine) GetDelta ¶
GetDelta returns the delta of the current cursor position to the last delta position and sets the last delta position to the current cursor position returns -1, if cursor is before last delta
func (*TimeLine) Plan ¶ added in v1.9.1
Plan registers the given callback to be invoked, when the cursor moves to the position given by the delta resulting from nbars, num, denom from the current cursor position. I.e. when Forward is invoked, it checks, if it moves the cursor across planned callbacks and if so they are called. However these callbacks must not move the cursor or set a delta. They should simply write midi events to some smf.Writer.