Beispiel #1
0
        protected static byte[] packTimeTag(DateTime value)
        {
            var tag = new OscTimeTag();

            tag.Set(value);

            return(tag.ToByteArray());;
        }
Beispiel #2
0
        /// <summary>
        /// Returns a value indicating whether this instance is equal to a specified OscTimeTag instance.
        /// </summary>
        /// <param name="value">An object to compare to this instance.</param>
        /// <returns>true if value is an instance of System.DateTime and equals the value of this instance; otherwise, false.</returns>
        public bool Equals(OscTimeTag value)
        {
            if ((object)value == null)
            {
                return(false);
            }

            return(mTimeStamp.Equals(value.mTimeStamp));
        }
Beispiel #3
0
/*
 *      protected static RGBAColor unpackColor(byte[] bytes, ref int start)
 *      {
 *          byte[] data = new byte[4];
 *          for (int i = 0; i < 4; i++, start++) data[i] = bytes[start];
 *          if (BitConverter.IsLittleEndian) data = swapEndian(data);
 *
 *          var col = new RGBAColor();
 *          col.R = (double)data[0] / 255.0;
 *          col.G = (double)data[1] / 255.0;
 *          col.B = (double)data[2] / 255.0;
 *          col.A = (double)data[3] / 255.0;
 *
 *          return col;
 *      }
 *
 *      protected static Vector2D unpackVector2D(byte[] bytes, ref int start)
 *      {
 *          var v = new Vector2D();
 *          v.x = unpackDouble(bytes, ref start);
 *          v.y = unpackDouble(bytes, ref start);
 *          return v;
 *      }
 *
 *      protected static Vector3D unpackVector3D(byte[] bytes, ref int start)
 *      {
 *          var v = new Vector3D();
 *          v.x = unpackDouble(bytes, ref start);
 *          v.y = unpackDouble(bytes, ref start);
 *          v.z = unpackDouble(bytes, ref start);
 *          return v;
 *      }
 *
 *      protected static Vector4D unpackVector4D(byte[] bytes, ref int start)
 *      {
 *          var v = new Vector4D();
 *          v.x = unpackDouble(bytes, ref start);
 *          v.y = unpackDouble(bytes, ref start);
 *          v.z = unpackDouble(bytes, ref start);
 *          v.w = unpackDouble(bytes, ref start);
 *          return v;
 *      }
 *
 *      protected static Matrix4x4 unpackMatrix(byte[] bytes, ref int start)
 *      {
 *          var m = new Matrix4x4();
 *          for (int i=0;i<16;i++) m[i] = unpackFloat(bytes, ref start);
 *          return m;
 *      }
 */
        protected static DateTime unpackTimeTag(byte[] bytes, ref int start)
        {
            byte[] data = new byte[8];
            for (int i = 0; i < 8; i++, start++)
            {
                data[i] = bytes[start];
            }
            var tag = new OscTimeTag(data);

            return(tag.DateTime);
        }
Beispiel #4
0
        /// <summary>
        /// Returns a value indicating whether this instance is equal to a specified object.
        /// </summary>
        /// <param name="value">An object to compare to this instance.</param>
        /// <returns>true if value is an instance of System.DateTime and equals the value of this instance; otherwise, false.</returns>
        public override bool Equals(object value)
        {
            if (value == null)
            {
                return(false);
            }

            OscTimeTag rhs = value as OscTimeTag;

            if (rhs == null)
            {
                return(false);
            }

            return(mTimeStamp.Equals(rhs.mTimeStamp));
        }
Beispiel #5
0
		protected static DateTime unpackTimeTag(byte[] bytes, ref int start)
		{
			byte[] data = new byte[8];
			for (int i = 0; i < 8; i++, start++) data[i] = bytes[start];
			var tag = new OscTimeTag(data);

			return tag.DateTime;
		}
Beispiel #6
0
		protected static byte[] packTimeTag(DateTime value)
		{
			var tag = new OscTimeTag();
			tag.Set(value);

			return tag.ToByteArray(); ;
		}
Beispiel #7
0
        /// <summary>
        /// Returns a value indicating whether this instance is equal to a specified OscTimeTag instance.
        /// </summary>
        /// <param name="value">An object to compare to this instance.</param>
        /// <returns>true if value is an instance of System.DateTime and equals the value of this instance; otherwise, false.</returns>
        public bool Equals(OscTimeTag value)
        {
            if ((object)value == null)
            {
                return false;
            }

            return mTimeStamp.Equals(value.mTimeStamp);
        }
Beispiel #8
0
 /// <summary>
 /// Determines whether two specified instances of OscTimeTag are equal.
 /// </summary>
 /// <param name="lhs">An OscTimeTag.</param>
 /// <param name="rhs">An OscTimeTag.</param>
 /// <returns>true if lhs and rhs represent the same time tag; otherwise, false.</returns>
 public static bool Equals(OscTimeTag lhs, OscTimeTag rhs)
 {
     return lhs.Equals(rhs);
 }
Beispiel #9
0
 /// <summary>
 /// Determines whether two specified instances of OscTimeTag are equal.
 /// </summary>
 /// <param name="lhs">An OscTimeTag.</param>
 /// <param name="rhs">An OscTimeTag.</param>
 /// <returns>true if lhs and rhs represent the same time tag; otherwise, false.</returns>
 public static bool Equals(OscTimeTag lhs, OscTimeTag rhs)
 {
     return(lhs.Equals(rhs));
 }