2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <boost/optional.hpp>
26 enum DisplayStandard {
27 DISPLAY_STANDARD_UNDEFINED,
28 DISPLAY_STANDARD_OPEN_SUBTITLING,
29 DISPLAY_STANDARD_LEVEL_1_TELETEXT,
30 DISPLAY_STANDARD_LEVEL_2_TELETEXT
35 LANGUAGE_GROUP_LATIN_CYRILLIC,
36 LANGUAGE_GROUP_LATIN_ARABIC,
37 LANGUAGE_GROUP_LATIN_GREEK,
38 LANGUAGE_GROUP_LATIN_HEBREW
67 LANGUAGE_LUXEMBORGIAN,
92 LANGUAGE_BIELORUSSIAN,
129 LANGUAGE_SERBO_CROAT,
133 LANGUAGE_SRANAN_TONGO,
147 enum TimecodeStatus {
148 TIMECODE_STATUS_NOT_INTENDED_FOR_USE,
149 TIMECODE_STATUS_INTENDED_FOR_USE
152 enum CumulativeStatus {
153 CUMULATIVE_STATUS_NOT_CUMULATIVE,
154 CUMULATIVE_STATUS_FIRST,
155 CUMULATIVE_STATUS_INTERMEDIATE,
156 CUMULATIVE_STATUS_LAST
162 JUSTIFICATION_CENTRE,
171 /** @class STLBinaryCode
172 * @brief A value of some STL parameter and a human-readable description of what it means.
182 STLBinaryCode (T v, std::string d)
188 std::string description;
191 /** @class STLBinaryTables
192 * @brief A set of conversion tables for STL binary files.
194 class STLBinaryTables
199 DisplayStandard display_standard_file_to_enum (std::string) const;
200 LanguageGroup language_group_file_to_enum (std::string) const;
201 Language language_file_to_enum (std::string) const;
202 TimecodeStatus timecode_status_file_to_enum (std::string) const;
203 CumulativeStatus cumulative_status_file_to_enum (int) const;
204 Justification justification_file_to_enum (int) const;
205 Comment comment_file_to_enum (int) const;
207 std::string language_enum_to_file (Language) const;
208 int cumulative_status_enum_to_file (CumulativeStatus) const;
209 int justification_enum_to_file (Justification) const;
210 int comment_enum_to_file (Comment) const;
212 std::string display_standard_enum_to_description (DisplayStandard) const;
213 std::string language_group_enum_to_description (LanguageGroup) const;
214 std::string language_enum_to_description (Language) const;
215 std::string timecode_status_enum_to_description (TimecodeStatus) const;
216 std::string cumulative_status_enum_to_description (CumulativeStatus) const;
217 std::string justification_enum_to_description (Justification) const;
218 std::string comment_enum_to_description (Comment) const;
220 boost::optional<Language> language_description_to_enum (std::string) const;
223 std::map<std::string, STLBinaryCode<DisplayStandard> > _display_standard_map;
224 std::map<std::string, STLBinaryCode<LanguageGroup> > _language_group_map;
225 std::map<std::string, STLBinaryCode<Language> > _language_map;
226 std::map<std::string, STLBinaryCode<TimecodeStatus> > _timecode_status_map;
227 std::map<int, STLBinaryCode<CumulativeStatus> > _cumulative_status_map;
228 std::map<int, STLBinaryCode<Justification> > _justification_map;
229 std::map<int, STLBinaryCode<Comment> > _comment_map;