連續播放*.vob檔的問題 |
尚未結案
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
●Windows MediaPlayer有支援VCD的播放,但討厭的是假如VCD檔案有分好幾個,我們要一個一個的開啟,這樣還有看電影的樂趣嗎?因此參考這個自動播放VCD的程式。
●很簡單的表單配置一個File1、Timer1與MediaPlayer1等物件,然後在Timer1裡做判斷!
●做這一個程式要知道,VCD會有MpegAv這個資料夾,只要檢查它存不存在,如果存在,把Dat檔給載入即可!
Private Sub Form_Load() On Error GoTo DoWith File1.Pattern = "*.dat" File1.Path = "E:\mpegav" Exit Sub DoWith: MsgBox "請放入VideoCD", 48 End Sub Private Sub Timer1_Timer() On Error GoTo DoWith If Dir("e:\mpegav", vbDirectory) <> "" And File1.ListCount = 0 Then File1.Pattern = "*.dat" File1.Path = "E:\mpegav" File1.Refresh End If If File1.ListIndex = -1 Then File1.ListIndex = 0 MediaPlayer1.FileName = File1.Path & "\" & File1.FileName End If If MediaPlayer1.CurrentPosition >= MediaPlayer1.Duration And MediaPlayer1.Duration > 0 Then If File1.ListIndex < File1.ListCount - 1 Then File1.ListIndex = File1.ListIndex 1 MediaPlayer1.FileName = File1.Path & "\" & File1.FileName End If End If Exit Sub DoWith: File1.Refresh End Sub●執行前先別放入VCD,試試有沒有問題! ●插入VCD後,Timer會幫我們自動載入影片! ●第一段的Dat檔播放結束後,Timer會自動幫我們放下一段的Dat檔! 上面的資料是我在這找到的http://vb.infoserv.com.tw/ 有辨法轉成BCB嗎 ~我還在學習狀態希望多多向您學習~ 發表人 - taishyang 於 2004/04/22 14:00:40 |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
這是我後試可以的分享給大家
void __fastcall TForm1::FormCreate(TObject *Sender) { FileListBox1->FileName ="c:\\pioneer"; FileListBox1->Mask ="*.VOB"; } //--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { if (FileListBox1->Count ==0) { FileListBox1->FileName ="c:\\pioneer"; FileListBox1->Mask ="*.VOB"; FileListBox1->Refresh(); } if (FileListBox1->ItemIndex ==-1) { FileListBox1->ItemIndex =0; WTMediaPlayer1->FileName =FileListBox1->FileName ; } if (WTMediaPlayer1->CurrentPosition >= WTMediaPlayer1->Duration && WTMediaPlayer1->Duration > 0) { if(FileListBox1->ItemIndex < FileListBox1->Count -1) { FileListBox1->ItemIndex= FileListBox1->ItemIndex 1; WTMediaPlayer1->FileName =FileListBox1->FileName ; } else { Close(); } } }~我還在學習狀態希望多多向您學習~ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |