Example #1
0
// Save persists the pattern.
func (s *RBMHSequence) Save(ls *persist.LoadSaver) {
	ls.SaveByte(rbmhLoader)
	ls.SaveBytes(s.Seq)
	for _, v := range s.Shift {
		ls.SaveSmallInt(v)
	}
}
Example #2
0
// Save persists the pattern.
func (l List) Save(ls *persist.LoadSaver) {
	ls.SaveByte(listLoader)
	ls.SaveSmallInt(len(l))
	for _, pat := range l {
		pat.Save(ls)
	}
}
Example #3
0
// Save frame to a LoadSaver.
func (w Window) Save(ls *persist.LoadSaver) {
	ls.SaveByte(windowLoader)
	ls.SaveByte(byte(w.OffType))
	ls.SaveInt(w.MinOff)
	ls.SaveInt(w.MaxOff)
	w.Pattern.Save(ls)
}
Example #4
0
// Save persists the pattern.
func (c Choice) Save(ls *persist.LoadSaver) {
	ls.SaveByte(choiceLoader)
	ls.SaveSmallInt(len(c))
	for _, pat := range c {
		pat.Save(ls)
	}
}
Example #5
0
func saveKeyFrames(ls *persist.LoadSaver, kfs [][]keyFrame) {
	ls.SaveSmallInt(len(kfs))
	for _, v := range kfs {
		ls.SaveSmallInt(len(v))
		for _, kf := range v {
			ls.SaveByte(byte(kf.typ))
			ls.SaveInt(int(kf.seg.pMin))
			ls.SaveInt(int(kf.seg.pMax))
			ls.SaveSmallInt(kf.seg.lMin)
			ls.SaveSmallInt(kf.seg.lMax)
			ls.SaveInt(int(kf.key.pMin))
			ls.SaveInt(int(kf.key.pMax))
			ls.SaveSmallInt(kf.key.lMin)
			ls.SaveSmallInt(kf.key.lMax)
		}
	}

}
Example #6
0
func (i *Identifier) Save(ls *persist.LoadSaver) {
	ls.SaveByte(core.Pronom)
	ls.SaveString(i.name)
	ls.SaveString(i.details)
	ls.SaveBool(i.noPriority)
	ls.SaveSmallInt(len(i.infos))
	for k, v := range i.infos {
		ls.SaveString(k)
		ls.SaveString(v.name)
		ls.SaveString(v.version)
		ls.SaveString(v.mimeType)
	}
	ls.SaveInt(i.eStart)
	ls.SaveStrings(i.ePuids)
	ls.SaveInt(i.cStart)
	ls.SaveStrings(i.cPuids)
	ls.SaveInt(i.bStart)
	ls.SaveStrings(i.bPuids)
	ls.SaveSmallInt(i.tStart)
}
Example #7
0
// Save frame to a LoadSaver.
func (w WildMin) Save(ls *persist.LoadSaver) {
	ls.SaveByte(wildMinLoader)
	ls.SaveByte(byte(w.OffType))
	ls.SaveInt(w.MinOff)
	w.Pattern.Save(ls)
}
Example #8
0
// Save frame to a LoadSaver.
func (w Wild) Save(ls *persist.LoadSaver) {
	ls.SaveByte(wildLoader)
	ls.SaveByte(byte(w.OffType))
	w.Pattern.Save(ls)
}
Example #9
0
// Save frame to a LoadSaver.
func (f Fixed) Save(ls *persist.LoadSaver) {
	ls.SaveByte(fixedLoader)
	ls.SaveByte(byte(f.OffType))
	ls.SaveInt(f.Off)
	f.Pattern.Save(ls)
}
Example #10
0
func (am AnyMask) Save(ls *persist.LoadSaver) {
	ls.SaveByte(anyMaskLoader)
	ls.SaveByte(byte(am))
}
Example #11
0
func (m Mask) Save(ls *persist.LoadSaver) {
	ls.SaveByte(maskLoader)
	ls.SaveByte(byte(m))
}
Example #12
0
func (r Range) Save(ls *persist.LoadSaver) {
	ls.SaveByte(rangeLoader)
	ls.SaveBytes(r.From)
	ls.SaveBytes(r.To)
}
Example #13
0
// Save persists the pattern.
func (n Not) Save(ls *persist.LoadSaver) {
	ls.SaveByte(notLoader)
	n.Pattern.Save(ls)
}
Example #14
0
// Save persists the pattern.
func (s Sequence) Save(ls *persist.LoadSaver) {
	ls.SaveByte(sequenceLoader)
	ls.SaveBytes(s)
}