diff --git a/ChangeLog b/ChangeLog index 7c741fc3..b5409af7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-30 Erik de Castro Lopo + + * doc/command.html + Improve documentation of SF_GET_FORMAT_SUBTYPE. + 2005-08-26 Erik de Castro Lopo * examples/sndfile-convert.c diff --git a/configure.ac b/configure.ac index b62818b7..6ba91194 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl Require autoconf version AC_PREREQ(2.53) -AC_INIT(libsndfile,1.0.12pre10,erikd@mega-nerd.com) +AC_INIT(libsndfile,1.0.12pre11,erikd@mega-nerd.com) AC_CONFIG_SRCDIR([src/sndfile.c]) AC_CANONICAL_TARGET([]) diff --git a/doc/command.html b/doc/command.html index efd75494..e1a4267a 100644 --- a/doc/command.html +++ b/doc/command.html @@ -766,7 +766,13 @@ Example:


SFC_GET_FORMAT_SUBTYPE

-Retrieve information about a subformat. +Enumerate the subtypes (this function does not translate a sub type into +a string describing that subtype). +A typical use case might be retrieving a string description of all subtypes +so that a dialog box can be filled in. +

+

+

Parameters: @@ -778,7 +784,7 @@ Parameters: datasize : sizeof (SF_FORMAT_INFO)

-Example: +Example 1: Retrieve all subytpes supported by the WAV format.

         SF_FORMAT_INFO	format_info ;
@@ -786,7 +792,6 @@ Example:
 
         sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
 
-        /* Retrieve all the subtypes supported by the WAV format. */
         for (k = 0 ; k < count ; k++)
         {   format_info.format = k ;
             sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
@@ -796,6 +801,24 @@ Example:
             } ;
 

+Example 2: Print a string describing the SF_FORMAT_PCM_16 subtype. +

+
+        SF_FORMAT_INFO	format_info ;
+        int             k, count ;
+
+        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
+
+        for (k = 0 ; k < count ; k++)
+        {   format_info.format = k ;
+            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
+            if (format_info.format == SF_FORMAT_PCM_16)
+            {   printf ("%08x  %s\n", format_info.format, format_info.name) ;
+                break ;
+                } ;
+            } ;
+
+

For a more comprehensive example, see the program list_formats.c in the examples/ directory of the libsndfile source code distribution.

@@ -1060,9 +1083,10 @@ The SF_FORMAT_INFO struct is defined in <sndfile.h> as: sf_count_t length ; } SF_EMBED_FILE_INFO ; +
Return value:
0 on success and non-zero otherwise. -
The value of the offset field of the SF_EMBED_FILE_INFO struct will be +
The value of the offset field of the SF_EMBED_FILE_INFO struct will be the offsets in bytes from the start of the outer file to the start of the audio file.
The value of the offset field of the SF_EMBED_FILE_INFO struct will be