Re: [Rhythmbox-devel] Creative Commons plugin



On Sat, 2007-01-06 at 02:03 +0000, Tim Retout wrote:
> On Fri, 2007-01-05 at 01:58 +0100, Jaime Frutos Morales wrote:
> > Is it possible to add a new column called ENTRY_VIEW_COL_LICENSE to the
> > UI (at the same place as title,artist,album,etc...) using python? 
> 
> I'll pass on that one. I don't think so, not in the general 'Library'
> view... but I might be wrong.

You actually can, although you have to add it to each entry view
separately, and it won't show up in the column preferences. We could
probably add a method to register new general columns or something.


So you'll need to iterate over all the sources and call a
add_my_column() function for each, and connect to the signal that gets
emitted so new sources to call it then too.

In the add_my_column() function, get the source's EntryView and then use
the insert_column() function. I think it should work.


> > It would have to check a web for the license for each song.Can it be
> > done in a separate thread using python?
> 
> Not with a separate thread, as far as I know. For fetching stuff from
> the web, though, you can use the GnomeVFS asynchronous methods - see the
> Magnatune plugin for some good examples of these.

We don't have threading enabled in python currently, as no-one has given
us a good reason to turn it on (it's not *hard*, but it's not trivial
either). If you just want to get data in a non-blocking way, use
gnomevfs as Tim suggests.


> > Can it be store in the rhythmbox's database using python?
> 
> This is a tricky one; I started looking at binding rhythmdb to Python,
> but didn't finish it. There are some varargs methods in there, which are
> difficult to write bindings for.
> 
> Perhaps writing a different C interface would be quickest, and binding
> that? I did see that SWIG[0] has some support for vararg methods, but I
> suspect it could be hacky in the general case.

The vararg methods are basically just convenience ones for C.
Unforunately we didn't bother to write the non-convenience ones :)

I've got a half-written patch to fix this, hopefully I'll get it done
soon.


Cheers,

James "Doc" Livingston
-- 
You need only two tools. WD-40 and duct tape. If it doesn't move and it
should, use WD-40. If it moves and shouldn't, use the tape.



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