Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { Version Version // V Type string // T Features []Feature // F Interval time.Duration // S MD5Sum string // M }
Header describes the header of a Lovense pattern file. It is everything that sits before a hash symbol (#) in a version 1 pattern file. All header fields are not guaranteed except for Interval.
type Point ¶
type Point []Strength
Point describes the strengths of motors in an instant of time, or a point, in a Lovense pattern file. Version 0 pattern files will always only have a single motor, while version 1 pattern files can have more.
type Points ¶
type Points []Point
Points contains a list of points, each containing a list of vibration strength numbers. It holds multiple points representing multiple instants of time incremented by the Interval.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader provides a Lovense pattern reader.
func (*Reader) ReadAllV0Points ¶
ReadAllV0Points reads all data points in a version 0 pattern file. Version 0 is not capable of containing data for more than 1 motor, so the length of the inner slice is always 1.
func (*Reader) ReadAllV1Points ¶
ReadAllV2Data reads all data points in a version 1 pattern file. It guarantees that all point pairs in the slice will be equally sized.
func (*Reader) ReadHeader ¶
ReadHeader reads the header. Note that the method will consume more bytes from the io.Reader than it needs to, since the reader is buffered.
func (*Reader) ReadV1Points ¶
ReadV1Points reads a list of motor data points in a version 1 pattern file.