Example #1
0
 void mediaEmulator_IsEnabledChanged(MediaEmulator emulator, bool isEnabled)
 {
     if (!isEnabled)
     {
         Bordmonitor.EnableRadioMenu();
     }
 }
Example #2
0
 void Radio_OnOffChanged(bool turnedOn)
 {
     if (turnedOn)
     {
         Bordmonitor.EnableRadioMenu(); // fixes disabled radio menu to update screen
     }
 }
Example #3
0
        protected void ProcessToRadioMessage(Message m)
        {
            if (!IsEnabled)
            {
                return;
            }

            // item click
            if (m.Data.Length == 4 && m.Data.StartsWith(0x31, 0x60, 0x00) && m.Data[3] <= 9)
            {
                var index = GetItemIndex(m.Data[3], true);
                m.ReceiverDescription = "Screen item click #" + index;
                var item = CurrentScreen.GetItem(index);
                if (item != null)
                {
                    item.Click();
                }
                return;
            }

            // BM buttons
            if (m.Data.Length == 2 && m.Data[0] == 0x48)
            {
                switch (m.Data[1])
                {
                case 0x14:     // <>
                    m.ReceiverDescription = "BM button <> - navigate home";
                    NavigateHome();
                    break;

                case 0x07:
                    m.ReceiverDescription = "BM button Clock - navigate BC";
                    NavigateAfterHome(BordcomputerScreen.Instance);
                    break;

                case 0x20:
                    m.ReceiverDescription = "BM button Sel";     // - navigate player";
                    // TODO fix in cdc mode
                    //NavigateAfterHome(HomeScreen.Instance.PlayerScreen);
                    break;

                case 0x30:
                    m.ReceiverDescription = "BM button Switch Screen";

                    /*if (screenSwitched)
                     * {
                     *  UpdateScreen();
                     * }*/
                    break;

                case 0x23:
                    m.ReceiverDescription = "BM button Mode";
                    IsEnabled             = false;
                    Bordmonitor.EnableRadioMenu();     // TODO test [and remove]
                    break;

                case 0x04:
                    m.ReceiverDescription = "BM button Tone";
                    // TODO fix Tone - skip clear till aux title
                    IsEnabled = false;
                    //Bordmonitor.EnableRadioMenu(); // TODO test [and remove]
                    break;

                case 0x10:
                    m.ReceiverDescription = "BM Button < prev track";
                    mediaEmulator.Player.Prev();
                    break;

                case 0x00:
                    m.ReceiverDescription = "BM Button > next track";
                    mediaEmulator.Player.Next();
                    break;
                }
                return;
            }
        }
Example #4
0
        protected void ProcessRadioMessage(Message m)
        {
            if (m.Data.Compare(Bordmonitor.DataRadioOn))
            {
                Bordmonitor.EnableRadioMenu(); // fixes disabled radio menu to update screen
                return;
            }

            if (!IsEnabled)
            {
                return;
            }

            var isRefresh = m.Data.Compare(Bordmonitor.MessageRefreshScreen.Data);

            if (isRefresh)
            {
                m.ReceiverDescription = "Screen refresh";
                skipClearTillRefresh  = false;
                if (skipRefreshScreen)
                {
                    skipRefreshScreen = false;
                    return;
                }
            }
            var isClear = m.Data.Compare(Bordmonitor.MessageClearScreen.Data);

            if (isClear)
            {
                m.ReceiverDescription = "Screen clear";
                if (skipClearScreen || skipClearTillRefresh)
                {
                    skipClearScreen = false;
                    return;
                }
            }
            if (isClear || isRefresh)
            {
                if (IsScreenSwitched)
                {
                    IsScreenSwitched = false;
                }

                if (disableRadioMenu || isClear)
                {
                    disableRadioMenu = false;
                    Bordmonitor.DisableRadioMenu();
                    return;
                }

                // TODO test "INFO" button
                UpdateScreen(MenuScreenUpdateReason.Refresh);
                return;
            }

            // Screen switch
            // 0x46 0x01 - switched by nav, after 0x45 0x91 from nav (eg. "menu" button)
            // 0x46 0x02 - switched by radio ("switch" button).
            if (m.Data.Length == 2 && m.Data[0] == 0x46 && (m.Data[1] == 0x01 || m.Data[1] == 0x02))
            {
                switch (m.Data[1])
                {
                case 0x01:
                    m.ReceiverDescription = "Screen SW by nav";
                    break;

                case 0x02:
                    m.ReceiverDescription = "Screen SW by rad";
                    skipClearScreen       = true; // to prevent on "clear screen" update on switch to BC/nav
                    break;
                }
                IsScreenSwitched = true;
                return;
            }

            /*if (m.Data.Compare(Bordmonitor.DataAUX))
             * {
             *  IsScreenSwitched = false;
             *  UpdateScreen(); // TODO prevent flickering
             *  return;
             * }*/

            if (m.Data.StartsWith(Bordmonitor.DataShowTitle) && (lastTitle == null || !lastTitle.Data.Compare(m.Data)))
            {
                IsScreenSwitched = false;
                disableRadioMenu = true;
                UpdateScreen(MenuScreenUpdateReason.Refresh);
                return;
            }
        }