ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

registry.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GRIM_REGISTRY_H
00024 #define GRIM_REGISTRY_H
00025 
00026 #include "common/str.h"
00027 
00028 namespace Grim {
00029 
00030 class Registry {
00031 public:
00032     enum ValueType {
00033         String,
00034         Integer,
00035         Boolean
00036     };
00037 
00038     const Common::String &getString(const Common::String &key) const;
00039     int getInt(const Common::String &key) const;
00040     bool getBool(const Common::String &key) const;
00041 
00042     void setString(const Common::String &key, const Common::String &val);
00043     void setInt(const Common::String &key, int val);
00044     void setBool(const Common::String &key, bool val);
00045 
00046     ValueType getValueType(const Common::String &key) const;
00047 
00048     void save();
00049 
00050     Registry();
00051     ~Registry() { }
00052 
00053 private:
00054     static Registry *_instance;
00055 
00056     class Value {
00057     public:
00058         void setString(const Common::String &str);
00059         void setInt(int num);
00060         void setBool(bool val);
00061 
00062         const Common::String &getString() const;
00063         int getInt() const;
00064         bool getBool() const;
00065 
00066         ValueType getType() const;
00067 
00068     private:
00069         struct {
00070             Common::String _str;
00071             int _num;
00072             bool _bool;
00073         } _val;
00074         ValueType _type;
00075     };
00076 
00077     const Value &value(const Common::String &key) const;
00078     Value &value(const Common::String &key);
00079 
00080     Value _develMode;
00081     Value _dataPath;
00082     Value _savePath;
00083     Value _lastSet;
00084     Value _musicVolume;
00085     Value _sfxVolume;
00086     Value _voiceVolume;
00087     Value _lastSavedGame;
00088     Value _gamma;
00089     Value _voiceEffects;
00090     Value _textSpeed;
00091     Value _speechMode;
00092     Value _movement;
00093     Value _joystick;
00094     Value _spewOnError;
00095     Value _transcript;
00096 
00097     bool _dirty;
00098 
00099     uint convertVolumeToMixer(uint volume);
00100     uint convertVolumeFromMixer(uint volume);
00101     uint convertTalkSpeedToGUI(uint talkspeed);
00102     uint convertTalkSpeedFromGUI(uint talkspeed);
00103     bool convertSubtitlesToGUI(uint speechmode);
00104     bool convertSpeechMuteToGUI(uint speechmode);
00105     uint convertSpeechModeFromGUI(bool subtitles, bool speechMute);
00106 };
00107 
00108 extern Registry *g_registry;
00109 
00110 } // end of namespace Grim
00111 
00112 #endif


Generated on Sat Oct 12 2019 05:00:56 for ResidualVM by doxygen 1.7.1
curved edge   curved edge