예제 #1
0
        public Stream toStream()
        {
            Stream stream = new MemoryStream();

            Bar.Entry MotionEntry = new Bar.Entry();
            MotionEntry.Type   = Bar.EntryType.Motion;
            MotionEntry.Index  = MotionIndex;
            MotionEntry.Name   = MotionName;
            MotionEntry.Stream = MotionFile.toStream();

            Bar.Entry TriggerEntry = new Bar.Entry();
            TriggerEntry.Type   = Bar.EntryType.MotionTriggers;
            TriggerEntry.Index  = TriggerIndex;
            TriggerEntry.Name   = TriggerName;
            TriggerEntry.Stream = (MotionTriggerFile != null) ? MotionTriggerFile.toStream() : new MemoryStream();

            Bar.Write(stream, new List <Bar.Entry> {
                MotionEntry, TriggerEntry
            });

            stream.Position = 0;
            return(stream);
        }
예제 #2
0
 private static bool ContainsAnimation(Bar.Entry entry) =>
 entry.Stream.Length > 0;