예제 #1
0
 /// <summary>
 /// Return the Volume Mixer volume of Spotify (requires Windows 7 or newer)
 /// </summary>
 /// <returns>Null if an error occured, otherwise a float between 0 and 100</returns>
 public float GetSpotifyVolume()
 {
     if (!IsOSCompatible(WindowsSevenMajorVersion, WindowsSevenMinorVersion))
     {
         throw new NotSupportedException("This feature is only available on Windows 7 or newer");
     }
     return(VolumeMixerControl.GetSpotifyVolume());
 }
예제 #2
0
 /// <summary>
 /// Return the Volume Mixer volume of Spotify (requires Windows 7 or newer)
 /// </summary>
 /// <returns>Null if an error occured, otherwise a float between 0 and 100</returns>
 public float GetSpotifyVolume()
 {
     //Windows < Windows Vista Check
     if (Environment.OSVersion.Version.Major < 6)
     {
         throw new NotSupportedException("This feature is only available on Windows 7 or newer");
     }
     //Windows Vista Check
     if (Environment.OSVersion.Version.Major == 6)
     {
         if (Environment.OSVersion.Version.Minor == 0)
         {
             throw new NotSupportedException("This feature is only available on Windows 7 or newer");
         }
     }
     return(VolumeMixerControl.GetSpotifyVolume());
 }