From 3120270d876c38f6ba22b49a44d93899f831cef6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 28 Dec 2016 12:35:28 +0100 Subject: Add enum for locale-config --- libs/ardour/ardour/types.h | 8 ++++++++ libs/ardour/enums.cc | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 5e59053aef..9a7b719111 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -249,6 +249,12 @@ namespace ARDOUR { TrackColor }; + enum LocaleMode { + SET_LC_ALL, + SET_LC_MESSAGES, + SET_LC_MESSAGES_AND_LC_NUMERIC + }; + enum RoundMode { RoundDownMaybe = -2, ///< Round down only if necessary RoundDownAlways = -1, ///< Always round down, even if on a division @@ -762,11 +768,13 @@ LIBARDOUR_API std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& s LIBARDOUR_API std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf); LIBARDOUR_API std::istream& operator>>(std::istream& o, ARDOUR::VUMeterStandard& sf); LIBARDOUR_API std::istream& operator>>(std::istream& o, ARDOUR::MeterLineUp& sf); +LIBARDOUR_API std::istream& operator>>(std::istream& o, ARDOUR::LocaleMode& sf); LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf); LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf); LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::VUMeterStandard& sf); LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::MeterLineUp& sf); +LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::LocaleMode& sf); static inline ARDOUR::framepos_t diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index cd1a120c92..db8aeb17b2 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -63,6 +63,7 @@ setup_enum_writer () NoteMode _NoteMode; ChannelMode _ChannelMode; ColorMode _ColorMode; + LocaleMode _LocaleMode; MeterFalloff _MeterFalloff; MeterHold _MeterHold; VUMeterStandard _VUMeterStandard; @@ -247,6 +248,11 @@ setup_enum_writer () REGISTER_ENUM (TrackColor); REGISTER (_ColorMode); + REGISTER_ENUM (SET_LC_ALL); + REGISTER_ENUM (SET_LC_MESSAGES); + REGISTER_ENUM (SET_LC_MESSAGES_AND_LC_NUMERIC); + REGISTER (_LocaleMode); + REGISTER_ENUM (MeterFalloffOff); REGISTER_ENUM (MeterFalloffSlowest); REGISTER_ENUM (MeterFalloffSlow); @@ -869,6 +875,20 @@ std::ostream& operator<<(std::ostream& o, const MeterLineUp& var) return o << s; } +std::istream& operator>>(std::istream& o, LocaleMode& var) +{ + std::string s; + o >> s; + var = (LocaleMode) string_2_enum (s, var); + return o; +} + +std::ostream& operator<<(std::ostream& o, const LocaleMode& var) +{ + std::string s = enum_2_string (var); + return o << s; +} + std::istream& operator>>(std::istream& o, PFLPosition& var) { std::string s; -- cgit v1.2.3