private ChannelTrack UpdateChannelTrack(ChannelTrack a, ChannelTrack b) { var base_atoms = new AtomCollection(a.Extra); base_atoms.Update(b.Extra); return(new ChannelTrack(base_atoms)); }
public static ChannelMessage CreateChannelTrack(ChannelTrack value) { return(new ChannelMessage { Timestamp = Timestamp.Now, Type = MessageType.ChannelTrack, Content = null, Data = value.Extra, }); }
public async Task MoveToNextTrack(Channel channel) { ICollection <ChannelTrack> channelTracks = channel.ChannelTracks; ChannelTrack currentChannelTrack = channelTracks.Single(channelTrack => channelTrack.Order == 0); foreach (ChannelTrack channelTrack in channelTracks) { --channelTrack.Order; } currentChannelTrack.Order = (uint)(channelTracks.Count - 1); _appDbContext.Channels.Update(channel); await _appDbContext.SaveChangesAsync(); }
private void BroadcastStart_Click(object sender, EventArgs args) { Uri source; if (Uri.TryCreate(bcStreamUrl.Text, UriKind.Absolute, out source)) { StreamSource = source; } else { StreamSource = null; } var reader = bcContentType.SelectedItem as ContentReaderItem; if (reader != null) { ContentReaderFactory = reader.ContentReaderFactory; } var yp = bcYP.SelectedItem as YellowPageItem; if (yp != null) { YellowPage = yp.YellowPage; } var info = new AtomCollection(); int bitrate; if (Int32.TryParse(bcBitrate.Text, out bitrate)) { info.SetChanInfoBitrate(bitrate); } info.SetChanInfoName(bcChannelName.Text); info.SetChanInfoGenre(bcGenre.Text); info.SetChanInfoDesc(bcDescription.Text); info.SetChanInfoComment(bcComment.Text); info.SetChanInfoURL(bcContactUrl.Text); ChannelInfo = new ChannelInfo(info); var track = new AtomCollection(); track.SetChanTrackTitle(bcTrackTitle.Text); track.SetChanTrackGenre(bcTrackGenre.Text); track.SetChanTrackAlbum(bcAlbum.Text); track.SetChanTrackCreator(bcCreator.Text); track.SetChanTrackURL(bcTrackURL.Text); ChannelTrack = new ChannelTrack(track); if (StreamSource != null && ContentReaderFactory != null && !String.IsNullOrEmpty(ChannelInfo.Name)) { DialogResult = DialogResult.OK; } }
public async Task <Track> MoveToNextTrack(string channelId) { Channel targetChannel = ChannelById(channelId); ICollection <ChannelTrack> channelTracks = targetChannel.ChannelTracks; ChannelTrack currentChannelTrack = channelTracks.Single(channelTrack => channelTrack.Order == 0); foreach (ChannelTrack channelTrack in channelTracks) { --channelTrack.Order; } currentChannelTrack.Order = (uint)(channelTracks.Count - 1); _appDbContext.Channels.Update(targetChannel); await _appDbContext.SaveChangesAsync(); return(CurrentChannelTrackFor(channelId).Track); }
public ChannelInfoContainer(ChannelInfo info, ChannelTrack track) { if (info != null) { InfoChannelName = info.Name; InfoGenre = info.Genre; InfoDesc = info.Desc; InfoContactURL = info.URL; InfoComment = info.Comment; InfoContentType = info.ContentType; InfoBitrate = String.Format("{0} kbps", info.Bitrate); } else { InfoChannelName = ""; InfoGenre = ""; InfoDesc = ""; InfoContactURL = ""; InfoComment = ""; InfoContentType = ""; InfoBitrate = ""; } if (track != null) { TrackAlbum = track.Album; TrackArtist = track.Creator; TrackTitle = track.Name; TrackContactURL = track.URL; } else { TrackAlbum = ""; TrackArtist = ""; TrackTitle = ""; TrackContactURL = ""; } }
public void OnChannelTrack(ChannelTrack channel_track) { Sink.OnChannelTrack(channel_track); }
public void OnChannelTrack(ChannelTrack channel_track) { msgQueue.Enqueue(new ContentMessage { Type = ContentMessage.MessageType.ChannelTrack, ChannelTrack = channel_track }); }
public void OnChannelTrack(ChannelTrack channel_track) { }
private bool IsTrackPlaying(ChannelTrack track, string animName, out TrackEntry trackEntry) { trackEntry = _animationState.Tracks.Items[track._trackIndex]; return(trackEntry != null && trackEntry.Animation != null && trackEntry.Animation.Name == animName); }
private bool IsTrackPlaying(ChannelTrack track) { TrackEntry trackEntry = _animationState.Tracks.Items[track._trackIndex]; return(IsTrackPlaying(trackEntry)); }