hatred for bonobo

Wednesday, Jun 22. 2005  –  Category: Musings

not the gorilla. the object layer in GNOME.

i either hate it, or i have ADD. i’m not sure. maybe i should take the test erik mentioned.

seriously, all i want to do is query bonobo and see what song Rhythmbox (my mp3 player) is playing. this should be a relatively simple piece of C code. i know it’s simple in Python-Gnome. but for the life of me, i can’t figure out how to do it in C. and no, doing:

system("/usr/bin/rhythmbox --print-playing");

doesn’t count.

all the sample bonobo code I can find on the ‘net is circa 2000. sigh. annoying.

3 Responses to “hatred for bonobo”

  1. Geoff Arnold Says:

    Interesting test. And yes, Bonobo sucks.

  2. Craig Says:

    i assume the reason

    system(”/usr/bin/rhythmbox –print-playing”);

    doesnt count is because it will just print the information to stdout. if, however, you do

    FILE* fp = popen(”/usr/bin/rhythmbox –print-playing”, “r”);

    you’ll get a handle to the stdout of the command. you can just run a

    while (fgets(str, length(str), fp))

    to capture all the data rhythmbox prints to stdout. i assume it just prints a string and exits, meaning you get one line of data back. you can then pclose(fp), and use the string however you like. this way it at least looks like you’re doing something cool to interface with rhythmbox, even if you’re not. =b

  3. stevel Says:

    haha. good correction. the reason it doesn’t count is because it’s lame; incorrectness aside, it’s just lame to have to open a pipe to call a program to do something that has a (supposed) C API to use.

Leave a Reply

Comments will be sent to the moderation queue.


Recent posts