FS-4657 --resolve update libsndfile to its latest master

This commit is contained in:
Jeff Lenk committed 2014-02-21 16:10:32 -06:00
1 parent 0c1f6ef2ed
commit 199a64bf6a
291 files changed
+25965 -5744

No files matched your search

+4 -1
View File
@@ -209,7 +209,7 @@
#define PACKAGE_VERSION "1.0.12"
/* Set to maximum allowed value of sf_count_t type. */
#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFi64
//#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFi64
/* The size of a `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
@@ -265,6 +265,8 @@
/* Version number of package */
#define VERSION "1.0.18"
#define HAVE_STDINT_H 1
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
@@ -280,6 +282,7 @@ typedef __int32 int32_t;
typedef intptr_t ssize_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#define PRId64 "I64d"
#define __func__ __FUNCTION__
#define snprintf _snprintf
@@ -116,12 +116,24 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\libsndfile\src\aiff.c" />
<ClCompile Include="..\..\libsndfile\src\alac.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_enc.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ALACBitUtilities.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_decoder.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_encoder.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_enc.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_enc.c" />
<ClCompile Include="..\..\libsndfile\src\alaw.c" />
<ClCompile Include="..\..\libsndfile\src\au.c" />
<ClCompile Include="..\..\libsndfile\src\audio_detect.c" />
<ClCompile Include="..\..\libsndfile\src\avr.c" />
<ClCompile Include="..\..\libsndfile\src\broadcast.c" />
<ClCompile Include="..\..\libsndfile\src\caf.c" />
<ClCompile Include="..\..\libsndfile\src\cart.c" />
<ClCompile Include="..\..\libsndfile\src\chanmap.c" />
<ClCompile Include="..\..\libsndfile\src\chunk.c" />
<ClCompile Include="..\..\libsndfile\src\command.c" />
<ClCompile Include="..\..\libsndfile\src\common.c" />
@@ -144,6 +156,7 @@
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\gsm610.c" />
<ClCompile Include="..\..\libsndfile\src\htk.c" />
<ClCompile Include="..\..\libsndfile\src\id3.c" />
<ClCompile Include="..\..\libsndfile\src\ima_adpcm.c" />
<ClCompile Include="..\..\libsndfile\src\ima_oki_adpcm.c" />
<ClCompile Include="..\..\libsndfile\src\ircam.c" />
@@ -194,6 +207,9 @@
<ClCompile Include="..\..\libsndfile\src\G72x\g72x.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libsndfile\src\ALAC\ALACAudioTypes.h" />
<ClInclude Include="..\..\libsndfile\src\ALAC\dplib.h" />
<ClInclude Include="..\..\libsndfile\src\chanmap.h" />
<ClInclude Include="..\..\libsndfile\src\ima_oki_adpcm.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
@@ -19,6 +19,9 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
<Filter Include="Source Files\ALLAC Sources">
<UniqueIdentifier>{f00f84d5-78ae-4996-bee3-00106a731232}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\libsndfile\src\aiff.c">
@@ -225,10 +228,58 @@
<ClCompile Include="..\..\libsndfile\src\G72x\g72x.c">
<Filter>Source Files\G72X Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\id3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\chanmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\cart.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\alac.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_encoder.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ALACBitUtilities.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_decoder.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libsndfile\src\ima_oki_adpcm.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\chanmap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\ALAC\ALACAudioTypes.h">
<Filter>Source Files\ALLAC Sources</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\ALAC\dplib.h">
<Filter>Source Files\ALLAC Sources</Filter>
</ClInclude>
</ItemGroup>
</Project>
+18 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@@ -120,12 +120,24 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\libsndfile\src\aiff.c" />
<ClCompile Include="..\..\libsndfile\src\alac.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_enc.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\ALACBitUtilities.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_decoder.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_encoder.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_enc.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_dec.c" />
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_enc.c" />
<ClCompile Include="..\..\libsndfile\src\alaw.c" />
<ClCompile Include="..\..\libsndfile\src\au.c" />
<ClCompile Include="..\..\libsndfile\src\audio_detect.c" />
<ClCompile Include="..\..\libsndfile\src\avr.c" />
<ClCompile Include="..\..\libsndfile\src\broadcast.c" />
<ClCompile Include="..\..\libsndfile\src\caf.c" />
<ClCompile Include="..\..\libsndfile\src\cart.c" />
<ClCompile Include="..\..\libsndfile\src\chanmap.c" />
<ClCompile Include="..\..\libsndfile\src\chunk.c" />
<ClCompile Include="..\..\libsndfile\src\command.c" />
<ClCompile Include="..\..\libsndfile\src\common.c" />
@@ -148,6 +160,7 @@
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\gsm610.c" />
<ClCompile Include="..\..\libsndfile\src\htk.c" />
<ClCompile Include="..\..\libsndfile\src\id3.c" />
<ClCompile Include="..\..\libsndfile\src\ima_adpcm.c" />
<ClCompile Include="..\..\libsndfile\src\ima_oki_adpcm.c" />
<ClCompile Include="..\..\libsndfile\src\ircam.c" />
@@ -198,9 +211,12 @@
<ClCompile Include="..\..\libsndfile\src\G72x\g72x.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libsndfile\src\ALAC\ALACAudioTypes.h" />
<ClInclude Include="..\..\libsndfile\src\ALAC\dplib.h" />
<ClInclude Include="..\..\libsndfile\src\chanmap.h" />
<ClInclude Include="..\..\libsndfile\src\ima_oki_adpcm.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -19,6 +19,9 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
<Filter Include="Source Files\ALLAC Sources">
<UniqueIdentifier>{f00f84d5-78ae-4996-bee3-00106a731232}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\libsndfile\src\aiff.c">
@@ -225,10 +228,58 @@
<ClCompile Include="..\..\libsndfile\src\G72x\g72x.c">
<Filter>Source Files\G72X Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\id3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\chanmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\cart.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\alac.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ag_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_encoder.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\ALACBitUtilities.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\dp_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_dec.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\matrix_enc.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
<ClCompile Include="..\..\libsndfile\src\ALAC\alac_decoder.c">
<Filter>Source Files\ALLAC Sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libsndfile\src\ima_oki_adpcm.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\chanmap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\ALAC\ALACAudioTypes.h">
<Filter>Source Files\ALLAC Sources</Filter>
</ClInclude>
<ClInclude Include="..\..\libsndfile\src\ALAC\dplib.h">
<Filter>Source Files\ALLAC Sources</Filter>
</ClInclude>
</ItemGroup>
</Project>
+250 -45
View File
@@ -1,5 +1,5 @@
/*
** Copyright (C) 1999-2009 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
@@ -105,6 +105,11 @@ enum
SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */
SF_FORMAT_ALAC_16 = 0x0070, /* Apple Lossless Audio Codec (16 bit). */
SF_FORMAT_ALAC_20 = 0x0071, /* Apple Lossless Audio Codec (20 bit). */
SF_FORMAT_ALAC_24 = 0x0072, /* Apple Lossless Audio Codec (24 bit). */
SF_FORMAT_ALAC_32 = 0x0073, /* Apple Lossless Audio Codec (32 bit). */
/* Endian-ness options. */
SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */
@@ -192,6 +197,11 @@ enum
SFC_WAVEX_GET_AMBISONIC = 0x1201,
SFC_SET_VBR_ENCODING_QUALITY = 0x1300,
SFC_SET_COMPRESSION_LEVEL = 0x1301,
/* Cart Chunk support */
SFC_SET_CART_INFO = 0x1400,
SFC_GET_CART_INFO = 0x1401,
/* Following commands for testing only. */
SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001,
@@ -199,7 +209,7 @@ enum
/*
** SFC_SET_ADD_* values are deprecated and will disappear at some
** time in the future. They are guaranteed to be here up to and
** including version 1.0.8 to avoid breakage of existng software.
** including version 1.0.8 to avoid breakage of existing software.
** They currently do nothing and will continue to do nothing.
*/
SFC_SET_ADD_DITHER_ON_WRITE = 0x1070,
@@ -221,7 +231,9 @@ enum
SF_STR_COMMENT = 0x05,
SF_STR_DATE = 0x06,
SF_STR_ALBUM = 0x07,
SF_STR_LICENSE = 0x08
SF_STR_LICENSE = 0x08,
SF_STR_TRACKNUMBER = 0x09,
SF_STR_GENRE = 0x10
} ;
/*
@@ -230,7 +242,7 @@ enum
*/
#define SF_STR_FIRST SF_STR_TITLE
#define SF_STR_LAST SF_STR_LICENSE
#define SF_STR_LAST SF_STR_GENRE
enum
{ /* True and false */
@@ -267,27 +279,34 @@ enum
enum
{ SF_CHANNEL_MAP_INVALID = 0,
SF_CHANNEL_MAP_MONO = 1,
SF_CHANNEL_MAP_LEFT,
SF_CHANNEL_MAP_RIGHT,
SF_CHANNEL_MAP_CENTER,
SF_CHANNEL_MAP_LEFT, /* Apple calls this 'Left' */
SF_CHANNEL_MAP_RIGHT, /* Apple calls this 'Right' */
SF_CHANNEL_MAP_CENTER, /* Apple calls this 'Center' */
SF_CHANNEL_MAP_FRONT_LEFT,
SF_CHANNEL_MAP_FRONT_RIGHT,
SF_CHANNEL_MAP_FRONT_CENTER,
SF_CHANNEL_MAP_REAR_CENTER,
SF_CHANNEL_MAP_REAR_LEFT,
SF_CHANNEL_MAP_REAR_RIGHT,
SF_CHANNEL_MAP_LFE,
SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,
SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,
SF_CHANNEL_MAP_SIDE_LEFT,
SF_CHANNEL_MAP_SIDE_RIGHT,
SF_CHANNEL_MAP_TOP_CENTER,
SF_CHANNEL_MAP_TOP_FRONT_LEFT,
SF_CHANNEL_MAP_TOP_FRONT_RIGHT,
SF_CHANNEL_MAP_TOP_FRONT_CENTER,
SF_CHANNEL_MAP_TOP_REAR_LEFT,
SF_CHANNEL_MAP_TOP_REAR_RIGHT,
SF_CHANNEL_MAP_TOP_REAR_CENTER
SF_CHANNEL_MAP_REAR_CENTER, /* Apple calls this 'Center Surround', Msft calls this 'Back Center' */
SF_CHANNEL_MAP_REAR_LEFT, /* Apple calls this 'Left Surround', Msft calls this 'Back Left' */
SF_CHANNEL_MAP_REAR_RIGHT, /* Apple calls this 'Right Surround', Msft calls this 'Back Right' */
SF_CHANNEL_MAP_LFE, /* Apple calls this 'LFEScreen', Msft calls this 'Low Frequency' */
SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, /* Apple calls this 'Left Center' */
SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, /* Apple calls this 'Right Center */
SF_CHANNEL_MAP_SIDE_LEFT, /* Apple calls this 'Left Surround Direct' */
SF_CHANNEL_MAP_SIDE_RIGHT, /* Apple calls this 'Right Surround Direct' */
SF_CHANNEL_MAP_TOP_CENTER, /* Apple calls this 'Top Center Surround' */
SF_CHANNEL_MAP_TOP_FRONT_LEFT, /* Apple calls this 'Vertical Height Left' */
SF_CHANNEL_MAP_TOP_FRONT_RIGHT, /* Apple calls this 'Vertical Height Right' */
SF_CHANNEL_MAP_TOP_FRONT_CENTER, /* Apple calls this 'Vertical Height Center' */
SF_CHANNEL_MAP_TOP_REAR_LEFT, /* Apple and MS call this 'Top Back Left' */
SF_CHANNEL_MAP_TOP_REAR_RIGHT, /* Apple and MS call this 'Top Back Right' */
SF_CHANNEL_MAP_TOP_REAR_CENTER, /* Apple and MS call this 'Top Back Center' */
SF_CHANNEL_MAP_AMBISONIC_B_W,
SF_CHANNEL_MAP_AMBISONIC_B_X,
SF_CHANNEL_MAP_AMBISONIC_B_Y,
SF_CHANNEL_MAP_AMBISONIC_B_Z,
SF_CHANNEL_MAP_MAX
} ;
@@ -296,18 +315,24 @@ enum
typedef struct SNDFILE_tag SNDFILE ;
/* The following typedef is system specific and is defined when libsndfile is
** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), off64_t
** (Solaris), __int64_t (Win32) etc. On windows, we need to allow the same
** header file to be compiler by both GCC and the microsoft compiler.
** compiled. sf_count_t will be a 64 bit value when the underlying OS allows
** 64 bit file offsets.
** On windows, we need to allow the same header file to be compiler by both GCC
** and the Microsoft compiler.
*/
typedef __int64 sf_count_t ;
#if (defined (_MSCVER) || defined (_MSC_VER))
typedef __int64 sf_count_t ;
#define SF_COUNT_MAX 0x7fffffffffffffffi64
#else
typedef @TYPEOF_SF_COUNT_T@ sf_count_t ;
#define SF_COUNT_MAX @SF_COUNT_MAX@
#endif
#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFi64
/* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.
/* A pointer to a SF_INFO structure is passed to sf_open () and filled in.
** On write, the SF_INFO structure is filled in by the user and passed into
** sf_open_write ().
** sf_open ().
*/
struct SF_INFO
@@ -391,9 +416,9 @@ typedef struct
struct
{ int mode ;
unsigned int start ;
unsigned int end ;
unsigned int count ;
uint32_t start ;
uint32_t end ;
uint32_t count ;
} loops [16] ; /* make variable in a sensible way */
} SF_INSTRUMENT ;
@@ -411,7 +436,7 @@ typedef struct
/* a full bar of 7/8 is 7 beats */
float bpm ; /* suggestion, as it can be calculated using other fields:*/
/* file's lenght, file's sampleRate and our time_sig_den*/
/* file's length, file's sampleRate and our time_sig_den*/
/* -> bpms are always the amount of _quarter notes_ per minute */
int root_key ; /* MIDI note, or -1 for None */
@@ -424,23 +449,56 @@ typedef struct
*/
#define SF_BROADCAST_INFO_VAR(coding_hist_size) \
struct \
{ char description [256] ; \
char originator [32] ; \
char originator_reference [32] ; \
char origination_date [10] ; \
char origination_time [8] ; \
unsigned int time_reference_low ; \
unsigned int time_reference_high ; \
short version ; \
char umid [64] ; \
char reserved [190] ; \
unsigned int coding_history_size ; \
char coding_history [coding_hist_size] ; \
{ char description [256] ; \
char originator [32] ; \
char originator_reference [32] ; \
char origination_date [10] ; \
char origination_time [8] ; \
uint32_t time_reference_low ; \
uint32_t time_reference_high ; \
short version ; \
char umid [64] ; \
char reserved [190] ; \
uint32_t coding_history_size ; \
char coding_history [coding_hist_size] ; \
}
/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */
typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ;
struct SF_CART_TIMER
{ char usage[4] ;
int32_t value ;
} ;
typedef struct SF_CART_TIMER SF_CART_TIMER ;
#define SF_CART_INFO_VAR(p_tag_text_size) \
struct \
{ char version [4] ; \
char title [64] ; \
char artist [64] ; \
char cut_id [64] ; \
char client_id [64] ; \
char category [64] ; \
char classification [64] ; \
char out_cue [64] ; \
char start_date [10] ; \
char start_time [8] ; \
char end_date [10] ; \
char end_time [8] ; \
char producer_app_id [64] ; \
char producer_app_version [64] ; \
char user_def [64] ; \
int32_t level_reference ; \
SF_CART_TIMER post_timers [8] ; \
char reserved [276] ; \
char url [1024] ; \
uint32_t tag_text_size ; \
char tag_text[p_tag_text_size] ; \
}
typedef SF_CART_INFO_VAR (256) SF_CART_INFO ;
/* Virtual I/O functionality. */
@@ -460,6 +518,7 @@ struct SF_VIRTUAL_IO
typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
/* Open the specified file for read, write or both. On error, this will
** return a NULL pointer. To find the error number, pass a NULL SNDFILE
** to sf_strerror ().
@@ -468,6 +527,7 @@ typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ;
/* Use the existing file descriptor to create a SNDFILE object. If close_desc
** is TRUE, the file descriptor will be closed when sf_close() is called. If
** it is FALSE, the descritor will not be closed.
@@ -484,18 +544,21 @@ SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
SNDFILE* sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
/* sf_error () returns a error number which can be translated to a text
** string using sf_error_number().
*/
int sf_error (SNDFILE *sndfile) ;
/* sf_strerror () returns to the caller a pointer to the current error message for
** the given SNDFILE.
*/
const char* sf_strerror (SNDFILE *sndfile) ;
/* sf_error_number () allows the retrieval of the error string for each internal
** error number.
**
@@ -503,6 +566,7 @@ const char* sf_strerror (SNDFILE *sndfile) ;
const char* sf_error_number (int errnum) ;
/* The following two error functions are deprecated but they will remain in the
** library for the forseeable future. The function sf_strerror() should be used
** in their place.
@@ -516,10 +580,12 @@ int sf_error_str (SNDFILE *sndfile, char* str, size_t len) ;
int sf_command (SNDFILE *sndfile, int command, void *data, int datasize) ;
/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
int sf_format_check (const SF_INFO *info) ;
/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses
** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as
** stdio.h function fseek ().
@@ -534,6 +600,7 @@ int sf_format_check (const SF_INFO *info) ;
sf_count_t sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) ;
/* Functions for retrieving and setting string data within sound files.
** Not all file types support this features; AIFF and WAV do. For both
** functions, the str_type parameter must be one of the SF_STR_* values
@@ -546,12 +613,31 @@ int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ;
const char* sf_get_string (SNDFILE *sndfile, int str_type) ;
/* Return the library version string. */
const char * sf_version_string (void) ;
/* Return the current byterate at this point in the file. The byte rate in this
** case is the number of bytes per second of audio data. For instance, for a
** stereo, 18 bit PCM encoded file with an 16kHz sample rate, the byte rate
** would be 2 (stereo) * 2 (two bytes per sample) * 16000 => 64000 bytes/sec.
** For some file formats the returned value will be accurate and exact, for some
** it will be a close approximation, for some it will be the average bitrate for
** the whole file and for some it will be a time varying value that was accurate
** when the file was most recently read or written.
** To get the bitrate, multiple this value by 8.
** Returns -1 for unknown.
*/
int sf_current_byterate (SNDFILE *sndfile) ;
/* Functions for reading/writing the waveform data of a sound file.
*/
sf_count_t sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
sf_count_t sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ;
/* Functions for reading and writing the data chunk in terms of frames.
** The number of items actually read/written = frames * number of channels.
** sf_xxxx_raw read/writes the raw data bytes from/to the file
@@ -574,6 +660,7 @@ sf_count_t sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frame
sf_count_t sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
sf_count_t sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ;
/* Functions for reading and writing the data chunk in terms of items.
** Otherwise similar to above.
** All of these read/write function return number of items read/written.
@@ -591,6 +678,7 @@ sf_count_t sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items)
sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ;
/* Close the SNDFILE and clean up all memory allocations associated with this
** file.
** Returns 0 on success, or an error number.
@@ -598,6 +686,7 @@ sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t item
int sf_close (SNDFILE *sndfile) ;
/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file
** to force the writing of data to disk. If the file is opened SFM_READ
** no action is taken.
@@ -605,8 +694,124 @@ int sf_close (SNDFILE *sndfile) ;
void sf_write_sync (SNDFILE *sndfile) ;
/* The function sf_wchar_open() is Windows Only!
** Open a file passing in a Windows Unicode filename. Otherwise, this is
** the same as sf_open().
**
** In order for this to work, you need to do the following:
**
** #include <windows.h>
** #define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
** #including <sndfile.h>
*/
#if (defined (ENABLE_SNDFILE_WINDOWS_PROTOTYPES) && ENABLE_SNDFILE_WINDOWS_PROTOTYPES)
SNDFILE* sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ;
#endif
/* Getting and setting of chunks from within a sound file.
**
** These functions allow the getting and setting of chunks within a sound file
** (for those formats which allow it).
**
** These functions fail safely. Specifically, they will not allow you to overwrite
** existing chunks or add extra versions of format specific reserved chunks but
** should allow you to retrieve any and all chunks (may not be implemented for
** all chunks or all file formats).
*/
struct SF_CHUNK_INFO
{ char id [64] ; /* The chunk identifier. */
unsigned id_size ; /* The size of the chunk identifier. */
unsigned datalen ; /* The size of that data. */
void *data ; /* Pointer to the data. */
} ;
typedef struct SF_CHUNK_INFO SF_CHUNK_INFO ;
/* Set the specified chunk info (must be done before any audio data is written
** to the file). This will fail for format specific reserved chunks.
** The chunk_info->data pointer must be valid until the file is closed.
** Returns SF_ERR_NO_ERROR on success or non-zero on failure.
*/
int sf_set_chunk (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ;
/*
** An opaque structure to an iterator over the all chunks of a given id
*/
typedef struct SF_CHUNK_ITERATOR SF_CHUNK_ITERATOR ;
/* Get an iterator for all chunks matching chunk_info.
** The iterator will point to the first chunk matching chunk_info.
** Chunks are matching, if (chunk_info->id) matches the first
** (chunk_info->id_size) bytes of a chunk found in the SNDFILE* handle.
** If chunk_info is NULL, an iterator to all chunks in the SNDFILE* handle
** is returned.
** The values of chunk_info->datalen and chunk_info->data are ignored.
** If no matching chunks are found in the sndfile, NULL is returned.
** The returned iterator will stay valid until one of the following occurs:
** a) The sndfile is closed.
** b) A new chunk is added using sf_set_chunk().
** c) Another chunk iterator function is called on the same SNDFILE* handle
** that causes the iterator to be modified.
** The memory for the iterator belongs to the SNDFILE* handle and is freed when
** sf_close() is called.
*/
SF_CHUNK_ITERATOR *
sf_get_chunk_iterator (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ;
/* Iterate through chunks by incrementing the iterator.
** Increments the iterator and returns a handle to the new one.
** After this call, iterator will no longer be valid, and you must use the
** newly returned handle from now on.
** The returned handle can be used to access the next chunk matching
** the criteria as defined in sf_get_chunk_iterator().
** If iterator points to the last chunk, this will free all resources
** associated with iterator and return NULL.
** The returned iterator will stay valid until sf_get_chunk_iterator_next
** is called again, the sndfile is closed or a new chunk us added.
*/
SF_CHUNK_ITERATOR *
sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) ;
/* Get the size of the specified chunk.
** If the specified chunk exists, the size will be returned in the
** datalen field of the SF_CHUNK_INFO struct.
** Additionally, the id of the chunk will be copied to the id
** field of the SF_CHUNK_INFO struct and it's id_size field will
** be updated accordingly.
** If the chunk doesn't exist chunk_info->datalen will be zero, and the
** id and id_size fields will be undefined.
** The function will return SF_ERR_NO_ERROR on success or non-zero on
** failure.
*/
int
sf_get_chunk_size (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ;
/* Get the specified chunk data.
** If the specified chunk exists, up to chunk_info->datalen bytes of
** the chunk data will be copied into the chunk_info->data buffer
** (allocated by the caller) and the chunk_info->datalen field
** updated to reflect the size of the data. The id and id_size
** field will be updated according to the retrieved chunk
** If the chunk doesn't exist chunk_info->datalen will be zero, and the
** id and id_size fields will be undefined.
** The function will return SF_ERR_NO_ERROR on success or non-zero on
** failure.
*/
int
sf_get_chunk_data (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ;
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* SNDFILE_H */