Example #1
0
 public void Puase()
 {
     TemStr   = "";
     TemStr   = TemStr.PadLeft(128, Convert.ToChar(" "));
     ilong    = APIClass.mciSendString("pause media", TemStr, TemStr.Length, 0);
     mc.state = State.mPuase;
 }
Example #2
0
 //播放
 public void play()
 {
     TemStr = "";
     TemStr = TemStr.PadLeft(127, Convert.ToChar(" "));
     APIClass.mciSendString("play media repeat", TemStr, TemStr.Length, 0);
     mc.state = State.mPlaying;
 }
Example #3
0
 //停止
 public void StopT()
 {
     TemStr   = "";
     TemStr   = TemStr.PadLeft(128, Convert.ToChar(" "));
     ilong    = APIClass.mciSendString("close media", TemStr, 128, 0);
     ilong    = APIClass.mciSendString("close all", TemStr, 128, 0);
     mc.state = State.mStop;
 }
Example #4
0
        public bool IsEnd()
        {
            durLength = "";
            durLength = durLength.PadLeft(128, Convert.ToChar(" "));
            APIClass.mciSendString("status media length", durLength, durLength.Length, 0);
            durLength = durLength.Trim();
            string curLength;

            curLength = "";
            curLength = curLength.PadLeft(128, Convert.ToChar(" "));
            APIClass.mciSendString("status media position", curLength, curLength.Length, 0);
            curLength = curLength.Trim();
            if (curLength == durLength)
            {
                return(true);
            }
            return(false);
        }