src/wav.c : Add ability to write the channel mask.

This commit is contained in:
Erik de Castro Lopo 2009-05-24 08:31:30 +10:00
parent 1d9e276d8e
commit ef85699437
2 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,9 @@
Add wavex_channelmask to WAV_PRIVATE struct and add a function to convert
an array of SF_CHANNEL_MASK_* values into a bit mask for use in WAV files.
* src/wav.c
Add ability to write the channel mask.
2009-05-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* programs/sndfile-info.c

View File

@ -918,6 +918,8 @@ wavex_write_fmt_chunk (SF_PRIVATE *psf)
*/
if (wpriv->wavex_ambisonic != SF_AMBISONIC_NONE)
psf_binheader_writef (psf, "4", 0) ;
else if (wpriv->wavex_channelmask != 0)
psf_binheader_writef (psf, "4", wpriv->wavex_channelmask) ;
else
{ /*
** Ok some liberty is taken here to use the most commonly used channel masks
@ -1262,6 +1264,10 @@ wav_command (SF_PRIVATE *psf, int command, void * UNUSED (data), int datasize)
case SFC_WAVEX_GET_AMBISONIC :
return wpriv->wavex_ambisonic ;
case SFC_SET_CHANNEL_MAP_INFO :
wpriv->wavex_channelmask = wavex_gen_channel_mask (psf->channel_map, psf->sf.channels) ;
return (wpriv->wavex_channelmask != 0) ;
default :
break ;
} ;