Ejemplo n.º 1
0
        public void RedockVideoControlsToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (!Configuration.Settings.General.Undocked)
                return;

            if (mediaPlayer != null)
                mediaPlayer.ShowNonFullScreenControls();

            SaveUndockedPositions();

            Configuration.Settings.General.Undocked = false;

            if (_videoControlsUnDocked != null && !_videoControlsUnDocked.IsDisposed)
            {
                var control = _videoControlsUnDocked.PanelContainer.Controls[0];
                var controlCheckBox = _videoControlsUnDocked.PanelContainer.Controls[1];
                _videoControlsUnDocked.PanelContainer.Controls.Clear();
                ReDockVideoButtons(control, controlCheckBox);
                _videoControlsUnDocked.Close();
                _videoControlsUnDocked = null;
            }

            if (_waveFormUnDocked != null && !_waveFormUnDocked.IsDisposed)
            {
                var controlWaveForm = _waveFormUnDocked.PanelContainer.Controls[0];
                var controlButtons = _waveFormUnDocked.PanelContainer.Controls[1];
                var controlTrackBar = _waveFormUnDocked.PanelContainer.Controls[2];
                _waveFormUnDocked.PanelContainer.Controls.Clear();
                ReDockWaveForm(controlWaveForm, controlButtons, controlTrackBar);
                _waveFormUnDocked.Close();
                _waveFormUnDocked = null;
            }

            if (_videoPlayerUnDocked != null && !_videoPlayerUnDocked.IsDisposed)
            {
                var control = _videoPlayerUnDocked.PanelContainer.Controls[0];
                _videoPlayerUnDocked.PanelContainer.Controls.Remove(control);
                ReDockVideoPlayer(control);
                _videoPlayerUnDocked.Close();
                _videoPlayerUnDocked = null;
                if (mediaPlayer != null)
                    mediaPlayer.ShowFullscreenButton = Configuration.Settings.General.VideoPlayerShowFullscreenButton;
            }

            _isVideoControlsUnDocked = false;
            _videoPlayerUnDocked = null;
            _waveFormUnDocked = null;
            _videoControlsUnDocked = null;
            ShowVideoPlayer();

            audioVisualizer.Visible = toolStripButtonToggleWaveForm.Checked;
            trackBarWaveFormPosition.Visible = toolStripButtonToggleWaveForm.Checked;
            panelWaveFormControls.Visible = toolStripButtonToggleWaveForm.Checked;
            if (!toolStripButtonToggleVideo.Checked)
                HideVideoPlayer();

            mediaPlayer.Invalidate();
            Refresh();

            undockVideoControlsToolStripMenuItem.Visible = true;
            redockVideoControlsToolStripMenuItem.Visible = false;
        }
Ejemplo n.º 2
0
        private void UnDockWaveForm()
        {
            _waveFormUnDocked = new WaveFormUnDocked(this, _formPositionsAndSizes);
            _formPositionsAndSizes.SetPositionAndSize(_waveFormUnDocked);

            var control = audioVisualizer;
            groupBoxVideo.Controls.Remove(control);
            control.Top = 0;
            control.Left = 0;
            control.Width = _waveFormUnDocked.PanelContainer.Width;
            control.Height = _waveFormUnDocked.PanelContainer.Height - panelWaveFormControls.Height;
            _waveFormUnDocked.PanelContainer.Controls.Add(control);

            var control2 = (Control)panelWaveFormControls;
            groupBoxVideo.Controls.Remove(control2);
            control2.Top = control.Height;
            control2.Left = 0;
            _waveFormUnDocked.PanelContainer.Controls.Add(control2);

            var control3 = (Control)trackBarWaveFormPosition;
            groupBoxVideo.Controls.Remove(control3);
            control3.Top = control.Height;
            control3.Left = control2.Width +2;
            control3.Width = _waveFormUnDocked.PanelContainer.Width - control3.Left;
            _waveFormUnDocked.PanelContainer.Controls.Add(control3);
        }