SDRSharper/Plugins/SDRSharper.RTLSDRGains/SDRSharp.RTLSDR/DeviceDisplay.cs
SDRSharpR c07e6e6034 SDRSharper (SDRSharp Remake) Full Source (VS2017)
SDRSharper (SDRSharp Remake) Full Source (VS2017)
2018-03-26 14:02:05 -07:00

39 lines
612 B
C#

namespace SDRSharp.RTLSDR
{
public class DeviceDisplay
{
public uint Index
{
get;
private set;
}
public string Name
{
get;
set;
}
public static DeviceDisplay[] GetActiveDevices()
{
uint num = NativeMethods.rtlsdr_get_device_count();
DeviceDisplay[] array = new DeviceDisplay[num];
for (uint num2 = 0u; num2 < num; num2++)
{
string name = NativeMethods.rtlsdr_get_device_name(num2);
array[num2] = new DeviceDisplay
{
Index = num2,
Name = name
};
}
return array;
}
public override string ToString()
{
return this.Name;
}
}
}