Ejemplo n.º 1
0
        public bool LoadBG(CasparItem item)
        {
            string clipname = item.Clipname.Replace("\\", "\\\\");

            if (item.VideoLayer == -1)
            {
                if (item.Seek == -1)
                {
                    Connection.SendString("LOADBG " + ID + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition);
                }
                else
                {
                    Connection.SendString("LOADBG " + ID + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition + " SEEK " + item.Seek + " LENGTH " + item.Length);
                }
            }
            else
            {
                if (item.Seek == -1)
                {
                    Connection.SendString("LOADBG " + ID + "-" + item.VideoLayer + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition);
                }
                else
                {
                    Connection.SendString("LOADBG " + ID + "-" + item.VideoLayer + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition + " SEEK " + item.Seek + " LENGTH " + item.Length);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void Load(CasparItem item)
        {
            string clipname = item.Clipname.Replace("\\", "\\\\");
            var    command  = new StringBuilder("LOAD ").Append(Id);

            if (item.VideoLayer >= 0)
            {
                command.AppendFormat("-{0}", item.VideoLayer);
            }
            command.Append(" ").Append(clipname);
            if (item.Seek > 0)
            {
                command.AppendFormat(" SEEK {0}", item.Seek);
            }
            if (item.Length > 0)
            {
                command.AppendFormat(" LENGTH {0}", item.Length);
            }
            if (item.Loop)
            {
                command.Append(" LOOP");
            }
            if (item.ChannelLayout != ChannelLayout.Default)
            {
                command.AppendFormat(" CHANNEL_LAYOUT {0}", item.ChannelLayout.ToString().ToUpperInvariant());
            }
            if (item.FieldOrderInverted)
            {
                command.Append(" FIELD_ORDER_INVERTED");
            }
            Connection.SendString(command.ToString());
        }
Ejemplo n.º 3
0
        public static CasparItem Create(System.Xml.XmlReader reader)
        {
            CasparItem item = new CasparItem();

            item.ReadXml(reader);
            return(item);
        }
Ejemplo n.º 4
0
        public bool Load(CasparItem item)
        {
            string clipname = item.Clipname.Replace("\\", "\\\\");

            if (item.VideoLayer == -1)
            {
                Connection.SendString("LOAD " + ID + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : ""));
            }
            else
            {
                Connection.SendString("LOAD " + ID + "-" + item.VideoLayer + " \"" + clipname + "\"" + (string)(item.Loop ? " LOOP" : ""));
            }
            return(true);
        }
Ejemplo n.º 5
0
		public RundownItem()
		{
			StaticItem = new Svt.Caspar.CasparItem(string.Empty);
            StaticItem.Transition.Duration = 12;
            StaticItem.VideoLayer = -1;
			CGItem = new Svt.Caspar.CasparCGItem();
            CGItem.VideoLayer = -1;
			IsCG = true;
            IsControl = false;
			MultiStep = false;
			IsStoredData = false;
            IsDataUpdate = false;
			IsStarted = false; 
            Color = Color.FromName(Properties.Settings.Default.TemplateColor);
			Name = Channel = string.Empty;
            Page = string.Empty;

            Online = false;
		}
Ejemplo n.º 6
0
        public bool LoadBG(CasparItem item)
        {
            string clipname = item.Clipname.Replace("\\", "\\\\");
            var    command  = new StringBuilder("LOADBG ").Append(Id);

            if (item.VideoLayer >= 0)
            {
                command.AppendFormat("-{0}", item.VideoLayer);
            }
            command.Append(" ").Append(clipname);
            if (item.Seek > 0)
            {
                command.AppendFormat(" SEEK {0}", item.Seek);
            }
            if (item.Length > 0)
            {
                command.AppendFormat(" LENGTH {0}", item.Length);
            }
            if (item.Loop)
            {
                command.Append(" LOOP");
            }
            if (item.ChannelLayout != ChannelLayout.Default)
            {
                command.AppendFormat(" CHANNEL_LAYOUT {0}", item.ChannelLayout.ToString().ToUpperInvariant());
            }
            var transition = item.Transition?.Type;

            if (transition != null && transition != TransitionType.CUT)
            {
                command.AppendFormat(" {0}", item.Transition);
            }
            if (item.FieldOrderInverted)
            {
                command.Append(" FIELD_ORDER_INVERTED");
            }
            Connection.SendString(command.ToString());
            return(true);
        }
Ejemplo n.º 7
0
        public bool LoadBG(CasparItem item)
        {
            string clipname = item.Clipname.Replace("\\", "\\\\");
            if (item.VideoLayer == -1)
            {
                if (item.Seek == -1)
                    Connection.SendString("LOADBG " + ID + " " + clipname + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition);
                else
                    Connection.SendString("LOADBG " + ID + " " + clipname + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition + " SEEK " + item.Seek + " LENGTH " + item.Length);
            }
            else
            {
                if (item.Seek == -1)
                    Connection.SendString("LOADBG " + ID + "-" + item.VideoLayer + " " + clipname + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition);
                else
                    Connection.SendString("LOADBG " + ID + "-" + item.VideoLayer + " " + clipname + (string)(item.Loop ? " LOOP" : "") + " " + item.Transition + " SEEK " + item.Seek + " LENGTH " + item.Length);
            }

            return true;
        }
Ejemplo n.º 8
0
 public bool Load(CasparItem item)
 {
     string clipname = item.Clipname.Replace("\\", "\\\\");
     if (item.VideoLayer == -1)
         Connection.SendString("LOAD " + ID + " " + clipname + (string)(item.Loop ? " LOOP" : ""));
     else
         Connection.SendString("LOAD " + ID + "-" + item.VideoLayer + " " + clipname + (string)(item.Loop ? " LOOP" : ""));
     return true;
 }
Ejemplo n.º 9
0
 public static CasparItem Create(System.Xml.XmlReader reader)
 {
     CasparItem item = new CasparItem();
     item.ReadXml(reader);
     return item;
 }
 private CasparItem _getItem(ServerMedia media, VideoLayer videolayer, long seek)
 {
     if (media != null)
     {
         CasparItem item = new CasparItem(string.Empty);
         if (media.MediaType == TMediaType.Movie || media.MediaType == TMediaType.Movie)
             item.Clipname = "\"" + Path.GetFileNameWithoutExtension(media.FileName) + "\"" +
                 ((media.MediaType == TMediaType.Movie && media.HasExtraLines) ? " FILTER CROP=720:576:0:32" : string.Empty) +
                 ((media.MediaType == TMediaType.Movie) ? " CHANNEL_LAYOUT STEREO" : string.Empty);
         item.VideoLayer = (int)videolayer;
         item.Seek = (int)seek;
         return item;
     }
     else
         return null;
 }
 private CasparItem _getItem(Event aEvent)
 {
     CasparItem item = new CasparItem(string.Empty);
     ServerMedia media = (aEvent.Engine.PlayoutChannelPGM == this) ? aEvent.ServerMediaPGM : aEvent.ServerMediaPRV;
     if (aEvent.EventType == TEventType.Live || media != null)
     {
         if (aEvent.EventType == TEventType.Movie || aEvent.EventType == TEventType.StillImage)
         {
             item.Clipname = "\"" + Path.GetFileNameWithoutExtension(media.FileName) + "\"" +
                 ((media.MediaType == TMediaType.Movie && media.HasExtraLines) ? " FILTER CROP=720:576:0:32" : string.Empty) +
                 (media.MediaType == TMediaType.Movie ? " CHANNEL_LAYOUT STEREO" : string.Empty);
         }
         if (aEvent.EventType == TEventType.Live)
             item.Clipname = LiveDevice ?? "BLACK";
         item.VideoLayer = (int)aEvent.Layer;
         item.Loop = false;
         item.Transition.Duration = (int)(aEvent.TransitionTime.Ticks / Engine.FrameTicks);
         item.Seek = (int)aEvent.SeekPGM;
         item.Transition.Type = (Svt.Caspar.TransitionType)aEvent.TransitionType;
         return item;
     }
     else
         return null;
 }
 public override bool Load(System.Drawing.Color color, VideoLayer videolayer)
 {
     var channel = _casparChannel;
     if (_checkConnected() && channel != null)
     {
         var scolor = '#' + color.ToArgb().ToString("X8");
         CasparItem item = new CasparItem((int)videolayer, scolor);
         channel.Load(item);
         Debug.WriteLine("CasparLoad color {0} Layer {1}", scolor, videolayer);
         return true;
     }
     return false;
 }
Ejemplo n.º 13
0
        private void buildPlayVideo(int currentPlayingItemIndex)
        {
            ListBoxVideoItem item = (ListBoxVideoItem) ListRunningOrder.Items[_cpi.index];
               CasparItem cItem = new CasparItem(VideoLayer, item.clipID, new Transition(item.Segue, item.SegLength), item.inFrames);

            Logger.Info("Built CasparItem: " + cItem);

            _casparDevice.Channels[casparServerChannelID].LoadBG(cItem);
            Logger.Info("Playing CasparItem: " + cItem);

            _casparDevice.Channels[casparServerChannelID].Play(cItem.VideoLayer);
            item.isPlaying = true;
            tmrClockStarts.Enabled = false;
        }