main.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Command line frontend program
  3. *
  4. * Copyright (c) 1999 Mark Taylor
  5. * 2000 Takehiro TOMIANGA
  6. * 2010-2011 Robert Hegemann
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. * Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef MAIN_H_INCLUDED
  24. #define MAIN_H_INCLUDED
  25. #ifdef HAVE_LIMITS_H
  26. # include <limits.h>
  27. #endif
  28. #include "get_audio.h"
  29. #if defined(__cplusplus)
  30. extern "C" {
  31. #endif
  32. #ifndef PATH_MAX
  33. #define PATH_MAX 1024
  34. #endif
  35. /* GLOBAL VARIABLES used by parse.c and main.c.
  36. instantiated in parce.c. ugly, ugly */
  37. typedef struct ReaderConfig
  38. {
  39. sound_file_format input_format;
  40. int swapbytes; /* force byte swapping default=0 */
  41. int swap_channel; /* 0: no-op, 1: swaps input channels */
  42. int input_samplerate;
  43. int ignorewavlength;
  44. } ReaderConfig;
  45. typedef struct WriterConfig
  46. {
  47. int flush_write;
  48. } WriterConfig;
  49. typedef struct UiConfig
  50. {
  51. int silent; /* Verbosity */
  52. int brhist;
  53. int print_clipping_info; /* print info whether waveform clips */
  54. float update_interval; /* to use Frank's time status display */
  55. } UiConfig;
  56. typedef struct DecoderConfig
  57. {
  58. int mp3_delay; /* to adjust the number of samples truncated during decode */
  59. int mp3_delay_set; /* user specified the value of the mp3 encoder delay to assume for decoding */
  60. int disable_wav_header;
  61. mp3data_struct mp3input_data;
  62. } DecoderConfig;
  63. typedef enum ByteOrder { ByteOrderLittleEndian, ByteOrderBigEndian } ByteOrder;
  64. typedef struct RawPCMConfig
  65. {
  66. int in_bitwidth;
  67. int in_signed;
  68. ByteOrder in_endian;
  69. } RawPCMConfig;
  70. extern ReaderConfig global_reader;
  71. extern WriterConfig global_writer;
  72. extern UiConfig global_ui_config;
  73. extern DecoderConfig global_decoder;
  74. extern RawPCMConfig global_raw_pcm;
  75. extern FILE* lame_fopen(char const* file, char const* mode);
  76. extern char* utf8ToConsole8Bit(const char* str);
  77. extern char* utf8ToLocal8Bit(const char* str);
  78. extern unsigned short* utf8ToUtf16(char const* str);
  79. extern char* utf8ToLatin1(char const* str);
  80. #ifdef _WIN32
  81. extern wchar_t* utf8ToUnicode(char const* str);
  82. #endif
  83. extern void dosToLongFileName(char* filename);
  84. extern void setProcessPriority(int priority);
  85. extern int lame_main(lame_t gf, int argc, char** argv);
  86. extern char* lame_getenv(char const* var);
  87. #if defined(__cplusplus)
  88. }
  89. #endif
  90. #endif