Re: [Rhythmbox-devel] GNOME GSoC 09 question


On Mon, Mar 16, 2009 at 3:29 PM, Easwar Hariharan <meindian523 gmail com> wrote:
On Mon, Mar 16, 2009 at 10:09 AM, Alexandre <airmind gmail com> wrote:
> You are going to have problems implementing a separate plugin for this using
> Python. The Rhythmbox internals is not entirely exposed in Python and the
> streaming plugin is written in C. You are going to have difficulties
> interfacing with the plugin in Python, or you'll end up rewriting
> the streaming code in Python to do all you want.

Insurmountable difficulties as in enough difficulties to prevent me
from completing the project during SOC,or difficulties which can be
worked around with a bit of brain wracking?
Difficulties that will probably stop you from completing the project, at least as a separate Python plugin.
If you do want to make this project, I believe the best way would be hacking the plugin in C. But then there are a bunch of complications, such as understanding C, GObject, the source code and how Rhythmbox works. Not that it is not worth it, but it's a lot of trouble. You will probably spend most of your time understanding how everything works.
> First, are you sure you want to detect the better bitrate to choose which to
> play? I know it sounds cool, but in the end you are going to have a lot of
> trouble and the advantadges are really small. For instance, how do you know
> the streaming bitrate? Unless you guess it, you are going to need to
> start the streaming just to know it's bitrate, and you can just sample a few
> bytes, because just as you said VBR can mess the calculations. So you'll
> waste bandwidth, and will make it take longer for the user to start
> listening to the song.

Well,I was planning to assume that Last.FM streams in CBR.....
But then the real advantages are gone. If the code starts assuming a lot, it would need to be fixed anytime changes the stream format (which, btw, is not garanteed to be the same for every stream).
I just think that files on disk would probably have higher quality then the stream.

> And as I said, streaming code is inside the C plugin, which is not
> exposed in Python. You will have to mess with the C plugin, either directly
> implementing the code in C, or trying to expose an API out of the plugin
> (very hard to do IMHO).
> The plugin source code is in
> if you want
> to take a look.

I have the source for RB,though I have to admit I understood zilch of it.

> I think it is work enough, I just dont think it is worth it.

Alexandre,could we discuss this on IRC?Then maybe I will get a better
understanding of the stuff involved.If it's okay with you,please ping
me(easwar/meindian523) on #rhythmbox(or the GNOME SOC channel,if there
is one)
I'm afraid I dont have much time to stay on IRC. If time allows I'll try to get online tonight or tomorrow.

> Can I give another suggestion instead? You could make a plugin that takes
> any feed (such as and
> generates playlists with the Rhythmbox database. This would allow playing
> local music with data from, giving an experience close to
> stations without the streaming. And this could be implemented entirelly as a
> Python plugin, probably as a Rhythmbox source, with some nice GUI on top.
> I would really love if these ( and
> APIs would be accessible that way.

Hmm,the services themselves look interesting,specially the loved
tracks one.What I think I might have a problem with is with
implementing it as a RB source,IIRC,RB is written in glade(that's what
a programmer friend told me),plugin looks easier.
A RB Source is simply a widget inside Rhythmbox, that communicates with the Rhythmbox database. It can, and usually is, implemented as plugins. The tab is a Rhythmbox source, for instance. But it is implemented in C, while you can do it in Python, which is usually much easier.
I'm not sure about Rhythmbox using Glade, but that doesnt matter. A Glade file is a XML representation of a window layout, such as where buttons and trees are located. You can load that representation in your code and it automatically creates the objects for you. Maybe Rhythmbox uses Glade for it's top window, I dont know and it doesnt matter to your plugin, but your plugin could use Glade to create the plugin GUI. Just take a look at the Glade program, it allows you to create user interfaces by drag-and-dropping components at a window.
Why I said that idea is easier to you is especially because all you'll need to handle is a Python plugin. Python is a very good starting point into Gnome and Rhythmbox, and eventually while you learn about the Rhythmbox API, you learn about GObject and how many things fit together.
Btw, there is a great page where to learn about Rhythmbox plugins:
There is a good description of RB Sources, and everything else you'll need to start writing a plugin.

Registered Linux user #442065

Alexandre Rosenfeld


FOG - The Fellowship of the Game

USP São Carlos - EESC/ICMC  
Engenharia de Computação 06
(Computer Engineering Student)

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