using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
while (true)
{
// Set the full audio device name here
string audioDeviceToCheck = "ASUS VG289 (NVIDIA High Definition Audio)";
// Get the audio device
// There's a bug where it sometimes returns nothing, so this will loop a few times until it gets an answer
string[] audioDevices = BFS.Audio.GetPlaybackDevices();
for (int i = 0; i < 3; i++)
{
if (audioDevices.Length == 0)
{
BFS.General.ThreadWait(500);
audioDevices = BFS.Audio.GetPlaybackDevices();
}
else
{
break;
}
}
// Loop through them to check for the specified device
bool audioDeviceFound = false;
foreach (string device in audioDevices)
{
// If the specified device matches to one in the array, mark it as found and break out of this loop
if (device.ToLower() == audioDeviceToCheck.ToLower())
{
audioDeviceFound = true;
break;
}
}
// Show an error dialog if the device wasn't found
if (!audioDeviceFound)
{
BFS.Dialog.ShowMessageError("Audio device missing: " + audioDeviceToCheck);
}
// Wait 60 seconds
BFS.General.ThreadWait(60000);
}
}
}