public MainWindow()
        {
            InitializeComponent();

            _engine = GameboyEngine.Instance;

            _processor = new BlobCountingObjectsProcessing(MinimumMovingObjectSize, MinimumMovingObjectSize, Color.Black);
            _detector = new MotionDetector(new TwoFramesDifferenceDetector(), _processor);

            _fields = new ButtonBase[MotionGrid.ColumnDefinitions.Count, MotionGrid.RowDefinitions.Count];

            RandomizeFields();

            Loaded += MainWindow_Loaded;
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();

            _engine = GameboyEngine.Instance;

            _processor = new BlobCountingObjectsProcessing(MinimumMovingObjectSize, MinimumMovingObjectSize, Color.Black);
            _detector  = new MotionDetector(new TwoFramesDifferenceDetector(), _processor);

            _fields = new ButtonBase[MotionGrid.ColumnDefinitions.Count, MotionGrid.RowDefinitions.Count];

            RandomizeFields();

            Loaded += MainWindow_Loaded;
        }
Exemple #3
0
        public MainWindow()
        {
            InitializeComponent();

            SizeToContent = SizeToContent.WidthAndHeight;
            ResizeMode    = ResizeMode.NoResize;
            WindowStyle   = WindowStyle.None;

            Left = 0;
            Top  = 0;

            _launchTime = DateTime.UtcNow;

            //assign two power users who can use special chat commands.
            _channelOwners = new[] { "ffMathy", "RandomnessPlaysPokemon" };

            _slowmotionCountdown = SpeedyTime;

            _gameboy          = GameboyEngine.Instance;
            _twitchChatEngine = TwitchChatEngine.Instance;

            //initialize chat, but only if an API key and username is available. you'll need to generate these yourselves.
            var dataRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                                        "XPlaysGameboy");
            var twitchOAuthTokenPath = Path.Combine(dataRoot, "Twitch.oauth");
            var twitchUsernamePath   = Path.Combine(dataRoot, "Twitch.username");

            if (File.Exists(twitchOAuthTokenPath) && File.Exists(twitchUsernamePath))
            {
                var twitchOAuthToken = File.ReadAllText(twitchOAuthTokenPath);
                var twitchUsername   = File.ReadAllText(twitchUsernamePath);
                _twitchChatEngine.Start(twitchUsername, twitchOAuthToken);
            }

            _twitchChatEngine.MessageReceived += _twitchChatEngine_MessageReceived;
            _twitchChatEngine.UserJoined      += _twitchChatEngine_UserJoined;

            Loaded += MainWindow_Loaded;
        }
        public MainWindow()
        {
            InitializeComponent();

            SizeToContent = SizeToContent.WidthAndHeight;
            ResizeMode = ResizeMode.NoResize;
            WindowStyle = WindowStyle.None;

            Left = 0;
            Top = 0;

            //assign two power users who can use special chat commands.
            _powerUsers = new[] {"ffMathy", "RandomnessPlaysPokemon"};

            _slowmotionCountdown = SpeedyTime;
            if (Debugger.IsAttached)
            {
                _slowmotionCountdown = 10;
            }

            _gameboy = GameboyEngine.Instance;
            _twitchChatEngine = TwitchChatEngine.Instance;

            //initialize chat, but only if an API key and username is available. you'll need to generate these yourselves.
            var dataRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                "XPlaysGameboy");
            var twitchOAuthTokenPath = Path.Combine(dataRoot, "Twitch.oauth");
            var twitchUsernamePath = Path.Combine(dataRoot, "Twitch.username");
            if (File.Exists(twitchOAuthTokenPath) && File.Exists(twitchUsernamePath))
            {
                var twitchOAuthToken = File.ReadAllText(twitchOAuthTokenPath);
                var twitchUsername = File.ReadAllText(twitchUsernamePath);
                _twitchChatEngine.Start(twitchUsername, twitchOAuthToken);
            }

            _twitchChatEngine.MessageReceived += _twitchChatEngine_MessageReceived;

            Loaded += MainWindow_Loaded;
        }