Exemple #1
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);
        }
Exemple #2
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, "");
        }