Exemplo n.º 1
0
        public void mp3Start(string title)
        {
            title = checkingFileName(fileOb.getTitle());

            string currentPath = Environment.CurrentDirectory + "\\save";
            string filePath    = currentPath + "\\" + fileOb.getYear() + "\\" + fileOb.getMonth() + "\\" + title + ".mp3";

            /*
             * mciSendString(@filePath, "", 0, 0); //경로에 MDI File이 존재하는 위치를 기술
             * mciSendString("PLAY MDIFile", "", 0, 0); //열린 File을 재생
             */
            mciSendString("open \"" + filePath + "\" type mpegvideo alias MediaFile", null, 0, IntPtr.Zero);
            mciSendString("play MediaFile", null, 0, IntPtr.Zero);
        }
Exemplo n.º 2
0
        private void playbtn_Click(object sender, EventArgs e)
        {
            if (playStatus == false)
            {
                string currentPath = Environment.CurrentDirectory + "\\save";
                string filePath    = currentPath + "\\" + fileOb.getYear() + "\\" + fileOb.getMonth() + "\\" + fileOb.getTitle() + ".mp3";

                mciSendString("open \"" + filePath + "\" type mpegvideo alias MediaFile", null, 0, IntPtr.Zero);
                mciSendString("play MediaFile", null, 0, IntPtr.Zero);
                timer1.Start();
                playStatus = true;

                macTrackBar1.Minimum = 0;
                macTrackBar1.Maximum = (int)fileLength;
            }
        }