Exemplo n.º 1
0
        /// <summary>
        /// Return the current volume for the requested channel.
        /// </summary>
        /// <param name="channelIndex">The 0 based index into the channels.</param>
        /// <returns>The volume level for the channel between 0.0 and 1.0.</returns>
        public float GetChannelVolume(int channelIndex)
        {
            CheckChannelIndex(channelIndex, nameof(channelIndex));

            uint  index = unchecked ((uint)channelIndex);
            float level;

            Marshal.ThrowExceptionForHR(audioStreamVolumeInterface.GetChannelVolume(index, out level));
            return(level);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return the current volume for the requested channel.
        /// </summary>
        /// <param name="channelIndex">The 0 based index into the channels.</param>
        /// <returns>The volume level for the channel between 0.0 and 1.0.</returns>
        public float GetChannelVolume(int channelIndex)
        {
            CheckChannelIndex(channelIndex, "channelIndex");

            uint index;

            unchecked
            {
                index = (uint)channelIndex;
            }
            Marshal.ThrowExceptionForHR(audioStreamVolumeInterface.GetChannelVolume(index, out var level));
            return(level);
        }
Exemplo n.º 3
0
 /// <summary>
 /// get / set channel volume
 /// </summary>
 /// <param name="index">channel index</param>
 public float this[int index]
 {
     get
     {
         float level;
         int   hr = _RealVolume.GetChannelVolume((uint)index, out level);
         Marshal.ThrowExceptionForHR(hr);
         return(level);
     }
     set
     {
         int hr = _RealVolume.SetChannelVolume((uint)index, value);
         Marshal.ThrowExceptionForHR(hr);
     }
 }