public void Detach(CGItemCollection cgItems) { if (_mplaylist != null && _cgManager != null) { _cgManager.Detach(cgItems); } }
public void Detach(CGItemCollection cgItems) { foreach (CGItem item in cgItems) { Detach(item); } }
public static void SaveCGItems(CGItemCollection cgItems) { _cgItems = cgItems; var value = CGItemCollection.ToXml(cgItems); SaveSetting(null, null, null, "CGItems", value, null); }
public PlaySource(IMediaSource mediaSource, PlayRange playRange, CGItemCollection cgItems) : this(mediaSource, playRange) { if (cgItems != null) { this.CGItems = cgItems.Clone(); } }
private bool Equals(CGItemCollection item1, CGItemCollection item2) { if (item1 == null || item1.Count == 0) { return(item2 == null || item2.Count == 0); } return(false); }
public PlayoutSystem(IPlayPreview preview, IPlaylist3 playlist, PlayoutSettings settings, ILog log, IChannelSwitcher switcher, IMediaFilePathResolver filePathResolver, CGItemCollection cgItems) { _playlist = playlist; var player = new Player(preview, settings, log, DefaultDateTimeService.Instance, filePathResolver); _scheduler = new PlayScheduler(player, playlist, DefaultDateTimeService.Instance, switcher, cgItems); _scheduler.CurrentPlayItemChanged += OnCurrentPlayItemChanged; _scheduler.NextPlayItemChanged += OnNextPlayItemChanged; }
public static PlaybillItemEntity ToEntity(PlaybillEntity billEntity, IPlaybillItem billItem, IMediaSource replaceAutoPadding) { var dtoItem = new PlaybillItemEntity(); dtoItem.Id = billItem.Id; dtoItem.Playbill = billEntity; dtoItem.StartTime = billItem.StartTime; dtoItem.MarkerIn = billItem.PlayRange.StartPosition.TotalSeconds; dtoItem.ScheduleMode = billItem.ScheduleMode; dtoItem.MarkerDuration = billItem.PlayRange.Duration.TotalSeconds; //_dtoItem.SegmentId = this.SegmentId; if (billItem.MediaSource.Category != MediaSourceCategory.Null) { dtoItem.MediaSourceId = billItem.MediaSource.Id; } else { dtoItem.MediaSourceTitle = billItem.MediaSource.Title; dtoItem.MediaSourceDuration = billItem.MediaSource.Duration.Value.TotalSeconds; } var autoBillItem = billItem as AutoPlaybillItem; if (autoBillItem != null) { if (autoBillItem.IsAutoPadding && replaceAutoPadding != null) { // TODO: 替换自动垫片。 dtoItem.MediaSourceId = replaceAutoPadding.Id; //dtoItem.IsAutoPadding = autoBillItem.IsAutoPadding; } } var fileMediaSource = billItem.MediaSource as IFileMediaSource; if (fileMediaSource != null) { dtoItem.AudioGain = fileMediaSource.AudioGain; } if (billItem.CGItems != null) { dtoItem.CGContents = CGItemCollection.ToXml(billItem.CGItems); } return(dtoItem); }
private void btnOK_Click(object sender, RoutedEventArgs e) { var confirm = (FCSPlayout.WPF.Core.EditCGItemsConfirmation) this.Notification; confirm.Confirmed = true; CGItemCollection newItems = new CGItemCollection(); newItems.AddRange(this.imageItemListView.NewCGItems); newItems.AddRange(this.textItemListView.NewCGItems); newItems.AddRange(this.tickerItemListView.NewCGItems); confirm.Items = newItems; this.FinishInteraction(); }
public PlayScheduler(IPlayer player, IPlaylist3 playlist, IDateTimeService dateTimeService, IChannelSwitcher switcher, CGItemCollection cgItems) { _player = player; _player.ItemLoaded += Player_ItemLoaded; _player.ItemStarted += Player_ItemStarted; _player.ItemStopped += Player_ItemStopped; _playlist = playlist; _dateTimeService = dateTimeService; _switcher = switcher; _cgItems = cgItems; }
public static CGItemCollection GetCGItems() { if (_cgItems == null) { var info = GetSettings("CGItems", null).FirstOrDefault(); if (info != null && !string.IsNullOrEmpty(info.Value)) { _cgItems = CGItemCollection.FromXml(info.Value); } } if (_cgItems == null) { _cgItems = new CGItemCollection(); } return(_cgItems); }
public PlaybillItemEntity(IPlaybillItem billItem, Func <IMediaSource, MediaSourceEntity> converter) { this.Id = billItem.Id; //this.Playbill = billEntity; this.StartTime = billItem.StartTime; this.MarkerIn = billItem.PlayRange.StartPosition.TotalSeconds; this.ScheduleMode = billItem.ScheduleMode; this.MarkerDuration = billItem.PlayRange.Duration.TotalSeconds; if (billItem.MediaSource.Category != MediaSourceCategory.Null) { this.MediaSourceId = billItem.MediaSource.Id; if (converter != null) { this.MediaSource = converter(billItem.MediaSource); } } else { this.MediaSourceTitle = billItem.MediaSource.Title; this.MediaSourceDuration = billItem.MediaSource.Duration.Value.TotalSeconds; } var autoBillItem = billItem as AutoPlaybillItem; if (autoBillItem != null) { this.IsAutoPadding = autoBillItem.IsAutoPadding; } var fileMediaSource = billItem.MediaSource as IFileMediaSource; if (fileMediaSource != null) { this.AudioGain = fileMediaSource.AudioGain; } if (billItem.CGItems != null) { this.CGContents = CGItemCollection.ToXml(billItem.CGItems); } }
private static IPlaySource Create(PlaybillItemEntity entity, IMediaSource mediaSource) { var range = new PlayRange(TimeSpan.FromSeconds(entity.MarkerIn), TimeSpan.FromSeconds(entity.MarkerDuration)); CGItemCollection cgItems = null; if (entity.CGContents != null) { cgItems = CGItemCollection.FromXml(entity.CGContents); } if (cgItems == null) { return(new PlaySource(mediaSource, range)); } else { return(new PlaySource(mediaSource, range, cgItems)); } }
private void OnCGItemsChanged(CGItemCollection oldValue, CGItemCollection newValue) { _viewModel.CGItems = this.CGItems; }