<br><br><div><span class="gmail_quote">On 1/11/07, <b class="gmail_sendername">Mikael Hallendal</b> &lt;<a href="mailto:micke@imendio.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">micke@imendio.com
</a>&gt; wrote:<br><br><br>On 1/11/07, Mikael Hallendal &lt;<a href="mailto:micke@imendio.com">micke@imendio.com</a>&gt; wrote:<br><br>&nbsp;&nbsp;&nbsp; I think it would make sense to have a call to play up a sound file,<br>&nbsp;&nbsp;&nbsp; for example for when a new message arrives in your inbox. I think
<br>&nbsp;&nbsp;&nbsp; however that anything more advanced than a simple &quot;PlaySoundFile&quot;<br>&nbsp;&nbsp;&nbsp; doesn&#39;t fit in the current design of DAPI.<br><br><br>Under the dapi.sound interface, there is a simple Play method.<br><br>Such methd, I would say, should not be limited to take only a filename. A URI at least&nbsp; would be much nicer. Another thing that comes to my mind, is that PlaySoundFile under dapi has only a limited chance to succeed on a cross-desktop project: if you need such function, then you probably need to do more advanced things, like getting metadata (even if there is other way for files, but lets talk about URI instead). Why? Because, if you refer to a soundfile, that means you are probably not willing to play a sound event. Right now, I only see a file manager for this &quot;file&quot; need (see Nautilus sound, for example). But a file manager need more things, like changing the playing state, seeking (and it would be nice, of course to set fadein/out!). Basically, you need some control. So you need to define an object that implement a 
sound.playback interface.<br><br>Let&#39;s talk rather about events (I see much more use in this case for cross-desktop applications - even if such call should come from a notification daemon/api), then you will have to give an id. Hopefully, all this can be handled easily with the same method, or at least, I guess it would be nice). And I agree, then, you probably don&#39;t want to see further object/handler/control. But if you start thinking about theming, then you will need some other object/interface like 
dapi.sound.theme. Still, lets stick to something simple: Name, and PathList would be enough for sound.theme (that should implement the waited fd.o spec).<br><br>What if you have to implement a classic game? background music would need some control, volume level, and you might appreciate looping (see the very simple QSound API that has been strimmed down over the year. They still provide Loop property).
<br><br>Hmm. No, let&#39;s talk about the cool things. Space positionning (an event come from the position of your window, interesting, would it be ?). Priority! Of course, I want to hear my phone ringing even if my resource is busy playing something else - and that would be nice if the other apps 
lower.I&#39;ll call that playback.advanced interface.<br><br>So we end up with a kind of list of requirement that would be nice to provide. If you look at the use case for the desktop (I have done that, even if I think that developpers are deaf because they don&#39;t use sound or because it&#39;s not big priority, or because we don&#39;t have a clear way to do it, or because it&#39;s boring to end up writing the samething all the time for dealing with PCM streaming, negotiation...)
<br><br>I try to unify desktop applications needs with a quite simple interface for people, like me sometime, who don&#39;t really care about the default API/backend, but would like to have a simple API that make a best effort for any desktop.
<br><br>Now, I can understand that maybe, DAPI is not the right place: I can imagine reading the specs, that you can be expecting another completely different behavior, like &quot;opening the default media player for this particular desktop with this sound (a la xdg script)&quot;. But I would suggest another api for that: OpenSoundFile or even OpenFile (ala xdg-open). The discussions take place to see where it could fit (we even thought about PortMusic or PortAudio, it might finally be PortDesktop, but I would find that a bit funny)
<br><br>&nbsp;&nbsp;&nbsp; More advanced functions such as setting volume, fade, loop, set<br>&nbsp;&nbsp;&nbsp; position etc would probably fit better in it&#39;s own component for such<br>&nbsp;&nbsp;&nbsp; applications (music players comes to mind) that need that.
<br><br><br>And everyone write the same thing (in different ways, yes) to handle the very same control over audio playback. But I don&#39;t really target music players (I target my_first_music player, yep). Believe me, I know that music players need more advanced things :) Even a common desktop sound API will need other properties if they don&#39;t come from other common API (like program name, application name, pid, user,...). one more thing I am considering is to add a window id to the sound object. But there might be other way. There is tons of things that we can define under DAPI. I just don&#39;t know what is the border line for you guys :)
<br><br>&nbsp;&nbsp;&nbsp; &gt; Regarding DAPI &quot;core&quot;, what about a common vtable for main loops/<br>&nbsp;&nbsp;&nbsp; &gt; events, similar to the one of D-Bus (instead of just leaving fd to<br>&nbsp;&nbsp;&nbsp; &gt; watch for)? It is interesting for different services implementation
<br>&nbsp;&nbsp;&nbsp; &gt; without big limitations, I guess.<br><br>&nbsp;&nbsp;&nbsp; I take it this refers to the IPC layer that is not being used in the<br>&nbsp;&nbsp;&nbsp; GNOME Dapi Daemon (where we use D-BUS). The idea is that all<br>&nbsp;&nbsp;&nbsp; implementations will use the same IPC layer and as far as I know the
<br>&nbsp;&nbsp;&nbsp; current idea is to use D-BUS for this.<br><br><br>The idea is that I don&#39;t want to care if it&#39;s an underlying IPC. Sometime it does not make sense to use IPC (for example with play sound or open!). Still the DBus interface should be provided also, I can (to some extent) agree and vote for it.
<br><br>But async calls are important. And implementation of different static lib version of the abstract api would need an event loop. And we face the very difficult and embarrassing problem to define a common main loop for various things (and other related needs).
<br><br><br>&nbsp;&nbsp;&nbsp; I can only talk about the GNOME part of DAPI but we are currently<br>&nbsp;&nbsp;&nbsp; waiting a bit to see where the D-BUS GLib bindings will go with<br>&nbsp;&nbsp;&nbsp; regards to generating the client side library from the D-BUS<br>
&nbsp;&nbsp;&nbsp; specification XML.<br><br><br>Ok, one flavour with Glib (I suppose you are talking about GObject instead). And what about a plain C implementation that I suggest? That&#39;s the reason why we can say that any flavour of an interface lib should share the description of the main loop dbus currently use. That would be great.
<br><br>Think about it, we could have:<br>- a sound lib that implement the C interface and use pulse or alsa directly<br>&nbsp;&nbsp; - a plain C dapi library using the sound lib (and hence no DBus) OR/AND DBus for other things (that is none of my business if I write C app)
<br>&nbsp;&nbsp; - a dbus daemon using the same sound lib for implementing DBus calls.<br><br>You end up with a nice integration, and still cross-desktop with different flavors choices (choosen by ISV or power user).<br><br>I won&#39;t develop other ideas I have, I would probably regret it later :)
<br><br>Regards,<br><br></span></div>-- <br>Marc-André Lureau, GSmartMix