Skip to content

Commit

Permalink
Changes to vWebClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-R committed Jan 6, 2014
1 parent 769f4ea commit d773712
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 55 deletions.
12 changes: 0 additions & 12 deletions vController/Preferences.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions vController/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions vController/vController.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vController/vController.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="vMixEvent.cs" />
<Compile Include="vMixMicroEvent.cs" />
<Compile Include="vEvent.cs" />
<Compile Include="vMicroEvent.cs" />
<Compile Include="Preferences.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Preferences.Designer.cs">
<DependentUpon>Preferences.cs</DependentUpon>
</Compile>
<Compile Include="vMixScheduler.cs" />
<Compile Include="vMixWebClient.cs" />
<Compile Include="vScheduler.cs" />
<Compile Include="vWebClient.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 19 additions & 24 deletions vController/vMixWebClient.cs → vController/vWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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;
}

Expand All @@ -75,23 +64,28 @@ 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;
}

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)
Expand All @@ -101,18 +95,19 @@ 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)
{
try
{
vMix.DownloadString("api?function=SetPosition&Value=" + position.ToString() + "&Input=" + guid);
//vMix.DownloadString("api?function=PlayPause&Input=" + guid);
}
catch
{
Expand Down
6 changes: 3 additions & 3 deletions vManager/vManager.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions vManager/vManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -55,6 +57,7 @@ private void UpdateDisplay()
{
if (donotredraw)
return;

donotredraw = true;
if (ActiveEvent != null)
{
Expand Down Expand Up @@ -944,9 +947,5 @@ private void bn_dr_25_Click(object sender, EventArgs e)
FixInPointAndDuration();
}
}




}
}
}

0 comments on commit d773712

Please sign in to comment.