Hello and proposal
- From: Nelson Rodriguez <nelfer hotpop com>
- To: drivel-list gnome org
- Subject: Hello and proposal
- Date: Fri, 14 Oct 2005 10:24:22 -0400
Hi,
I'm new to the list. The reason why I joined is because I had recently
installed drivel and I like it.
The only thing is that I'm using a non supported music player (amarok for KDE)
to get the "Listening to".
So I went into checking the source code to see how feasible it is to have
another player. So while looking at the code I realize that it will be better
to have a "generic" form.
This is the idea, somewhere in the configuration screen to add a "Query Music
Player with command:" and let the user enter the command to query the player
(in amarok case is "dcop amarok player NowPlaying").
Then in the query_music_player.c program, create the typical two functions,
one to init and one to query. The one to init will just check if the user
entered a command or not and the one to query will do something like this:
static gchar
*generic_query (void)
{
gchar *nowplaying;
FILE *stream;
stream=popen(COMMAND_ENTERED_BY_THE_USER,"r");
if(stream!=NULL)
{
fgets(nowplaying,254,stream);
pclose(stream);
}
return nowplaying;
}
This way you'll have way more flexibility by letting the user decide how to
query the player, which will also help if the user only wants to show the
artist or just the song, or whatever, even with the supported players.
I had not done any programming in GNOME and that's why I don't even know if
the function will work (i'm just using stdio popen and fgets. I'm not
allocating memory for gchar *nowplaying...I don't know if a gchar is just a
char or what) and I don't know how to modify the configuration screen to have
an entry for the user command.
I tried to do a prototype but when I tried to compile, I don't have in my
environment a bunch of things that drivel requires.
So what do you think?
--
Nelson Rodriguez
Now Listening: Linkin Park - From the Inside
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]