コード例 #1
0
 /// <summary>
 /// Constructor which initialises the video handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public VideoHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player                 = player;
     _osdHandler             = osdHandler;
     _aspectRatio            = "1.0";
     _videoHeight            = -1;
     _videoWidth             = 0;
     _ar                     = GUIGraphicsContext.ARType;
     _mplayerBackgroundPanel = new Panel
     {
         ForeColor = Color.Black,
         BackColor = Color.Black,
         Size      = new Size(0, 0),
         Location  = new Point(0, 0)
     };
     _mplayerOuterPanel = new Panel
     {
         ForeColor = Color.Black,
         BackColor = Color.Black,
         Size      = new Size(0, 0),
         Location  = new Point(0, 0)
     };
     _mplayerInnerPanel = new Panel
     {
         Size      = new Size(0, 0),
         ForeColor = Color.FromArgb(16, 16, 16),
         BackColor = Color.FromArgb(16, 16, 16)
     };
     _mplayerOuterPanel.Controls.Add(_mplayerInnerPanel);
     _mplayerInnerPanel.Location = new Point(0, 0);
 }
コード例 #2
0
 /// <summary>
 /// Constructor which initialises the audio and subtitle handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public AudioSubtitleHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player                  = player;
     _osdHandler              = osdHandler;
     _audioID                 = new Dictionary <int, int>();
     _audioNames              = new Dictionary <int, string>();
     _subtitleID              = new Dictionary <int, int>();
     _subtitleNames           = new Dictionary <int, string>();
     _numberOfAudioStreams    = 0;
     _numberOfSubtitles       = 0;
     _currentAudioStream      = 0;
     _currentSubtitleStream   = 0;
     _currentAudioDelay       = 0;
     _currentSubtitleDelay    = 0;
     _configManager           = ConfigurationManager.GetInstance();
     _audioDelayStep          = _configManager.AudioDelayStep;
     _subtitleDelayStep       = _configManager.SubtitleDelayStep;
     _subtitlesEnabled        = _configManager.EnableSubtitles;
     _currentSubtitlePosition = _configManager.SubtitlePosition;
     _currentSubtitleSize     = _configManager.SubtitleSize;
     if (OSInfo.OSInfo.OSList.WindowsVista == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows2008 == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows7 == OSInfo.OSInfo.GetOSName())
     {
         _mpMessageHandler           = OnMessage;
         GUIWindowManager.Receivers += _mpMessageHandler;
     }
     _volume = 100;
 }
コード例 #3
0
 /// <summary>
 /// Constructor which initialises the seeking handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public SeekingHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player              = player;
     _osdHandler          = osdHandler;
     _additionalTime      = DateTime.Now;
     _baseTime            = 0;
     _speed               = 1;
     _performSeekRelative = false;
     _checkTime           = false;
     _isDvdMenu           = false;
     _lastStreamPos       = -1;
 }
コード例 #4
0
        /// <summary>
        /// Initialize the system (Objects, Controls etc.)
        /// </summary>
        /// <param name="isVideo">Indícate if the file has video</param>
        private void InitSystem(bool isVideo)
        {
            _mediaInfo = new MediaInfoWrapper(_currentFile);

            _playState = PlayState.Playing;
            if (_configManager.OsdMode == OSDMode.InternalMPlayer || !isVideo)
            {
                _osdHandler = new InternalOSDHandler(this, true);
            }
            else if (_configManager.OsdMode == OSDMode.ExternalOSDLibrary)
            {
                _osdHandler = new ExternalOSDLibrary(this);
            }
            _videoHandler         = new VideoHandler(this, _osdHandler);
            _audioSubtitleHandler = new AudioSubtitleHandler(this, _osdHandler);
            _seekingHandler       = new SeekingHandler(this, _osdHandler);
            _messageHandlers      = new List <IMessageHandler> {
                _videoHandler, _audioSubtitleHandler, _seekingHandler, _osdHandler
            };
            _actionHandler = OnNewAction;
            GUIWindowManager.OnNewAction += _actionHandler;
        }
コード例 #5
0
ファイル: SeekingHandler.cs プロジェクト: MisterD81/MyMPlayer
 /// <summary>
 /// Constructor which initialises the seeking handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public SeekingHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player = player;
       _osdHandler = osdHandler;
       _additionalTime = DateTime.Now;
       _baseTime = 0;
       _speed = 1;
       _performSeekRelative = false;
       _checkTime = false;
       _isDvdMenu = false;
       _lastStreamPos = -1;
 }
コード例 #6
0
 /// <summary>
 /// Constructor which initialises the audio and subtitle handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public AudioSubtitleHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player = player;
       _osdHandler = osdHandler;
       _audioID = new Dictionary<int, int>();
       _audioNames = new Dictionary<int, string>();
       _subtitleID = new Dictionary<int, int>();
       _subtitleNames = new Dictionary<int, string>();
       _numberOfAudioStreams = 0;
       _numberOfSubtitles = 0;
       _currentAudioStream = 0;
       _currentSubtitleStream = 0;
       _currentAudioDelay = 0;
       _currentSubtitleDelay = 0;
       _configManager = ConfigurationManager.GetInstance();
       _audioDelayStep = _configManager.AudioDelayStep;
       _subtitleDelayStep = _configManager.SubtitleDelayStep;
       _subtitlesEnabled = _configManager.EnableSubtitles;
       _currentSubtitlePosition = _configManager.SubtitlePosition;
       _currentSubtitleSize = _configManager.SubtitleSize;
       if (OSInfo.OSInfo.OSList.WindowsVista == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows2008 == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows7 == OSInfo.OSInfo.GetOSName())
       {
     _mpMessageHandler = OnMessage;
     GUIWindowManager.Receivers += _mpMessageHandler;
       }
       _volume = 100;
 }
コード例 #7
0
        /// <summary>
        /// Initialize the system (Objects, Controls etc.)
        /// </summary>
        /// <param name="isVideo">Indícate if the file has video</param>
        private void InitSystem(bool isVideo)
        {
            _mediaInfo = new MediaInfoWrapper(_currentFile);

              _playState = PlayState.Playing;
              if (_configManager.OsdMode == OSDMode.InternalMPlayer || !isVideo)
              {
            _osdHandler = new InternalOSDHandler(this, true);
              }
              else if (_configManager.OsdMode == OSDMode.ExternalOSDLibrary)
              {
            _osdHandler = new ExternalOSDLibrary(this);
              }
              _videoHandler = new VideoHandler(this, _osdHandler);
              _audioSubtitleHandler = new AudioSubtitleHandler(this, _osdHandler);
              _seekingHandler = new SeekingHandler(this, _osdHandler);
              _messageHandlers = new List<IMessageHandler> { _videoHandler, _audioSubtitleHandler, _seekingHandler, _osdHandler };
              _actionHandler = OnNewAction;
              GUIWindowManager.OnNewAction += _actionHandler;
        }
コード例 #8
0
ファイル: VideoHandler.cs プロジェクト: MisterD81/MyMPlayer
 /// <summary>
 /// Constructor which initialises the video handler
 /// </summary>
 /// <param name="player">Instance of external player</param>
 /// <param name="osdHandler">Instance of the osdHandler</param>
 public VideoHandler(MPlayerExtPlayer player, IOSDHandler osdHandler)
 {
     _player = player;
       _osdHandler = osdHandler;
       _aspectRatio = "1.0";
       _videoHeight = -1;
       _videoWidth = 0;
       _ar = GUIGraphicsContext.ARType;
       _mplayerBackgroundPanel = new Panel
                           {
                             ForeColor = Color.Black,
                             BackColor = Color.Black,
                             Size = new Size(0, 0),
                             Location = new Point(0, 0)
                           };
       _mplayerOuterPanel = new Panel
                      {
                        ForeColor = Color.Black,
                        BackColor = Color.Black,
                        Size = new Size(0, 0),
                        Location = new Point(0, 0)
                      };
       _mplayerInnerPanel = new Panel
                      {
                        Size = new Size(0, 0),
                        ForeColor = Color.FromArgb(16, 16, 16),
                        BackColor = Color.FromArgb(16, 16, 16)
                      };
       _mplayerOuterPanel.Controls.Add(_mplayerInnerPanel);
       _mplayerInnerPanel.Location = new Point(0, 0);
 }