//* -----------------------------------------------------------------------* /// <summary>グラデーション計算をします。</summary> /// /// <param name="nNow">現在値</param> /// <param name="nSize">分割数</param> /// <returns>補完値</returns> public float smooth(int nNow, int nSize) { if (limit1 == limit2) { return(limit1); } return(MathHelper.Clamp(CInterpolate.smooth(start, end, nNow, nSize), MathHelper.Min(limit1, limit2), MathHelper.Max(limit1, limit2))); }
//* -----------------------------------------------------------------------* /// <summary>音量値を文字列化します。</summary> /// /// <param name="bSlider">スライダーを挿入するかどうか</param> /// <returns>文字列化した音量値</returns> public string ToString(bool bSlider) { string strResult = ""; string strDB = String.Format("{0:+0.0;-0.0;0}dB", dB); if (bSlider) { char[] szVolume = new string( '・', 10 ).ToCharArray(); szVolume[( int )MathHelper.Min(CInterpolate.smooth(0, 10, volume, 2), 9)] = '◆'; strResult += new string( szVolume ) + Environment.NewLine; strDB = string.Format("({0})", strDB); } return(strResult + strDB); }