1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 00:23:32 +02:00

managed patch for libsndfile to support Album and Track tags in WAV files, created by Joel Bouchat <bouchat@hotmail.com>. This patch is on it's way upstream from the author

This commit is contained in:
richardash1981
2013-08-18 20:43:36 +00:00
parent 8867d65df8
commit 1351caba69
4 changed files with 138 additions and 2 deletions

View File

@@ -89,6 +89,8 @@
#define ISRC_MARKER (MAKE_MARKER ('I', 'S', 'R', 'C'))
#define ISBJ_MARKER (MAKE_MARKER ('I', 'S', 'B', 'J'))
#define ICMT_MARKER (MAKE_MARKER ('I', 'C', 'M', 'T'))
#define IAUT_MARKER (MAKE_MARKER ('I', 'A', 'U', 'T'))
#define ITRK_MARKER (MAKE_MARKER ('I', 'T', 'R', 'K'))
/* Weird WAVPACK marker which can show up at the start of the DATA section. */
#define wvpk_MARKER (MAKE_MARKER ('w', 'v', 'p', 'k'))
@@ -1208,6 +1210,14 @@ wav_write_strings (SF_PRIVATE *psf, int location)
psf_binheader_writef (psf, "ms", IGNR_MARKER, psf->strings [k].str) ;
break ;
case SF_STR_ALBUM :
psf_binheader_writef (psf, "ms", IPRD_MARKER, psf->strings [k].str) ;
break ;
case SF_STR_TRACKNUMBER :
psf_binheader_writef (psf, "ms", ITRK_MARKER, psf->strings [k].str) ;
break ;
default :
break ;
} ;
@@ -1338,6 +1348,8 @@ wav_subchunk_parse (SF_PRIVATE *psf, int chunk)
case IPRD_MARKER :
case ISBJ_MARKER :
case ISRC_MARKER :
case IAUT_MARKER :
case ITRK_MARKER :
bytesread += psf_binheader_readf (psf, "4", &dword) ;
dword += (dword & 1) ;
if (dword >= SIGNED_SIZEOF (psf->u.cbuf))
@@ -1434,6 +1446,12 @@ wav_subchunk_parse (SF_PRIVATE *psf, int chunk)
case IGNR_MARKER :
psf_store_string (psf, SF_STR_GENRE, psf->u.cbuf) ;
break ;
case IPRD_MARKER :
psf_store_string (psf, SF_STR_ALBUM, psf->u.cbuf) ;
break ;
case ITRK_MARKER :
psf_store_string (psf, SF_STR_TRACKNUMBER, psf->u.cbuf) ;
break ;
} ;
} ;