Interpreting CDRWIN command FLAGS

This commit is contained in:
Thomas Schmitt 2012-01-01 12:46:50 +00:00
parent a1f18ad44e
commit 0c3fa9b341
4 changed files with 63 additions and 13 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2012.01.01.124424" #define Cdrskin_timestamP "2012.01.01.124645"

View File

@ -643,18 +643,21 @@ CATALOG 1234567890123
FILE "cdtext.bin" BINARY FILE "cdtext.bin" BINARY
TITLE "Joyful Nights" TITLE "Joyful Nights"
TRACK 01 AUDIO TRACK 01 AUDIO
FLAGS DCP 4CH PRE
TITLE "Song of Joy" TITLE "Song of Joy"
PERFORMER "Felix and The Purrs" PERFORMER "Felix and The Purrs"
SONGWRITER "Friedrich Schiller" SONGWRITER "Friedrich Schiller"
ISRC XYBLG1101234 ISRC XYBLG1101234
INDEX 01 00:00:00 INDEX 01 00:00:00
TRACK 02 AUDIO TRACK 02 AUDIO
FLAGS DCP
TITLE "Humpty Dumpty" TITLE "Humpty Dumpty"
PERFORMER "Catwalk Beauties" PERFORMER "Catwalk Beauties"
SONGWRITER "Mother Goose" SONGWRITER "Mother Goose"
ISRC XYBLG1100005 ISRC XYBLG1100005
INDEX 01 08:20:12 INDEX 01 08:20:12
TRACK 03 AUDIO TRACK 03 AUDIO
FLAGS DCP
TITLE "Mee Owwww" TITLE "Mee Owwww"
PERFORMER "Mia Kitten" PERFORMER "Mia Kitten"
SONGWRITER "Mia Kitten" SONGWRITER "Mia Kitten"
@ -665,13 +668,13 @@ TITLE "Joyful Nights"
Several restrictions apply in the libburn call burn_session_by_cue_file(): Several restrictions apply in the libburn call burn_session_by_cue_file():
Commands FLAGS, POSTGAP, PREGAP are ignored. Only FILE types BINARY, MOTOROLA Commands POSTGAP, PREGAP are ignored. Only FILE types BINARY, MOTOROLA are
are allowed. Only TRACK datatypes AUDIO, MODE1/2048 are allowed. They may not allowed. Only TRACK datatypes AUDIO, MODE1/2048 are allowed. They may not
be mixed in the same session. INDEX numbers 00, 02 to 99 are ignored. be mixed in the same session. INDEX numbers 00, 02 to 99 are ignored.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
This text is copyright 2011 Thomas Schmitt <scdbackup@gmx.net>. This text is copyright 2011 - 2012 Thomas Schmitt <scdbackup@gmx.net>.
Permission is granted to copy, modify, and distribute it, as long as the Permission is granted to copy, modify, and distribute it, as long as the
references to the original information sources are maintained. references to the original information sources are maintained.
There is NO WARRANTY, to the extent permitted by law. There is NO WARRANTY, to the extent permitted by law.

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net> Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
This is the official API definition of libburn. This is the official API definition of libburn.
@ -123,6 +123,8 @@ struct burn_write_opts;
/* ts B11230 */ /* ts B11230 */
/** Track mode modifier - Serial Copy Management System, SAO only /** Track mode modifier - Serial Copy Management System, SAO only
If this is set and BURN_COPY is not set, then copying the emerging
track will be forbidden.
@since 1.2.0 @since 1.2.0
*/ */
#define BURN_SCMS (1 << 13) #define BURN_SCMS (1 << 13)
@ -1862,18 +1864,19 @@ int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s);
CD-TEXT according to the content of the file. CD-TEXT according to the content of the file.
For a description of CDRWIN file format see For a description of CDRWIN file format see
http://digitalx.org/cue-sheet/syntax/ http://digitalx.org/cue-sheet/syntax/
>>> supported commands: CATALOG CDTEXTFILE ISRC PERFORMER REM SONGWRITER TITLE >>> fully supported commands: CATALOG CDTEXTFILE FLAGS ISRC PERFORMER REM
>>> SONGWRITER TITLE
>>> partly supported commands: FILE INDEX TRACK >>> partly supported commands: FILE INDEX TRACK
>>> supported FILE types: BINARY MOTOROLA >>> supported FILE types: BINARY MOTOROLA
>>> supported FLAGS:
>>> supported TRACK datatypes: AUDIO MODE1/2048 >>> supported TRACK datatypes: AUDIO MODE1/2048
>>> ignored commands: POSTGAP PREGAP FLAGS >>> ignored commands: POSTGAP PREGAP
>>> ignored INDEX numbers: 00, 02 to 99 >>> ignored INDEX numbers: 00, 02 to 99
>>> ignored FLAGS: DCP 4CH PRE SCMS
>>> not allowed: mixing of ADUIO and MODE1/2048 >>> not allowed: mixing of ADUIO and MODE1/2048
>>> not allowed: unsupported FILE types >>> not allowed: unsupported FILE types
>>> not allowed: unsupported TRACK datatypes >>> not allowed: unsupported TRACK datatypes
>>> >>>
>>> man cdrecord documents further commands:
>>> ARRANGER COMPOSER MESSAGE
>>> >>>
@param session Session where to attach tracks. It must not yet have @param session Session where to attach tracks. It must not yet have
tracks or else this call will fail. tracks or else this call will fail.

View File

@ -1,6 +1,6 @@
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net> Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
*/ */
@ -1028,6 +1028,7 @@ struct burn_cue_file_cursor {
int track_has_source; int track_has_source;
int block_size; int block_size;
int block_size_locked; int block_size_locked;
int track_mode;
int flags; int flags;
}; };
@ -1058,6 +1059,7 @@ static int cue_crs_new(struct burn_cue_file_cursor **reply, int flag)
crs->track_has_source = 0; crs->track_has_source = 0;
crs->block_size = 0; crs->block_size = 0;
crs->block_size_locked = 0; crs->block_size_locked = 0;
crs->track_mode = 0;
crs->flags = 0; crs->flags = 0;
*reply = crs; *reply = crs;
@ -1266,7 +1268,7 @@ static int cue_interpret_line(struct burn_session *session, char *line,
struct burn_cue_file_cursor *crs, int flag) struct burn_cue_file_cursor *crs, int flag)
{ {
int ret, mode, index_no, minute, second, frame, file_ba, chunks; int ret, mode, index_no, minute, second, frame, file_ba, chunks;
int block_size; int block_size, step;
off_t size; off_t size;
char *cmd, *apt, *msg = NULL, msf[3], *msf_pt, *cpt, *filetype; char *cmd, *apt, *msg = NULL, msf[3], *msf_pt, *cpt, *filetype;
struct burn_source *src, *inp_src; struct burn_source *src, *inp_src;
@ -1388,8 +1390,49 @@ not_usable_file:;
goto ex; goto ex;
} else if (strcmp(cmd, "FLAGS") == 0) { } else if (strcmp(cmd, "FLAGS") == 0) {
if (crs->track == NULL) {
libdax_msgs_submit(libdax_messenger, -1, 0x00020192,
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
"In cue sheet file: FLAGS found before TRACK",
0, 0);
ret = 0; goto ex;
}
while (*apt) {
if (strncmp(apt, "DCP", 3) == 0) {
crs->track_mode |= BURN_COPY;
step = 3;
} else if (strncmp(apt, "4CH", 3) == 0) {
crs->track_mode |= BURN_4CH;
step = 3;
} else if (strncmp(apt, "PRE", 3) == 0) {
crs->track_mode |= BURN_PREEMPHASIS;
step = 3;
} else if (strncmp(apt, "SCMS", 4) == 0) {
crs->track_mode |= BURN_SCMS;
step = 4;
} else {
bad_flags:;
for (cpt = apt;
*cpt != 32 && *cpt != 9 && *cpt != 0; cpt++);
*cpt = 0;
sprintf(msg,
"In cue sheet file: Unknown FLAGS option '%.4000s'",
apt);
libdax_msgs_submit(libdax_messenger, -1,
0x00020194,
LIBDAX_MSGS_SEV_FAILURE,
LIBDAX_MSGS_PRIO_HIGH,
burn_printify(msg), 0, 0);
ret = 0; goto ex;
}
/* >>> Interpret DCP 4CH PRE SCMS into crs->flags */; /* Look for start of next word */
if (apt[step] != 0 && apt[step] != 32 &&
apt[step] != 9)
goto bad_flags;
for (apt += step; *apt == 32 || *apt == 9; apt++);
}
burn_track_define_data(crs->track, 0, 0, 1, crs->track_mode);
} else if (strcmp(cmd, "INDEX") == 0) { } else if (strcmp(cmd, "INDEX") == 0) {
if (crs->track == NULL) { if (crs->track == NULL) {
@ -1608,8 +1651,9 @@ overlapping_ba:;
if (crs->track == NULL) if (crs->track == NULL)
goto out_of_mem; goto out_of_mem;
crs->track_has_source = 0; crs->track_has_source = 0;
crs->track_mode = mode;
burn_track_define_data(crs->track, 0, 0, 1, mode); burn_track_define_data(crs->track, 0, 0, 1, mode);
if (mode == BURN_AUDIO) if (mode & BURN_AUDIO)
burn_track_set_byte_swap(crs->track, burn_track_set_byte_swap(crs->track,
!!crs->swap_audio_bytes); !!crs->swap_audio_bytes);