public TwitchPagerAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.Settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.Settings = payload.Settings.ToObject <PluginSettings>();
            }
            MyTwitchChannelInfo.Instance.TwitchStreamInfoChanged += Instance_TwitchStreamInfoChanged;
            AlertManager.Instance.TwitchPagerShown += Instance_TwitchPagerShown;
            TwitchChat.Instance.PageRaised         += Chat_PageRaised;

            this.Settings.ChatMessage = TwitchChat.Instance.ChatMessage;
            this.Settings.PageCommand = TwitchChat.Instance.PageCommand;
            Settings.TokenExists      = TwitchTokenManager.Instance.TokenExists;
            AlertManager.Instance.Initialize(Connection);
            ResetChat();
            InitializeStreamInfo();

            tmrPage.Interval = 200;
            tmrPage.Elapsed += TmrPage_Elapsed;
            SaveSettings();
            Connection.GetGlobalSettingsAsync();
        }
        public WindowsMoverAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
                CheckBackwardsCompability();
            }
            Connection.OnSendToPlugin += Connection_OnSendToPlugin;
            tmrRetryProcess.Interval   = 5000;
            tmrRetryProcess.Elapsed   += TmrRetryProcess_Elapsed;

            // Used for backward compatibility
            if (!settings.AppSpecific && !settings.AppCurrent)
            {
                settings.AppSpecific = true;
            }

            PopulateApplications();
            PopulateScreens();
            SaveSettings();
        }
Beispiel #3
0
        public TwitchPager(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }
            TwitchStreamInfoManager.Instance.TwitchStreamInfoChanged += Instance_TwitchStreamInfoChanged;
            TwitchTokenManager.Instance.TokenStatusChanged           += Instance_TokenStatusChanged;
            Connection.StreamDeckConnection.OnSendToPlugin           += StreamDeckConnection_OnSendToPlugin;
            TwitchChat.Instance.PageRaised += Chat_PageRaised;

            this.settings.ChatMessage = TwitchChat.Instance.ChatMessage;
            settings.TokenExists      = TwitchTokenManager.Instance.TokenExists;
            ResetChat();
            deviceType = Connection.DeviceInfo().Type;

            tmrPage.Interval = 200;
            tmrPage.Elapsed += TmrPage_Elapsed;
            SaveSettings();
            Connection.GetGlobalSettingsAsync();
        }
Beispiel #4
0
        public PluginAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                Logger.Instance.LogMessage(TracingLevel.DEBUG, "CreateDefaultSettings");
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                Logger.Instance.LogMessage(TracingLevel.DEBUG, "LoadSettings");
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }

            Connection.GetGlobalSettingsAsync();

            Console.WriteLine(fhem_client);

            Logger.Instance.LogMessage(TracingLevel.DEBUG, this.GetHashCode() + "fhem_client : " + fhem_client.GetHashCode());
            //if (settings_complete())
            //{
            //    if (longpoll == null)
            //    {
            //        longpoll = longpoll_Async();
            //    }
            //    if (longpoll.Status != TaskStatus.Running)
            //    {
            //        longpoll.Start();
            //    }
            //}
        }
Beispiel #5
0
        public Button(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            base.settings = payload.Settings == null || payload.Settings.Count == 0
                ? PluginSettings.CreateDefaultSettings()
                : payload.Settings.ToObject <PluginSettings>();

            ApplySettings();
        }
Beispiel #6
0
 public vJoyButton(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
Beispiel #7
0
 public VMMicrophone(SDConnection connection, JObject settings) : base(connection, settings)
 {
     if (settings == null || settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = settings.ToObject <PluginSettings>();
     }
 }
 public CoronavirusWorldwideStatsAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
        //private bool keyPressed = false;
        //private DateTime keyPressStart;

        #endregion

        #region PluginBase Methods
        public Car(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
                Connection.SetSettingsAsync(JObject.FromObject(settings));
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }
        }
Beispiel #10
0
 public CurrencyTicker(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0) // Called the first time you drop a new action into the Stream Deck
     {
         this.settings = PluginSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(settings));
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
 public DisableControllerProperty(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
 public IncrementEffectValues(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
Beispiel #13
0
 public ShowOverallIntensityValue(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
Beispiel #14
0
 public StartSimFeedback(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(settings));
         SaveSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
     }
 }
Beispiel #15
0
 public PowerPlanSwitcherAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     InitializeSettings();
 }
 public SuperMacroAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         Settings = PluginSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(Settings));
     }
     else
     {
         Settings = payload.Settings.ToObject <PluginSettings>();
     }
     LoadMacros();
 }
        public TextFileUpdaterAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }

            Connection.OnSendToPlugin += Connection_OnSendToPlugin;
        }
Beispiel #18
0
 public NetworkCardAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     LoadNetworkCards();
 }
 public StickyKeypress(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         Settings = PluginSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(Settings));
     }
     else
     {
         Settings = payload.Settings.ToObject <PluginSettings>();
         HandleFilenames();
     }
 }
 public FilterToggleAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     OBSManager.Instance.Connect();
     CheckServerInfoExists();
 }
        public PluginAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }

            this.RefreshMIDIDevices();
        }
 public TwitchChannelAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.Settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.Settings = payload.Settings.ToObject <PluginSettings>();
     }
     Settings.TokenExists = TwitchTokenManager.Instance.TokenExists;
     InitializeSettings();
     SaveSettings();
 }
Beispiel #23
0
 public StartStopMotionToggle(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
         HandleFilenames();
     }
     HandleFilenames();
     SetNotRunning();
 }
Beispiel #24
0
        public SoundpadRemoveAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }

            SoundpadManager.Instance.Connect();
            _ = InitializeSettings();
        }
Beispiel #25
0
 public PrimaryActionMonitor(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     Connection.OnTitleParametersDidChange += Connection_OnTitleParametersDidChange;
     PopulateScreens();
     SaveSettings();
 }
 public IsTelemetryProviderConnected(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         settings = PluginSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(settings));
         SaveSettings();
     }
     else
     {
         settings = payload.Settings.ToObject <PluginSettings>();
         HandleFilenames();
     }
 }
 public CPUUsageAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     OBSManager.Instance.StreamStatusChanged += Instance_StreamStatusChanged;
     OBSManager.Instance.Connect();
     CheckServerInfoExists();
 }
        public OscToggle(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                this.settings = PluginSettings.CreateDefaultSettings();
                Connection.SetSettingsAsync(JObject.FromObject(settings));

                Logger.Instance.LogMessage(TracingLevel.INFO, $"OscToggle: Settings initially set: {this.settings}");
            }
            else
            {
                this.settings = payload.Settings.ToObject <PluginSettings>();
            }
        }
        public TeamSpeak3ChannelSwitchAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
        {
            if (payload.Settings == null || payload.Settings.Count == 0)
            {
                _settings = PluginSettings.CreateDefaultSettings();
            }
            else
            {
                _settings = payload.Settings.ToObject <PluginSettings>();
            }
            connection.StreamDeckConnection.OnSendToPlugin += StreamDeckConnection_OnSendToPlugin;

            SaveSettings();
        }
Beispiel #30
0
 public KeyboardLedsAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         this.settings = PluginSettings.CreateDefaultSettings();
         SaveSettings();
     }
     else
     {
         this.settings = payload.Settings.ToObject <PluginSettings>();
     }
     Connection.OnTitleParametersDidChange += Connection_OnTitleParametersDidChange;
     PrefetchImages();
 }