/// <summary> /// Get the current volume for the specified channel /// <para> /// The volume level is abstracted to an integer representing the volume as a percentage from 0 to 100 /// </para> /// </summary> /// <param name="channel">Select Channel</param> /// <returns>Current Volume</returns> public UInt16 GetVolume(string channel) { UInt16 _Vol = RC_LastChange.GetVolume(channel); double VolP = ((double)_Vol - (double)MinVolume) / (double)(MaxVolume - MinVolume); UInt16 NewVolume = (UInt16)(VolP * (double)100); return(NewVolume); }
protected void VolumeSink(RenderingControlLastChange sender) { double VolP = ((double)sender.GetVolume("Master") - (double)MinVolume) / (double)(MaxVolume - MinVolume); UInt16 NewVolume = (UInt16)(VolP * (double)100); if (OnVolume != null) { OnVolume(this, NewVolume); } }
protected void VolumeSink(RenderingControlLastChange sender) { double VolP = ((double)sender.GetVolume("Master")-(double)MinVolume)/(double)(MaxVolume-MinVolume); UInt16 NewVolume = (UInt16)(VolP*(double)100); if(OnVolume!=null) OnVolume(this,NewVolume); }