Esempio n. 1
0
        /// <summary>
        /// Set settings of the specified BrowserSource
        /// </summary>
        /// <param name="sourceName">Source name</param>
        /// <param name="props">BrowserSource properties</param>
        /// <param name="sceneName">Optional name of a scene where the specified source can be found</param>
        public void SetBrowserSourceProperties(string sourceName, BrowserSourceProperties props, string sceneName = null)
        {
            //override sourcename in props with the name passed
            props.Source = sourceName;
            var request    = new JObject();
            var jsonString = JsonConvert.SerializeObject(request);

            JsonConvert.PopulateObject(jsonString, request);
            SendRequest("SetBrowserSourceProperties", request);
        }
Esempio n. 2
0
        /// <summary>
        /// Set settings of the specified BrowserSource
        /// </summary>
        /// <param name="sourceName">Source name</param>
        /// <param name="props">BrowserSource properties</param>
        /// <param name="sceneName">Optional name of a scene where the specified source can be found</param>
        public void SetBrowserSourceProperties(string sourceName, BrowserSourceProperties props, string sceneName = null)
        {
            props.Source = sourceName;
            var request = JObject.FromObject(props);

            if (sceneName != null)
            {
                request.Add("scene-name", sourceName);
            }

            SendRequest("SetBrowserSourceProperties", request);
        }
        /// <summary>
        /// Set settings of the specified BrowserSource
        /// </summary>
        /// <param name="sourceName">Source name</param>
        /// <param name="props">BrowserSource properties</param>
        /// <param name="sceneName">Optional name of a scene where the specified source can be found</param>
        public void SetBrowserSourceProperties(string sourceName, BrowserSourceProperties props, string sceneName = null)
        {
            var request = new JObject();

            request.Add("source", sourceName);
            if (sceneName != null)
            {
                request.Add("scene-name", sourceName);
            }

            request.Merge(props.ToJSON(), new JsonMergeSettings()
            {
                MergeArrayHandling = MergeArrayHandling.Union
            });

            SendRequest("SetBrowserSourceProperties", request);
        }