예제 #1
0
        public VideoPanelViewModel()
        {
            //
            //TODO: Add the constructor code here
            //
            //videoRender = null;
            //mediaPlayer.Dock = DockStyle.Fill;
            //mediaPlayer.stretchToFit = true;


            videoRender = new VideoRender(VideoPanel);
            audioPlayer = new StreamingAudioBuffer(this);

            //videoRender.initialize(0,0);
            videoDecoder = new VideoPlayer();
            videoDecoder.FrameQueue.Closed += new EventHandler(frameQueue_Closed);

            videoDecoder.setLogCallback(new VideoPlayer.LogCallbackDelegate(videoDecoderLogCallback),
                                        true, true);

            videoRefreshTimer       = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE);
            videoRefreshTimer.Tick += new EventHandler(videoRefreshTimer_Tick);
            //videoRefreshTimer.SynchronizingObject = this;
            videoRefreshTimer.AutoReset = false;

            audioRefreshTimer                     = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE);
            audioRefreshTimer.Tick               += new EventHandler(audioRefreshTimer_Tick);
            audioRefreshTimer.AutoReset           = false;
            audioRefreshTimer.SynchronizingObject = null;

            videoDebug = new VideoDebugForm();

            audioDiffAvgCoef = Math.Exp(Math.Log(0.01) / AUDIO_DIFF_AVG_NB);

            //syncMode = SyncMode.VIDEO_SYNCS_TO_AUDIO;
            syncMode   = SyncMode.AUDIO_SYNCS_TO_VIDEO;
            VideoState = VideoState.CLOSED;

            updateTimeTrackBar = true;

            timeTrackBarToolTip           = new CustomToolTip();
            timeTrackBarToolTip.BackColor = SystemColors.Info;
            this.Controls.Add(timeTrackBarToolTip);

            timeTrackBarToolTip.Show();
            timeTrackBarToolTip.BringToFront();
            timeTrackBarToolTip.Visible = false;

            muteCheckBox.Checked = bool.Parse(Settings.getVar(Settings.VarName.VIDEO_MUTED));
            volumeTrackBar.Value = Util.lerp <int>(Double.Parse(Settings.getVar(Settings.VarName.VIDEO_VOLUME)), volumeTrackBar.Minimum, volumeTrackBar.Maximum);
        }
        public VideoPanelViewModel()
		{
			
			//
			//TODO: Add the constructor code here
			//
			//videoRender = null;
			//mediaPlayer.Dock = DockStyle.Fill;
			//mediaPlayer.stretchToFit = true;


			videoRender = new VideoRender(VideoPanel);
			audioPlayer = new StreamingAudioBuffer(this);

			//videoRender.initialize(0,0);
			videoDecoder = new VideoPlayer();	
			videoDecoder.FrameQueue.Closed += new EventHandler(frameQueue_Closed);

			videoDecoder.setLogCallback(new VideoPlayer.LogCallbackDelegate(videoDecoderLogCallback),
				true, true);
			
			videoRefreshTimer = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE);
			videoRefreshTimer.Tick += new EventHandler(videoRefreshTimer_Tick);
			//videoRefreshTimer.SynchronizingObject = this;
			videoRefreshTimer.AutoReset = false;

			audioRefreshTimer = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE);
			audioRefreshTimer.Tick += new EventHandler(audioRefreshTimer_Tick);
			audioRefreshTimer.AutoReset = false;
			audioRefreshTimer.SynchronizingObject = null;

			videoDebug = new VideoDebugForm();

			audioDiffAvgCoef  = Math.Exp(Math.Log(0.01) / AUDIO_DIFF_AVG_NB);

			//syncMode = SyncMode.VIDEO_SYNCS_TO_AUDIO;
			syncMode = SyncMode.AUDIO_SYNCS_TO_VIDEO;
			VideoState = VideoState.CLOSED;

			updateTimeTrackBar = true;

			timeTrackBarToolTip = new CustomToolTip();
			timeTrackBarToolTip.BackColor = SystemColors.Info;
			this.Controls.Add(timeTrackBarToolTip);

			timeTrackBarToolTip.Show();
			timeTrackBarToolTip.BringToFront();
			timeTrackBarToolTip.Visible = false;			
			
			muteCheckBox.Checked = bool.Parse(Settings.getVar(Settings.VarName.VIDEO_MUTED));
			volumeTrackBar.Value = Util.lerp<int>(Double.Parse(Settings.getVar(Settings.VarName.VIDEO_VOLUME)), volumeTrackBar.Minimum, volumeTrackBar.Maximum);

		}