예제 #1
0
파일: Config.cs 프로젝트: de1mos242/Jukebox
        private bool ExistDevice(string deviceId)
        {
            ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice);

            for (int i = 0; i < outputDevices.DeviceCount; i++)
            {
                if (outputDevices.getDeviceID(i) == deviceId)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
파일: Config.cs 프로젝트: de1mos242/Jukebox
        private string DeviceDialog()
        {
            Console.WriteLine("Output devices: ");
            ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice);

            for (int i = 0; i < outputDevices.DeviceCount; i++)
            {
                Console.WriteLine(i.ToString() + ": " + outputDevices.getDeviceDescription(i));
            }
            Console.Write("Choose device (0): ");
            var    deviceString = Console.ReadLine();
            int    deviceIndex  = deviceString.Length != 1 ? 0 : int.Parse(deviceString);
            string deviceID     = outputDevices.getDeviceID(deviceIndex);

            return(deviceID);
        }
예제 #3
0
파일: Config.cs 프로젝트: de1mos242/Jukebox
 private string DeviceDialog()
 {
     Console.WriteLine("Output devices: ");
     ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice);
     for (int i = 0; i < outputDevices.DeviceCount; i++)
     {
         Console.WriteLine(i.ToString() + ": " + outputDevices.getDeviceDescription(i));
     }
     Console.Write("Choose device (0): ");
     var deviceString = Console.ReadLine();
     int deviceIndex = deviceString.Length != 1 ? 0 : int.Parse(deviceString);
     string deviceID = outputDevices.getDeviceID(deviceIndex);
     return deviceID;
 }
예제 #4
0
파일: Config.cs 프로젝트: de1mos242/Jukebox
 private bool ExistDevice(string deviceId)
 {
     ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice);
     for (int i = 0; i < outputDevices.DeviceCount; i++)
     {
         if (outputDevices.getDeviceID(i) == deviceId)
         {
             return true;
         }
     }
     return false;
 }