common.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. ** Copyright (C) 1999-2013 Erik de Castro Lopo <[email protected]>
  3. **
  4. ** All rights reserved.
  5. **
  6. ** Redistribution and use in source and binary forms, with or without
  7. ** modification, are permitted provided that the following conditions are
  8. ** met:
  9. **
  10. ** * Redistributions of source code must retain the above copyright
  11. ** notice, this list of conditions and the following disclaimer.
  12. ** * Redistributions in binary form must reproduce the above copyright
  13. ** notice, this list of conditions and the following disclaimer in
  14. ** the documentation and/or other materials provided with the
  15. ** distribution.
  16. ** * Neither the author nor the names of any contributors may be used
  17. ** to endorse or promote products derived from this software without
  18. ** specific prior written permission.
  19. **
  20. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  22. ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. ** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  30. ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof (x [0])))
  33. #define MAX(a, b) ((a) > (b) ? (a) : (b))
  34. typedef struct
  35. { const char * title ;
  36. const char * copyright ;
  37. const char * artist ;
  38. const char * comment ;
  39. const char * date ;
  40. const char * album ;
  41. const char * license ;
  42. /* Stuff to go in the 'bext' chunk of WAV files. */
  43. int has_bext_fields ;
  44. int coding_hist_append ;
  45. const char * description ;
  46. const char * originator ;
  47. const char * originator_reference ;
  48. const char * origination_date ;
  49. const char * origination_time ;
  50. const char * umid ;
  51. const char * loudness_value ;
  52. const char * loudness_range ;
  53. const char * max_true_peak_level ;
  54. const char * max_momentary_loudness ;
  55. const char * max_shortterm_loudness ;
  56. const char * coding_history ;
  57. const char * time_ref ;
  58. } METADATA_INFO ;
  59. typedef SF_BROADCAST_INFO_VAR (2048) SF_BROADCAST_INFO_2K ;
  60. void sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info) ;
  61. int sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize) ;
  62. void sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ;
  63. int sfe_file_type_of_ext (const char *filename, int format) ;
  64. void sfe_dump_format_map (void) ;
  65. const char * program_name (const char * argv0) ;
  66. const char * sfe_endian_name (int format) ;
  67. const char * sfe_container_name (int format) ;
  68. const char * sfe_codec_name (int format) ;