Re: [Rhythmbox-devel] rb applet

On Wed, 2003-09-10 at 20:07, William Jon McCann wrote:
> Hi,
> I have made an attempt at creating a panel applet for rhythmbox.  It 
> seems to work fairly well considering this is a first try.

Cool!  Thanks for working on this.  I haven't been able to actually get
it to run, mainly because I can't figure out how to run applets built in
a different prefix than my main GNOME installation.

> * There doesn't seem to be an easy way to determine if RB is paused. 
>  From the IDL:
>     long getPlayingTime ();         /* returns -1 if not playing */
> But when a song is paused the playing time just stays the same, and is 
> positive.
> This makes it hard to update the play/pause button state.

Right...I think what you really want is for the applet buttons to match
the rb buttons exactly.  So that would probably mean hooking a signal
into rb-shell-player.c:rb_shell_player_sync_buttons.  You could have it
pass a structure back like

struct RBPlayButtonState 
    gboolean prev_enabled;
    enum {
    } state;
    gboolean next_enabled;

Or maybe alternatively you could pass this as three parameters instead
of using a structure.   Anyways after doing that, then add a handler for
this signal in rb-shell.c, which will then emit it via Bonobo.  Or
something like that.

> * When the applet is added to the panel, RB will restart after it is exited.

Hm, I think you might be able to ask bonobo-activation whether rb is
running before calling a method on it.  

> Please let me know what you think.  This is my first applet so be kind ;).

In general it looks fairly good.  The only issues I really have are that
it doesn't compile with -Wall -Werror, and the code is fairly
procedural, but in rb we use a highly GObject-oriented style.  You don't
have to do this right away, but using GObject makes things a lot more
understandable, even if it is a little bit of a pain to make new

Oh and would be nice if you could add an arch-tag: thing to
the source files.  You can see elsewhere in rb how I chose them; the
main idea is that they should be descriptive and unique.  I can do it if
you would prefer that though.

So anyways, I'd definitely be happy if you committed this to CVS, after
fixing the -Wall -Werror issue.

Thanks again!

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