-
Notifications
You must be signed in to change notification settings - Fork 43
/
options.h
132 lines (116 loc) · 4.21 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef _OPTIONS_H
#define _OPTIONS_H
#include <vector>
#include <map>
#include <stdint.h>
#include "misc.h"
struct DRCParams {
double m_threshold, m_ratio, m_knee_width, m_attack, m_release;
const wchar_t *m_stat_file;
DRCParams():
m_threshold(0.0), m_ratio(0.0), m_knee_width(0.0),
m_attack(0.0), m_release(0.0),
m_stat_file(0)
{}
DRCParams(double threshold, double ratio, double knee_width,
double attack, double release, const wchar_t *stat_file)
: m_threshold(threshold), m_ratio(ratio), m_knee_width(knee_width),
m_attack(attack), m_release(release),
m_stat_file(stat_file)
{}
};
struct Options {
// enum { kABR, kTVBR, kCVBR, kCBR };
enum { kCBR, kABR, kCVBR, kTVBR };
Options() :
method(-1), quality(-1),
rate(-1), verbose(1), lowpass(0), native_resampler_quality(-1),
chanmask(-1), num_priming(2112),
bits_per_sample(0), raw_channels(2), raw_sample_rate(44100),
artwork_size(0), native_resampler_complexity(0), textcp(0),
gapless_mode(0),
ofilename(0), outdir(0), raw_format(L"S16LE"),
fname_format(L"${tracknumber}${title& }${title}"),
chapter_file(0), logfilename(0), remix_preset(0), remix_file(0),
tmpdir(0), start(0), end(0), delay(0),
is_raw(false), is_adts(false), is_caf(false),
save_stat(false), nice(false), native_chanmapper(false),
ignore_length(false), no_optimize(false), native_resampler(false),
check_only(false), normalize(false),
print_available_formats(false), alac_fast(false), threading(false),
concat(false), no_matrix_normalize(false), no_dither(false),
filename_from_tag(false), sort_args(false),
no_smart_padding(false), limiter(false), copy_artwork(false),
bitrate(-1.0), gain(0.0),
output_format(0)
{}
bool parse(int &argc, wchar_t **&argv);
bool isMP4() const
{
return !is_caf && ((isAAC() && !is_adts) || isALAC());
}
bool isAAC() const
{
return output_format == 'aac ' || output_format == 'aach';
}
bool isSBR() const
{
return output_format == 'aach';
}
bool isALAC() const
{
return output_format == 'alac';
}
bool isLPCM() const
{
return output_format == 'lpcm';
}
bool isWaveOut() const
{
return output_format == 'play';
}
bool isPeak() const
{
return output_format == 'peak';
}
const wchar_t *extension() const
{
if (is_caf) return L".caf";
else if (isMP4()) return L".m4a";
else if (isLPCM()) return L".wav";
else if (isWaveOut() || isPeak()) return L"";
else return L".aac";
}
int32_t method, quality;
int rate; /* -1: keep, 0: auto, others: literal value */
int verbose, lowpass, native_resampler_quality;
int chanmask; /* -1: honor chanmask in the source(default)
0: ignore chanmask in the source
others: use the value as chanmask */
unsigned num_priming;
uint32_t bits_per_sample, raw_channels, raw_sample_rate,
artwork_size, native_resampler_complexity, textcp,
gapless_mode;
const wchar_t
*ofilename, *outdir, *raw_format, *fname_format, *chapter_file,
*logfilename, *remix_preset, *remix_file, *tmpdir,
*start, *end, *delay;
bool is_raw, is_adts, is_caf, save_stat, nice, native_chanmapper,
ignore_length, no_optimize, native_resampler, check_only,
normalize, print_available_formats, alac_fast, threading,
concat, no_matrix_normalize, no_dither, filename_from_tag,
sort_args, no_smart_padding, limiter, copy_artwork;
double bitrate, gain;
uint32_t output_format;
std::vector<DRCParams> drc_params;
std::map<uint32_t, std::string> tagopts;
std::map<uint32_t, std::wstring> ftagopts;
std::map<std::string, std::string> longtags;
std::vector<misc::chapter_t> chapters;
std::vector<std::wstring> artwork_files;
std::vector<std::vector<char> > artworks;
std::wstring encoder_name;
std::vector<uint32_t> chanmap;
std::vector<int> cue_tracks;
};
#endif