Пример #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>
 /// Unmutes Spotify (Requires Windows 7 or newer)
 /// </summary>
 public void UnMute()
 {
     if (!IsOSCompatible(WindowsSevenMajorVersion, WindowsSevenMinorVersion))
     {
         throw new NotSupportedException("This feature is only available on Windows 7 or newer");
     }
     VolumeMixerControl.MuteSpotify(false);
 }
Пример #3
0
 /// <summary>
 ///  Sets the Volume Mixer volume (requires Windows 7 or newer)
 /// </summary>
 /// <param name="volume">A value between 0 and 100</param>
 public void SetSpotifyVolume(float volume = 100)
 {
     if (!IsOSCompatible(WindowsSevenMajorVersion, WindowsSevenMinorVersion))
     {
         throw new NotSupportedException("This feature is only available on Windows 7 or newer");
     }
     if (volume < 0 || volume > 100)
     {
         throw new ArgumentOutOfRangeException(nameof(volume));
     }
     VolumeMixerControl.SetSpotifyVolume(volume);
 }
Пример #4
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());
 }
Пример #5
0
 /// <summary>
 /// Unmutes Spotify (Requires Windows 7 or newer)
 /// </summary>
 public void UnMute()
 {
     //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");
         }
     }
     VolumeMixerControl.MuteSpotify(false);
 }
Пример #6
0
 /// <summary>
 ///  Sets the Volume Mixer volume (requires Windows 7 or newer)
 /// </summary>
 /// <param name="volume">A value between 0 and 100</param>
 public void SetSpotifyVolume(float volume = 100)
 {
     //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");
         }
     }
     if (volume < 0 || volume > 100)
     {
         throw new ArgumentOutOfRangeException(nameof(volume));
     }
     VolumeMixerControl.SetSpotifyVolume(volume);
 }