SoundEnvelope
Inheritance: ISwfSerializer
Ejemplo n.º 1
0
 /// <summary>
 /// Removes the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 public void Remove(SoundEnvelope value)
 {
     if (List.Contains(value))
     {
         List.Remove(value as object);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the size of.
        /// </summary>
        /// <returns>Size of this object.</returns>
        public int GetSizeOf()
        {
            int res = 1;

            if (HasInPoint)
            {
                res += 4;
            }
            if (HasOutPoint)
            {
                res += 4;
            }
            if (HasLoops)
            {
                res += 2;
            }
            if (HasEnvelope)
            {
                res++;
                if (envelopeRecord != null)
                {
                    res += envelopeRecord.Count * SoundEnvelope.GetSizeOf();
                }
            }
            return(res);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            binaryReader.ReadUBits(2);

            syncStop       = binaryReader.ReadBoolean();
            syncNoMultiple = binaryReader.ReadBoolean();
            bool hasEnvelope = binaryReader.ReadBoolean();
            bool hasLoops    = binaryReader.ReadBoolean();
            bool hasOutPoint = binaryReader.ReadBoolean();
            bool hasInPoint  = binaryReader.ReadBoolean();

            if (hasInPoint)
            {
                inPoint = binaryReader.ReadUInt32();
            }
            if (hasOutPoint)
            {
                outPoint = binaryReader.ReadUInt32();
            }
            if (hasLoops)
            {
                loopCount = binaryReader.ReadUInt16();
            }
            if (hasEnvelope)
            {
                byte envPoints = binaryReader.ReadByte();
                if (envPoints != 0)
                {
                    envelopeRecord.Clear();
                    for (int i = 0; i < envPoints; i++)
                    {
                        SoundEnvelope envelope = new SoundEnvelope();
                        envelope.ReadData(binaryReader);
                        envelopeRecord.Add(envelope);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            binaryReader.ReadUBits(2);

            syncStop = binaryReader.ReadBoolean();
            syncNoMultiple = binaryReader.ReadBoolean();
            bool hasEnvelope = binaryReader.ReadBoolean();
            bool hasLoops = binaryReader.ReadBoolean();
            bool hasOutPoint = binaryReader.ReadBoolean();
            bool hasInPoint = binaryReader.ReadBoolean();

            if (hasInPoint)
                inPoint = binaryReader.ReadUInt32();
            if (hasOutPoint)
                outPoint = binaryReader.ReadUInt32();
            if (hasLoops)
                loopCount = binaryReader.ReadUInt16();
            if (hasEnvelope)
            {
                byte envPoints = binaryReader.ReadByte();
                if (envPoints != 0)
                {
                    envelopeRecord.Clear();
                    for (int i = 0; i < envPoints; i++)
                    {
                        SoundEnvelope envelope = new SoundEnvelope();
                        envelope.ReadData(binaryReader);
                        envelopeRecord.Add(envelope);
                    }
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Removes the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 public void Remove(SoundEnvelope value)
 {
     if (List.Contains(value))
         List.Remove(value as object);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Inserts the specified index.
 /// </summary>
 /// <param name="index">Index.</param>
 /// <param name="value">Value.</param>
 public void Insert(int index, SoundEnvelope value)
 {
     List.Insert(index, value as object);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Get the index of.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public int IndexOf(SoundEnvelope value)
 {
     return List.IndexOf(value);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Containses the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public bool Contains(SoundEnvelope value)
 {
     return List.Contains(value as object);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds the range.
 /// </summary>
 /// <param name="values">Values.</param>
 public void AddRange(SoundEnvelope[] values)
 {
     IEnumerator val = values.GetEnumerator();
     while (val.MoveNext())
        Add((SoundEnvelope)val.Current);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Adds the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public SoundEnvelope Add(SoundEnvelope value)
 {
     List.Add(value as object);
     return value;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Get the index of.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public int IndexOf(SoundEnvelope value)
 {
     return(List.IndexOf(value));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Containses the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public bool Contains(SoundEnvelope value)
 {
     return(List.Contains(value as object));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Inserts the specified index.
 /// </summary>
 /// <param name="index">Index.</param>
 /// <param name="value">Value.</param>
 public void Insert(int index, SoundEnvelope value)
 {
     List.Insert(index, value as object);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Adds the specified value.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <returns></returns>
 public SoundEnvelope Add(SoundEnvelope value)
 {
     List.Add(value as object);
     return(value);
 }