1159b3361Sopenharmony_ci/*
2159b3361Sopenharmony_ci *      Command line frontend program
3159b3361Sopenharmony_ci *
4159b3361Sopenharmony_ci *      Copyright (c) 1999 Mark Taylor
5159b3361Sopenharmony_ci *                    2000 Takehiro TOMIANGA
6159b3361Sopenharmony_ci *                    2010-2011 Robert Hegemann
7159b3361Sopenharmony_ci *
8159b3361Sopenharmony_ci * This library is free software; you can redistribute it and/or
9159b3361Sopenharmony_ci * modify it under the terms of the GNU Library General Public
10159b3361Sopenharmony_ci * License as published by the Free Software Foundation; either
11159b3361Sopenharmony_ci * version 2 of the License, or (at your option) any later version.
12159b3361Sopenharmony_ci *
13159b3361Sopenharmony_ci * This library is distributed in the hope that it will be useful,
14159b3361Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
15159b3361Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16159b3361Sopenharmony_ci * Library General Public License for more details.
17159b3361Sopenharmony_ci *
18159b3361Sopenharmony_ci * You should have received a copy of the GNU Library General Public
19159b3361Sopenharmony_ci * License along with this library; if not, write to the
20159b3361Sopenharmony_ci * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21159b3361Sopenharmony_ci * Boston, MA 02111-1307, USA.
22159b3361Sopenharmony_ci */
23159b3361Sopenharmony_ci
24159b3361Sopenharmony_ci#ifndef MAIN_H_INCLUDED
25159b3361Sopenharmony_ci#define MAIN_H_INCLUDED
26159b3361Sopenharmony_ci
27159b3361Sopenharmony_ci#ifdef HAVE_LIMITS_H
28159b3361Sopenharmony_ci# include <limits.h>
29159b3361Sopenharmony_ci#endif
30159b3361Sopenharmony_ci
31159b3361Sopenharmony_ci#include "get_audio.h"
32159b3361Sopenharmony_ci
33159b3361Sopenharmony_ci#if defined(__cplusplus)
34159b3361Sopenharmony_ciextern "C" {
35159b3361Sopenharmony_ci#endif
36159b3361Sopenharmony_ci
37159b3361Sopenharmony_ci#ifndef PATH_MAX
38159b3361Sopenharmony_ci#define PATH_MAX 1024
39159b3361Sopenharmony_ci#endif
40159b3361Sopenharmony_ci
41159b3361Sopenharmony_ci
42159b3361Sopenharmony_ci/* GLOBAL VARIABLES used by parse.c and main.c.
43159b3361Sopenharmony_ci   instantiated in parce.c.  ugly, ugly */
44159b3361Sopenharmony_ci
45159b3361Sopenharmony_citypedef struct ReaderConfig
46159b3361Sopenharmony_ci{
47159b3361Sopenharmony_ci    sound_file_format input_format;
48159b3361Sopenharmony_ci    int   swapbytes;                /* force byte swapping   default=0 */
49159b3361Sopenharmony_ci    int   swap_channel;             /* 0: no-op, 1: swaps input channels */
50159b3361Sopenharmony_ci    int   input_samplerate;
51159b3361Sopenharmony_ci    int   ignorewavlength;
52159b3361Sopenharmony_ci} ReaderConfig;
53159b3361Sopenharmony_ci
54159b3361Sopenharmony_citypedef struct WriterConfig
55159b3361Sopenharmony_ci{
56159b3361Sopenharmony_ci    int   flush_write;
57159b3361Sopenharmony_ci} WriterConfig;
58159b3361Sopenharmony_ci
59159b3361Sopenharmony_citypedef struct UiConfig
60159b3361Sopenharmony_ci{
61159b3361Sopenharmony_ci    int   silent;                   /* Verbosity */
62159b3361Sopenharmony_ci    int   brhist;
63159b3361Sopenharmony_ci    int   print_clipping_info;      /* print info whether waveform clips */
64159b3361Sopenharmony_ci    float update_interval;          /* to use Frank's time status display */
65159b3361Sopenharmony_ci} UiConfig;
66159b3361Sopenharmony_ci
67159b3361Sopenharmony_citypedef struct DecoderConfig
68159b3361Sopenharmony_ci{
69159b3361Sopenharmony_ci    int   mp3_delay;                /* to adjust the number of samples truncated during decode */
70159b3361Sopenharmony_ci    int   mp3_delay_set;            /* user specified the value of the mp3 encoder delay to assume for decoding */
71159b3361Sopenharmony_ci    int   disable_wav_header;
72159b3361Sopenharmony_ci    mp3data_struct mp3input_data;
73159b3361Sopenharmony_ci} DecoderConfig;
74159b3361Sopenharmony_ci
75159b3361Sopenharmony_citypedef enum ByteOrder { ByteOrderLittleEndian, ByteOrderBigEndian } ByteOrder;
76159b3361Sopenharmony_ci
77159b3361Sopenharmony_citypedef struct RawPCMConfig
78159b3361Sopenharmony_ci{
79159b3361Sopenharmony_ci    int     in_bitwidth;
80159b3361Sopenharmony_ci    int     in_signed;
81159b3361Sopenharmony_ci    ByteOrder in_endian;
82159b3361Sopenharmony_ci} RawPCMConfig;
83159b3361Sopenharmony_ci
84159b3361Sopenharmony_ciextern ReaderConfig global_reader;
85159b3361Sopenharmony_ciextern WriterConfig global_writer;
86159b3361Sopenharmony_ciextern UiConfig global_ui_config;
87159b3361Sopenharmony_ciextern DecoderConfig global_decoder;
88159b3361Sopenharmony_ciextern RawPCMConfig global_raw_pcm;
89159b3361Sopenharmony_ci
90159b3361Sopenharmony_ci
91159b3361Sopenharmony_ciextern FILE* lame_fopen(char const* file, char const* mode);
92159b3361Sopenharmony_ciextern char* utf8ToConsole8Bit(const char* str);
93159b3361Sopenharmony_ciextern char* utf8ToLocal8Bit(const char* str);
94159b3361Sopenharmony_ciextern unsigned short* utf8ToUtf16(char const* mbstr);
95159b3361Sopenharmony_ciextern char* utf8ToLatin1(char const* str);
96159b3361Sopenharmony_ci#ifdef _WIN32
97159b3361Sopenharmony_ciextern wchar_t* utf8ToUnicode(char const* mbstr);
98159b3361Sopenharmony_ciextern char *unicodeToUtf8(const wchar_t *wstr);
99159b3361Sopenharmony_ci#endif
100159b3361Sopenharmony_ci
101159b3361Sopenharmony_ciextern void dosToLongFileName(char* filename);
102159b3361Sopenharmony_ciextern void setProcessPriority(int priority);
103159b3361Sopenharmony_ci
104159b3361Sopenharmony_ciextern int lame_main(lame_t gf, int argc, char** argv);
105159b3361Sopenharmony_ciextern char* lame_getenv(char const* var);
106159b3361Sopenharmony_ci
107159b3361Sopenharmony_ci#if defined(__cplusplus)
108159b3361Sopenharmony_ci}
109159b3361Sopenharmony_ci#endif
110159b3361Sopenharmony_ci
111159b3361Sopenharmony_ci#endif
112