Beispiel #1
0
        public void sendOSCBundle(OSCbundle ob, int timetag)
        {
            byte[] Bval = new byte[4];
            byte[] data = new byte[4];

            string cmd = formateMSG("#bundle");

            data = Encoding.ASCII.GetBytes(cmd);

            data = append(data, toByte(0));
            data = append(data, toByte(timetag));

            for (int i = 0; i < ob.bundle.Count; i++)
            {
                string tt = ",";
                foreach (string s in ob.bundle[i].typeTag)
                {
                    tt = tt + s;
                }
                string ms = formateMSG(ob.bundle[i].msg) + formateMSG(tt);
                Bval = Encoding.ASCII.GetBytes(ms);
                Bval = append(Bval, ob.bundle[i].value[0]);


                for (int j = 1; j < ob.bundle[i].value.Count; j++)
                {
                    Bval = append(Bval, ob.bundle[i].value[j]);
                }
                //data = append(data, toByte(Bval.Length/8 + (align(Bval.Length/8))));
                data = append(data, toByte(Bval.Length));
                data = append(data, Bval);
            }

            server.Send(data, data.Length);
        }
Beispiel #2
0
        public void sendOSCBundle(OSCbundle ob, int timetag)
        {
            byte[] Bval = new byte[4];
            byte[] data = new byte[4];

            string cmd = formateMSG("#bundle");
            data = Encoding.ASCII.GetBytes(cmd);

            data = append(data, toByte(0));
            data = append(data, toByte(timetag));

            for (int i = 0; i < ob.bundle.Count; i++)
            {
                string tt = ",";
                foreach (string s in ob.bundle[i].typeTag) { tt = tt + s; }
                string ms = formateMSG(ob.bundle[i].msg) + formateMSG(tt);
                Bval = Encoding.ASCII.GetBytes(ms);
                Bval = append(Bval, ob.bundle[i].value[0]);

                for (int j = 1; j < ob.bundle[i].value.Count; j++)
                {
                    Bval = append(Bval, ob.bundle[i].value[j]);
                }
                //data = append(data, toByte(Bval.Length/8 + (align(Bval.Length/8))));
                data = append(data, toByte(Bval.Length));
                data = append(data, Bval);
            }

            server.Send(data, data.Length);
        }