delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


Media Player & Autorepeat FunctionFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi all versions
Category:
Multimedia
Skill Level:
Scoring:
Last Update:
11/01/2001
Search Keys:
delphi delphi3000 article borland vcl code-snippet Mediaplayer Autorepeat
Times Scored:
4
Visits:
5944
Uploader: Cesario Lababidi
Company:
Reference: N/A
 
Question/Problem/Abstract:
how can I write an Autorepeat Function for Mediaplayer ?
Answer:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
MPlayer;

type
TForm1 = class(TForm)
   MediaPlayer1: TMediaPlayer;
   procedure FormCreate(Sender: TObject);
private
   { Private-Deklarationen }
public
    fAutoRepeat:Boolean;
    procedure NotifyProc(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.DFM}




procedure TForm1.FormCreate(Sender: TObject);
begin
MediaPlayer1.Notify := True;
MediaPlayer1.OnNotify := NotifyProc;
fAutorepeat := True;
end;

procedure TForm1.NotifyProc(Sender: TObject);
begin
With Sender As TMediaPlayer do begin
   Case Mode of
     mpStopped: IF fAutoRepeat
                 Then (Sender as tMediaplayer).play;
   end;
   //must set to true to enable next-time notification
   Notify := True;
end;
end;

end.


Best Regards

Cesario





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Que onda con tu código
    Gerardo Fernández (Sep 11 2003 12:08PM)

Traté de usar el código que estaba puesto y no me funcionó
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
L. Rosenstein
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)