Example #1
0
 public SiftOscCubeEvent(Cube cube, OscClient client, IPEndPoint endPoint, List<SiftOscEventMessage> messages)
 {
     this.cube = cube;
       this.client = client;
       this.endPoint = endPoint;
       this.messages = messages;
 }
        public void Send(OscPacket packet)
        {
            Assert.ParamIsNotNull(packet);

            mOscClient = new OscClient(Destination);
            mOscClient.Connect();

            mPacket = packet;
            mPacket.Client = mOscClient;

            mTransmitterThread = new Thread(RunWorker);
            mTransmitterThread.Start();
        }
        public void Start(OscPacket packet)
        {
            Assert.ParamIsNotNull(packet);

            mOscClient = new OscClient(Destination);
            mOscClient.Connect();
            Console.WriteLine("Sending to: " + Destination.Address.ToString() + ":" + Destination.Port.ToString());

            mPacket = packet;
            mPacket.Client = mOscClient;
            mSendMessages = true;

            mTransmitterThread = new Thread(RunWorker);
            mTransmitterThread.Start();
        }
        public void Initialize(Wiimotes wiimotesObj)
        {
            sSendMessages = true;

            if (TransportType == TransportType.Tcp)
            {
                sOscClient = new OscClient(Destination.Address, Destination.Port);
                sOscClient.Connect();
            }

            _sourceEndPoint = new IPEndPoint(IPAddress.Loopback, Port);

            wiimotesObj.RecordingStartedEvent += new Wiimotes.OnRecordingStartedEvent(OnRecordingStartedEvent);
            wiimotesObj.RecordingCompletedEvent += new Wiimotes.OnRecordingCompletedEvent(OnRecordingCompletedEvent);

            Thread serverThread = new Thread(RunWorker);
            serverThread.Start();
        }
Example #5
0
        static void Main(string[] args)
        {
            SiftOsc app = new SiftOsc();
              OscClient client = new OscClient(IPAddress.Loopback, 7001);
              app.setClient(client);
              app.siftOscCubes = new Dictionary<int, SiftOscCube>();
              app.siftOscCallbacks = new Dictionary<SiftOscCube, String>();

              StreamReader input = new StreamReader("config.yml");
              StringReader content = new StringReader(input.ReadToEnd());

              var yaml = new YamlStream();
              yaml.Load(content);
              YamlMappingNode mapping = (YamlMappingNode)yaml.Documents[0].RootNode;

              foreach (var cubeID in mapping.Children) {
            String cubeIDName = (((YamlScalarNode)cubeID.Key).Value);
            SiftOscCube cube = new SiftOscCube(null, client, null);
            app.addCube(Int32.Parse(cubeIDName), cube);
            cube.generateFromYaml((YamlMappingNode)cubeID.Value);
              }

              app.Run();
        }
Example #6
0
 /// <summary>
 /// Transmit an Osc packet via TCP through the connected OscClient.
 /// </summary>
 /// <param name="packet">The packet to transmit.</param>
 /// <param name="client">The OscClient to communicate through.</param>
 /// <remarks>The OscClient must be connected for successful transmission.</remarks>
 public static void Send(OscPacket packet, OscClient client)
 {
     client.Send(packet);
 }
Example #7
0
 public void setClient(OscClient client)
 {
     this.client = client;
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OscBundle"/> class.
 /// </summary>
 /// <param name="sourceEndPoint">The packet origin.</param>
 /// <param name="timeStamp">The creation time of the bundle.</param>
 /// <param name="client">The destination of sent packets when using TransportType.Tcp.</param>
 public OscBundle(IPEndPoint sourceEndPoint, OscTimeTag timeStamp, OscClient client = null)
     : base(sourceEndPoint, BundlePrefix, client)
 {
     mTimeStamp = timeStamp;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OscBundle"/> class.
 /// </summary>
 /// <param name="sourceEndPoint">The packet origin.</param>
 /// <param name="client">The destination of sent packets when using TransportType.Tcp.</param>
 public OscBundle(IPEndPoint sourceEndPoint, OscClient client = null)
     : this(sourceEndPoint, new OscTimeTag(), client)
 {
 }
Example #10
0
 /// <summary>
 /// Creates a new instance of OscBundle.
 /// </summary>
 /// <param name="sourceEndPoint">The packet origin.</param>
 /// <param name="client">The destination of sent packets when using TransportType.Tcp.</param>
 public OscBundle(IPEndPoint sourceEndPoint, OscClient client)
     : this(sourceEndPoint, 0, client)
 {
 }
Example #11
0
 public SiftOscCube(Cube cube, OscClient client, Dictionary<String, List<SiftOscCubeEvent>> siftOscCubeEvents)
 {
     this.cube = cube;
       this.client = client;
       this.siftOscCubeEvents = (siftOscCubeEvents != null)? siftOscCubeEvents : new Dictionary<String, List<SiftOscCubeEvent>>();
 }