patches for a unique CD player app



What the attached patches (for gnome-media and gnome-applets) do do is
implement two extra command line options for gnome-cd:

  --unique                               Only start if there isn't already a
                                         CD player application running
  --play                                 Play the CD on startup

The use case for this is an app like magicdev that, when an audio CD
is inserted, if there isn't already a CD player running, starts
gnome-cd and plays the CD. If there is one, simply plays the CD.

The way that --play is implemented is; there is a command line option:
_REDHAT_CD_PLAYER. [Name chosen to avoid treading on toes until
it is more standard]

When a CD player app/applet starts it sees if there is an existing
owner, if not, it claims the selection.  When the current selection
owner goes away, if there are other cd applets/apps running, one of
them takes over ownership of the selection.

This isn't quite finished perfect ... it should be 

 _GNOME_CD_PLAYER:/dev/cdrom

Or maybe even:

 _GNOME_CD_PLAYER:fresnel.devel.redhat.com:/dev/cdrom

But before I tried to tweak it to perfect, I wanted to get a general
reaction to doing this via X properties rather than Bonobo.

The reasons I didn't use Bonobo are:

 - I don't know much about Bonobo; I know a lot about X selections.

 - Bonobo seemed more complex, since I'd need to install IDL files,
   server files, etc. For this simple case, it really seems
   like overkill.

 - I wasn't sure that the right semantics were possible. It's
   not a "unique application"; instead what it is is that the
   behavior of:

    gnome-cd-player --unique

   Depends on whether there are zero cd players displayed currently
   or one or more cd players displayed currently; it's perfectly
   legitimate to have both the cd-player applet and gnome-cd
   running at the same time.

   It also is explicitely per-display, not per-user, per-home-dir
   or whatever.

 - The X based protocol is more friendly to outside-of-GNOME 
   cooperation; I don't have much expectation of getting this
   standardized... it's a bit too specialized to have a special
   mechanism for. But I don't want to cut off the possibility
   for no good reason.

Note that this is *not* the "CD player service" situation that
has featured as a desktop example forever. This isn't about
how to play a CD. It's about how to get a GUI for CD playing
up on the screen without duplication.

If non-Bonobo isn't acceptable, I don't expect to have the time
to rewrite it using Bonobo, but it's really the behavior I
care about, not the implementation mechanism

Thansk,

                                    Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]