Пример #1
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            double Bandwidth;

            if (BandBox.Text == "" || !double.TryParse(BandBox.Text, out Bandwidth))//prawdopodobnie można wywalić sprawdanie pustego
            {
                host.messageQueue.Enqueue(Logger.Log("Wrong band width.", LogType.ERROR));
                return;
            }
            AllLockedState();
            try
            {
                if (host.ReSetSession(Bandwidth))
                {
                    host.messageQueue.Enqueue(Logger.Log("Band changed to " + Bandwidth.ToString() + " Mbps.", LogType.INFO));
                    SessionState();
                }
                else
                {
                    host.messageQueue.Enqueue(Logger.Log("Failed to change bandwidth", LogType.ERROR));
                    SessionState();
                }
            }
            catch (Exception ex)
            {
                host.messageQueue.Enqueue(Logger.Log(ex.Message, LogType.ERROR));
                InitState();
            }
        }
Пример #2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("\nMetaData Configuration:");
            sb.AppendLine("\tStream         = " + Stream);
            sb.AppendLine("\tBandwidth      = " + (Bandwidth.HasValue ? Bandwidth.ToString() : "N/A"));
            sb.AppendLine("\tMinBufferTime  = " + (MinBufferTime.HasValue ? MinBufferTime.ToString() : "N/A"));
            sb.AppendLine("\tBufferDuration = " + BufferDuration);

            return(sb.ToString());
        }
Пример #3
0
        public override string ToString()
        {
            string result = (Bandwidth?.ToString() ?? "-");

            if (Profiles != null)
            {
                result += " / " + Profiles.ToString();
            }
            result += " / " + (GetMimeType(MimeType, Codecs) ?? "-");

            string size = Size(Width, Height);

            if (size != null || FrameRate != null)
            {
                result += " [" + (size ?? "");
                if (FrameRate != null)
                {
                    result += "@" + FrameRate;
                }
                result += "]";
            }

            string rate = Rate(SampleRate);
            string ch   = Channels(NumChannels);

            if (rate != null || ch != null)
            {
                result += " [" + (rate ?? "");
                if (rate != null && ch != null)
                {
                    result += " ";
                }
                result += (ch ?? "") + "]";
            }

            return(result + " (duration:" + ((Segments?.Duration)?.ToString() ?? "-") + ")");
        }