Skip to content

Commit dca3e51

Browse files
authored
Merge pull request #20 from lucidcode/volume-control
Add volume control for video feed
2 parents fd0f487 + bc2e11b commit dca3e51

5 files changed

Lines changed: 59 additions & 15 deletions

File tree

Halovision/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.9.0")]
36-
[assembly: AssemblyFileVersion("1.2.9.0")]
35+
[assembly: AssemblyVersion("1.3.0.0")]
36+
[assembly: AssemblyFileVersion("1.3.0.0")]

Halovision/VisionForm.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Emgu.CV;
1515
using Emgu.CV.Structure;
1616
using LibVLCSharp.Shared;
17+
using System.Runtime.Remoting.Messaging;
1718

1819
namespace lucidcode.LucidScribe.Plugin.Halovision
1920
{
@@ -243,6 +244,7 @@ private void LoadSettings()
243244
defaultSettings += "<DashThreshold>600</DashThreshold>";
244245
defaultSettings += "<Classifier>None</Classifier>";
245246
defaultSettings += "<WaveForm>Triangle</WaveForm>";
247+
defaultSettings += "<Volume>0</Volume>";
246248
defaultSettings += "</Plugin>";
247249
defaultSettings += "</LucidScribeData>";
248250
File.WriteAllText(settingsFilePath, defaultSettings);
@@ -275,6 +277,11 @@ private void LoadSettings()
275277
txtDeviceURL.Text = xmlSettings.DocumentElement.SelectSingleNode("//DeviceURL").InnerText;
276278
}
277279

280+
if (xmlSettings.DocumentElement.SelectSingleNode("//Volume") != null)
281+
{
282+
VolumeTrackBar.Value = Convert.ToInt32(xmlSettings.DocumentElement.SelectSingleNode("//Volume").InnerText);
283+
}
284+
278285
if (xmlSettings.DocumentElement.SelectSingleNode("//CopyFromScreen") != null && xmlSettings.DocumentElement.SelectSingleNode("//CopyFromScreen").InnerText == "1")
279286
{
280287
chkCopyFromScreen.Checked = true;
@@ -438,7 +445,7 @@ private void ConnectHalovisionDevice()
438445
{
439446
player = new MediaPlayer(media);
440447
player.Hwnd = pbDisplay.Handle;
441-
player.Volume = 0;
448+
player.Volume = VolumeTrackBar.Value;
442449

443450
player.Play();
444451
}
@@ -473,7 +480,7 @@ private void ConnectHalovisionDevice()
473480

474481
player = new MediaPlayer(media);
475482
player.Hwnd = pbDisplay.Handle;
476-
player.Volume = 0;
483+
player.Volume = VolumeTrackBar.Value;
477484

478485
// Note: This will connect the pipe and read the video.
479486
player.Play();
@@ -517,7 +524,7 @@ private void ConnectInspecDevice()
517524
{
518525
player = new MediaPlayer(media);
519526
player.Hwnd = pbDisplay.Handle;
520-
player.Volume = 0;
527+
player.Volume = VolumeTrackBar.Value;
521528
player.Play();
522529
}
523530
}
@@ -949,6 +956,7 @@ private void SaveSettings()
949956
settings += "<EyeMoveMin>" + eyeMoveMinInput.Value + "</EyeMoveMin>";
950957
settings += "<EyeMoveMax>" + eyeMoveMaxInput.Value + "</EyeMoveMax>";
951958
settings += "<IdleTicks>" + idleTicksInput.Value + "</IdleTicks>";
959+
settings += "<Volume>" + VolumeTrackBar.Value + "</Volume>";
952960
settings += "<IgnorePercentage>" + cmbIgnorePercentage.Text + "</IgnorePercentage>";
953961

954962
if (chkCopyFromScreen.Checked)
@@ -1145,5 +1153,14 @@ private void cmbWaveForm_SelectedIndexChanged(object sender, EventArgs e)
11451153
}
11461154
SaveSettings();
11471155
}
1156+
1157+
private void VolumeTrackBar_Scroll(object sender, EventArgs e)
1158+
{
1159+
if (player != null)
1160+
{
1161+
player.Volume = VolumeTrackBar.Value;
1162+
}
1163+
SaveSettings();
1164+
}
11481165
}
11491166
}

Halovision/VisionForm.designer.cs

Lines changed: 33 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Halovision/VisionForm.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
129129
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
130130
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACW
131-
DQAAAk1TRnQBSQFMAwEBAAE4AQIBOAECAR8BAAEcAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABfAMA
131+
DQAAAk1TRnQBSQFMAwEBAAFAAQIBQAECAR8BAAEcAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABfAMA
132132
ARwDAAEBAQABGAUAAbABKBIAXf//ABgABv8B6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHW
133133
AccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHW
134134
AccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6QHWAccB6AHX

Installer/Lucid Scribe Halovision.vdproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28626,15 +28626,15 @@
2862628626
{
2862728627
"Name" = "8:Microsoft Visual Studio"
2862828628
"ProductName" = "8:Lucid Scribe Halovision"
28629-
"ProductCode" = "8:{20F60104-49E6-4E5D-B892-7DE307B4BC0A}"
28630-
"PackageCode" = "8:{77F22B94-0B0F-410F-AFF9-755443491580}"
28629+
"ProductCode" = "8:{7EDFD84B-BBFD-4883-B987-C3125EF36595}"
28630+
"PackageCode" = "8:{DCD15C6E-BE54-4E96-B2FA-9F50AC7397BF}"
2863128631
"UpgradeCode" = "8:{CAAB2187-AD23-435C-A3DB-568744247625}"
2863228632
"AspNetVersion" = "8:4.0.30319.0"
2863328633
"RestartWWWService" = "11:FALSE"
2863428634
"RemovePreviousVersions" = "11:TRUE"
2863528635
"DetectNewerInstalledVersion" = "11:TRUE"
2863628636
"InstallAllUsers" = "11:TRUE"
28637-
"ProductVersion" = "8:1.2.9"
28637+
"ProductVersion" = "8:1.3.0"
2863828638
"Manufacturer" = "8:lucidcode"
2863928639
"ARPHELPTELEPHONE" = "8:"
2864028640
"ARPHELPLINK" = "8:http://www.lucidcode.com/Contact"

0 commit comments

Comments
 (0)