History

Preliminary Win32 updates.

Erik de Castro Lopo committed 18 years ago

Commit bf3d57b1 parent a58d4345 files · +230 −96Browse files

Unified · Split

5 files
  1. ChangeLog +3 −0
  2. Make.bat +0 −9
  3. Win32/Makefile.am +0 −7
  4. Win32/config.h +23 −15
  5. Win32/sndfile.h +204 −65
ChangeLog+3−0
@@ -3,6 +3,9 @@ · 2 unmodified lines
33 * src/* tests/*
44 Remove all traces of old SRC_OLD_SINC_* converters.
55
6+ * Make.bat Win32/*
7+ Preliminary Win32 updates.
8+
69 * configure.ac
710 Bump version to 0.1.3.
811
Make.bat+0−9
@@ -20,12 +20,3 @@ goto END · 19 unmodified lines
2020
2121 :END
2222
23−goto skipArchTag
24−
25− Do not edit or modify anything in this comment block.
26− The arch-tag line is a file identity tag for the GNU Arch
27− revision control system.
28−
29− arch-tag: 8700080b-8d9a-4852-ad8a-8ecd027f1f61
30−
31−:skipArchTag
Win32/Makefile.am+0−7
@@ -1,9 +1,2 @@
11 EXTRA_DIST = Makefile.msvc config.h unistd.h unistd.h libsamplerate.def
22
3−
4−## Do not edit or modify anything in this comment block.
5−## The arch-tag line is a file identity tag for the GNU Arch
6−## revision control system.
7−##
8−## arch-tag: fcba51ab-858b-462c-9954-66fee32b7f8f
9−
Win32/config.h+23−15
@@ -1,5 +1,5 @@
11 /*
2−** Copyright (C) 2002-2004 Erik de Castro Lopo <erikd@mega-nerd.com>
2+** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
33 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
@@ -53,12 +53,21 @@ · 47 unmodified lines
5353 /* Target processor clips on positive float to int conversion. */
5454 #define CPU_CLIPS_POSITIVE 0
5555
56+/* Target processor is big endian. */
57+#define CPU_IS_BIG_ENDIAN 0
58+
59+/* Target processor is little endian. */
60+#define CPU_IS_LITTLE_ENDIAN 1
61+
5662 /* Set to 1 to enable debugging. */
5763 #define ENABLE_DEBUG 0
5864
5965 /* Major version of GCC or 3 otherwise. */
6066 /* #undef GCC_MAJOR_VERSION */
6167
68+/* Define to 1 if you have the `alarm' function. */
69+/* #undef HAVE_ALARM */
70+
6271 /* Define to 1 if you have the `calloc' function. */
6372 #define HAVE_CALLOC 1
6473
@@ -68,9 +77,6 @@ · 3 unmodified lines
6877 /* Define to 1 if you have the <dlfcn.h> header file. */
6978 /* #undef HAVE_DLFCN_H */
7079
71−/* Set to 1 if you have libfftw3. */
72−/* #undef HAVE_FFTW3 */
73−
7480 /* Define to 1 if you have the `floor' function. */
7581 #define HAVE_FLOOR 1
7682
@@ -86,9 +92,15 @@ · 9 unmodified lines
8692 /* Define to 1 if you have the `efence' library (-lefence). */
8793 /* #undef HAVE_LIBEFENCE */
8894
95+/* Define to 1 if you have the `fftw' library (-lfftw). */
96+/* #undef HAVE_LIBFFTW */
97+
8998 /* Define to 1 if you have the `m' library (-lm). */
9099 /* #undef HAVE_LIBM */
91100
101+/* Define to 1 if you have the `rfftw' library (-lrfftw). */
102+/* #undef HAVE_LIBRFFTW */
103+
92104 /* Define if you have C99's lrint function. */
93105 /* #undef HAVE_LRINT */
94106
@@ -107,6 +119,12 @@ · 12 unmodified lines
107119 /* Define to 1 if you have the <memory.h> header file. */
108120 #define HAVE_MEMORY_H 1
109121
122+/* Define if you have signal SIGALRM. */
123+/* #undef HAVE_SIGALRM */
124+
125+/* Define to 1 if you have the `signal' function. */
126+/* #undef HAVE_SIGNAL */
127+
110128 /* Set to 1 if you have libsndfile. */
111129 #define HAVE_SNDFILE 1
112130
@@ -125,9 +143,6 @@ · 12 unmodified lines
125143 /* Define to 1 if you have the <sys/stat.h> header file. */
126144 #define HAVE_SYS_STAT_H 1
127145
128−/* Define to 1 if you have the <sys/times.h> header file. */
129−/* #undef HAVE_SYS_TIMES_H */
130−
131146 /* Define to 1 if you have the <sys/types.h> header file. */
132147 #define HAVE_SYS_TYPES_H 1
133148
@@ -171,12 +186,5 @@ · 37 unmodified lines
171186 #define STDC_HEADERS 1
172187
173188 /* Version number of package */
174−#define VERSION "0.1.2"
189+#define VERSION "0.1.3"
175190
176−/*
177−** Do not edit or modify anything in this comment block.
178−** The arch-tag line is a file identity tag for the GNU Arch
179−** revision control system.
180−**
181−** arch-tag: 7c5a8910-8149-4e89-98ce-be92835e435b
182−*/
Win32/sndfile.h+204−65
@@ -1,5 +1,5 @@
11 /*
2−** Copyright (C) 1999-2004 Erik de Castro Lopo <erikd@mega-nerd.com>
2+** Copyright (C) 1999-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
33 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU Lesser General Public License as published by
@@ -30,14 +30,7 @@ · 24 unmodified lines
3030 #define SNDFILE_1
3131
3232 #include <stdio.h>
33−
34−/* For the Metrowerks CodeWarrior Pro Compiler (mainly MacOS) */
35−
36−#if (defined (__MWERKS__))
37−#include <unix.h>
38−#else
39−#include <sys/types.h>
40−#endif
33+#include <sys/types.h>
4134
4235 #ifdef __cplusplus
4336 extern "C" {
@@ -52,7 +45,7 @@ extern "C" { · 8 unmodified lines
5245
5346 enum
5447 { /* Major formats. */
55− SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian). */
48+ SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian default). */
5649 SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */
5750 SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */
5851 SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */
@@ -68,7 +61,14 @@ enum · 9 unmodified lines
6861 SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */
6962 SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */
7063 SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */
71−
64+ SF_FORMAT_AVR = 0x120000, /* Audio Visual Research */
65+ SF_FORMAT_WAVEX = 0x130000, /* MS WAVE with WAVEFORMATEX */
66+ SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */
67+ SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */
68+ SF_FORMAT_CAF = 0x180000, /* Core Audio File format */
69+ SF_FORMAT_WVE = 0x190000, /* Psion WVE format */
70+ SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */
71+
7272 /* Subtypes from here on. */
7373
7474 SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */
@@ -123,11 +123,15 @@ enum · 48 unmodified lines
123123 enum
124124 { SFC_GET_LIB_VERSION = 0x1000,
125125 SFC_GET_LOG_INFO = 0x1001,
126+ SFC_GET_CURRENT_SF_INFO = 0x1002,
127+
126128
127129 SFC_GET_NORM_DOUBLE = 0x1010,
128130 SFC_GET_NORM_FLOAT = 0x1011,
129131 SFC_SET_NORM_DOUBLE = 0x1012,
130132 SFC_SET_NORM_FLOAT = 0x1013,
133+ SFC_SET_SCALE_FLOAT_INT_READ = 0x1014,
134+ SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015,
131135
132136 SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020,
133137 SFC_GET_SIMPLE_FORMAT = 0x1021,
@@ -143,6 +147,8 @@ enum · 9 unmodified lines
143147 SFC_CALC_NORM_SIGNAL_MAX = 0x1041,
144148 SFC_CALC_MAX_ALL_CHANNELS = 0x1042,
145149 SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043,
150+ SFC_GET_SIGNAL_MAX = 0x1044,
151+ SFC_GET_MAX_ALL_CHANNELS = 0x1045,
146152
147153 SFC_SET_ADD_PEAK_CHUNK = 0x1050,
148154
@@ -150,7 +156,7 @@ enum · 1 unmodified line
150156 SFC_SET_UPDATE_HEADER_AUTO = 0x1061,
151157
152158 SFC_FILE_TRUNCATE = 0x1080,
153−
159+
154160 SFC_SET_RAW_START_OFFSET = 0x1090,
155161
156162 SFC_SET_DITHER_ON_WRITE = 0x10A0,
@@ -160,21 +166,37 @@ enum · 3 unmodified lines
160166 SFC_GET_DITHER_INFO = 0x10A3,
161167
162168 SFC_GET_EMBED_FILE_INFO = 0x10B0,
163−
169+
164170 SFC_SET_CLIPPING = 0x10C0,
165171 SFC_GET_CLIPPING = 0x10C1,
166172
167173 SFC_GET_INSTRUMENT = 0x10D0,
168174 SFC_SET_INSTRUMENT = 0x10D1,
169175
176+ SFC_GET_LOOP_INFO = 0x10E0,
177+
178+ SFC_GET_BROADCAST_INFO = 0x10F0,
179+ SFC_SET_BROADCAST_INFO = 0x10F1,
180+
181+ SFC_GET_CHANNEL_MAP_INFO = 0x1100,
182+ SFC_SET_CHANNEL_MAP_INFO = 0x1101,
183+
184+ SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110,
185+
186+ /* Support for Wavex Ambisonics Format */
187+ SFC_WAVEX_SET_AMBISONIC = 0x1200,
188+ SFC_WAVEX_GET_AMBISONIC = 0x1201,
189+
190+ SFC_SET_VBR_ENCODING_QUALITY = 0x1300,
191+
170192 /* Following commands for testing only. */
171193 SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001,
172194
173195 /*
174196 ** SFC_SET_ADD_* values are deprecated and will disappear at some
175− ** time in the future. They are guaranteed to be here up to and
176− ** including version 1.0.8 to avoid breakage of existng software.
177− ** They currently do nothing and will continue to do nothing.
197+ ** time in the future. They are guaranteed to be here up to and
198+ ** including version 1.0.8 to avoid breakage of existng software.
199+ ** They currently do nothing and will continue to do nothing.
178200 */
179201 SFC_SET_ADD_DITHER_ON_WRITE = 0x1070,
180202 SFC_SET_ADD_DITHER_ON_READ = 0x1071
@@ -193,9 +215,19 @@ enum · 12 unmodified lines
193215 SF_STR_SOFTWARE = 0x03,
194216 SF_STR_ARTIST = 0x04,
195217 SF_STR_COMMENT = 0x05,
196− SF_STR_DATE = 0x06
218+ SF_STR_DATE = 0x06,
219+ SF_STR_ALBUM = 0x07,
220+ SF_STR_LICENSE = 0x08
197221 } ;
198222
223+/*
224+** Use the following as the start and end index when doing metadata
225+** transcoding.
226+*/
227+
228+#define SF_STR_FIRST SF_STR_TITLE
229+#define SF_STR_LAST SF_STR_LICENSE
230+
199231 enum
200232 { /* True and false */
201233 SF_FALSE = 0,
@@ -204,33 +236,75 @@ enum · 2 unmodified lines
204236 /* Modes for opening files. */
205237 SFM_READ = 0x10,
206238 SFM_WRITE = 0x20,
207− SFM_RDWR = 0x30
239+ SFM_RDWR = 0x30,
240+
241+ SF_AMBISONIC_NONE = 0x40,
242+ SF_AMBISONIC_B_FORMAT = 0x41
208243 } ;
209244
210−/* Pubic error values. These are guaranteed to remain unchanged for the duration
211−** of the library major version number.
245+/* Public error values. These are guaranteed to remain unchanged for the duration
246+** of the library major version number.
212247 ** There are also a large number of private error numbers which are internal to
213248 ** the library which can change at any time.
214249 */
215250
216251 enum
217−{ SF_ERR_NO_ERROR = 0,
252+{ SF_ERR_NO_ERROR = 0,
218253 SF_ERR_UNRECOGNISED_FORMAT = 1,
219− SF_ERR_SYSTEM = 2
254+ SF_ERR_SYSTEM = 2,
255+ SF_ERR_MALFORMED_FILE = 3,
256+ SF_ERR_UNSUPPORTED_ENCODING = 4
220257 } ;
221258
259+
260+/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP).
261+*/
262+
263+enum
264+{ SF_CHANNEL_MAP_INVALID = 0,
265+ SF_CHANNEL_MAP_MONO = 1,
266+ SF_CHANNEL_MAP_LEFT,
267+ SF_CHANNEL_MAP_RIGHT,
268+ SF_CHANNEL_MAP_CENTER,
269+ SF_CHANNEL_MAP_FRONT_LEFT,
270+ SF_CHANNEL_MAP_FRONT_RIGHT,
271+ SF_CHANNEL_MAP_FRONT_CENTER,
272+ SF_CHANNEL_MAP_REAR_CENTER,
273+ SF_CHANNEL_MAP_REAR_LEFT,
274+ SF_CHANNEL_MAP_REAR_RIGHT,
275+ SF_CHANNEL_MAP_LFE,
276+ SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,
277+ SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,
278+ SF_CHANNEL_MAP_SIDE_LEFT,
279+ SF_CHANNEL_MAP_SIDE_RIGHT,
280+ SF_CHANNEL_MAP_TOP_CENTER,
281+ SF_CHANNEL_MAP_TOP_FRONT_LEFT,
282+ SF_CHANNEL_MAP_TOP_FRONT_RIGHT,
283+ SF_CHANNEL_MAP_TOP_FRONT_CENTER,
284+ SF_CHANNEL_MAP_TOP_REAR_LEFT,
285+ SF_CHANNEL_MAP_TOP_REAR_RIGHT,
286+ SF_CHANNEL_MAP_TOP_REAR_CENTER
287+} ;
288+
289+
222290 /* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
223291
224292 typedef struct SNDFILE_tag SNDFILE ;
225293
226−/* The following typedef is system specific and is defined when libsndfile is.
227−** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD),
228−** off64_t (Solaris), __int64_t (Win32) etc.
294+/* The following typedef is system specific and is defined when libsndfile is
295+** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), off64_t
296+** (Solaris), __int64_t (Win32) etc. On windows, we need to allow the same
297+** header file to be compiler by both GCC and the microsoft compiler.
229298 */
230299
231−typedef __int64 sf_count_t ;
300+#ifdef _MSCVER
301+typedef __int64_t sf_count_t ;
302+#define SF_COUNT_MAX 0x7fffffffffffffffi64
303+#else
304+typedef loff_t sf_count_t ;
305+#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFLL
306+#endif
232307
233−#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFi64
234308
235309 /* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.
236310 ** On write, the SF_INFO structure is filled in by the user and passed into
@@ -261,13 +335,13 @@ typedef struct SF_INFO SF_INFO ; · 24 unmodified lines
261335
262336 typedef struct
263337 { int format ;
264− const char *name ;
265− const char *extension ;
338+ const char *name ;
339+ const char *extension ;
266340 } SF_FORMAT_INFO ;
267341
268342 /*
269−** Enums and typedefs for adding dither on read and write.
270−** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
343+** Enums and typedefs for adding dither on read and write.
344+** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
271345 ** and SFC_SET_DITHER_ON_READ.
272346 */
273347
@@ -295,26 +369,91 @@ typedef struct · 21 unmodified lines
295369 sf_count_t length ;
296370 } SF_EMBED_FILE_INFO ;
297371
298−/* Struct used to retrieve music sample information from a file.
372+/*
373+** Structs used to retrieve music sample information from a file.
299374 */
300375
376+enum
377+{ /*
378+ ** The loop mode field in SF_INSTRUMENT will be one of the following.
379+ */
380+ SF_LOOP_NONE = 800,
381+ SF_LOOP_FORWARD,
382+ SF_LOOP_BACKWARD,
383+ SF_LOOP_ALTERNATING
384+} ;
385+
301386 typedef struct
302−{ int basenote ;
303− int gain ;
304− int sustain_mode ;
305− int sustain_start, sustain_end ;
306− int release_mode ;
307− int release_start, reslease_end ;
387+{ int gain ;
388+ char basenote, detune ;
389+ char velocity_lo, velocity_hi ;
390+ char key_lo, key_hi ;
391+ int loop_count ;
392+
393+ struct
394+ { int mode ;
395+ unsigned int start ;
396+ unsigned int end ;
397+ unsigned int count ;
398+ } loops [16] ; /* make variable in a sensible way */
308399 } SF_INSTRUMENT ;
309400
310−/* sustain_mode and release_mode will be one of the following. */
311401
312−enum
313−{ SF_LOOP_NONE = 800,
314− SF_LOOP_FORWARD,
315− SF_LOOP_BACKWARD,
402+
403+/* Struct used to retrieve loop information from a file.*/
404+typedef struct
405+{
406+ short time_sig_num ; /* any positive integer > 0 */
407+ short time_sig_den ; /* any positive power of 2 > 0 */
408+ int loop_mode ; /* see SF_LOOP enum */
409+
410+ int num_beats ; /* this is NOT the amount of quarter notes !!!*/
411+ /* a full bar of 4/4 is 4 beats */
412+ /* a full bar of 7/8 is 7 beats */
413+
414+ float bpm ; /* suggestion, as it can be calculated using other fields:*/
415+ /* file's lenght, file's sampleRate and our time_sig_den*/
416+ /* -> bpms are always the amount of _quarter notes_ per minute */
417+
418+ int root_key ; /* MIDI note, or -1 for None */
419+ int future [6] ;
420+} SF_LOOP_INFO ;
421+
422+
423+/* Struct used to retrieve broadcast (EBU) information from a file.
424+** Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
425+*/
426+typedef struct
427+{ char description [256] ;
428+ char originator [32] ;
429+ char originator_reference [32] ;
430+ char origination_date [10] ;
431+ char origination_time [8] ;
432+ int time_reference_low ;
433+ int time_reference_high ;
434+ short version ;
435+ char umid [64] ;
436+ char reserved [190] ;
437+ unsigned int coding_history_size ;
438+ char coding_history [256] ;
439+} SF_BROADCAST_INFO ;
440+
441+typedef sf_count_t (*sf_vio_get_filelen) (void *user_data) ;
442+typedef sf_count_t (*sf_vio_seek) (sf_count_t offset, int whence, void *user_data) ;
443+typedef sf_count_t (*sf_vio_read) (void *ptr, sf_count_t count, void *user_data) ;
444+typedef sf_count_t (*sf_vio_write) (const void *ptr, sf_count_t count, void *user_data) ;
445+typedef sf_count_t (*sf_vio_tell) (void *user_data) ;
446+
447+struct SF_VIRTUAL_IO
448+{ sf_vio_get_filelen get_filelen ;
449+ sf_vio_seek seek ;
450+ sf_vio_read read ;
451+ sf_vio_write write ;
452+ sf_vio_tell tell ;
316453 } ;
317454
455+typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
456+
318457 /* Open the specified file for read, write or both. On error, this will
319458 ** return a NULL pointer. To find the error number, pass a NULL SNDFILE
320459 ** to sf_perror () or sf_error_str ().
@@ -329,7 +468,7 @@ SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ; · 8 unmodified lines
329468 ** When passed a descriptor like this, the library will assume that the start
330469 ** of file header is at the current file offset. This allows sound files within
331470 ** larger container files to be read and/or written.
332−** On error, this will return a NULL pointer. To find the error number, pass a
471+** On error, this will return a NULL pointer. To find the error number, pass a
333472 ** NULL SNDFILE to sf_perror () or sf_error_str ().
334473 ** All calls to sf_open_fd() should be matched with a call to sf_close().
335474
@@ -337,20 +476,22 @@ SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ; · 1 unmodified line
337476
338477 SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
339478
340−/* sf_error () returns a error number which can be translated to a text
479+SNDFILE* sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
480+
481+/* sf_error () returns a error number which can be translated to a text
341482 ** string using sf_error_number().
342483 */
343484
344485 int sf_error (SNDFILE *sndfile) ;
345486
346−/* sf_strerror () returns to the caller a pointer to the current error message for
487+/* sf_strerror () returns to the caller a pointer to the current error message for
347488 ** the given SNDFILE.
348489 */
349490
350491 const char* sf_strerror (SNDFILE *sndfile) ;
351492
352493 /* sf_error_number () allows the retrieval of the error string for each internal
353−** error number.
494+** error number.
354495 **
355496 */
356497
@@ -403,7 +544,7 @@ const char* sf_get_string (SNDFILE *sndfile, int str_type) ; · 46 unmodified lines
403544 */
404545
405546 sf_count_t sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
406−sf_count_t sf_write_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
547+sf_count_t sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ;
407548
408549 /* Functions for reading and writing the data chunk in terms of frames.
409550 ** The number of items actually read/written = frames * number of channels.
@@ -416,16 +557,16 @@ sf_count_t sf_write_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ; · 6 unmodified lines
416557 */
417558
418559 sf_count_t sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
419−sf_count_t sf_writef_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
560+sf_count_t sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) ;
420561
421562 sf_count_t sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
422−sf_count_t sf_writef_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
563+sf_count_t sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) ;
423564
424565 sf_count_t sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
425−sf_count_t sf_writef_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
566+sf_count_t sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) ;
426567
427568 sf_count_t sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
428−sf_count_t sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
569+sf_count_t sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ;
429570
430571 /* Functions for reading and writing the data chunk in terms of items.
431572 ** Otherwise similar to above.
@@ -433,16 +574,16 @@ sf_count_t sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ; · 1 unmodified line
433574 */
434575
435576 sf_count_t sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
436−sf_count_t sf_write_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
577+sf_count_t sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t items) ;
437578
438579 sf_count_t sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
439−sf_count_t sf_write_int (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
580+sf_count_t sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t items) ;
440581
441582 sf_count_t sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
442−sf_count_t sf_write_float (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
583+sf_count_t sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items) ;
443584
444585 sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
445−sf_count_t sf_write_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
586+sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ;
446587
447588 /* Close the SNDFILE and clean up all memory allocations associated with this
448589 ** file.
@@ -451,17 +592,15 @@ sf_count_t sf_write_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ; · 2 unmodified lines
451592
452593 int sf_close (SNDFILE *sndfile) ;
453594
595+/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file
596+** to force the writing of data to disk. If the file is opened SFM_READ
597+** no action is taken.
598+*/
599+
600+void sf_write_sync (SNDFILE *sndfile) ;
601+
454602 #ifdef __cplusplus
455603 } /* extern "C" */
456604 #endif /* __cplusplus */
457605
458606 #endif /* SNDFILE_H */
459−
460−/*
461−** Do not edit or modify anything in this comment block.
462−** The arch-tag line is a file identity tag for the GNU Arch
463−** revision control system.
464−**
465−** arch-tag: 906bb197-18f2-4f66-a395-b4722bab5114
466−*/
467−

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t