procedure TForm1.Timer1Timer(Sender: TObject); var TrackPos, TrackLen:Integer; begin TrackPos :=Trunc( WindowsMediaPlayer1.controls.currentPosition); TrackLen :=Trunc( WindowsMediaPlayer1.currentMedia.duration); if (TrackPos=TrackLen) and (TrackPos>0) then begin ComboBox1.ItemIndex :=ComboBox1.ItemIndex+1; ComboBox1Change(self); end; end;
ملاحظة : اجعل خاصية Enabled لل TTimer غير مفعلة إلا عند بداية القراءة .
والسلام عليكم .
اخي الكريم الاجابة تمت على اساس طرحك للمشكل الكود الذي كتبته نجح معي وتتم القراءة من سورة الى اخرى بعد انتهاء الاولى هذا يتم على حساب الطول الزمني للسورة .
انظرالى :
SouraPos و SouraLen .
هل هذا ماتبحث عنه
PHP كود :
procedure TForm1.ComboBox1Change(Sender: TObject); begin Case ComboBox1.ItemIndex of 1:WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/001.mp3'; 2:WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/008.mp3'; 3:WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/009.mp3'; end; timer1.enabled:=true;
{هذا كله يمكنك استبداله بالكود الموجود في الاعلى If ComboBox1.text='EL_FATHA' then WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/001.mp3'; //////////////////////////////// If ComboBox1.text='EL_ANFALL' then WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/008.mp3'; //////////////////////////////// If ComboBox1.text='EL_TAOUBAA' then WindowsMediaPlayer1.URL:='http://server10.mp3quran.net/jleel/009.mp3'; } end;
procedure TForm1.Timer1Timer(Sender: TObject); var SouraPos, SouraLen:Integer; begin SouraPos :=Trunc( WindowsMediaPlayer1.controls.currentPosition); SouraLen :=Trunc( WindowsMediaPlayer1.currentMedia.duration); if (SouraPos=SouraLen) and (SouraPos>0) then begin ComboBox1.ItemIndex :=ComboBox1.ItemIndex+1; ComboBox1Change(self); end; end;