Пример #1
0
        public void UpdateAllButtonsSelectedStatus(EnumStreamDeckButtonNames selectedButtonName)
        {
            //System.Diagnostics.Debugger.Break();

            foreach (var buttonImage in ButtonImages)
            {
                try
                {
                    if (selectedButtonName == buttonImage.Bill.StreamDeckButtonName)
                    {
                        if (buttonImage.Bill.IsSelected)
                        {
                            buttonImage.Source          = buttonImage.Bill.DeselectedImage;
                            buttonImage.Bill.IsSelected = false;
                        }
                        else
                        {
                            buttonImage.Source          = buttonImage.Bill.SelectedImage;
                            buttonImage.Bill.IsSelected = true;
                        }
                    }
                    else
                    {
                        buttonImage.Source          = buttonImage.Bill.DeselectedImage;
                        buttonImage.Bill.IsSelected = false;
                    }
                }
                catch (Exception ex)
                {
                    Common.ShowErrorMessageBox(ex);
                }
            }
        }
 public StreamDeckDCSBIOSConverterWindow(EnumStreamDeckButtonNames streamDeckButtonName, DCSBIOSConverter dcsbiosConverter, StreamDeckPanel streamDeckPanel)
 {
     InitializeComponent();
     _streamDeckButtonName = streamDeckButtonName;
     _streamDeckPanel      = streamDeckPanel;
     _dcsbiosConverter     = dcsbiosConverter;
 }
Пример #3
0
 public StreamDeckDCSBIOSConverterWindow(EnumStreamDeckButtonNames streamDeckButtonName, string streamDeckPanelInstanceId, DCSBIOSConverter dcsbiosConverter)
 {
     InitializeComponent();
     _streamDeckButtonName      = streamDeckButtonName;
     _streamDeckPanelInstanceId = streamDeckPanelInstanceId;
     _streamDeckPanel           = StreamDeckPanel.GetInstance(_streamDeckPanelInstanceId);
     _dcsbiosConverter          = dcsbiosConverter;
 }
Пример #4
0
        public static int ButtonNumber(EnumStreamDeckButtonNames streamDeckButtonName)
        {
            if (streamDeckButtonName == EnumStreamDeckButtonNames.BUTTON0_NO_BUTTON)
            {
                return(-1);
            }

            return(int.Parse(streamDeckButtonName.ToString().Replace("BUTTON", "")));
        }
Пример #5
0
        public static void SenderNotifiesIsDirty(object sender, EnumStreamDeckButtonNames buttonName, string layerName)
        {
            var eventArguments = new StreamDeckDirtyNotificationArgs();

            eventArguments.ButtonName = buttonName;
            eventArguments.LayerName  = layerName;

            OnDirtyNotificationEventHandler?.Invoke(sender, eventArguments);
        }
Пример #6
0
        public void SetImage(EnumStreamDeckButtonNames streamDeckButtonName, Bitmap bitmap)
        {
            if (streamDeckButtonName == EnumStreamDeckButtonNames.BUTTON0_NO_BUTTON)
            {
                return;
            }
            var keyBitmap = KeyBitmap.Create.FromBitmap(bitmap);

            _streamDeckBoard.SetKeyBitmap(StreamDeckFunction.ButtonNumber(streamDeckButtonName) - 1, keyBitmap);
        }
Пример #7
0
        public static void SenderNotifiesIsDirty(object sender, EnumStreamDeckButtonNames buttonName, string layerName, string bindingHash)
        {
            var eventArguments = new StreamDeckDirtyNotificationArgs
            {
                BindingHash = bindingHash,
                ButtonName  = buttonName,
                LayerName   = layerName
            };

            OnDirtyNotificationEventHandler?.Invoke(sender, eventArguments);
        }
Пример #8
0
        public void SetImage(EnumStreamDeckButtonNames streamDeckButtonName, BitmapImage bitmapImage)
        {
            if (streamDeckButtonName == EnumStreamDeckButtonNames.BUTTON0_NO_BUTTON)
            {
                return;
            }
            var keyBitmap = KeyBitmap.Create.FromBitmap(BitMapCreator.BitmapImage2Bitmap(bitmapImage));

            lock (_updateStreamDeckOledLockObject)
            {
                _streamDeckBoard.SetKeyBitmap(StreamDeckCommon.ButtonNumber(streamDeckButtonName) - 1, keyBitmap);
            }
        }
Пример #9
0
        public void SetImage(EnumStreamDeckButtonNames streamDeckButtonName, BitmapImage bitmapImage)
        {
            if (streamDeckButtonName == EnumStreamDeckButtonNames.BUTTON0_NO_BUTTON)
            {
                return;
            }
            var keyBitmap = KeyBitmap.Create.FromBitmap(BitMapCreator.BitmapImage2Bitmap(bitmapImage));

            lock (_updateStreamDeckOledLockObject)
            {
                //EventHandlers.NotifyOledImageChange(this, PanelHash, streamDeckButtonName, BitMapCreator.BitmapImage2Bitmap(bitmapImage));
                _streamDeckBoard.SetKeyBitmap(StreamDeckCommon.ButtonNumber(streamDeckButtonName) - 1, keyBitmap);
            }
        }
        public StreamDeckDCSBIOSDecoderWindow(string streamDeckInstanceId, EnumStreamDeckButtonNames streamDeckButton)
        {
            InitializeComponent();
            _dcsbiosDecoder = new DCSBIOSDecoder();
            _dcsbiosDecoder.SetEssentials(streamDeckInstanceId, streamDeckButton);
            LoadDefaults();
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            _dcsbiosDecoder.StreamDeckButtonName = streamDeckButton;
            _streamDeckInstanceId = streamDeckInstanceId;
            var thread = new Thread(ThreadLoop);

            thread.Start();
        }
 protected void SetSelectedButtonUIOnly(EnumStreamDeckButtonNames selectedButtonName)
 {
     foreach (var buttonImage in ButtonImages)
     {
         try
         {
             if (selectedButtonName == buttonImage.Bill.StreamDeckButtonName)
             {
                 buttonImage.Source     = buttonImage.Bill.SelectedImage;
                 buttonImage.IsSelected = true;
             }
             else
             {
                 buttonImage.Source     = buttonImage.Bill.DeselectedImage;
                 buttonImage.IsSelected = false;
             }
         }
         catch (Exception ex)
         {
             Common.ShowErrorMessageBox(ex);
         }
     }
 }
Пример #12
0
 public void SetEssentials(string streamDeckInstance, EnumStreamDeckButtonNames streamDeckButton)
 {
     StreamDeckButtonName = streamDeckButton;
     StreamDeckInstanceId = streamDeckInstance;
 }
Пример #13
0
 public StreamDeckButton(EnumStreamDeckButtonNames enumStreamDeckButton, string panelHash)
 {
     _streamDeckButtonName = enumStreamDeckButton;
     _panelHash            = panelHash;
     _streamDeckButtons.Add(this);
 }
Пример #14
0
 public static BitmapImage GetButtonNumberImage(EnumStreamDeckButtonNames streamDeckButtonName, Color color)
 {
     return(new BitmapImage(new Uri(Constants.NUMBER_BUTTON_LOCATION + StreamDeckFunction.ButtonNumber(streamDeckButtonName) + "_" + color.Name.ToLower() + ".png", UriKind.Absolute)));
 }
 /// <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;
 }
Пример #16
0
 public void ClearFace(EnumStreamDeckButtonNames streamDeckButtonName)
 {
     _streamDeckLayerHandler.ClearFace(streamDeckButtonName);
 }
 public void SetButton(EnumStreamDeckButtonNames streamDeckButton)
 {
     _streamDeckButton = streamDeckButton;
 }
Пример #18
0
 public StreamDeckButtonOnOff(EnumStreamDeckButtonNames enumStreamDeckButton, bool buttonState)
 {
     _enumStreamDeckButtonName = enumStreamDeckButton;
     _buttonState = buttonState;
 }
 public StreamDeckButton(EnumStreamDeckButtonNames enumStreamDeckButton)
 {
     _enumStreamDeckButtonName = enumStreamDeckButton;
     streamDeckButtons.Add(this);
 }
Пример #20
0
 public static StreamDeckButton GetStatic(EnumStreamDeckButtonNames streamDeckButtonName)
 {
     return(_staticStreamDeckButtons.Find(o => o.StreamDeckButtonName == streamDeckButtonName));
 }