Exemple #1
0
 internal Channel(Svt.Network.ServerConnection connection, int id, VideoMode videoMode)
 {
     ID = id;
     VideoMode = videoMode;
     Connection = connection;
     CG = new CGManager(this);
 }
Exemple #2
0
        public async Task Sell()
        {
            var sd = Svt.Where(i => i.Rarity < 3 && !i.isLock && i.lv == 1).Take(50);

            var str = string.Join(",", sd.Select(i => "{\"id\":" + i.id + ",\"num\":1}"));

            await fgo_shopsellsvt(str);

            MessagingCenter.Send(new LogMessage($"{sd.Count()}狗粮已出售"), "Log");
            await fgo_home();
        }
 private void _casparDevice_ConnectionStatusChanged(object sender, Svt.Network.ConnectionEventArgs e)
 {
     _isConnected = e.Connected;
     if (e.Connected)
     {
         _casparDevice.RefreshTemplates();
         if (_casparDevice.Channels.Count > 0)
             _updateChannels(_casparDevice.Channels);
         else
             _needUpdateChannels = true;
     }
     Debug.WriteLine(e.Connected, "Caspar connected");
     NotifyPropertyChanged("IsConnected");
 }
 void caspar_FailedConnect(object sender, Svt.Network.NetworkEventArgs e)
 {
     CasparDevice casparDevice = (CasparDevice)sender;
     if (casparDevice != null && devices_.ContainsKey(casparDevice.Settings.Hostname))
     {
         devices_[casparDevice.Settings.Hostname].HasValidConnection = false;
         UpdateValidConnections();
     }
 }
		public void Parse(byte[] data, int length, Svt.Network.RemoteHostState state) { throw new NotImplementedException(); }
 void caspar_Connected(object sender, Svt.Network.NetworkEventArgs e)
 {
     CasparDevice casparDevice = (CasparDevice)sender;
     casparDevice.RefreshMediafiles();
 }
		public void Parse(string data, Svt.Network.RemoteHostState state)
		{
			parser_.Parse(data);
		}
Exemple #8
0
        void casparDevice_ConnectionStatusChanged(object sender, Svt.Network.ConnectionEventArgs e)
        {
            CasparDevice casparDevice = (CasparDevice)sender;
            if (e.Connected)
            {
                if(Files.Count == 0)
                    casparDevice.RefreshMediafiles();

                if (Templates.All.Count == 0)
                    casparDevice.RefreshTemplates();
            }
            else
            {
                foreach (ChannelInformation channel in Channels)
                    channel.Online = false;

                HasValidConnection = false;
            }
        }
        public void Update(Svt.Caspar.CasparCGItem item)
        {
            if (item != null)
            {
                string dataxml = Svt.Caspar.CGDataPair.ToXml(item.Data);
                StringBuilder request = new StringBuilder((Version == Versions.Version17 || Version == Versions.Version18) ? UpdateRequestTemplate17 : UpdateRequestTemplate, dataxml.Length + UpdateRequestTemplate.Length);
                request.Replace("$LAYER$", item.Layer.ToString());
                request.Replace("$DATA$", dataxml);

                InvokeFlashCall(request.ToString());
            }
        }
        public bool Add(Svt.Caspar.CasparCGItem item, int layer)
        {
            if (item != null)
            {
                string fullFilename = System.IO.Path.GetFullPath(System.IO.Path.Combine(TemplateFolder, item.TemplateIdentifier));

                if (System.IO.File.Exists(fullFilename + ".ft"))
                {
                    string dataxml = Svt.Caspar.CGDataPair.ToXml(item.Data);
                    string template = (Version == Versions.Version18) ? (item.TemplateIdentifier) : fullFilename + ".ft";
                    StringBuilder request = new StringBuilder((Version == Versions.Version17 || Version == Versions.Version18) ? AddRequestTemplate17 : AddRequestTemplate, dataxml.Length + AddRequestTemplate.Length);
                    request.Replace("$LAYER$", layer.ToString());
                    request.Replace("$TEMPLATE$", template);
                    request.Replace("$MIXDURATION$", "0");
                    request.Replace("$PLAY$", "<true />");
                    request.Replace("$LABEL$", string.Empty);
                    request.Replace("$DATA$", dataxml);

                    InvokeFlashCall(request.ToString());
                    return true;
                }
            }
            return false;
        }
 public bool Add(Svt.Caspar.CasparCGItem item)
 {
     if(item != null)
         return Add(item, item.Layer);
     return false;
 }