I wasn't getting at your code particularly.  Sorry, didn't mean to
ruffle feathers.  It was a combined response to a number of messages.

However I believe Chris was looking for something to indicate progress
WHILE a clip was playing. You seemed to be talking about responding to
the end of a clip.

I was sort of encouraging people not to be afraid of threads, and nope,
I'm afraid I don't have time either to put together a threading example.

Apologies if I picked things up wrong.

Cheers,

C.

-----Original Message-----
From: Ben Taylor [mailto:[EMAIL PROTECTED] 

i'm not going to take too much time to respond to this (i have other
things to do
:-) ) but as far as i'm concerned, the async code i gave below is a
perfectly legit way of doing things.. threading in this case isnt
required (unless maybe the original requestor has other design
requirements). and there's no hacks (app.processmessages)..

if you want to show an simpler implementation using threads, im sure
people would be interested :-)

and yes, i know when/where to use threads :-) i just dont think this
situation is a good example of when to use..

just my 2c :-) 

--- [EMAIL PROTECTED] wrote:
> If you can get to grips with threading, guys, it will pay off.
> 
> You can do a lot of stuff with progress dialogs etc, if you can make 
> use of threading.  It doesn't have to be that complicated.
> 
> And IMHO, there is no place for Application.ProcessMessages in an app.
> It's a hack, and only useful for VB developers. ;-)
> 
> I prefer clean designs, and App.ProcessMessages doesn't figure...
> 
> No offence intended.
> 
> Cheers,
> 
> Conor
> 
> -----Original Message-----
> From: Ben Taylor [mailto:[EMAIL PROTECTED]
> 
> i think you need to forget about using .wait (and threading) and have 
> a look at doing it asyncronously using the .onnotify event to tell 
> when the current clip ends.
> much simpler (and possible)..
> 
> something like: (quick hack) (the .mode property seems to have a bug 
> in
> d6 too)
> 
> procedure TForm1.Button1Click(Sender: TObject); //starts the sequence 
> begin  GetNext;  mp.Open;  mp.Play; end;
> 
> procedure TForm1.mpNotify(Sender: TObject); //when clip ends, get the 
> next clip to show and plays it begin  if mp.Mode=mpstopped then  begin

> GetNext;  if mp.FileName='' then Exit;  mp.Open;  mp.Play;  end; end;
> 
> procedure TForm1.FormCreate(Sender: TObject); begin 
> lb.Items.Add('c:\clip1.avi'); lb.Items.Add('c:\clip2.avi'); end;
> 
> procedure TForm1.GetNext;
> //gets next filename from a listbox
> var
>  aStr:string;
> begin
>  if lb.Items.Count>0 then
>   begin
>   mp.FileName:=lb.Items[0];
>   lb.Items.Delete(0);
>   end
>  else
>   begin
>   mp.FileName:='';
>   end;
> end;
> 
> hope that helps,
> b
> 
> --- Chris Veale <[EMAIL PROTECTED]> wrote:
> > Hi.
> > 
> > Im playing around with the tmediaplayer and am wanting to play a 
> > video
> 
> > in a second window, but I want to update the initial form with a 
> > time > > remaining
> > 
> > when I play the video though ir locks the form until the video stops

> > (I believe cause I use the wait procedure of the tmediaplayer)
> > 
> > but I need the wait as people can choose to play two videos and I 
> > want
> 
> > them to be able to, instead of skipping to the last one only.
> > 
> > I looked at threads for this but this also locks the form.
> > 
> > any thoughts how I can do this?
> > 
> > Cheers
> 
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you're looking for faster
http://search.yahoo.com _______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to