示例#1
0
        private void OnPlaybackPlay()
        {
            PlayRequest request = (PlayRequest)RequestFactory.CreateRequest(MessageType.Play);

            if (_playlistForm.GetCurrent().Count.Equals(0))
            {
                MessageBox.Show("Playlist is empty. Nothing to play", "Information");
                return;
            }

            request.Tracks = _playlistForm.GetCurrent();

            AResponse response = _playerCommunicatorControl.SendRequest(request);

            try
            {
                // if success
                if (response.ResponseType == ServerResponseType.Success)
                {
                    // set controls state
                    _mediaInfo.Open(_playlistForm.GetCurrent()[0]);
                    _playbackControl.PlaybackStarted(_mediaInfo.GetDuration());
                    _mediaInfo.Close();

                    _addonsForm.PlaybackStarted();

                    // Set volume
                    OnPlaybackVolume(_playbackControl.Volume);
                }
            }
            catch (System.Exception)
            {
            }
        }
示例#2
0
        private void OnPlaybackPlay()
        {
            // Send sound effects
            SoundFxRequest soundFxRequest = new SoundFxRequest();

            soundFxRequest.Effects = _effectsForm.GetEnabledEffects();
            _playerCommunicatorControl.SendRequest(soundFxRequest);

            // Send play request
            PlayRequest request = (PlayRequest)RequestFactory.CreateRequest(MessageType.Play);

            if (_playlistForm.GetCurrent().Count.Equals(0))
            {
                MessageBox.Show("Playlist is empty. Nothing to play", "Information");
                return;
            }
            request.Tracks = _playlistForm.GetCurrent();
            _playerCommunicatorControl.SendRequest(request);

            // TODO set state based on response
            // set controls state
            _mediaInfo.Open(_playlistForm.GetCurrent()[0]);
            _playbackControl.PlaybackStarted(_mediaInfo.GetDuration());
            _mediaInfo.Close();
        }
示例#3
0
        private void OnPlaybackPlay()
        {
            // Send play request
            PlayRequest request = (PlayRequest)RequestFactory.CreateRequest(MessageType.Play);

            if (_playlistForm.GetCurrent().Count.Equals(0))
            {
                MessageBox.Show("Playlist is empty. Nothing to play", "Information");
                return;
            }
            request.Tracks = _playlistForm.GetCurrent();
            _playerCommunicatorControl.SendRequest(request);

            // TODO set state based on response
            // set controls state
            _playbackControl.DisableSeeking();
            _playbackControl.PlaybackStarted(0);
        }