Ejemplo n.º 1
0
        // builds a STON entity from a looping stream provider
        private static IStonEntity ToSton(this LoopStreamProvider provider)
        {
            var properties = new List <KeyValuePair <IStonBindingKey, IStonEntity> >();

            if (provider.TrackStart >= 0)
            {
                properties.Add(MakeStonProperty("TrackStart", MakeStonSimpleEntity(provider.TrackStart)));
            }
            if (provider.StreamLoopStart >= 0)
            {
                properties.Add(MakeStonProperty("LoopStart", MakeStonSimpleEntity(provider.StreamLoopStart)));
            }
            if (provider.StreamLoopEnd >= 0)
            {
                properties.Add(MakeStonProperty("LoopEnd", MakeStonSimpleEntity(provider.StreamLoopEnd)));
            }
            if (provider.TrackEnd >= 0)
            {
                properties.Add(MakeStonProperty("TrackEnd", MakeStonSimpleEntity(provider.TrackEnd)));
            }
            if (provider.Loops >= 0)
            {
                properties.Add(MakeStonProperty("Loops", MakeStonSimpleEntity(provider.Loops)));
            }

            return(new StonComplexEntity(
                       type: new StonNamedType("Loop"),
                       memberInit: new StonMemberInit(properties)
                       ));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a copy of the given looping stream provider.
 /// </summary>
 /// <param name="provider">The provider to be copied.</param>
 public LoopStreamProvider(LoopStreamProvider provider)
     : this(provider.Track)
 {
     TrackStart      = provider.TrackStart;
     StreamLoopStart = provider.StreamLoopStart;
     StreamLoopEnd   = provider.StreamLoopEnd;
     TrackEnd        = provider.TrackEnd;
     Loops           = provider.Loops;
 }