| 90 | } |
| 91 | |
| 92 | void DurationController::setup(){ |
| 93 | |
| 94 | #ifdef TARGET_WIN32 |
| 95 | FreeConsole(); |
| 96 | #endif |
| 97 | if(!translation.load("languageFile.csv")){ |
| 98 | ofLogError("DurationController::setup") << "error setting up translation, unpredictable stuff will happen" << endl; |
| 99 | } |
| 100 | |
| 101 | ofxXmlSettings defaultSettings; |
| 102 | bool settingsLoaded = defaultSettings.loadFile("settings.xml"); ; |
| 103 | translation.setCurrentLanguage(defaultSettings.getValue("language", "english")); |
| 104 | |
| 105 | if(!settingsLoaded){ |
| 106 | defaultSettings.setValue("language", "english"); |
| 107 | defaultSettings.saveFile(); |
| 108 | } |
| 109 | |
| 110 | //populate projects |
| 111 | vector<string> projects; |
| 112 | projects.push_back(translation.translateKey("new project...")); |
| 113 | projects.push_back(translation.translateKey("open project...")); |
| 114 | |
| 115 | #ifdef TARGET_WIN32 |
| 116 | defaultProjectDirectoryPath = ofToDataPath(ofFilePath::getUserHomeDir() + "\\Documents\\Duration\\"); |
| 117 | #else |
| 118 | defaultProjectDirectoryPath = ofToDataPath(ofFilePath::getUserHomeDir() + "/Documents/Duration/"); |
| 119 | #endif |
| 120 | ofDirectory projectDirectory = ofDirectory(defaultProjectDirectoryPath); |
| 121 | |
| 122 | if(!projectDirectory.exists()){ |
| 123 | projectDirectory.create(true); |
| 124 | } |
| 125 | |
| 126 | projectDirectory.listDir(); |
| 127 | for(int i = 0; i < projectDirectory.size(); i++){ |
| 128 | if(projectDirectory.getFile(i).isDirectory()){ |
| 129 | ofDirectory subDir = ofDirectory(projectDirectory.getPath(i)); |
| 130 | //cout << "checking path " << projectDirectory.getPath(i) << endl; |
| 131 | subDir.allowExt("durationproj"); |
| 132 | subDir.setShowHidden(true); |
| 133 | subDir.listDir(); |
| 134 | if(subDir.size() > 0){ |
| 135 | projects.push_back(projectDirectory.getName(i)); |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | #ifdef TARGET_WIN32 |
| 141 | timeline.setupFont("GUI/mplus-1c-regular.ttf", 9); |
| 142 | tooltipFont.loadFont("GUI/mplus-1c-regular.ttf", 7); |
| 143 | #else |
| 144 | timeline.setupFont("GUI/mplus-1c-regular.ttf", 6); |
| 145 | tooltipFont.loadFont("GUI/mplus-1c-regular.ttf", 5); |
| 146 | #endif |
| 147 | //setup timeline |
| 148 | timeline.setup(); |
| 149 | // timeline.curvesUseBinary = true; //ELOI SWITCH THIS HERE |
no outgoing calls
no test coverage detected