[TV] 4994: Automatically Change Channel on Program Reminder (1 Viewer)

I'm gonna recheck the build of this DLL and resubmit a zip file.
It is odd that 'Yes' gets selected but the switch does not happen.
 
Yep really strange, I'm willing to stick with it until it's working though as it's a nice improvement and we haven't had many of those over the last few years due to the code freeze.
 
C#:
            tvNotifyDlg.SetDefaultToYes(true);
            tvNotifyDlg.DoModal(GUIWindowManager.ActiveWindow);

            if (tvNotifyDlg.IsConfirmed)
            {
              try
              {
                MediaPortal.Player.g_Player.Stop();
                if (c.IsTv)
                {
                  MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow((int)MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_TV);
                  TVHome.ViewChannelAndCheck(c);
                  if (TVHome.Card.IsTimeShifting && TVHome.Card.IdChannel == c.IdChannel)
                  {
                    g_Player.ShowFullScreenWindow();
                  }
                }
                else if (c.IsRadio)
                {
                  MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow((int)MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_RADIO);
                  Radio.CurrentChannel = c;
                  Radio.Play();
                }
              }
              catch (Exception e)
              {
                Log.Error("TVHome: TVNotification: Error on starting channel {0} after notification: {1} {2} {3}", notify.Channel.DisplayName, e.Message, e.Source, e.StackTrace);
              }
            }
            break;
          }

Setting default to true should satisfy if (tvNotifyDlg.IsConfirmed) and enable the change.
 
Last edited by a moderator:
Can't see how there could be a problem, just tried 2 more reminders...same result, selecting 'OK' on the handset before the window closes changes the channel straight away.
 
Above the snippet I shared is this though:
C#:
            tvNotifyDlg.SetImage(strLogo);
           tvNotifyDlg.TimeOut = _notifyTVTimeout;
            if (_playNotifyBeep)
            {
              MediaPortal.Util.Utils.PlaySound("notify.wav", false, true);
            }
            tvNotifyDlg.SetDefaultToYes(true);
            tvNotifyDlg.DoModal(GUIWindowManager.ActiveWindow);

            if (tvNotifyDlg.IsConfirmed)
            {
              try
              {
                MediaPortal.Player.g_Player.Stop();

                if (c.IsTv)
                {
                  MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow((int)MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_TV);
                  TVHome.ViewChannelAndCheck(c);
                  if (TVHome.Card.IsTimeShifting && TVHome.Card.IdChannel == c.IdChannel)
                  {
                    g_Player.ShowFullScreenWindow();
                  }
                }
                else if (c.IsRadio)
                {
                  MediaPortal.GUI.Library.GUIWindowManager.ActivateWindow((int)MediaPortal.GUI.Library.GUIWindow.Window.WINDOW_RADIO);
                  Radio.CurrentChannel = c;
                  Radio.Play();
                }
              }
              catch (Exception e)
              {
                Log.Error("TVHome: TVNotification: Error on starting channel {0} after notification: {1} {2} {3}", notify.Channel.DisplayName, e.Message, e.Source, e.StackTrace);
              }

Including the above 2 lines reveals that a timeout for the dialogue is set.
Should I still set the timeout to 5 ?
 

Users who are viewing this thread

Back
Top Bottom