public void SetStreamDeckPanelInstance(StreamDeckPanel streamDeckPanel)
 {
     foreach (var streamDeckLayer in LayerList)
     {
         streamDeckLayer.StreamDeckPanelInstance = streamDeckPanel;
     }
 }
Пример #2
0
 public DCSBIOSDecoder(StreamDeckPanel streamDeckPanel) : base(streamDeckPanel)
 {
     _jaceId           = RandomFactory.Get();
     _imageUpdateTread = new Thread(ImageRefreshingThread);
     _imageUpdateTread.Start();
     DCSBIOS.GetInstance().AttachDataReceivedListener(this);
     EventHandlers.AttachDCSBIOSDecoder(this);
 }
Пример #3
0
 public static List <StreamDeckButton> GetStaticButtons(StreamDeckPanel streamDeckPanel)
 {
     if (streamDeckPanel == null)
     {
         return(_staticStreamDeckButtons);
     }
     return(_staticStreamDeckButtons.FindAll(o => o.StreamDeckPanelInstance.BindingHash == streamDeckPanel.BindingHash).ToList());
 }
Пример #4
0
 protected override void Show()
 {
     if (_refreshBitmap)
     {
         _bitmap        = BitMapCreator.CreateStreamDeckBitmap(_buttonText, _textFont, _fontColor, _backgroundColor, OffsetX, OffsetY);
         _refreshBitmap = false;
     }
     StreamDeckPanel.GetInstance(StreamDeckInstanceId).SetImage(StreamDeckButtonName, _bitmap);
 }
Пример #5
0
 protected override void Show()
 {
     DrawBitmap();
     if (Bitmap == null)
     {
         return;
     }
     StreamDeckPanel.GetInstance(PanelHash).SetImage(StreamDeckButtonName, Bitmap);
 }
 public void SetEssentials(StreamDeckPanel streamDeckPanel)
 {
     foreach (var streamDeckButton in StreamDeckButtons)
     {
         if (streamDeckButton.FaceType == EnumStreamDeckFaceType.DCSBIOS)
         {
             ((DCSBIOSDecoder)streamDeckButton.Face).SetEssentials(streamDeckPanel.InstanceId, streamDeckButton.StreamDeckButtonName);
         }
     }
 }
Пример #7
0
        protected override void DrawBitmap()
        {
            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap       = StreamDeckPanel.Validate(_imageFile);
                RefreshBitmap = false;
            }

            if (_keyBitmap == null)
            {
                _keyBitmap = KeyBitmap.Create.FromBitmap(_bitmap);
            }
        }
        protected override void DrawBitmap()
        {
            if (_backgroundBitmap == null || _loadBackground)
            {
                _backgroundBitmap = StreamDeckPanel.Validate(_backgroundBitmapPath);
                RefreshBitmap     = true;
            }

            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap       = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, OffsetX, OffsetY, _backgroundBitmap);
                RefreshBitmap = false;
            }
        }
Пример #9
0
        protected override void Show()
        {
            if (StreamDeckButtonName == EnumStreamDeckButtonNames.BUTTON0_NO_BUTTON)
            {
                return;
            }

            if (_refreshBitmap)
            {
                _bitmap        = new Bitmap(_imageFile);
                _refreshBitmap = false;
            }

            var keyBitmap = KeyBitmap.Create.FromBitmap(_bitmap);

            StreamDeckPanel.GetInstance(StreamDeckInstanceId).StreamDeckBoard.SetKeyBitmap(StreamDeckFunction.ButtonNumber(StreamDeckButtonName) - 1, keyBitmap);
        }
Пример #10
0
        protected override void DrawBitmap()
        {
            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap = StreamDeckPanel.Validate(_imageFile);

                if (BitMapCreator.IsSmallerThanStreamdeckDefault(_bitmap))
                {
                    _bitmap = BitMapCreator.AdjustBitmap(_bitmap, 1.0f, 4.0f, 1.0f);
                    _bitmap = BitMapCreator.EnlargeBitmapCanvas(_bitmap);
                }
                RefreshBitmap = false;
            }

            if (_keyBitmap == null)
            {
                _keyBitmap = KeyBitmap.Create.FromBitmap(_bitmap);
            }
        }
        protected override void DrawBitmap()
        {
            if (_backgroundBitmap == null || _loadBackground)
            {
                _backgroundBitmap = StreamDeckPanel.Validate(_backgroundBitmapPath);
                RefreshBitmap     = true;
            }

            if (_bitmap == null || RefreshBitmap)
            {
                if (string.IsNullOrEmpty(_backgroundBitmapPath)) //User maybe only wants text displayed.
                {
                    _bitmap = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, Color.LightGray, OffsetX, OffsetY);
                }
                else
                {
                    _bitmap = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, OffsetX, OffsetY, _backgroundBitmap);
                }
                RefreshBitmap = true;
            }
        }
 /// <summary>
 /// This is used when creating buttons for the UI that wasn't in the JSON
 /// </summary>
 /// <param name="enumStreamDeckButton"></param>
 /// <param name="streamDeckPanel"></param>
 public StreamDeckButton(EnumStreamDeckButtonNames enumStreamDeckButton, StreamDeckPanel streamDeckPanel)
 {
     _streamDeckButtonName = enumStreamDeckButton;
     _streamDeckPanel      = streamDeckPanel;
 }
Пример #13
0
 public StreamDeckLayer(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
 }
Пример #14
0
 public DCSBIOSConverter(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel        = streamDeckPanel;
     _faceTypeDCSBIOSOverlay = new FaceTypeDCSBIOSOverlay();
 }
Пример #15
0
 protected override void Show()
 {
     DrawBitmap();
     StreamDeckPanel.GetInstance(PanelHash).SetImage(StreamDeckButtonName, Bitmap);
 }
Пример #16
0
 public FaceTypeDCSBIOS(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
 }
Пример #17
0
 public ActionTypeKey(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
 }
Пример #18
0
 public static void ShowOnly(DCSBIOSDecoder dcsbiosDecoder, string panelHash)
 {
     EventHandlers.HideDCSBIOSDecoders(dcsbiosDecoder, StreamDeckPanel.GetInstance(panelHash).SelectedLayerName);
     dcsbiosDecoder.IsVisible = true;
 }
Пример #19
0
 public static void ShowOnly(DCSBIOSDecoder dcsbiosDecoder, StreamDeckPanel streamDeckPanel)
 {
     EventHandlers.HideDCSBIOSDecoders(dcsbiosDecoder, streamDeckPanel.SelectedLayerName, streamDeckPanel.BindingHash);
     dcsbiosDecoder.IsVisible = true;
 }
Пример #20
0
 public void ClearFace()
 {
     StreamDeckPanel.GetInstance(_panelHash).ClearFace(_streamDeckButtonName);
 }
 public FaceTypeDCSBIOSOverlay(StreamDeckPanel streamDeckPanel) : base(streamDeckPanel)
 {
 }
 public StreamDeckLayerHandler(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
     _streamDeckBoard = streamDeckPanel.StreamDeckBoard;
 }
Пример #23
0
 public StreamDeckLayerHandler(StreamDeckPanel streamDeckPanel)
 {
     _instanceId      = _instanceIdCounter++;
     _streamDeckPanel = streamDeckPanel;
     _streamDeckBoard = streamDeckPanel.StreamDeckBoard;
 }
Пример #24
0
 public ActionTypeDCSBIOS(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
 }
Пример #25
0
 public ActionTypeLayer(StreamDeckPanel streamDeckPanel)
 {
     _streamDeckPanel = streamDeckPanel;
 }
Пример #26
0
 protected override void Show()
 {
     DrawBitmap();
     StreamDeckPanel.GetInstance(PanelHash).StreamDeckBoard.SetKeyBitmap(StreamDeckCommon.ButtonNumber(StreamDeckButtonName) - 1, _keyBitmap);
 }