/// <summary> /// Loads a producer in the background and prepares it for playout. If no layer is specified the default layer index will be used. /// </summary> /// <param name="item"></param> /// <param name="auto">indicate if CasparCG need to play the clip automatically after the previous stopped</param> /// <returns></returns> public virtual bool LoadBG(CasparPlayingInfoItem item, bool auto = false) { string str = item.Clipname; var cmd = new StringBuilder(); cmd.Append($"LOADBG {ID}-{item.VideoLayer} {item.Clipname}"); cmd.Append(item.Loop ? " LOOP" : ""); cmd.Append(item.Transition != null ? $" {item.Transition.ToString()}" : string.Empty); cmd.Append(item.Seek.HasValue ? $" SEEK {item.Seek}" : string.Empty); cmd.Append(item.Length.HasValue ? $" LENGTH {item.Length}" : string.Empty); cmd.Append(auto ? " AUTO" : string.Empty); return(_amcpTcpParser.SendCommand(cmd.ToString())); }
/// <summary> /// Loads a clip to the foreground and plays the first frame before pausing. If any clip is playing on the target foreground then this clip will be replaced. /// </summary> /// <param name="item">parameter object to indicate transition,clip...</param> /// <returns></returns> public virtual bool Load(CasparPlayingInfoItem item) { var cmd = $"LOAD {ID}-{item.VideoLayer} {item.Clipname} {item.Transition?.ToString()}".Trim(); return(_amcpTcpParser.SendCommand(cmd)); }
/// <summary> /// Play item with info for transition clip /// </summary> /// <param name="playingInfoItem">parameters to play item</param> /// <returns></returns> public virtual bool Play(CasparPlayingInfoItem playingInfoItem) { return(_amcpTcpParser.SendCommand($"{AMCPCommand.PLAY.ToAmcpValue()} {ID}-{playingInfoItem.VideoLayer} {playingInfoItem.Clipname} {playingInfoItem.Transition.ToString()}")); }