summaryrefslogtreecommitdiffstats
path: root/src/StateManager.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-02 17:10:26 +0000
committerDavid Robillard <d@drobilla.net>2008-01-02 17:10:26 +0000
commitcc2e862e207046040438c8f0c1c1cab3dd140b13 (patch)
treee1c57dc527c35da48fe7d4f5d9819c3cdf18ccf1 /src/StateManager.cpp
parentd29ecca68be290b7c2505e48fd2b6906f2f317d9 (diff)
downloadpatchage-cc2e862e207046040438c8f0c1c1cab3dd140b13.tar.gz
patchage-cc2e862e207046040438c8f0c1c1cab3dd140b13.tar.bz2
patchage-cc2e862e207046040438c8f0c1c1cab3dd140b13.zip
Added back retarded "do the winndow manager's job" code.
git-svn-id: http://svn.drobilla.net/lad/patchage@1005 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/StateManager.cpp')
-rw-r--r--src/StateManager.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/StateManager.cpp b/src/StateManager.cpp
index 86fe07c..9753a18 100644
--- a/src/StateManager.cpp
+++ b/src/StateManager.cpp
@@ -27,6 +27,10 @@ using namespace std;
StateManager::StateManager()
{
+ _window_location.x = 0;
+ _window_location.y = 0;
+ _window_size.x = 640;
+ _window_size.y = 480;
_zoom = 1.0;
}
@@ -100,16 +104,24 @@ StateManager::load(const string& filename)
}
string s;
- is >> s;
+ is >> s;
if (s == "window_location") {
- is >> s; is >> s; is >> s;// skip
+ is >> s;
+ _window_location.x = atoi(s.c_str());
+ is >> s;
+ _window_location.y = atoi(s.c_str());
}
+ is >> s;
if (s == "window_size") {
- is >> s; is >> s; is >> s;// skip
+ is >> s;
+ _window_size.x = atoi(s.c_str());
+ is >> s;
+ _window_size.y = atoi(s.c_str());
}
+ is >> s;
if (s != "zoom_level") {
std::string msg = "Corrupt settings file: expected \"zoom_level\", found \"";
msg.append(s).append("\"");
@@ -165,6 +177,8 @@ StateManager::save(const string& filename)
std::ofstream os;
os.open(filename.c_str(), std::ios::out);
+ os << "window_location " << _window_location.x << " " << _window_location.y << std::endl;
+ os << "window_size " << _window_size.x << " " << _window_size.y << std::endl;
os << "zoom_level " << _zoom << std::endl;
ModuleLocation ml;