From d7737121a0d7938aef90f2f256000150ff214e01 Mon Sep 17 00:00:00 2001 From: Tim-R Date: Sun, 5 Jan 2014 18:18:57 -0800 Subject: [PATCH] Changes to vWebClient --- vController/Preferences.Designer.cs | 12 ------ vController/Preferences.cs | 5 --- vController/vController.Designer.cs | 2 + vController/vController.csproj | 8 ++-- vController/{vMixEvent.cs => vEvent.cs} | 0 .../{vMixMicroEvent.cs => vMicroEvent.cs} | 0 .../{vMixScheduler.cs => vScheduler.cs} | 0 .../{vMixWebClient.cs => vWebClient.cs} | 43 ++++++++----------- vManager/vManager.Designer.cs | 6 +-- vManager/vManager.cs | 13 +++--- 10 files changed, 34 insertions(+), 55 deletions(-) rename vController/{vMixEvent.cs => vEvent.cs} (100%) rename vController/{vMixMicroEvent.cs => vMicroEvent.cs} (100%) rename vController/{vMixScheduler.cs => vScheduler.cs} (100%) rename vController/{vMixWebClient.cs => vWebClient.cs} (88%) diff --git a/vController/Preferences.Designer.cs b/vController/Preferences.Designer.cs index cdd7c4e..07639f4 100644 --- a/vController/Preferences.Designer.cs +++ b/vController/Preferences.Designer.cs @@ -2,15 +2,8 @@ { partial class vMixPreferences { - /// - /// Erforderliche Designervariable. - /// private System.ComponentModel.IContainer components = null; - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. protected override void Dispose(bool disposing) { if (disposing && (components != null)) @@ -22,10 +15,6 @@ protected override void Dispose(bool disposing) #region Vom Windows Form-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// private void InitializeComponent() { this.ud_vMixPort = new System.Windows.Forms.NumericUpDown(); @@ -221,7 +210,6 @@ private void InitializeComponent() this.Text = "Settings"; this.TopMost = true; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.vMixPreferences_FormClosing); - this.Load += new System.EventHandler(this.vMixPreferences_Load); ((System.ComponentModel.ISupportInitialize)(this.ud_vMixPort)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ud_preload)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ud_linger)).EndInit(); diff --git a/vController/Preferences.cs b/vController/Preferences.cs index 349f0d0..3731b3d 100644 --- a/vController/Preferences.cs +++ b/vController/Preferences.cs @@ -81,11 +81,6 @@ private void ud_linger_ValueChanged(object sender, EventArgs e) _vMixLinger = (int)ud_linger.Value; } - private void vMixPreferences_Load(object sender, EventArgs e) - { - - } - private void vMixPreferences_FormClosing(object sender, FormClosingEventArgs e) { SaveSettings(); diff --git a/vController/vController.Designer.cs b/vController/vController.Designer.cs index e58f2e6..7524d07 100644 --- a/vController/vController.Designer.cs +++ b/vController/vController.Designer.cs @@ -243,12 +243,14 @@ private void InitializeComponent() // // toolStrip1 // + this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lbl_clock, this.bn_load_schedule, this.bn_showpreferences}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; this.toolStrip1.Size = new System.Drawing.Size(667, 25); this.toolStrip1.TabIndex = 14; this.toolStrip1.Text = "toolStrip1"; diff --git a/vController/vController.csproj b/vController/vController.csproj index dba3a20..943c44b 100644 --- a/vController/vController.csproj +++ b/vController/vController.csproj @@ -116,16 +116,16 @@ - - + + Form Preferences.cs - - + + ResXFileCodeGenerator Resources.Designer.cs diff --git a/vController/vMixEvent.cs b/vController/vEvent.cs similarity index 100% rename from vController/vMixEvent.cs rename to vController/vEvent.cs diff --git a/vController/vMixMicroEvent.cs b/vController/vMicroEvent.cs similarity index 100% rename from vController/vMixMicroEvent.cs rename to vController/vMicroEvent.cs diff --git a/vController/vMixScheduler.cs b/vController/vScheduler.cs similarity index 100% rename from vController/vMixScheduler.cs rename to vController/vScheduler.cs diff --git a/vController/vMixWebClient.cs b/vController/vWebClient.cs similarity index 88% rename from vController/vMixWebClient.cs rename to vController/vWebClient.cs index 60d0f9e..ed1da78 100644 --- a/vController/vMixWebClient.cs +++ b/vController/vWebClient.cs @@ -26,11 +26,14 @@ public bool GetStatus() { vMixInputs.Clear(); XmlDocument doc = new XmlDocument(); + try { doc.LoadXml(vMix.DownloadString("api")); - if (!CheckVersion()) + string[] v = doc.SelectNodes("vmix/version")[0].InnerText.Split('.'); + + if (int.Parse(v[0]) < 11) return false; foreach (XmlNode node in doc.SelectNodes("vmix/inputs/input")) @@ -49,21 +52,7 @@ public bool GetStatus() } return true; } - catch { } - return false; - } - - public bool CheckVersion() - { - XmlDocument doc = new XmlDocument(); - try - { - doc.LoadXml(vMix.DownloadString("api")); - string[] v = doc.SelectNodes("vmix/version")[0].InnerText.Split('.'); - if (int.Parse(v[0]) >= 11) - return true; - } - catch { } + catch {} return false; } @@ -75,11 +64,14 @@ public bool GetGUID(string inputname, out string guid) return false; foreach (vMixInput vmi in vMixInputs) + { if (vmi.name == inputname) { guid = vmi.guid; break; } + } + return true; } @@ -87,11 +79,13 @@ public bool AddInput(string type, string path, string guid) { try { - vMix.DownloadString("api?function=AddInput&Input=" + guid + "&Value=" + type + "|" + HttpUtility.UrlEncode(path)); - return true; + vMix.DownloadString("api?function=AddInput&Input=" + guid + "&Value=" + type + "|" + HttpUtility.UrlEncode(path)); } - catch { } - return false; + catch + { + return false; + } + return true; } public bool SetupSlideshow(int intervall, string transitioneffect, int transitiontime, string guid) @@ -101,10 +95,12 @@ public bool SetupSlideshow(int intervall, string transitioneffect, int transitio vMix.DownloadString("api?function=SetPictureTransition&Input=" + guid + "&Value=" + intervall.ToString()); vMix.DownloadString("api?function=SetPictureEffect&Input=" + guid + "&Value=" + transitioneffect); vMix.DownloadString("api?function=SetPictureEffectDuration&Input=" + guid + "&Value=" + transitiontime.ToString()); - return true; } - catch { } - return false; + catch + { + return false; + } + return true; } public bool ForwardTo(string guid, int position) @@ -112,7 +108,6 @@ public bool ForwardTo(string guid, int position) try { vMix.DownloadString("api?function=SetPosition&Value=" + position.ToString() + "&Input=" + guid); - //vMix.DownloadString("api?function=PlayPause&Input=" + guid); } catch { diff --git a/vManager/vManager.Designer.cs b/vManager/vManager.Designer.cs index ce22738..d076216 100644 --- a/vManager/vManager.Designer.cs +++ b/vManager/vManager.Designer.cs @@ -225,7 +225,7 @@ private void InitializeComponent() this.bn_now.Name = "bn_now"; this.bn_now.Size = new System.Drawing.Size(39, 23); this.bn_now.TabIndex = 26; - this.bn_now.Text = "now"; + this.bn_now.Text = "Now"; this.bn_now.UseVisualStyleBackColor = true; this.bn_now.Click += new System.EventHandler(this.bn_now_Click); // @@ -302,7 +302,7 @@ private void InitializeComponent() this.bn_add_photos.Name = "bn_add_photos"; this.bn_add_photos.Size = new System.Drawing.Size(74, 23); this.bn_add_photos.TabIndex = 18; - this.bn_add_photos.Text = "Photos"; + this.bn_add_photos.Text = "Photo"; this.bn_add_photos.UseVisualStyleBackColor = true; this.bn_add_photos.Click += new System.EventHandler(this.bn_add_photos_Click); // @@ -997,7 +997,7 @@ private void InitializeComponent() this.columnHeader6, this.columnHeader7, this.columnHeader8}); - this.EventList.Dock = System.Windows.Forms.DockStyle.Fill; + this.EventList.Dock = System.Windows.Forms.DockStyle.Left; this.EventList.FullRowSelect = true; this.EventList.GridLines = true; this.EventList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; diff --git a/vManager/vManager.cs b/vManager/vManager.cs index 844de52..3335c09 100644 --- a/vManager/vManager.cs +++ b/vManager/vManager.cs @@ -41,11 +41,13 @@ private void EventList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEve public ListViewItem EventListItem(vMixEvent vmixevent) { - string[] caption = { vmixevent.Title, + string[] caption = { + vmixevent.Title, vmixevent.EventStart.ToString("MM-dd HH:mm:ss"), vmixevent.EventDuration.ToString(@"hh\:mm\:ss"), vmixevent.EventTypeString(), - vmixevent.EventPath }; + vmixevent.EventPath + }; ListViewItem lvi = new ListViewItem(caption); lvi.ToolTipText = vmixevent.EventInfoText; return lvi; @@ -55,6 +57,7 @@ private void UpdateDisplay() { if (donotredraw) return; + donotredraw = true; if (ActiveEvent != null) { @@ -944,9 +947,5 @@ private void bn_dr_25_Click(object sender, EventArgs e) FixInPointAndDuration(); } } - - - - } -} +} \ No newline at end of file