Esempio n. 1
0
        private VlcMonitor(Label statusLabel, ShutdauwnForm shutdawunForm)
        {
            this.monitorRunning = true;
            this.statusLabel    = statusLabel;
            this.vlcStatus      = VlcStatus.MediaStopped;
            VlcMonitor.instance = this;
            this.shutdawunForm  = shutdawunForm;

            this.monitorVlc(statusLabel);
        }
Esempio n. 2
0
        private VlcMonitor(Label statusLabel, ShutdauwnForm shutdawunForm)
        {
            this.monitorRunning = true;
            this.statusLabel = statusLabel;
            this.vlcStatus = VlcStatus.MediaStopped;
            VlcMonitor.instance = this;
            this.shutdawunForm = shutdawunForm;

            this.monitorVlc(statusLabel);
        }
Esempio n. 3
0
 private void monitorVlcButton_Click(object sender, EventArgs e)
 {
     if (VlcMonitor.MonitorStarted)
     {
         VlcMonitor.StopMonitoring();
         this.monitorVlcButton.Text = "Start monitoring VLC";
         this.vlcStatusLabel.Text   = "";
     }
     else
     {
         VlcMonitor.StartMonitoring(this.vlcStatusLabel, this);
         this.monitorVlcButton.Text = "Stop monitoring VLC";
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Set the current state of the VLC monitoring, and change the visual status to an appropiate decsription
        /// </summary>
        /// <param name="newVlcStatus"></param>
        private void setStatus(VlcStatus newVlcStatus)
        {
            if (newVlcStatus == this.vlcStatus)
            {
                return;
            }

            this.vlcStatus = newVlcStatus;

            string status;

            switch (newVlcStatus)
            {
            case VlcStatus.MediaStopped:
                status = "Media stopped, shutting down";
                break;

            case VlcStatus.Idle:
                status = "VLC is idle";
                break;

            case VlcStatus.MediaStarted:
                status = "Media started";
                break;

            case VlcStatus.MediaPlaying:
                status = "Media is playing";
                break;

            case VlcStatus.NotFound:
                status = "VLC process not found";
                break;

            default:
                status = "Unknown VLC event";
                break;
            }

            VlcMonitor.setStatus(this.statusLabel, status);
        }
Esempio n. 5
0
        private void monitorVlc(Label statusLabel)
        {
            this.isVideoPlaying = false;

            while (this.monitorRunning)
            {
                this.vlcProcesses = VlcMonitor.getVlcProcesses();

                if (this.vlcProcesses == null)
                {
                    this.setStatus(VlcStatus.NotFound);
                    Thread.Sleep(500);
                    continue;
                }

                this.finiteAutomaton();

                Thread.Sleep(500);
            }

            VlcMonitor.setStatus(statusLabel, "");
        }