private async void Chat_PageRaised(object sender, PageRaisedEventArgs e)
        {
            Logger.Instance.LogMessage(TracingLevel.INFO, "AlertManager: Page Raised!");
            SavePageToFile($"{global.FilePrefix}{e.Message}");
            if (!global.FullScreenAlert)
            {
                return;
            }

            if (TwitchPagerShown == null && !global.AlwaysAlert)
            {
                return;
            }

            // Set color if defined in page
            if (String.IsNullOrEmpty(e.Color))
            {
                currentPageInitialColor = global?.InitialAlertColor ?? DEFAULT_ALERT_COLOR;
            }
            else
            {
                currentPageInitialColor = e.Color;
            }
            pageMessage = e.Message;

            Logger.Instance.LogMessage(TracingLevel.INFO, $"Full screen alert: {pageMessage ?? String.Empty} Color: {currentPageInitialColor}");
            InitFlash();

            await SwitchToFullScreen();
        }
Beispiel #2
0
 private void Chat_PageRaised(object sender, PageRaisedEventArgs e)
 {
     Logger.Instance.LogMessage(TracingLevel.INFO, $"Received a page! Message: {e.Message?? String.Empty}");
     pageMessage = e.Message;
     isPaging    = true;
     fullScreenAlertTriggered = false;
 }
 private async void Chat_PageRaised(object sender, PageRaisedEventArgs e)
 {
     Logger.Instance.LogMessage(TracingLevel.INFO, $"Received a page! Message: {e.Message?? String.Empty}");
     pageMessage = e.Message;
     isPaging    = true;
     if (Settings.PlaySoundOnNotification)
     {
         await HandleSoundPlay(e.Author);
     }
 }
        private async void Chat_PageRaised(object sender, PageRaisedEventArgs e)
        {
            Logger.Instance.LogMessage(TracingLevel.INFO, "AlertManager: Page Raised!");
            SavePageToFile($"{global.FilePrefix}{e.Message}");
            if (!global.FullScreenAlert)
            {
                return;
            }

            if (TwitchPagerShown == null && !global.AlwaysAlert)
            {
                return;
            }

            // Set color if defined in page
            if (String.IsNullOrEmpty(e.Color))
            {
                currentPageInitialColor = global?.InitialAlertColor ?? DEFAULT_ALERT_COLOR;
            }
            else
            {
                currentPageInitialColor = e.Color;
            }
            pageMessage = e.Message;

            Logger.Instance.LogMessage(TracingLevel.INFO, $"Full screen alert: {pageMessage ?? String.Empty} Color: {currentPageInitialColor}");
            InitFlash();

            switch (connection.DeviceInfo().Type)
            {
            case StreamDeckDeviceType.StreamDeckClassic:
                await connection.SwitchProfileAsync("FullScreenAlert");

                break;

            case StreamDeckDeviceType.StreamDeckMini:
                await connection.SwitchProfileAsync("FullScreenAlertMini");

                break;

            case StreamDeckDeviceType.StreamDeckXL:
                await connection.SwitchProfileAsync("FullScreenAlertXL");

                break;

            default:
                Logger.Instance.LogMessage(TracingLevel.WARN, $"SwitchProfileAsync: Unsupported device type: {connection.DeviceInfo().Type}");
                break;
            }
        }