Transmitting CATALOG by mode page 5. ISRC too, if TAO.
This commit is contained in:
@ -340,7 +340,7 @@ int burn_drive_send_default_page_05(struct burn_drive *d, int flag)
|
||||
else
|
||||
burn_write_opts_set_write_type(opts,
|
||||
BURN_WRITE_SAO, BURN_BLOCK_SAO);
|
||||
d->send_write_parameters(d, opts);
|
||||
d->send_write_parameters(d, NULL, 0, opts);
|
||||
burn_write_opts_free(opts);
|
||||
d->sent_default_page_05 = 1;
|
||||
return 1;
|
||||
@ -2469,7 +2469,7 @@ int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
if (d->drive_role != 1)
|
||||
return 0;
|
||||
if (o != NULL)
|
||||
d->send_write_parameters(d, o);
|
||||
d->send_write_parameters(d, NULL, 0, o);
|
||||
ret = d->get_nwa(d, trackno, lba, nwa);
|
||||
return ret;
|
||||
}
|
||||
@ -2522,7 +2522,7 @@ off_t burn_disc_available_space(struct burn_drive *d,
|
||||
(off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048);
|
||||
} else {
|
||||
if (o != NULL)
|
||||
d->send_write_parameters(d, o);
|
||||
d->send_write_parameters(d, NULL, 0, o);
|
||||
d->get_nwa(d, -1, &lba, &nwa);
|
||||
}
|
||||
if (o != NULL) {
|
||||
|
@ -1855,15 +1855,13 @@ int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s);
|
||||
CD-TEXT according to the content of the file.
|
||||
For a description of CDRWIN file format see
|
||||
http://digitalx.org/cue-sheet/syntax/
|
||||
>>> supported commands: CDTEXTFILE PERFORMER REM SONGWRITER TITLE
|
||||
>>> partly supported commands: CATALOG FILE ISRC INDEX TRACK
|
||||
>>> supported commands: CATALOG CDTEXTFILE ISRC PERFORMER REM SONGWRITER TITLE
|
||||
>>> partly supported commands: FILE INDEX TRACK
|
||||
>>> supported FILE types: BINARY MOTOROLA
|
||||
>>> supported FLAGS:
|
||||
>>> supported TRACK datatypes: AUDIO MODE1/2048
|
||||
>>> ignored commands: POSTGAP PREGAP FLAGS
|
||||
>>> ignored INDEX numbers: 00, 02 to 99
|
||||
>>> ignored CUE SHEET features: CATALOG and ISRC
|
||||
>>> (not yet transmitted by mode page 5)
|
||||
>>> ignored FLAGS: DCP 4CH PRE SCMS
|
||||
>>> not allowed: mixing of ADUIO and MODE1/2048
|
||||
>>> not allowed: unsupported FILE types
|
||||
|
@ -539,7 +539,7 @@ void mmc_close_disc(struct burn_write_opts *o)
|
||||
/* a ssert(o->drive == d); */
|
||||
|
||||
o->multi = 0;
|
||||
spc_select_write_params(d, o);
|
||||
spc_select_write_params(d, NULL, 0, o);
|
||||
mmc_close(d, 1, 0);
|
||||
}
|
||||
|
||||
@ -560,7 +560,7 @@ void mmc_close_session(struct burn_write_opts *o)
|
||||
/* a ssert(o->drive == d); */
|
||||
|
||||
o->multi = 3;
|
||||
spc_select_write_params(d, o);
|
||||
spc_select_write_params(d, NULL, 0, o);
|
||||
mmc_close(d, 1, 0);
|
||||
}
|
||||
|
||||
@ -3981,10 +3981,14 @@ int mmc_get_write_performance(struct burn_drive *d)
|
||||
memset(pd, 0, 2 + d->mdata->write_page_length);
|
||||
is the eventual duty of the caller.
|
||||
*/
|
||||
int mmc_compose_mode_page_5(struct burn_drive *d,
|
||||
const struct burn_write_opts *o,
|
||||
int mmc_compose_mode_page_5(struct burn_drive *d, struct burn_session *s,
|
||||
int tno, const struct burn_write_opts *o,
|
||||
unsigned char *pd)
|
||||
{
|
||||
unsigned char *catalog = NULL;
|
||||
char isrc_text[13];
|
||||
struct isrc *isrc;
|
||||
|
||||
pd[0] = 5;
|
||||
pd[1] = d->mdata->write_page_length;
|
||||
|
||||
@ -4094,6 +4098,39 @@ fprintf(stderr, "libburn_EXPERIMENTAL: block_type = %d, pd[4]= %u\n",
|
||||
/*XXX need session format! */
|
||||
/* ts A61229 : but session format (pd[8]) = 0 seems ok */
|
||||
|
||||
/* Media Catalog Number at byte 16 to 31,
|
||||
MMC-5, 7.5, Tables 664, 670
|
||||
*/
|
||||
if (o->has_mediacatalog)
|
||||
catalog = (unsigned char *) o->mediacatalog;
|
||||
else if (s != NULL) {
|
||||
if (s->mediacatalog[0])
|
||||
catalog = s->mediacatalog;
|
||||
}
|
||||
if (catalog != NULL && d->mdata->write_page_length >= 30) {
|
||||
pd[16] = 0x80; /* MCVAL */
|
||||
memcpy(pd + 17, catalog, 13);
|
||||
}
|
||||
|
||||
/* ISRC at bytes 32 to 47. Tables 664, 671 */
|
||||
isrc_text[0] = 0;
|
||||
if (s != NULL && o->write_type == BURN_WRITE_TAO)
|
||||
if (tno >= 1 && tno <= s->tracks)
|
||||
if (s->track[tno - 1]->isrc.has_isrc) {
|
||||
isrc = &(s->track[tno - 1]->isrc);
|
||||
isrc_text[0] = isrc->country[0];
|
||||
isrc_text[1] = isrc->country[1];
|
||||
isrc_text[2] = isrc->owner[0];
|
||||
isrc_text[3] = isrc->owner[1];
|
||||
isrc_text[4] = isrc->owner[2];
|
||||
sprintf(isrc_text + 5, "%-2.2u%-5.5u",
|
||||
(unsigned int) isrc->year,
|
||||
isrc->serial);
|
||||
}
|
||||
if (isrc_text[0] != 0 && d->mdata->write_page_length >= 46) {
|
||||
pd[32] = 0x80; /* TCVAL */
|
||||
memcpy(pd + 33, isrc_text, 12);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ int mmc_get_write_performance(struct burn_drive *d);
|
||||
is the eventual duty of the caller.
|
||||
*/
|
||||
int mmc_compose_mode_page_5(struct burn_drive *d,
|
||||
struct burn_session *s, int tno,
|
||||
const struct burn_write_opts *o,
|
||||
unsigned char *pd);
|
||||
|
||||
|
@ -721,8 +721,8 @@ Although command MODE SELECT is SPC, the content of the
|
||||
Write Parameters Mode Page (05h) is MMC (Table 108 in MMC-1).
|
||||
Thus the filling of the mode page is done by mmc_compose_mode_page_5().
|
||||
*/
|
||||
void spc_select_write_params(struct burn_drive *d,
|
||||
const struct burn_write_opts *o)
|
||||
void spc_select_write_params(struct burn_drive *d, struct burn_session *s,
|
||||
int tno, const struct burn_write_opts *o)
|
||||
{
|
||||
struct buffer *buf = NULL;
|
||||
struct command *c = NULL;
|
||||
@ -779,7 +779,7 @@ void spc_select_write_params(struct burn_drive *d,
|
||||
c->page->bytes = alloc_len;
|
||||
|
||||
/* ts A61229 */
|
||||
if (mmc_compose_mode_page_5(d, o, c->page->data + 8) <= 0)
|
||||
if (mmc_compose_mode_page_5(d, s, tno, o, c->page->data + 8) <= 0)
|
||||
goto ex;
|
||||
|
||||
c->dir = TO_DRIVE;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -21,6 +21,7 @@ void spc_select_error_params(struct burn_drive *,
|
||||
void spc_getcaps(struct burn_drive *d);
|
||||
void spc_sense_write_params(struct burn_drive *);
|
||||
void spc_select_write_params(struct burn_drive *,
|
||||
struct burn_session *, int,
|
||||
const struct burn_write_opts *);
|
||||
void spc_probe_write_modes(struct burn_drive *);
|
||||
void spc_request_sense(struct burn_drive *d, struct buffer *buf);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -381,6 +381,7 @@ struct burn_drive
|
||||
void (*send_parameters) (struct burn_drive *,
|
||||
const struct burn_read_opts *);
|
||||
void (*send_write_parameters) (struct burn_drive *,
|
||||
struct burn_session *, int tno,
|
||||
const struct burn_write_opts *);
|
||||
void (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
|
||||
|
||||
|
Reference in New Issue
Block a user