コード例 #1
0
        private ChannelTrack UpdateChannelTrack(ChannelTrack a, ChannelTrack b)
        {
            var base_atoms = new AtomCollection(a.Extra);

            base_atoms.Update(b.Extra);
            return(new ChannelTrack(base_atoms));
        }
コード例 #2
0
 public static ChannelMessage CreateChannelTrack(ChannelTrack value)
 {
     return(new ChannelMessage {
         Timestamp = Timestamp.Now,
         Type = MessageType.ChannelTrack,
         Content = null,
         Data = value.Extra,
     });
 }
コード例 #3
0
        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();
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: j0hn---/peercaststation
 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 = "";
     }
 }
コード例 #7
0
 public void OnChannelTrack(ChannelTrack channel_track)
 {
     Sink.OnChannelTrack(channel_track);
 }
コード例 #8
0
 public void OnChannelTrack(ChannelTrack channel_track)
 {
     msgQueue.Enqueue(new ContentMessage {
         Type = ContentMessage.MessageType.ChannelTrack, ChannelTrack = channel_track
     });
 }
コード例 #9
0
 public void OnChannelTrack(ChannelTrack channel_track)
 {
 }
コード例 #10
0
 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);
 }
コード例 #11
0
                private bool IsTrackPlaying(ChannelTrack track)
                {
                    TrackEntry trackEntry = _animationState.Tracks.Items[track._trackIndex];

                    return(IsTrackPlaying(trackEntry));
                }