Add enum for locale-config
authorRobin Gareus <robin@gareus.org>
Wed, 28 Dec 2016 11:35:28 +0000 (12:35 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 28 Dec 2016 12:38:49 +0000 (13:38 +0100)
libs/ardour/ardour/types.h
libs/ardour/enums.cc

index 5e59053aef425e42fad7c1ee37ce87462bfd8a28..9a7b71911186048e116e47b3321172cae6a5db6a 100644 (file)
@@ -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
index cd1a120c92c5ccb428862da9c4c9fcdc6c7f6be0..db8aeb17b2b9534b374f7fd6a530686cb1e53b2a 100644 (file)
@@ -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;