/// <summary> /// Sets the pitch of the specified channel. /// </summary> /// <param name="handle">The handle that represents the channel to adjust.</param> /// <param name="pitch">The channel's new pitch.</param> public static void SetPitch(UInt32 handle, Single pitch) { if (BASSNative.ChannelIsSliding(handle, BASSAttrib.ATTRIB_TEMPO_PITCH)) { if (!BASSNative.ChannelSlideAttribute(handle, BASSAttrib.ATTRIB_TEMPO_PITCH, pitch * SemitonesPerOctave, 0)) { throw new BASSException(); } } else { if (!BASSNative.ChannelSetAttribute(handle, BASSAttrib.ATTRIB_TEMPO_PITCH, pitch * SemitonesPerOctave)) { throw new BASSException(); } } var tempo = (Math.Pow(2.0, pitch) - 1.0) * 100.0; if (BASSNative.ChannelIsSliding(handle, BASSAttrib.ATTRIB_TEMPO)) { if (!BASSNative.ChannelSlideAttribute(handle, BASSAttrib.ATTRIB_TEMPO, (float)tempo, 0)) { throw new BASSException(); } } else { if (!BASSNative.ChannelSetAttribute(handle, BASSAttrib.ATTRIB_TEMPO, (float)tempo)) { throw new BASSException(); } } }
/// <summary> /// Sets the pan of the specified channel. /// </summary> /// <param name="handle">The handle that represents the channel to adjust.</param> /// <param name="pan">The channel's new pan.</param> public static void SetPan(UInt32 handle, Single pan) { if (BASSNative.ChannelIsSliding(handle, BASSAttrib.ATTRIB_PAN)) { if (!BASSNative.ChannelSlideAttribute(handle, BASSAttrib.ATTRIB_PAN, pan, 0)) { throw new BASSException(); } } else { if (!BASSNative.ChannelSetAttribute(handle, BASSAttrib.ATTRIB_PAN, pan)) { throw new BASSException(); } } }
/// <summary> /// Sets the volume of the specified channel. /// </summary> /// <param name="handle">The handle that represents the channel to adjust.</param> /// <param name="volume">The channel's new volume./</param> public static void SetVolume(UInt32 handle, Single volume) { if (BASSNative.ChannelIsSliding(handle, BASSAttrib.ATTRIB_VOL)) { if (!BASSNative.ChannelSlideAttribute(handle, BASSAttrib.ATTRIB_VOL, volume, 0)) { throw new BASSException(); } } else { if (!BASSNative.ChannelSetAttribute(handle, BASSAttrib.ATTRIB_VOL, volume)) { throw new BASSException(); } } }