Example #1
0
 public HandlerBase(string context, ModelBase settings, StreamDeckType deckType)
 {
     Context        = context;
     CommonSettings = settings;
     DeckType       = deckType;
     DrawImage      = DefaultImage;
 }
Example #2
0
        public static string GetImageFileReal(string image, StreamDeckType deckType)
        {
            string imageReal = image;

            switch (deckType)
            {
            case StreamDeckType.StreamDeckXL:
                if (!image.Contains(AppSettings.hqImageSuffix))
                {
                    int idx = image.IndexOf(".png");
                    imageReal = image.Insert(idx, AppSettings.hqImageSuffix);
                    if (!File.Exists(imageReal))
                    {
                        if (File.Exists(image))
                        {
                            imageReal = image;
                        }
                        else
                        {
                            imageReal = AppSettings.waitImage;
                        }
                    }
                }
                break;

            default:
                if (image.Contains(AppSettings.hqImageSuffix))
                {
                    imageReal = image.Replace(AppSettings.hqImageSuffix, "");
                }
                break;
            }

            return(imageReal);
        }
Example #3
0
 public ImageDefinition(string image, StreamDeckType deckType, bool loadImage)
 {
     FileNameCommon = image;
     FileNameReal   = GetImageFileReal(image, deckType);
     DeckType       = deckType;
     if (loadImage)
     {
         Load();
     }
 }
Example #4
0
        public static int GetRowsForStreamDeckType(StreamDeckType streamDeckType)
        {
            switch (streamDeckType)
            {
            case (StreamDeckType.Classic):
                return(3);

            case (StreamDeckType.Mini):
                return(2);

            case (StreamDeckType.XL):
                return(4);
            }
            return(0);
        }
Example #5
0
        public static int GetColumnsForStreamDeckType(StreamDeckType streamDeckType)
        {
            switch (streamDeckType)
            {
            case (StreamDeckType.Classic):
                return(5);

            case (StreamDeckType.Mini):
                return(3);

            case (StreamDeckType.XL):
                return(8);
            }
            return(0);
        }
Example #6
0
        public static void DisplayKeyLayout(StreamDeckType streamDeckType)
        {
            int rows = GetRowsForStreamDeckType(streamDeckType);
            int cols = GetColumnsForStreamDeckType(streamDeckType);

            Console.WriteLine("---------- STREAM DECK LAYOUT ----------");
            for (int idx = 0; idx < rows; idx++)
            {
                for (int idx2 = 0; idx2 < cols; idx2++)
                {
                    Console.Write($"[{idx2},{idx}]  ");
                }
                Console.WriteLine("");
            }
            Console.WriteLine("----------------------------------------");
        }
Example #7
0
 public HandlerSwitch(string context, ModelSwitch settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
 }
Example #8
0
 public HandlerDisplayGauge(string context, ModelDisplayGauge settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
     IsArc    = settings.DrawArc;
 }
 public HandlerSwitchKorry(string context, ModelSwitchKorry settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
     KorrySettings.Address = KorrySettings.AddressTop;
 }
 public HandlerDisplayRadio(string context, ModelDisplayRadio settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
 }
Example #11
0
 public HandlerDisplayGaugeDual(string context, ModelDisplayGaugeDual settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
 }
Example #12
0
 public HandlerDisplayText(string context, ModelDisplayText settings, StreamDeckType deckType) : base(context, settings, deckType)
 {
     Settings = settings;
     DrawBox  = settings.DrawBox;
 }