Пример #1
0
        private void BeginPlayback([NotNull] string url, [NotNull] IPlaybackEngine playbackEngine)
        {
            if (_currentChannel != null && _currentChannel.IsActive)
                Stop();

            _url = url;

            _playbackEngine = playbackEngine;
            _playbackEngine.ChannelSwitched += PlaybackEngineOnChannelSwitched;
            _playbackEngine.End += PlaybackEngineOnEnd;

            _playbackEngine.Initialize(_bassEngine, _plugins);

            TAG_INFO tags;
            _currentChannel = _playbackEngine.PlayChannel(url, out tags);
            _mixer = new Mix(flags:BassMixFlags.Software | BassMixFlags.Nonstop) {Equalizer = _equalizer};

            _currentChannel.Mix = _mixer;

            _visualHelper.Channel = _mixer;

            _mixer.Play();
            _play.Publish(EventArgs.Empty);
            _tagInfo = PublishTitle(tags);
        }
Пример #2
0
        private void BeginPlayback([NotNull] string url, [NotNull] IPlaybackEngine playbackEngine)
        {
            if (_currentChannel != null && _currentChannel.IsActive)
                Stop();

            _url = url;

            _playbackEngine = playbackEngine;
            _playbackEngine.ChannelSwitched += PlaybackEngineOnChannelSwitched;
            _playbackEngine.End += PlaybackEngineOnEnd;

            _playbackEngine.Initialize(_bassEngine, _plugins);

            TAG_INFO tags;
            _currentChannel = _playbackEngine.PlayChannel(url, out tags);
            _mixer = new Mix(flags:BassMixFlags.Software | BassMixFlags.Nonstop) {Equalizer = _internalEqualizer};

            _currentChannel.Mix = _mixer;

            //_visualHelper.Channel = _mixer;

            _mixer.Play();
            OnPropertyChanged(() => Playing);
            _play.Publish(EventArgs.Empty);
            _tagInfo = BassTag.GetInfo(PublishTitle(new BassTag(tags)));
            _internalPlayerStream.Channel = _currentChannel;

            OnChannelSwitchEvent(_currentChannel);
        }