Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AudioSwitch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System" />
<Reference Include="System.RunTime" />
<Reference Include="System.Drawing" />
<Compile Include="Classes\EndPoints.cs" />
<Compile Include="Classes\OSDskin.cs" />
Expand Down Expand Up @@ -286,6 +287,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Resources\shadow.png" />
<Content Include="Skins\Default\back.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
5 changes: 5 additions & 0 deletions Classes/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public static Settings newSettings()
Transparency = 255
},

ShowBothDataFlow = false,

VolumeScroll = new CVolScroll
{
Key = VolumeScrollKey.LWin,
Expand All @@ -53,6 +55,9 @@ public static Settings newSettings()
[XmlElement]
public bool ColorVU;

[XmlElement]
public bool ShowBothDataFlow;

[XmlElement]
public bool ShowHardwareName;

Expand Down
262 changes: 138 additions & 124 deletions Forms/FormSettings.Designer.cs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Forms/FormSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private void FormSettings_Load(object sender, EventArgs e)
comboDefMode.Text = Program.settings.DefaultDataFlow == EDataFlow.eCapture ? "Recording" : "Playback";
checkDefaultMultiAndComm.Checked = Program.settings.DefaultMultimediaAndComm;
checkColorVU.Checked = Program.settings.ColorVU;
checkShowBoth.Checked = Program.settings.ShowBothDataFlow;
checkVolScroll.Checked = Program.settings.VolumeScroll.Enabled;
comboScrollKey.Text = Program.settings.VolumeScroll.Key.ToString();
checkScrShowOSD.Checked = Program.settings.VolumeScroll.ShowOSD;
Expand Down Expand Up @@ -156,6 +157,7 @@ private void FormSettings_FormClosing(object sender, FormClosingEventArgs e)

Program.settings.DefaultMultimediaAndComm = checkDefaultMultiAndComm.Checked;
Program.settings.ColorVU = checkColorVU.Checked;
Program.settings.ShowBothDataFlow = checkShowBoth.Checked;
Program.settings.ShowHardwareName = checkShowHWName.Checked;
Program.settings.QuickSwitchEnabled = radioQuickSwitch.Checked;
Program.settings.QuickSwitchShowOSD = checkQSShowOSD.Checked;
Expand Down Expand Up @@ -345,5 +347,10 @@ private void checkCustomName_CheckedChanged(object sender, EventArgs e)
{
textCustomName.Enabled = checkCustomName.Checked;
}

private void comboDefMode_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
}
8 changes: 5 additions & 3 deletions Forms/FormSwitcher.Designer.cs

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

33 changes: 30 additions & 3 deletions Forms/FormSwitcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,28 @@ private void RefreshDevices(EDataFlow renderType)
DeviceIcons.Clear();

listDevices.BeginUpdate();

if (Program.settings.ShowBothDataFlow)
renderType = EDataFlow.eAll;

var pDevices = EndPoints.DeviceEnumerator.EnumerateAudioEndPoints(renderType, EDeviceState.Active);


if (pDevices.Count > 0)
{
var defaultDev = EndPoints.DeviceEnumerator.GetDefaultAudioEndpoint(renderType, ERole.eMultimedia).ID;
var defaultDevcies = new List<string>();

if (renderType == EDataFlow.eAll)
{
defaultDevcies.Add(EndPoints.DeviceEnumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia).ID);
defaultDevcies.Add(EndPoints.DeviceEnumerator.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eMultimedia).ID);
}
else
{
defaultDevcies.Add(EndPoints.DeviceEnumerator.GetDefaultAudioEndpoint(renderType, ERole.eMultimedia).ID);
}


var devCount = pDevices.Count;

for (var i = 0; i < devCount; i++)
Expand All @@ -473,13 +490,13 @@ private void RefreshDevices(EDataFlow renderType)
{
ImageIndex = i,
Text = (devSettings != null && devSettings.UseCustomName) ? devSettings.CustomName : device.FriendlyName,
Selected = devID == defaultDev,
Selected = defaultDevcies.Contains(devID),
Tag = devID,
};

listDevices.Items.Add(item);

if (devID == defaultDev)
if (defaultDevcies.Contains(devID))
{
SetDeviceIcon(i, true);
SetTrayIcons();
Expand Down Expand Up @@ -564,5 +581,15 @@ private void audioDevicesToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("control", "mmsys.cpl sounds");
}

private void listDevices_SelectedIndexChanged(object sender, EventArgs e)
{

}

private void VolBar_Load(object sender, EventArgs e)
{

}
}
}
Binary file added Resources/Thumbs.db
Binary file not shown.
Binary file added gh-pages/Thumbs.db
Binary file not shown.
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Runtime" version="4.0.0" targetFramework="net45" />
</packages>