[PATCH 7/9] main.c: Teaching main.c to handle new "skip forward/backward 5 seconds"

Kristoffer Sederlof <[email protected]> Sat, 27 Aug 2005 23:35:45 +0300 (EEST)
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
Howdy!

This patch does four things:

    1. Adds the "-F" and "--Fwd" respective "-B" and "--Back" switches
       to "xmms-1.2.10/xmms/main.c" help section.

    2. Re-orders the getopt_long part to match the code order.

    3. Adds the "-F" and "-B" switches to getopt_long

    4. Adds missing "-i" to getopt_long

Please consider applying.

Signed-off-by: Kristoffer Sederlöf <[email protected]>
---
diff -Nru ./xmms-1.2.10/xmms/main.c.orig ./xmms-1.2.10/xmms/main.c > main.c.patch

--- ./xmms-1.2.10/xmms/main.c.orig	2005-08-09 23:13:54.000000000 +0300
+++ ./xmms-1.2.10/xmms/main.c	2005-08-27 17:43:32.000000000 +0300
@@ -3208,6 +3208,8 @@
 	{"play-pause", 0, NULL, 't'},
 	{"stop", 0, NULL, 's'},
 	{"fwd", 0, NULL, 'f'},
+	{"Fwd", 0, NULL, 'F'},
+	{"Back", 0, NULL, 'B'},
 	{"enqueue", 0, NULL, 'e'},
 	{"show-main-window", 0, NULL, 'm'},
 	{"version", 0, NULL, 'v'},
@@ -3244,6 +3246,12 @@
 	fprintf(stderr, "\n-f, --fwd		");
 	/* -f, --fwd switch */
 	fprintf(stderr, _("Skip forward in playlist"));
+	fprintf(stderr, "\n-F, --Fwd		");
+	/* -F, --Forward 5 seconds  */
+	fprintf(stderr, _("Skip 5 seconds forward in current song"));
+	fprintf(stderr, "\n-B, --Back		");
+	/* -B, --Back 5 seconds */
+	fprintf(stderr, _("Skip 5 seconds backwords in current song"));
 	fprintf(stderr, "\n-e, --enqueue		");
 	/* -e, --enqueue switch */
 	fprintf(stderr, _("Don't clear the playlist"));
@@ -3264,6 +3272,7 @@
 	GList *filenames;
 	int session;
 	gboolean play, stop, pause, fwd, rew, play_pause;
+	gboolean fwd5sec, back5sec;
 	gboolean enqueue, mainwin, remote;
 	char *previous_session_id;
 };
@@ -3275,7 +3284,7 @@

 	memset(opt, 0, sizeof(struct cmdlineopt));
 	opt->session = -1;
-	while ((c = getopt_long(argc, argv, "hn:rpusfemvt", long_options, NULL)) != -1)
+	while ((c = getopt_long(argc, argv, "hn:rpusfFBtmevi", long_options, NULL)) != -1)
 	{
 		switch (c)
 		{
@@ -3300,6 +3309,12 @@
 			case 'f':
 				opt->fwd = TRUE;
 				break;
+			case 'F':
+				opt->fwd5sec = TRUE;
+				break;
+			case 'B':
+				opt->back5sec = TRUE;
+				break;
 			case 't':
 				opt->play_pause = TRUE;
 				break;
@@ -3376,6 +3391,10 @@
 		xmms_remote_stop(opt->session);
 	if (opt->fwd)
 		xmms_remote_playlist_next(opt->session);
+	if (opt->fwd5sec)
+		xmms_remote_fwd5sec(opt->session);
+	if (opt->back5sec)
+		xmms_remote_back5sec(opt->session);
 	if (opt->play_pause)
 		xmms_remote_play_pause(opt->session);
 	if (opt->mainwin)

_______________________________________________
xmms-devel mailing list
[email protected]
http://lists.xmms.org/mailman/listinfo/xmms-devel