Exemple #1
0
        /// <summary>
        /// Raises the <see cref="DeviceRemoval"/> event.
        /// </summary>
        /// <param name="deviceType">The device type that was removed.</param>
        protected virtual void OnDeviceRemoval(LcdDeviceType deviceType)
        {
            EventHandler <LcdDeviceTypeEventArgs> handler = DeviceRemoval;

            if (handler != null)
            {
                handler(this, new LcdDeviceTypeEventArgs(deviceType));
            }
        }
Exemple #2
0
 /// <summary>
 /// Creates a new instance of <see cref="LcdDevice"/> for the given applet and device type.
 /// </summary>
 /// <param name="applet"><see cref="LcdApplet"/> that opened this device.</param>
 /// <param name="deviceType">Type of this device.</param>
 internal LcdDevice(LcdApplet applet, LcdDeviceType deviceType)
 {
     new LgLcdPermission(PermissionState.Unrestricted).Demand();
     _applet              = applet;
     _deviceType          = deviceType;
     _deviceNumber        = -1;
     _softButtonsCallback = SoftButtonsChangedCallback;
     _stopwatch           = new Stopwatch();
     ReOpen();
 }
        public StartupScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "StartupScreen";

            if (type == LcdDeviceType.Monochrome)
            {
                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                createColor();
            }
        }
        public MainScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "MainScreen";
            plugin_.getSongData();

            if (type == LcdDeviceType.Monochrome)
            {
                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                createColor();
            }
        }
Exemple #5
0
        /// <summary>
        /// Opens a device of a given type.
        /// This function is generally called after a <see cref="DeviceArrival" /> event has been received.
        /// </summary>
        /// <param name="deviceType">Type of the device to open.</param>
        public LcdDevice OpenDeviceByType(LcdDeviceType deviceType)
        {
            VerifyConnected();
            switch (deviceType)
            {
            case LcdDeviceType.Monochrome:
                return(new LcdDeviceMonochrome(this));

            case LcdDeviceType.Qvga:
                return(new LcdDeviceQvga(this));

            default:
                throw new NotSupportedException(deviceType + " is not a supported device type.");
            }
        }
Exemple #6
0
        public VolumeScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index, int volume)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "VolumeScreen";
            plugin_.getSongData();

            volumeChanger_ = volume / 100f;

            if (type == LcdDeviceType.Monochrome)
            {
                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                createColor();
            }
        }
        public LyricsScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "LyricsScreen";

            plugin_.getSongData();

            if (type == LcdDeviceType.Monochrome)
            {
                maximumTextSize_ = 40;
                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                mainTextFont_    = new Font(mainTextFont_, FontStyle.Bold);
                maximumTextSize_ = 50;
                createColor();
            }
        }
Exemple #8
0
        public PlayerControlScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "ControlScreen";

            plugin_.getSongData();

            if (type == LcdDeviceType.Monochrome)
            {
                controlsGdi_ = new LcdGdiText[5];

                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                controlsGdi_ = new LcdGdiText[5];

                createColor();
            }
        }
        public Screen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin musicBeePlugin, int index)
            : base(device)
        {
            plugin_ = musicBeePlugin;
            type_   = type;
            device_ = device;
            index_  = index;

            if (device.DeviceType == LcdDeviceType.Qvga && String.IsNullOrEmpty(backgroundGdi))
            {
                backgroundImage_ = (Image)Resource.G19Background;
                backgroundGdi_   = new LcdGdiImage(backgroundImage_);
                this.Children.Add(backgroundGdi_);
            }
            else if (device.DeviceType == LcdDeviceType.Qvga && backgroundGdi != "")
            {
                backgroundImage_ = Image.FromFile(backgroundGdi, true);
                backgroundGdi_   = new LcdGdiImage(backgroundImage_);
                this.Children.Add(backgroundGdi_);
            }
        }
        public PlayerSettingsScreen(LcdDevice device, LcdDeviceType type, string backgroundGdi, Plugin plugin, int index, int volume)
            : base(device, type, backgroundGdi, plugin, index)
        {
            screenName_ = "SettingsScreen";

            volumeChanger_ = volume / 100f;

            plugin_.getSongData();

            repeatArray_[0] = Plugin.RepeatMode.None;
            repeatArray_[1] = Plugin.RepeatMode.One;
            repeatArray_[2] = Plugin.RepeatMode.All;

            if (type == LcdDeviceType.Monochrome)
            {
                settingsGdi_ = new LcdGdiText[4];
                createMono();
            }
            else if (type == LcdDeviceType.Qvga)
            {
                settingsGdi_ = new LcdGdiText[5];
                createColor();
            }
        }
 /// <summary>
 /// set the device type
 /// </summary>
 /// <param name="LcdType"></param>
 private void SetDeviceType(LcdDeviceType LcdType)
 {
     deviceType = LcdType;
 }
 /// <summary>
 /// Creates a new instance of <see cref="LcdDeviceTypeEventArgs"/> with the specified device type.
 /// </summary>
 /// <param name="deviceType"><see cref="LcdDeviceType"/> represented by these arguments.</param>
 public LcdDeviceTypeEventArgs(LcdDeviceType deviceType)
 {
     _deviceType = deviceType;
 }