smftimeline

package
v1.23.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func (t *TimeLine) AddTimeSignature(num, denom uint8)

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

func (t *TimeLine) Forward(nbars, num, denom uint32)

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

func (t *TimeLine) GetDelta() int32

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

func (t *TimeLine) Plan(nbars, num, denom uint32, callback func(delta int32))

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.

func (*TimeLine) Reset

func (t *TimeLine) Reset()

Reset resets the cursor and last delta

func (*TimeLine) Restore added in v1.10.5

func (t *TimeLine) Restore()

Restore restores cursor, lastDelta and plannedCallbacks from the backup

func (*TimeLine) Ticks

func (t *TimeLine) Ticks(num, denom uint32) int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL