From 9e20edb51e8a83f6ffcf48cda77d934bf30a7702 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 31 Oct 2004 12:48:25 +0000 Subject: [PATCH] Add SFC_GET_LOOP_INFO and SF_LOOP_INFO struct. --- src/sndfile.h.in | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/sndfile.h.in b/src/sndfile.h.in index d5b19049..58fe5de9 100644 --- a/src/sndfile.h.in +++ b/src/sndfile.h.in @@ -171,6 +171,8 @@ enum SFC_GET_INSTRUMENT = 0x10D0, SFC_SET_INSTRUMENT = 0x10D1, + SFC_GET_LOOP_INFO = 0x10E0, + /* Following commands for testing only. */ SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001, @@ -236,7 +238,7 @@ 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), +** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), ** off64_t (Solaris), __int64_t (Win32) etc. */ @@ -327,6 +329,25 @@ enum SF_LOOP_BACKWARD } ; +/* Struct used to retrieve loop information from a file.*/ +typedef struct +{ + short time_sig_num ; /* any positive integer >0 */ + short time_sig_den ; /* any positive power of 2 >0 */ + int loop_mode ; /* see SF_LOOP enum */ + + int num_beats ; /* this is NOT the amount of quarter notes !!!*/ + /* a full bar of 4/4 is 4 beats */ + /* 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*/ + /* -> bpms are always the amount of _quarter notes_ per minute */ + + int root_key ; /* MIDI note, or -1 for None */ + int future [6] ; +} SF_LOOP_INFO ; + /* 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_perror () or sf_error_str ().