예제 #1
0
        private void OnBroadcast()
        {
            var source = StreamSource;
            var contentReaderFactory = ContentType;

            if (!CanBroadcast(source, contentReaderFactory, channelName))
            {
                return;
            }
            IYellowPageClient yellowPage = this.yellowPage;
            var channelInfo  = CreateChannelInfo(this);
            var channelTrack = CreateChannelTrack(this);

            var channel_id = PeerCastStation.Core.BroadcastChannel.CreateChannelID(
                peerCast.BroadcastID,
                channelName,
                genre,
                source.ToString());
            var source_stream =
                selectedSourceStream ??
                peerCast.SourceStreamFactories
                .Where(sstream => (sstream.Type & SourceStreamType.Broadcast) != 0)
                .FirstOrDefault(sstream => sstream.Scheme == source.Scheme);
            var channel = peerCast.BroadcastChannel(
                yellowPage,
                channel_id,
                channelInfo,
                source,
                source_stream,
                contentReaderFactory);

            if (channel != null)
            {
                channel.ChannelTrack = channelTrack;
            }

            var info = new BroadcastInfoViewModel {
                StreamUrl   = this.StreamUrl,
                StreamType  = this.SelectedSourceStream != null ? this.SelectedSourceStream.Name : null,
                Bitrate     = this.bitrate.HasValue ? this.bitrate.Value : 0,
                ContentType = this.ContentType.Name,
                YellowPage  = this.YellowPage != null ? this.YellowPage.Name : null,
                ChannelName = this.ChannelName,
                Genre       = this.Genre,
                Description = this.Description,
                Comment     = this.Comment,
                ContactUrl  = this.ContactUrl,
                TrackTitle  = this.TrackTitle,
                TrackAlbum  = this.TrackAlbum,
                TrackArtist = this.TrackArtist,
                TrackGenre  = this.TrackGenre,
                TrackUrl    = this.TrackUrl,
                Favorite    = false,
            };

            uiSettings.AddBroadcastHistory(info);
            uiSettings.Save();
        }
        private void OnBroadcast()
        {
            var source = StreamSource;
              var contentReaderFactory = ContentType;
              if (!CanBroadcast(source, contentReaderFactory, channelName)) return;
              IYellowPageClient yellowPage = this.yellowPage;
              var channelInfo = CreateChannelInfo(this);
              var channelTrack = CreateChannelTrack(this);

              var channel_id = PeerCastStation.Core.BroadcastChannel.CreateChannelID(
            peerCast.BroadcastID,
            channelName,
            genre,
            source.ToString());
              var source_stream =
            selectedSourceStream ??
            peerCast.SourceStreamFactories
              .Where(sstream => (sstream.Type & SourceStreamType.Broadcast)!=0)
              .FirstOrDefault(sstream => sstream.Scheme==source.Scheme);
              var channel = peerCast.BroadcastChannel(
            yellowPage,
            channel_id,
            channelInfo,
            source,
            source_stream,
            contentReaderFactory);
              if (channel!=null) {
            channel.ChannelTrack = channelTrack;
              }

              var info = new BroadcastInfoViewModel {
            StreamUrl   = this.StreamUrl,
            StreamType  = this.SelectedSourceStream!=null ? this.SelectedSourceStream.Name : null,
            Bitrate     = this.bitrate.HasValue ? this.bitrate.Value : 0,
            ContentType = this.ContentType.Name,
            YellowPage  = this.YellowPage!=null ? this.YellowPage.Name : null,
            ChannelName = this.ChannelName,
            Genre       = this.Genre,
            Description = this.Description,
            Comment     = this.Comment,
            ContactUrl  = this.ContactUrl,
            TrackTitle  = this.TrackTitle,
            TrackAlbum  = this.TrackAlbum,
            TrackArtist = this.TrackArtist,
            TrackGenre  = this.TrackGenre,
            TrackUrl    = this.TrackUrl,
            Favorite    = false,
              };
              uiSettings.AddBroadcastHistory(info);
              uiSettings.Save();
        }