Re: Media prefs

Jérôme Duval <[email protected]> Thu, 26 Feb 2004 17:19:30 +0100
Newsgroups gmane.os.openbeos.mediakit
Message-ID <[email protected]>
Selon Axel Dörfler <[email protected]>:

> 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