/// <summary> /// Statistics routine /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void timerStatus_Tick(object sender, EventArgs e) { eMState eState; double dblTimeRemain; if (m_currItem != null) { m_currItem.FileStateGet(out eState, out dblTimeRemain); try { string strPath; double dblFilePos; m_currItem.FileNameGet(out strPath); m_currItem.FilePosGet(out dblFilePos); double dblIn, dblOut, dblFileLen = 0; m_currItem.FileInOutGet(out dblIn, out dblOut, out dblFileLen); if (dblOut > dblIn) { dblFileLen = dblOut; } labelPos.Width = (int)((trackBarSeek.Width) * dblFilePos / dblFileLen); string strFile = strPath.Substring(strPath.LastIndexOf('\\') + 1); labelStatus.Text = Dbl2PosStr(dblFilePos) + "/" + Dbl2PosStr(dblFileLen) + " " + eState.ToString() + " " + "\r\n" + strFile + "\r\n" + strPath; } catch { labelStatus.Text = eState.ToString(); labelPos.Width = 0; } } }
private PlayRange GetInOut(MItem mitem) { double dblIn = 0.0, dblOut = 0.0, dblTotal = 0.0; mitem.FileInOutGet(out dblIn, out dblOut, out dblTotal); if (dblOut == dblIn || dblOut == 0.0) { dblOut = dblTotal; } TimeSpan startPos = TimeSpan.FromSeconds(dblIn); TimeSpan duration = TimeSpan.FromSeconds(dblOut - dblIn); // TimeSpan.FromSeconds(dblTotal); return(new PlayRange(startPos, duration)); }
private PlayRange SetInOut(MItem mitem, PlayRange playRange) { double dblIn = 0.0, dblOut = 0.0; dblIn = playRange.StartPosition.TotalSeconds; dblOut = playRange.StopPosition.TotalSeconds; mitem.FileInOutSet(dblIn, dblOut); double dblDuration; mitem.FileInOutGet(out dblIn, out dblOut, out dblDuration); if (dblOut == dblIn || dblOut == 0.0) { dblOut = dblDuration; } return(new PlayRange(TimeSpan.FromSeconds(dblIn), TimeSpan.FromSeconds(dblOut - dblIn))); }