Exemple #1
0
 public NetworkResponder()
 {
     this.mw          = (MainWindow)Application.Current.MainWindow;
     this.tts         = this.mw.TextToSpeech;
     this.sr          = this.mw.SpeechRecogniton;
     this.st          = this.mw.SkeletonTracking;
     this.msi         = this.mw.MultiSourceImage;
     this.af          = this.mw.AudioFrame;
     this.context     = new ZContext();
     this.socket      = new ZSocket(this.context, ZSocketType.REP);
     this.binded      = false;
     this.srv         = this.mw.SpeechRecognitionView;
     this.stv         = this.mw.SkeletonTrackingView;
     this.ttsv        = this.mw.TextToSpeechView;
     this.rgbdmicv    = this.mw.RGBDplusMic;
     this.json_thread = new Thread(new ThreadStart(this.ReceiveJson));
     this.json_thread.SetApartmentState(ApartmentState.STA);
     this.json_thread.IsBackground = true;
     this.json_thread.Start();
 }
        public ParametersUpdater(SpeechRecognition sr, SkeletonFaceTracking st, TextToSpeech tts, MultiSourceImage msi, AudioFrame af, SpeechRecognitionView srv, SkeletonTrackingView stv, TextToSpeechView ttsv, RGBDplusMic rgbdmicv)
        {
            this.sr       = sr;
            this.st       = st;
            this.tts      = tts;
            this.msi      = msi;
            this.af       = af;
            this.srv      = srv;
            this.stv      = stv;
            this.ttsv     = ttsv;
            this.rgbdmicv = rgbdmicv;
            this.mw       = (MainWindow)Application.Current.MainWindow;

            this.responder = new NetworkResponder();
            this.responder.Bind("33412");

            this.json_thread = new Thread(new ThreadStart(this.ReceiveAndUpdate));
            this.json_thread.SetApartmentState(ApartmentState.STA);
            this.json_thread.IsBackground = true;
            this.json_thread.Start();
        }
        public MainWindow()
        {
            setKinectSensor();
            this.publisher = new NetworkPublisher();
            this.publisher.Bind("33405");
            this.subscriber = new NetworkSubscriber();
            this.subscriber.Bind("33406");
            this.colorPublisher = new NetworkPublisher();
            this.colorPublisher.Bind("33407");
            this.colorPublisher.SetConflate();
            this.depthPublisher = new NetworkPublisher();
            this.depthPublisher.Bind("33408");
            this.depthPublisher.SetConflate();
            this.audioPublisher = new NetworkPublisher();
            this.audioPublisher.Bind("33409");
            this.audioPublisher.SetConflate();
            this.mappingPublisher = new NetworkPublisher();
            this.mappingPublisher.Bind("33411");
            this.mappingPublisher.SetConflate();

            this.sr  = new SpeechRecognition(this.kinectSensor, this.publisher, this.convertStream);
            this.st  = new SkeletonTracking(this.kinectSensor, this.publisher);
            this.tts = new TextToSpeech(this.subscriber);
            this.af  = new AudioFrame(this.kinectSensor, this.audioPublisher);
            this.msi = new MultiSourceImage(this.kinectSensor, this.depthPublisher, this.colorPublisher, this.mappingPublisher);


            InitializeComponent();

            this.srv          = this.srview;
            this.stv          = this.stview;
            this.ttsv         = this.ttsview;
            this.rgbdplusmicv = this.rgbdmicview;

            // Need to create the responder after models because it's using instance of sr, srw, st & tts
            this.responder = new NetworkResponder();
            this.responder.Bind("33410");
        }