예제 #1
0
        public bool SetAll(bool show)
        {
            if (!this.wrapper.IsInitialized)
            {
                this.wrapper.OnLogError("LCD.Icons.SetAll(): Not initialized");
                throw new InvalidOperationException("The display is not initialized");
            }

            if (LogDisplayingDiscIcons)
            {
                this.wrapper.OnLog("IMON_Display_SetLcdAllIcons(" + show + ")");
            }
            iMonNativeApi.iMonDisplayResult result = iMonNativeApi.IMON_Display_SetLcdAllIcons(show);

            switch (result)
            {
            case iMonNativeApi.iMonDisplayResult.Succeeded:
                iMonLcdIcons[] iconArray = new iMonLcdIcons[this.icons.Count];
                this.icons.Keys.CopyTo(iconArray, 0);
                foreach (iMonLcdIcons icon in iconArray)
                {
                    this.icons[icon] = show;
                }
                return(true);

            case iMonNativeApi.iMonDisplayResult.NotInitialized:
                this.wrapper.OnLogError("IMON_Display_SetLcdAllIcons() => not initialized");
                throw new InvalidOperationException("The display is not initialized");
            }

            return(false);
        }
예제 #2
0
        public bool Set(iMonLcdIcons icon, bool show)
        {
            if (!this.wrapper.IsInitialized)
            {
                this.wrapper.OnLogError("LCD.Icons.Set(): Not initialized");
                throw new InvalidOperationException("The display is not initialized");
            }
            if (this.icons[icon] == show)
            {
                return(true);
            }

            iMonNativeApi.iMonDisplayResult result = this.set(icon, show);

            switch (result)
            {
            case iMonNativeApi.iMonDisplayResult.Succeeded:
                this.icons[icon] = show;
                return(true);

            case iMonNativeApi.iMonDisplayResult.NotInitialized:
                this.wrapper.OnLogError("Cannot set icon when the display has not been initialized");
                throw new InvalidOperationException("The display is not initialized");
            }

            return(false);
        }
예제 #3
0
 internal void Reset()
 {
     this.wrapper.OnLog("LCD.Icons.Reset()");
     if (this.wrapper.IsInitialized)
     {
         this.SetAll(false);
     }
     else
     {
         iMonLcdIcons[] iconArray = new iMonLcdIcons[this.icons.Count];
         this.icons.Keys.CopyTo(iconArray, 0);
         foreach (iMonLcdIcons icon in iconArray)
         {
             this.icons[icon] = false;
         }
     }
 }
예제 #4
0
        public void SetIcon(iMonLcdIcons icon, bool show)
        {
            if (LogDisplayingIcons)
            {
                Logging.Log(LoggingArea, "Trying to set LCD icon " + icon + " to " + show);
            }

            this.icons[icon] = show;

            if (this.lcd)
            {
                if (LogDisplayingIcons)
                {
                    Logging.Log(LoggingArea, "Setting LCD icon " + icon + " to " + show);
                }

                this.imon.LCD.Icons.Set(icon, show);
            }
        }
예제 #5
0
        public bool this[iMonLcdIcons icon]
        {
            get
            {
                if (!this.wrapper.IsInitialized)
                {
                    return(false);
                }

                return(this.icons[icon]);
            }
            set
            {
                if (!this.wrapper.IsInitialized)
                {
                    this.wrapper.OnLogError("Cannot set icon when the display has not been initialized");
                    throw new InvalidOperationException("The display is not initialized");
                }

                this.Set(icon, value);
            }
        }
예제 #6
0
 public bool Hide(iMonLcdIcons icon)
 {
     return(this.Set(icon, false));
 }
예제 #7
0
 public bool Show(iMonLcdIcons icon)
 {
     return(this.Set(icon, true));
 }
        public bool this[iMonLcdIcons icon]
        {
            get
            {
                if (!this.wrapper.IsInitialized)
                {
                    return false;
                }

                return this.icons[icon];
            }
            set
            {
                if (!this.wrapper.IsInitialized)
                {
                    this.wrapper.OnLogError("Cannot set icon when the display has not been initialized");
                    throw new InvalidOperationException("The display is not initialized");
                }

                this.Set(icon, value);
            }
        }
        private iMonNativeApi.iMonDisplayResult set(iMonLcdIcons icon, bool show)
        {
            byte[] data = new byte[2];

            switch (icon)
            {
                #region Sound icons
                case iMonLcdIcons.SpeakerCenter:
                case iMonLcdIcons.SpeakerFrontLeft:
                case iMonLcdIcons.SpeakerFrontRight:
                case iMonLcdIcons.SpeakerLFE:
                case iMonLcdIcons.SpeakerRearLeft:
                case iMonLcdIcons.SpeakerRearRight:
                case iMonLcdIcons.SpeakerSideLeft:
                case iMonLcdIcons.SpeakerSideRight:
                case iMonLcdIcons.SpeakerSPDIF:
                {
                    if (this.icons[iMonLcdIcons.SpeakerCenter])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerCenter];
                    if (this.icons[iMonLcdIcons.SpeakerFrontLeft])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerFrontLeft];
                    if (this.icons[iMonLcdIcons.SpeakerFrontRight])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerFrontRight];
                    if (this.icons[iMonLcdIcons.SpeakerLFE])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerLFE];
                    if (this.icons[iMonLcdIcons.SpeakerRearLeft])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerRearLeft];
                    if (this.icons[iMonLcdIcons.SpeakerRearRight])
                        data[1] |= iconMasks[iMonLcdIcons.SpeakerRearRight];
                    if (this.icons[iMonLcdIcons.SpeakerSideLeft])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerSideLeft];
                    if (this.icons[iMonLcdIcons.SpeakerSideRight])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerSideRight];
                    if (this.icons[iMonLcdIcons.SpeakerSPDIF])
                        data[0] |= iconMasks[iMonLcdIcons.SpeakerSPDIF];

                    int index = 0;
                    if (icon == iMonLcdIcons.SpeakerRearRight)
                    {
                        index = 1;
                    }

                    if (show)
                    {
                        data[index] |= iconMasks[icon];
                    }
                    else
                    {
                        data[index] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdSpeakerIcon(" + Convert.ToString(data[0], 2) + ", " + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdSpeakerIcon(data[0], data[1]);
                }
                #endregion

                #region Disc icons
                case iMonLcdIcons.DiscTopCenter:
                case iMonLcdIcons.DiscTopLeft:
                case iMonLcdIcons.DiscMiddleLeft:
                case iMonLcdIcons.DiscBottomLeft:
                case iMonLcdIcons.DiscBottomCenter:
                case iMonLcdIcons.DiscBottomRight:
                case iMonLcdIcons.DiscMiddleRight:
                case iMonLcdIcons.DiscTopRight:
                case iMonLcdIcons.DiscCircle:
                {
                    if (this.icons[iMonLcdIcons.DiscTopCenter])
                        data[0] |= iconMasks[iMonLcdIcons.DiscTopCenter];
                    if (this.icons[iMonLcdIcons.DiscTopLeft])
                        data[0] |= iconMasks[iMonLcdIcons.DiscTopLeft];
                    if (this.icons[iMonLcdIcons.DiscMiddleLeft])
                        data[0] |= iconMasks[iMonLcdIcons.DiscMiddleLeft];
                    if (this.icons[iMonLcdIcons.DiscBottomLeft])
                        data[0] |= iconMasks[iMonLcdIcons.DiscBottomLeft];
                    if (this.icons[iMonLcdIcons.DiscBottomCenter])
                        data[0] |= iconMasks[iMonLcdIcons.DiscBottomCenter];
                    if (this.icons[iMonLcdIcons.DiscBottomRight])
                        data[0] |= iconMasks[iMonLcdIcons.DiscBottomRight];
                    if (this.icons[iMonLcdIcons.DiscMiddleRight])
                        data[0] |= iconMasks[iMonLcdIcons.DiscMiddleRight];
                    if (this.icons[iMonLcdIcons.DiscTopRight])
                        data[0] |= iconMasks[iMonLcdIcons.DiscTopRight];
                    if (this.icons[iMonLcdIcons.DiscCircle])
                        data[0] |= iconMasks[iMonLcdIcons.DiscCircle];

                    int index = 0;
                    if (icon == iMonLcdIcons.DiscCircle)
                    {
                        index = 1;
                    }

                    if (show)
                    {
                        data[index] |= iconMasks[icon];
                    }
                    else
                    {
                        data[index] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdOrangeIcon(" + Convert.ToString(data[0], 2) + ", " + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdOrangeIcon(data[0], data[1]);
                }
                #endregion

                #region Media type icons
                case iMonLcdIcons.Music:
                case iMonLcdIcons.Movie:
                case iMonLcdIcons.Photo:
                case iMonLcdIcons.CdDvd:
                case iMonLcdIcons.Tv:
                case iMonLcdIcons.Webcast:
                case iMonLcdIcons.NewsWeather:
                {
                    if (this.icons[iMonLcdIcons.Music])
                        data[0] |= iconMasks[iMonLcdIcons.Music];
                    if (this.icons[iMonLcdIcons.Movie])
                        data[0] |= iconMasks[iMonLcdIcons.Movie];
                    if (this.icons[iMonLcdIcons.Photo])
                        data[0] |= iconMasks[iMonLcdIcons.Photo];
                    if (this.icons[iMonLcdIcons.CdDvd])
                        data[0] |= iconMasks[iMonLcdIcons.CdDvd];
                    if (this.icons[iMonLcdIcons.Tv])
                        data[0] |= iconMasks[iMonLcdIcons.Tv];
                    if (this.icons[iMonLcdIcons.Webcast])
                        data[0] |= iconMasks[iMonLcdIcons.Webcast];
                    if (this.icons[iMonLcdIcons.NewsWeather])
                        data[0] |= iconMasks[iMonLcdIcons.NewsWeather];

                    if (show)
                    {
                        data[0] |= iconMasks[icon];
                    }
                    else
                    {
                        data[0] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdMediaTypeIcon(" + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdMediaTypeIcon(data[0]);
                }
                #endregion

                #region Video codec icons
                case iMonLcdIcons.VideoMPG:
                case iMonLcdIcons.VideoDivX:
                case iMonLcdIcons.VideoXviD:
                case iMonLcdIcons.VideoWMV:
                case iMonLcdIcons.VideoMPGAudio:
                case iMonLcdIcons.VideoAC3:
                case iMonLcdIcons.VideoDTS:
                case iMonLcdIcons.VideoWMA:
                {
                    if (this.icons[iMonLcdIcons.VideoMPG])
                        data[0] |= iconMasks[iMonLcdIcons.VideoMPG];
                    if (this.icons[iMonLcdIcons.VideoDivX])
                        data[0] |= iconMasks[iMonLcdIcons.VideoDivX];
                    if (this.icons[iMonLcdIcons.VideoXviD])
                        data[0] |= iconMasks[iMonLcdIcons.VideoXviD];
                    if (this.icons[iMonLcdIcons.VideoWMV])
                        data[0] |= iconMasks[iMonLcdIcons.VideoWMV];
                    if (this.icons[iMonLcdIcons.VideoMPGAudio])
                        data[0] |= iconMasks[iMonLcdIcons.VideoMPGAudio];
                    if (this.icons[iMonLcdIcons.VideoAC3])
                        data[0] |= iconMasks[iMonLcdIcons.VideoAC3];
                    if (this.icons[iMonLcdIcons.VideoDTS])
                        data[0] |= iconMasks[iMonLcdIcons.VideoDTS];
                    if (this.icons[iMonLcdIcons.VideoWMA])
                        data[0] |= iconMasks[iMonLcdIcons.VideoWMA];

                    if (show)
                    {
                        data[0] |= iconMasks[icon];
                    }
                    else
                    {
                        data[0] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdVideoCodecIcon(" + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdVideoCodecIcon(data[0]);
                }
                #endregion

                #region Audio codec icons
                case iMonLcdIcons.AudioMP3:
                case iMonLcdIcons.AudioOGG:
                case iMonLcdIcons.AudioWMA:
                case iMonLcdIcons.AudioWAV:
                {
                    if (this.icons[iMonLcdIcons.AudioMP3])
                        data[0] |= iconMasks[iMonLcdIcons.AudioMP3];
                    if (this.icons[iMonLcdIcons.AudioOGG])
                        data[0] |= iconMasks[iMonLcdIcons.AudioOGG];
                    if (this.icons[iMonLcdIcons.AudioWMA])
                        data[0] |= iconMasks[iMonLcdIcons.AudioWMA];
                    if (this.icons[iMonLcdIcons.AudioWAV])
                        data[0] |= iconMasks[iMonLcdIcons.AudioWAV];

                    if (show)
                    {
                        data[0] |= iconMasks[icon];
                    }
                    else
                    {
                        data[0] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdAudioCodecIcon(" + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdAudioCodecIcon(data[0]);
                }
                #endregion

                #region Aspect ratio icons
                case iMonLcdIcons.AspectRatioSource:
                case iMonLcdIcons.AspectRatioFIT:
                case iMonLcdIcons.AspectRatioTv:
                case iMonLcdIcons.AspectRatioHDTV:
                case iMonLcdIcons.AspectRatioScreen1:
                case iMonLcdIcons.AspectRatioScreen2:
                {
                    if (this.icons[iMonLcdIcons.AspectRatioSource])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioSource];
                    if (this.icons[iMonLcdIcons.AspectRatioFIT])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioFIT];
                    if (this.icons[iMonLcdIcons.AspectRatioTv])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioTv];
                    if (this.icons[iMonLcdIcons.AspectRatioHDTV])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioHDTV];
                    if (this.icons[iMonLcdIcons.AspectRatioScreen1])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioScreen1];
                    if (this.icons[iMonLcdIcons.AspectRatioScreen2])
                        data[0] |= iconMasks[iMonLcdIcons.AspectRatioScreen2];

                    if (show)
                    {
                        data[0] |= iconMasks[icon];
                    }
                    else
                    {
                        data[0] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdAspectRatioIcon(" + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdAspectRatioIcon(data[0]);
                }
                #endregion

                #region Other icons
                case iMonLcdIcons.Repeat:
                case iMonLcdIcons.Shuffle:
                case iMonLcdIcons.Alarm:
                case iMonLcdIcons.Recording:
                case iMonLcdIcons.Volume:
                case iMonLcdIcons.Time:
                {
                    if (this.icons[iMonLcdIcons.Repeat])
                        data[0] |= iconMasks[iMonLcdIcons.Repeat];
                    if (this.icons[iMonLcdIcons.Shuffle])
                        data[0] |= iconMasks[iMonLcdIcons.Shuffle];
                    if (this.icons[iMonLcdIcons.Alarm])
                        data[0] |= iconMasks[iMonLcdIcons.Alarm];
                    if (this.icons[iMonLcdIcons.Recording])
                        data[0] |= iconMasks[iMonLcdIcons.Recording];
                    if (this.icons[iMonLcdIcons.Volume])
                        data[0] |= iconMasks[iMonLcdIcons.Volume];
                    if (this.icons[iMonLcdIcons.Time])
                        data[0] |= iconMasks[iMonLcdIcons.Time];

                    if (show)
                    {
                        data[0] |= iconMasks[icon];
                    }
                    else
                    {
                        data[0] &= (byte)~iconMasks[icon];
                    }

                    this.wrapper.OnLog("IMON_Display_SetLcdEtcIcon(" + Convert.ToString(data[0], 2) + ")");
                    return iMonNativeApi.IMON_Display_SetLcdEtcIcon(data[0]);
                }
                #endregion
            }

            return iMonNativeApi.iMonDisplayResult.Failed;
        }
 internal void Reset()
 {
     this.wrapper.OnLog("LCD.Icons.Reset()");
     if (this.wrapper.IsInitialized)
     {
         this.SetAll(false);
     }
     else
     {
         iMonLcdIcons[] iconArray = new iMonLcdIcons[this.icons.Count];
         this.icons.Keys.CopyTo(iconArray, 0);
         foreach (iMonLcdIcons icon in iconArray)
         {
             this.icons[icon] = false;
         }
     }
 }
 public bool Show(iMonLcdIcons icon)
 {
     return this.Set(icon, true);
 }
        public bool SetAll(bool show)
        {
            if (!this.wrapper.IsInitialized)
            {
                this.wrapper.OnLogError("LCD.Icons.SetAll(): Not initialized");
                throw new InvalidOperationException("The display is not initialized");
            }

            this.wrapper.OnLog("IMON_Display_SetLcdAllIcons(" + show + ")");
            iMonNativeApi.iMonDisplayResult result = iMonNativeApi.IMON_Display_SetLcdAllIcons(show);

            switch (result)
            {
                case iMonNativeApi.iMonDisplayResult.Succeeded:
                    iMonLcdIcons[] iconArray = new iMonLcdIcons[this.icons.Count];
                    this.icons.Keys.CopyTo(iconArray, 0);
                    foreach (iMonLcdIcons icon in iconArray)
                    {
                        this.icons[icon] = show;
                    }
                    return true;

                case iMonNativeApi.iMonDisplayResult.NotInitialized:
                    this.wrapper.OnLogError("IMON_Display_SetLcdAllIcons() => not initialized");
            throw new InvalidOperationException("The display is not initialized");
            }

            return false;
        }
        public bool Set(iMonLcdIcons icon, bool show)
        {
            if (!this.wrapper.IsInitialized)
            {
                this.wrapper.OnLogError("LCD.Icons.Set(): Not initialized");
                throw new InvalidOperationException("The display is not initialized");
            }
            if (this.icons[icon] == show)
            {
                return true;
            }

            iMonNativeApi.iMonDisplayResult result = this.set(icon, show);

            switch (result)
            {
                case iMonNativeApi.iMonDisplayResult.Succeeded:
                    this.icons[icon] = show;
                    return true;

                case iMonNativeApi.iMonDisplayResult.NotInitialized:
                    this.wrapper.OnLogError("Cannot set icon when the display has not been initialized");
                    throw new InvalidOperationException("The display is not initialized");
            }

            return false;
        }
 public bool Hide(iMonLcdIcons icon)
 {
     return this.Set(icon, false);
 }
예제 #15
0
        // TODO: Optimalize setting of more icons at the same time
        private iMonNativeApi.iMonDisplayResult set(iMonLcdIcons icon, bool show)
        {
            byte[] data = new byte[2];

            switch (icon)
            {
                #region Sound icons
            case iMonLcdIcons.SpeakerCenter:
            case iMonLcdIcons.SpeakerFrontLeft:
            case iMonLcdIcons.SpeakerFrontRight:
            case iMonLcdIcons.SpeakerLFE:
            case iMonLcdIcons.SpeakerRearLeft:
            case iMonLcdIcons.SpeakerRearRight:
            case iMonLcdIcons.SpeakerSideLeft:
            case iMonLcdIcons.SpeakerSideRight:
            case iMonLcdIcons.SpeakerSPDIF:
            {
                if (this.icons[iMonLcdIcons.SpeakerCenter])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerCenter];
                }
                if (this.icons[iMonLcdIcons.SpeakerFrontLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerFrontLeft];
                }
                if (this.icons[iMonLcdIcons.SpeakerFrontRight])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerFrontRight];
                }
                if (this.icons[iMonLcdIcons.SpeakerLFE])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerLFE];
                }
                if (this.icons[iMonLcdIcons.SpeakerRearLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerRearLeft];
                }
                if (this.icons[iMonLcdIcons.SpeakerRearRight])
                {
                    data[1] |= iconMasks[iMonLcdIcons.SpeakerRearRight];
                }
                if (this.icons[iMonLcdIcons.SpeakerSideLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerSideLeft];
                }
                if (this.icons[iMonLcdIcons.SpeakerSideRight])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerSideRight];
                }
                if (this.icons[iMonLcdIcons.SpeakerSPDIF])
                {
                    data[0] |= iconMasks[iMonLcdIcons.SpeakerSPDIF];
                }

                int index = 0;
                if (icon == iMonLcdIcons.SpeakerRearRight)
                {
                    index = 1;
                }

                if (show)
                {
                    data[index] |= iconMasks[icon];
                }
                else
                {
                    data[index] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdSpeakerIcon(" + Convert.ToString(data[0], 2) + ", " + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdSpeakerIcon(data[0], data[1]));
            }
                #endregion

                #region Disc icons
            case iMonLcdIcons.DiscTopCenter:
            case iMonLcdIcons.DiscTopLeft:
            case iMonLcdIcons.DiscMiddleLeft:
            case iMonLcdIcons.DiscBottomLeft:
            case iMonLcdIcons.DiscBottomCenter:
            case iMonLcdIcons.DiscBottomRight:
            case iMonLcdIcons.DiscMiddleRight:
            case iMonLcdIcons.DiscTopRight:
            case iMonLcdIcons.DiscCircle:
            {
                if (this.icons[iMonLcdIcons.DiscTopCenter])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscTopCenter];
                }
                if (this.icons[iMonLcdIcons.DiscTopLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscTopLeft];
                }
                if (this.icons[iMonLcdIcons.DiscMiddleLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscMiddleLeft];
                }
                if (this.icons[iMonLcdIcons.DiscBottomLeft])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscBottomLeft];
                }
                if (this.icons[iMonLcdIcons.DiscBottomCenter])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscBottomCenter];
                }
                if (this.icons[iMonLcdIcons.DiscBottomRight])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscBottomRight];
                }
                if (this.icons[iMonLcdIcons.DiscMiddleRight])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscMiddleRight];
                }
                if (this.icons[iMonLcdIcons.DiscTopRight])
                {
                    data[0] |= iconMasks[iMonLcdIcons.DiscTopRight];
                }
                if (this.icons[iMonLcdIcons.DiscCircle])
                {
                    data[1] |= iconMasks[iMonLcdIcons.DiscCircle];
                }

                int index = 0;
                if (icon == iMonLcdIcons.DiscCircle)
                {
                    index = 1;
                }

                if (show)
                {
                    data[index] |= iconMasks[icon];
                }
                else
                {
                    data[index] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdOrangeIcon(" + Convert.ToString(data[0], 2) + ", " + Convert.ToString(data[1], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdOrangeIcon(data[0], data[1]));
            }
                #endregion

                #region Media type icons
            case iMonLcdIcons.Music:
            case iMonLcdIcons.Movie:
            case iMonLcdIcons.Photo:
            case iMonLcdIcons.CdDvd:
            case iMonLcdIcons.Tv:
            case iMonLcdIcons.Webcast:
            case iMonLcdIcons.NewsWeather:
            {
                if (this.icons[iMonLcdIcons.Music])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Music];
                }
                if (this.icons[iMonLcdIcons.Movie])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Movie];
                }
                if (this.icons[iMonLcdIcons.Photo])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Photo];
                }
                if (this.icons[iMonLcdIcons.CdDvd])
                {
                    data[0] |= iconMasks[iMonLcdIcons.CdDvd];
                }
                if (this.icons[iMonLcdIcons.Tv])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Tv];
                }
                if (this.icons[iMonLcdIcons.Webcast])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Webcast];
                }
                if (this.icons[iMonLcdIcons.NewsWeather])
                {
                    data[0] |= iconMasks[iMonLcdIcons.NewsWeather];
                }

                if (show)
                {
                    data[0] |= iconMasks[icon];
                }
                else
                {
                    data[0] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdMediaTypeIcon(" + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdMediaTypeIcon(data[0]));
            }
                #endregion

                #region Video codec icons
            case iMonLcdIcons.VideoMPG:
            case iMonLcdIcons.VideoDivX:
            case iMonLcdIcons.VideoXviD:
            case iMonLcdIcons.VideoWMV:
            case iMonLcdIcons.VideoMPGAudio:
            case iMonLcdIcons.VideoAC3:
            case iMonLcdIcons.VideoDTS:
            case iMonLcdIcons.VideoWMA:
            {
                if (this.icons[iMonLcdIcons.VideoMPG])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoMPG];
                }
                if (this.icons[iMonLcdIcons.VideoDivX])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoDivX];
                }
                if (this.icons[iMonLcdIcons.VideoXviD])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoXviD];
                }
                if (this.icons[iMonLcdIcons.VideoWMV])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoWMV];
                }
                if (this.icons[iMonLcdIcons.VideoMPGAudio])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoMPGAudio];
                }
                if (this.icons[iMonLcdIcons.VideoAC3])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoAC3];
                }
                if (this.icons[iMonLcdIcons.VideoDTS])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoDTS];
                }
                if (this.icons[iMonLcdIcons.VideoWMA])
                {
                    data[0] |= iconMasks[iMonLcdIcons.VideoWMA];
                }

                if (show)
                {
                    data[0] |= iconMasks[icon];
                }
                else
                {
                    data[0] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdVideoCodecIcon(" + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdVideoCodecIcon(data[0]));
            }
                #endregion

                #region Audio codec icons
            case iMonLcdIcons.AudioMP3:
            case iMonLcdIcons.AudioOGG:
            case iMonLcdIcons.AudioWMA:
            case iMonLcdIcons.AudioWAV:
            {
                if (this.icons[iMonLcdIcons.AudioMP3])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AudioMP3];
                }
                if (this.icons[iMonLcdIcons.AudioOGG])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AudioOGG];
                }
                if (this.icons[iMonLcdIcons.AudioWMA])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AudioWMA];
                }
                if (this.icons[iMonLcdIcons.AudioWAV])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AudioWAV];
                }

                if (show)
                {
                    data[0] |= iconMasks[icon];
                }
                else
                {
                    data[0] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdAudioCodecIcon(" + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdAudioCodecIcon(data[0]));
            }
                #endregion

                #region Aspect ratio icons
            case iMonLcdIcons.AspectRatioSource:
            case iMonLcdIcons.AspectRatioFIT:
            case iMonLcdIcons.AspectRatioTv:
            case iMonLcdIcons.AspectRatioHDTV:
            case iMonLcdIcons.AspectRatioScreen1:
            case iMonLcdIcons.AspectRatioScreen2:
            {
                if (this.icons[iMonLcdIcons.AspectRatioSource])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioSource];
                }
                if (this.icons[iMonLcdIcons.AspectRatioFIT])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioFIT];
                }
                if (this.icons[iMonLcdIcons.AspectRatioTv])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioTv];
                }
                if (this.icons[iMonLcdIcons.AspectRatioHDTV])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioHDTV];
                }
                if (this.icons[iMonLcdIcons.AspectRatioScreen1])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioScreen1];
                }
                if (this.icons[iMonLcdIcons.AspectRatioScreen2])
                {
                    data[0] |= iconMasks[iMonLcdIcons.AspectRatioScreen2];
                }

                if (show)
                {
                    data[0] |= iconMasks[icon];
                }
                else
                {
                    data[0] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdAspectRatioIcon(" + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdAspectRatioIcon(data[0]));
            }
                #endregion

                #region Other icons
            case iMonLcdIcons.Repeat:
            case iMonLcdIcons.Shuffle:
            case iMonLcdIcons.Alarm:
            case iMonLcdIcons.Recording:
            case iMonLcdIcons.Volume:
            case iMonLcdIcons.Time:
            {
                if (this.icons[iMonLcdIcons.Repeat])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Repeat];
                }
                if (this.icons[iMonLcdIcons.Shuffle])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Shuffle];
                }
                if (this.icons[iMonLcdIcons.Alarm])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Alarm];
                }
                if (this.icons[iMonLcdIcons.Recording])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Recording];
                }
                if (this.icons[iMonLcdIcons.Volume])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Volume];
                }
                if (this.icons[iMonLcdIcons.Time])
                {
                    data[0] |= iconMasks[iMonLcdIcons.Time];
                }

                if (show)
                {
                    data[0] |= iconMasks[icon];
                }
                else
                {
                    data[0] &= (byte)~iconMasks[icon];
                }

                if (LogDisplayingDiscIcons)
                {
                    this.wrapper.OnLog("IMON_Display_SetLcdEtcIcon(" + Convert.ToString(data[0], 2) + ")");
                }
                return(iMonNativeApi.IMON_Display_SetLcdEtcIcon(data[0]));
            }
                #endregion
            }

            return(iMonNativeApi.iMonDisplayResult.Failed);
        }
예제 #16
0
        public void SetIcon(iMonLcdIcons icon, bool show)
        {
            if (LogDisplayingIcons)
                Logging.Log(LoggingArea, "Trying to set LCD icon " + icon + " to " + show);

            this.icons[icon] = show;

            if (this.lcd)
            {
                if (LogDisplayingIcons)
                    Logging.Log(LoggingArea, "Setting LCD icon " + icon + " to " + show);

                this.imon.LCD.Icons.Set(icon, show);
            }
        }
예제 #17
0
        public void SetIcon(iMonLcdIcons icon, bool show)
        {
            this.icons[icon] = show;

            if (this.lcd)
            {
                Logging.Log("Display Handler", "Setting LCD icon " + icon + " to " + show);

                this.imon.LCD.Icons.Set(icon, show);
            }
        }