Esempio n. 1
0
        public MainPage()
        {
            this.InitializeComponent();

            Loaded += (sender, args) =>
            {
                HapticPlayer = new HapticPlayer();
                HapticPlayer.StatusReceived += response =>
                {
                    Debug.WriteLine("response " + response.ActiveKeys.Count);
                };

                WebSocketSender = new WebSocketSender();
                WebSocketSender.Initialize(true);

                try
                {
                    var          assembly = this.GetType().GetTypeInfo().Assembly;
                    var          resource = assembly.GetManifestResourceStream("App1.BowShoot.tact");
                    StreamReader reader   = new StreamReader(resource);
                    string       text     = reader.ReadToEnd();

                    var project = HapticFeedbackFile.ToHapticFeedbackFile(text).Project;
                    HapticPlayer.Register("test", project);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            };
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            hapticPlayer = new HapticPlayer();

            var file    = File.ReadAllText("ElectricFront.tact");
            var project = CommonUtils.ConvertJsonStringToTactosyFile(file).Project;

            hapticPlayer.Register("file", project);
        }
Esempio n. 3
0
        public MainWindow()
        {
            InitializeComponent();

            hapticPlayer = new HapticPlayer("sample", "sample");

            var file    = File.ReadAllText("ElectricFront.tact");
            var project = CommonUtils.ConvertJsonStringToTactosyFile(file).Project;

            hapticPlayer.Register("file", project);

            timerToCheckIfDeviceActive.Elapsed += (sender, args) =>
            {
                hapticPlayer.Submit("ping", PositionType.FootL, new List <DotPoint>(), 100);
            };

            timerToCheckIfDeviceActive.Start();
        }