Пример #1
0
        /// <summary>
        /// Create a new instance of mplayer class.
        /// </summary>
        /// <param name="wid">Window ID that mplayer should attach itself</param>
        /// <param name="backend">The video output backend that mplayer will use.</param>
        /// <param name="mplayerPath">The full filepath to mplayer.exe.  If mplayerPath is left empty it will search for mplayer.exe in
        /// "current directory\backend\mplayer.exe" on windows and mplayer in the path on linux.</param>
        /// <param name="loadMplayer">If true mplayer will immediately be loaded and you should not attempt to
        /// play any files until MplayerRunning is true.</param>
        /// <param name="positionUpdateInterval">Interval of periodical position updates</param>
        /// <param name="consoleArguments">Specify custom console arguments here; default "-slave -quiet -idle -v -ontop" ( do not set -vo and -wid ) </param>
        public MPlayer(int wid, MplayerBackends backend, string mplayerPath, bool loadMplayer, TimeSpan positionUpdateInterval, string consoleArguments = "-slave -quiet -idle -v -ontop")
        {
            this._wid            = wid;
            this._fullscreen     = false;
            this.MplayerRunning  = false;
            this._mplayerBackend = backend;
            this._mplayerPath    = mplayerPath;
            this.CurrentStatus   = MediaStatus.Stopped;

            this.consoleArguments = consoleArguments;

            this._backendProgram = new BackendPrograms(mplayerPath);

            MediaPlayer = new System.Diagnostics.Process();

            // This timer will send an event every second with the current video postion when video
            // is in play mode.
            this._currentPostionTimer          = new System.Timers.Timer(positionUpdateInterval.TotalMilliseconds);
            this._currentPostionTimer.Elapsed += new ElapsedEventHandler(_currentPostionTimer_Elapsed);
            this._currentPostionTimer.Enabled  = false;

            if (loadMplayer)
            {
                Action caller = new Action(InitializeMplayer);
                caller.BeginInvoke(null, null);
            }
        }
Пример #2
0
        /// <summary>
        /// Create a new instance of mplayer class.
        /// </summary>
        /// <param name="wid">Window ID that mplayer should attach itself</param>
        /// <param name="backend">The video output backend that mplayer will use.</param>
        /// <param name="mplayerPath">The full filepath to mplayer.exe.  If mplayerPath is left empty it will search for mplayer.exe in
        /// "current directory\backend\mplayer.exe" on windows and mplayer in the path on linux.</param>
        /// <param name="loadMplayer">If true mplayer will immediately be loaded and you should not attempt to
        /// play any files until MplayerRunning is true.</param>
        public MPlayer(int wid, MplayerBackends backend, string mplayerPath, bool loadMplayer)
        {
            this._wid            = wid;
            this._fullscreen     = false;
            this.MplayerRunning  = false;
            this._mplayerBackend = backend;
            this._mplayerPath    = mplayerPath;
            this.CurrentStatus   = MediaStatus.Stopped;

            this._backendProgram = new BackendPrograms(mplayerPath);

            MediaPlayer = new System.Diagnostics.Process();

            // This timer will send an event every second with the current video postion when video
            // is in play mode.
            this._currentPostionTimer          = new System.Timers.Timer(1000);
            this._currentPostionTimer.Elapsed += new ElapsedEventHandler(_currentPostionTimer_Elapsed);
            this._currentPostionTimer.Enabled  = true;

            if (loadMplayer)
            {
                Action caller = new Action(InitializeMplayer);
                caller.BeginInvoke(null, null);
            }
        }
Пример #3
0
        /// <summary>
        /// Create a new instance of mplayer class.
        /// </summary>
        /// <param name="wid">Window ID that mplayer should attach itself</param>
        /// <param name="backend">The video output backend that mplayer will use.</param>
        /// <param name="mplayerPath">The full filepath to mplayer.exe.  If mplayerPath is left empty it will search for mplayer.exe in 
        /// "current directory\backend\mplayer.exe" on windows and mplayer in the path on linux.</param>
        public MPlayer(int wid, MplayerBackends backend, string mplayerPath)
        {
            this._wid = wid;
            this._fullscreen = false;
            this.MplayerRunning = false;
            this._mplayerBackend = backend;
            this._mplayerPath = mplayerPath;
            this.CurrentStatus = MediaStatus.Stopped;

            this._backendProgram = new BackendPrograms(mplayerPath);

            MediaPlayer = new System.Diagnostics.Process();

            // This timer will send an event every second with the current video postion when video
            // is in play mode.
            this._currentPostionTimer = new System.Timers.Timer(1000);
            this._currentPostionTimer.Elapsed += new ElapsedEventHandler(_currentPostionTimer_Elapsed);
            this._currentPostionTimer.Enabled = true;
        }
Пример #4
0
 public MPlayer(int wid, MplayerBackends backend)
     : this(wid, backend, "")
 {
 }
Пример #5
0
 public MPlayer(int wid, MplayerBackends backend)
 {
     this._wid = wid;
     this._fullscreen = false;
     this.MplayerRunning = false;
     this._mplayerBackend = backend;
     MediaPlayer = new System.Diagnostics.Process();
 }
Пример #6
0
 public MPlayer(int wid, MplayerBackends backend, string mplayerPath)
     : this(wid, backend, mplayerPath, false, TimeSpan.FromMilliseconds(1000))
 {
 }
Пример #7
0
 public MPlayer(int wid, MplayerBackends backend)
     : this(wid, backend, "")
 {
 }
Пример #8
0
 public MPlayer(int wid, MplayerBackends backend, string mplayerPath)
     : this(wid, backend, mplayerPath, false)
 {
 }
Пример #9
0
 public MPlayer(int wid, MplayerBackends backend, string mplayerPath)
     : this(wid, backend, mplayerPath, false)
 {
 }