コード例 #1
0
        // Token: 0x060000B9 RID: 185 RVA: 0x000036E0 File Offset: 0x000018E0
        public override void ToStream(Stream stream)
        {
            bool          flag          = this.type == SystemExclusiveEventType.Normal || this.type == SystemExclusiveEventType.Terminating;
            ABinaryWriter abinaryWriter = new ABinaryWriter(stream, Endianness.Big);

            abinaryWriter.WriteUIntVar(base.DeltaTime);
            if (this.type == SystemExclusiveEventType.Normal)
            {
                abinaryWriter.Write8(240);
            }
            else
            {
                abinaryWriter.Write8(247);
            }
            abinaryWriter.WriteUIntVar((ulong)((long)((flag ? (this.data.Length + 1) : this.data.Length) + (this.HasWideManufacturerID ? 3 : 1))));
            if (this.HasWideManufacturerID)
            {
                abinaryWriter.Write8(0);
                abinaryWriter.Write16((ushort)this.manufacturerID);
            }
            else
            {
                abinaryWriter.Write8((byte)(this.manufacturerID >> 16));
            }
            abinaryWriter.Write8s(this.data);
            if (flag)
            {
                abinaryWriter.Write8(247);
            }
        }
コード例 #2
0
 // Token: 0x060002FA RID: 762 RVA: 0x0000B514 File Offset: 0x00009714
 public void ToStream(Stream stream, WaveWriteOptions options)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanWrite)
     {
         throw new ArgumentNullException("Given Stream cannot write.");
     }
     using (ABinaryWriter abinaryWriter = new ABinaryWriter(stream))
     {
         if (!options.HasFlag(WaveWriteOptions.NoHeader))
         {
             abinaryWriter.WriteString("RIFF");
             abinaryWriter.Write32(this.WrittenSize);
             abinaryWriter.WriteString("WAVE");
             abinaryWriter.WritePadding(4, 0);
         }
         abinaryWriter.WriteString("fmt ");
         abinaryWriter.Write32((this.format == WaveFormat.PCM) ? 16U : 20U);
         abinaryWriter.Write16((ushort)this.format);
         abinaryWriter.Write16(this.channelCount);
         abinaryWriter.Write32(this.sampleRate);
         abinaryWriter.Write32(this.ByteRate);
         abinaryWriter.Write32((uint)this.BlockAlign);
         abinaryWriter.Write32((uint)this.bitsPerSample);
         if (this.format != WaveFormat.PCM)
         {
             abinaryWriter.Write32(0U);
         }
         abinaryWriter.WritePadding(4, 0);
         abinaryWriter.WriteString("data");
         if (this.data == null)
         {
             abinaryWriter.Write32(0U);
         }
         else
         {
             abinaryWriter.WriteS32(this.data.Length);
             abinaryWriter.Write8s(this.data);
         }
         abinaryWriter.WritePadding(4, 0);
     }
 }
コード例 #3
0
        // Token: 0x06000084 RID: 132 RVA: 0x000030DC File Offset: 0x000012DC
        public override void ToStream(Stream stream)
        {
            ABinaryWriter abinaryWriter = new ABinaryWriter(stream, Endianness.Big);

            abinaryWriter.WriteUIntVar(base.DeltaTime);
            abinaryWriter.Write8(byte.MaxValue);
            abinaryWriter.Write8((byte)this.Type);
            abinaryWriter.WriteUIntVar((ulong)((long)(this.data.Length + (this.HasWideManufacturerID ? 3 : 1))));
            if (this.HasWideManufacturerID)
            {
                abinaryWriter.Write8(0);
                abinaryWriter.Write16((ushort)this.manufacturerID);
            }
            else
            {
                abinaryWriter.Write8((byte)(this.manufacturerID >> 16));
            }
            abinaryWriter.Write8s(this.data);
        }