void cd_amarok1_control (MyPlayerControl pControl, const gchar *cFile) { //Permet d'effectuer les actions de bases sur le lecteur GError *erreur = NULL; if (pControl != PLAYER_JUMPBOX && pControl != PLAYER_SHUFFLE && pControl != PLAYER_REPEAT && pControl != PLAYER_ENQUEUE) { g_free (myData.cRawTitle); myData.cRawTitle = NULL; //Reset the title to detect it for sure ;) } gchar *cCommand = NULL; switch (pControl) { case PLAYER_PREVIOUS : cCommand = "dcop amarok player prev"; break; case PLAYER_PLAY_PAUSE : cCommand = "dcop amarok player playPause"; break; case PLAYER_STOP : cCommand = "dcop amarok player stop"; break; case PLAYER_NEXT : cCommand = "dcop amarok player next"; break; case PLAYER_SHUFFLE : cCommand = "dcop amarok playlist shufflePlaylist"; break; case PLAYER_REPEAT : cCommand = g_strdup_printf("dcop amarok player enableRepeatPlaylist %s", cd_dcop_get_boolean("dcop amarok player repeatPlaylistStatu") ? "true" : "false"); /*recuperer le boolean "dcop amarok player repeatPlaylistStatus" puis lancer : "dcop amarok player enableRepeatPlaylist false/true"*/ break; case PLAYER_ENQUEUE : if (cFile != NULL) cCommand = g_strdup_printf ("dcop amarok playlist addMediaList [ \"%s\" ]", cFile); break; default : return; break; } cd_debug ("Handler Amarok 1.4: will use '%s'", cCommand); g_spawn_command_line_async (cCommand, &erreur); if (pControl == PLAYER_ENQUEUE) g_free (cCommand); if (erreur != NULL) { cd_warning ("Attention : when trying to execute command : %s", erreur->message); g_error_free (erreur); CD_APPLET_MAKE_TEMPORARY_EMBLEM_CLASSIC (CAIRO_DOCK_EMBLEM_ERROR, CAIRO_DOCK_EMBLEM_UPPER_LEFT, 5000); } }
void cd_xmms_control (MyPlayerControl pControl, gchar *cFile) { //Permet d'effectuer les actions de bases sur le lecteur GError *erreur = NULL; if (pControl != PLAYER_JUMPBOX && pControl != PLAYER_SHUFFLE && pControl != PLAYER_REPEAT && pControl != PLAYER_ENQUEUE) { g_free (myData.cRawTitle); myData.cRawTitle = NULL; //Reset the title to detect it for sure ;) } gchar *cCommand = NULL; switch (pControl) { case PLAYER_PREVIOUS : cCommand = "xmms -r"; break; case PLAYER_PLAY_PAUSE : cCommand = "xmms -t"; break; case PLAYER_STOP : cCommand = "xmms -s"; break; case PLAYER_NEXT : cCommand = "xmms -f"; break; case PLAYER_JUMPBOX : cCommand = "xmms -j"; break; case PLAYER_SHUFFLE : cCommand = "xmms -S"; break; case PLAYER_REPEAT : cCommand = "xmms -R"; break; case PLAYER_ENQUEUE : if (cFile != NULL) cCommand = g_strdup_printf ("xmms -e %s", cFile); break; } cd_debug ("Handeler XMMS: will use '%s'", cCommand); g_spawn_command_line_async (cCommand, &erreur); if (pControl == PLAYER_ENQUEUE) g_free (cCommand); if (erreur != NULL) { cd_warning ("Attention : when trying to execute command : %s", erreur->message); g_error_free (erreur); CD_APPLET_MAKE_TEMPORARY_EMBLEM_CLASSIC (CAIRO_DOCK_EMBLEM_ERROR, CAIRO_DOCK_EMBLEM_UPPER_LEFT, 5000); } }