예제 #1
0
 /// <summary>Constructor for Meter Group</summary>
 /// <param name="bytes">The array of float values contained in a byte array</param>
 /// <param name="t">The type of meter group</param>
 public X32MeterGroup(byte[] bytes, Constants.METER_TYPE t)
 {
     values = new List <float>();
     _type  = t;
     for (int i = 0; i < bytes.Length / 4; i++)
     {
         byte[] bFloat = new byte[4];
         for (int j = 0; j < 4; j++)
         {
             bFloat[j] = bytes[i * 4 + j];
         }
         //if (BitConverter.IsLittleEndian) bFloat = Utilities.swapEndian(bFloat);
         float fFloat = BitConverter.ToSingle(bFloat, 0);
         values.Add(fFloat);
     }
 }
예제 #2
0
        public static void FromLocal(Constants.METER_TYPE type)
        {
            List <float> temp    = new List <float>();
            Random       randGen = new Random(DateTime.Now.Millisecond);

            for (int i = 0; i < 70; i++)
            {
                temp.Add((float)randGen.NextDouble());
            }

            MemoryStream toSend = new MemoryStream();

            for (int i = 0; i < 70; i++)
            {
                toSend.Write(BitConverter.GetBytes(temp[i]), 0, 4);
            }
            OSCMessage msg = new OSCMessage("/meters/0", (oscStream)toSend);

            OSCInPort.Instance.RaiseEventFake(msg);
        }
예제 #3
0
 public static void FromOSC(Constants.METER_TYPE type)
 {
     //TODO Implement this ya dummy
 }