[openbeosmediakit] Re: Media prefs

  • From: Jérôme Duval <korli@xxxxxxxx>
  • To: openbeosmediakit@xxxxxxxxxxxxx
  • Date: Thu, 26 Feb 2004 17:19:30 +0100

Selon Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:

> The "flags" argument is completely unused?

It seems. But i think it could be used to make the launch_media_server call 
wait 
or not for the launch completion. 
My current problem is waiting for the media_server launch completion, i tried 
to 
send it a message with some timeout (2 seconds for deliver, 2 seconds for reply)
, but it answers very quickly. What should i do ? I think media_server should 
postpone its reply until launch completion. Is it a good practice ?

> isn't it just something like (in pseudo code):
> 
>       port_id port = create_port(...);
>       status = SendToServer(initiate shutdown, port);
>       while (status == B_OK) {
>               struct {
>                       int32 stage;
>                       char message[256];
>               } s;
>               status = read_port(..., s, timeout);
> 
>               progress(s.stage, s.message, cookie);
> 
>               if (stage >= 100)
>                       break;
>       }
>       return B_OK;
> 
> ?

Yes, it seems a good pseudo code. It's just the notifications in media server 
seem not implemented. So feeding the port should be tricky. We could start with 
a thread with several snooze calls though :)

Bye,
Jerome

Other related posts: