[Rhythmbox-devel] RhythmDB::entry-extra-metadata-gather and python plugins


I've tried to provide extra metadata to rhythmbox from a Python plugin,
by simply connecting a handler to the
RhythmDB::entry-extra-metadata-gather signal, so I could insert a new
key-value par to the metadata hash table.

However, it seems like I can't really modify the metadata hashtable from
python, because in the callback I connected, metadata is only a
gobject.GBoxed, for which repr() reports a "<GHashTable at 0x81491c0>".

To clarify things, the problem is that the C signature:

  extra_metadata_gather_cb (RhythmDB      *db, 
                            RhythmDBEntry *entry,
                            GHashTable    *metadata,
                            gpointer      *userdata);

In python becomes

  def extra_metadata_gather_cb (self, db, entry, metadata)


  db:       RhythmDBTree
  entry:    RhythmDBEntry
  metadata: gobject.GBoxed (holding a GHashTable).

And therefore, metadata is not modifiable from the python plugin, and it
seems to me that this signal renders useless in python (as the main idea
behind it is to be able to insert key-value pairs to the metadata

I'm a bit stuck with this, as I'm not really proficient with python and
wrappers. The main reason why I'm doing this in python instead of C, is
because I am extending an already existing python plugin.

Do you have any suggestions to overcome this situation, or this would
need to add some API to rhythmbox?

Thanks a lot,


Claudio Saavedra <csaavedra alumnos utalca cl>

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