-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants_programs.h
More file actions
144 lines (111 loc) · 4.21 KB
/
constants_programs.h
File metadata and controls
144 lines (111 loc) · 4.21 KB
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
133
134
135
136
137
138
139
140
141
/*
Copyright (C) 2009-2014 jakago
Copyright (C) 2018-2026 CSReviser Team
This file is part of CaptureStream2, the recorder to support HLS for
NHK radio language courses.
CaptureStream2 is a modified version of CaptureStream, originally
developed by jakago.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/gpl-2.0.html>.
*/
// constants_programs.h
#pragma once
#include <QString>
#include <QMap>
#include <QMultiMap>
#include <QStringList>
namespace Constants {
struct ProgramDefinition {
enum class Kind { English, Optional, Spec, Feature };
Kind kind;
const char* keyChecked;
bool checkedDefault;
const char* keyId;
const char* idDefault;
bool saveId;
bool hasId;
const char* keyLabel;
const char* labelDefault;
bool saveLabel;
bool hasLabel;
const char* objectName;
};
// --- 配列の宣言(実体は.cpp) ---
extern const ProgramDefinition EnglishPrograms[];
extern const int EnglishCount;
extern const ProgramDefinition OptionalPrograms[];
extern const int OptionalCount;
extern const ProgramDefinition SpecPrograms[];
extern const int SpecCount;
extern const char* AUDIO_EXT_LIST[];
extern const int AUDIO_EXT_COUNT;
// --- コンテナ系の取得関数 ---
const QMap<QString, QString>& getMap();
const QMultiMap<QString, QString>& getMultiMap();
const QMultiMap<QString, QString>& getMultiMap1();
const std::vector<QStringList>& getOptPresets();
const std::vector<QStringList>& getPresets();
// --- その他の構造体 ---
struct Item { const QString key; const char* defaultValue; };
extern const Item TITLE_ITEMS[];
extern const Item FILENAME_ITEMS[];
extern const int ITEM_COUNT;
struct CustomizePreset { const char* value; const char* label; };
extern const CustomizePreset FILENAME_PRESETS[];
extern const int FILENAME_PRESET_COUNT;
extern const CustomizePreset TITLE_PRESETS[];
extern const int TITLE_PRESETS_COUNT;
// 固定文字列は利便性のため inline のまま維持(変更頻度が低いため)
inline constexpr auto prefix = "http://cgi2.nhk.or.jp/gogaku/st/xml/";
inline constexpr auto suffix = "listdataflv.xml";
inline constexpr auto json_prefix = "https://www.nhk.or.jp/radioondemand/json/";
// --- 実体配列の参照宣言 ---
extern const ProgramDefinition EnglishPrograms[];
extern const ProgramDefinition OptionalPrograms[];
extern const ProgramDefinition SpecPrograms[];
// --- 【重要】個数を自動で返す関数 ---
int getEnglishCount();
int getOptionalCount();
int getSpecCount();
int getItemCount();
int getAudioExtCount();
// std::array の代わりに使う側のための別名(セマンティクス維持)
int getOptPresetSize();
int getPresetSize();
// inline int getOptPresetSize() { return getOptionalCount(); }
// inline int getPresetSize() { return getSpecCount(); }
// English keywords
extern const char* PROGRAM_KEYWORDS_ENGLISH[];
// Other language keywords
extern const char* PROGRAM_KEYWORDS_OTHER[];
// keyword counts
extern const int PROGRAM_KEYWORDS_ENGLISH_COUNT;
extern const int PROGRAM_KEYWORDS_OTHER_COUNT;
// exclude tag
extern const char* PROGRAM_EXCLUDE_TAG;
struct OptionPresetLabel {
const char* objectName;
const char* label;
};
struct SpecPresetLabel {
const char* objectName;
const char* label;
};
extern const OptionPresetLabel OPTION_LABEL[];
extern const int OPTION_LABEL_COUNT;
int getOptionLabelCount();
extern const SpecPresetLabel SPEC_LABEL[];
extern const int SPEC_LABEL_COUNT;
int getSpecLabelCount();
// 入門編、初級編、応用編分離キーワード
extern const char* LEVEL_WORDS[];
extern const int LEVEL_WORDS_COUNT;
} // namespace Constants