public PlayerUserControl(NewMainWindow mw, List <Light> mActionBeanList, String audioResources, double dTime, int nowTimeI) { InitializeComponent(); this.mw = mw; AudioResources = audioResources; this.dTime = dTime; this.mActionBeanList = mActionBeanList; InitPlayLaunchpad(); SetData(mActionBeanList); tbBPM.Text = mw.NowProjectModel.Bpm.ToString(); playLpd.SmallTime = nowTimeI; //(int)(LightBusiness.GetMax(mActionBeanList) * dTime) //Console.WriteLine((int)Math.Round(nowTimeP * LightBusiness.GetMax(GetData()))); if (!AudioResources.Equals(String.Empty)) { dAllTime = double.Parse(MediaFileTimeUtil.GetAsfTime(AudioResources, double.Parse(tbBPM.Text))); //MediaElementPosition = dTime * LightBusiness.GetMax(mActionBeanList) / dAllTime; MediaElementPosition = (nowTimeI * 1.0 / dAllTime); } //Console.WriteLine(nowTimeI +"---"+ LightBusiness.GetMax(mActionBeanList)+ "---"+dAllTime); //Console.WriteLine(MediaElementPosition); }
private void btnCalc_Click(object sender, RoutedEventArgs e) { if (!File.Exists(tbFilePath.Text)) { return; } tbResult.Text = MediaFileTimeUtil.GetAsfTime(tbFilePath.Text, double.Parse(tbBPM.Text)); }
public void SetTime(List <Light> mActionBeanList, String audioResources, double dTime, int nowTimeI) { AudioResources = audioResources; this.dTime = dTime; this.mActionBeanList = mActionBeanList; InitPlayLaunchpad(); SetData(mActionBeanList); //tbBPM.Text = mw.NowProjectModel.Bpm.ToString(); playLpd.SmallTime = nowTimeI; //(int)(LightBusiness.GetMax(mActionBeanList) * dTime) //Console.WriteLine((int)Math.Round(nowTimeP * LightBusiness.GetMax(GetData()))); if (!AudioResources.Equals(String.Empty)) { dAllTime = double.Parse(MediaFileTimeUtil.GetAsfTime(AudioResources, double.Parse(tbBPM.Text))); //MediaElementPosition = dTime * LightBusiness.GetMax(mActionBeanList) / dAllTime; MediaElementPosition = (nowTimeI * 1.0 / dAllTime); } }