shithub: opus-tools

Download patch

ref: 2df05010cd766652a3f4e83d3bfc87f15f29d415
parent: 37016e01527e98e3d2240d0d49454a4abc5631c5
author: moisesmcardona <moises@moises-studios.com>
date: Sat Sep 15 11:59:22 EDT 2018

opusenc: Add --tracknumber option

Closes https://github.com/xiph/opus-tools/pull/37
Signed-off-by: Mark Harris <mark.hsj@gmail.com>

--- a/man/opusenc.1
+++ b/man/opusenc.1
@@ -57,6 +57,9 @@
 .B --album
 .I 'album title'
 ] [
+.B --tracknumber
+.I 'track number'
+] [
 .B --genre
 .I genre
 ] [
@@ -207,6 +210,9 @@
 .IP "--album album"
 Set the album or collection title field to
 .I album
+.IP "--tracknumber N"
+Set the track number comment field to
+.I N
 .IP "--date YYYY-MM-DD"
 Set the date comment field to
 .I YYYY-MM-DD.
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -158,6 +158,7 @@
   printf(" --title title      Set track title\n");
   printf(" --artist artist    Set artist or author, may be used multiple times\n");
   printf(" --album album      Set album or collection\n");
+  printf(" --tracknumber n    Set track number\n");
   printf(" --genre genre      Set genre, may be used multiple times\n");
   printf(" --date YYYY-MM-DD  Set date of track (YYYY, YYYY-MM, or YYYY-MM-DD)\n");
   printf(" --comment tag=val  Add the given string as an extra comment\n");
@@ -385,6 +386,7 @@
     {"artist", required_argument, NULL, 0},
     {"title", required_argument, NULL, 0},
     {"album", required_argument, NULL, 0},
+    {"tracknumber", required_argument, NULL, 0},
     {"date", required_argument, NULL, 0},
     {"genre", required_argument, NULL, 0},
     {"picture", required_argument, NULL, 0},
@@ -662,6 +664,7 @@
         } else if (strcmp(optname, "artist") == 0 ||
                    strcmp(optname, "title") == 0 ||
                    strcmp(optname, "album") == 0 ||
+                   strcmp(optname, "tracknumber") == 0 ||
                    strcmp(optname, "date") == 0 ||
                    strcmp(optname, "genre") == 0) {
           save_cmd=0;