예제 #1
0
 /// <summary>
 /// Writes the value to the output.
 /// </summary>
 /// <param name="output">The output writer object.</param>
 /// <param name="value">The value to write to the output.</param>
 protected internal override void Write(ContentWriter output, TOutput value)
 {
     output.Write(value.Position);
     output.Write(value.Direction);
 }
예제 #2
0
 /// <summary>
 /// Writes the value to the output.
 /// </summary>
 /// <param name="output">The output writer object.</param>
 /// <param name="value">The value to write to the output.</param>
 protected internal override void Write(ContentWriter output, TOutput value)
 {
     output.Write(value);
 }
예제 #3
0
 protected internal override void Write(ContentWriter output, VertexBufferContent value)
 {
     output.WriteRawObject(value.VertexDeclaration);
     output.Write((uint)(value.VertexData.Length / value.VertexDeclaration.VertexStride));
     output.Write(value.VertexData);
 }
예제 #4
0
 /// <summary>
 /// Writes the value to the output.
 /// </summary>
 /// <param name="output">The output writer object.</param>
 /// <param name="value">The value to write to the output.</param>
 protected internal override void Write(ContentWriter output, SongContent value)
 {
     output.Write(value.fileName);
     output.WriteObject((int)value.duration.TotalMilliseconds);
 }
예제 #5
0
 public override void Write(ContentWriter writer, Int32 value)
 {
     writer.Write(value);
 }
예제 #6
0
 public override void Write(ContentWriter writer, Single value)
 {
     writer.Write(value);
 }
예제 #7
0
 public override void Write(ContentWriter writer, Char value)
 {
     writer.Write(value);
 }
예제 #8
0
        public override void Write(ContentWriter writer, AudioContent value)
        {
            ushort pcmFormat;

            if (value.FileType != AudioFileType.Wav)
            {
                throw new NotImplementedException("Only WAV file support currently implemented");
            }
            else
            {
                pcmFormat = 1;
            }

            writer.Write((uint)18);             // total size of the following WAVEFORMATEX structure
            writer.Write((ushort)pcmFormat);
            writer.Write((ushort)value.AudioFormat.Channels);
            writer.Write((uint)value.AudioFormat.SampleRate);
            writer.Write((uint)value.AudioFormat.AverageBytesPerSecond);
            writer.Write((ushort)value.AudioFormat.BlockAlign);
            writer.Write((ushort)value.AudioFormat.BitsPerSample);
            writer.Write((ushort)0);             // No extra bytes

            byte[] data = value.Data;

            writer.Write(data.Length);
            writer.Write(data);

            writer.Write(value.LoopStart);
            writer.Write(value.LoopEnd);
            writer.Write(value.Duration.Milliseconds);
        }
예제 #9
0
 public override void Write(ContentWriter writer, string value)
 {
     writer.Write(value);
 }
예제 #10
0
 public override void Write(ContentWriter writer, Vector3 value)
 {
     writer.Write(value);
 }
 /// <summary>
 /// Writes the value to the output.
 /// </summary>
 /// <param name="output">The output writer object.</param>
 /// <param name="value">The value to write to the output.</param>
 protected internal override void Write(ContentWriter output, TOutput value)
 {
     output.Write(value.Center);
     output.Write(value.Radius);
 }