[379103]: src / org / esb / config / Defaults.cpp  Maximize  Restore  History

Download this file

50 lines (42 with data), 1.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "org/esb/util/Properties.h"
#include "org/esb/io/File.h"
#include <stdlib.h>
namespace org {
namespace esb {
namespace config {
void loadDefaults(Properties * props) {
/*setting up the base path*/
std::string base_path;
if(!props->hasProperty("hive.base_path")){
org::esb::io::File base(".");
base_path = base.getPath();
}else{
base_path = props->getProperty("hive.base_path");
}
//std::cout<<"BasePath=" << base_path<<std::endl;
props->setProperty("hive.base_path", base_path.c_str());
props->setProperty("hive.data_path", base_path+"/data");
/*default port for HiveListener*/
props->setProperty("hive.port", "20200");
/*default port for Webserver*/
props->setProperty("web.port", "8080");
/*make directory for the database*/
org::esb::io::File datadir(base_path+"/data");
if(!datadir.exists())
datadir.mkdir();
/*default url for the Database Server*/
if(!props->hasProperty("db.url"))
props->setProperty("db.url", "database="+base_path+"/data/hive.db");
/*default path for the presets*/
props->setProperty("preset.path", base_path+"/presets");
props->setProperty("log.path", base_path+"/logs");
putenv("bla=test");
//setenv("log.path",std::string(base_path+"/logs").c_str(),1);
/*default parameter for the encoding profiles*/
//props->setProperty("framerates", "1/10#10,1/15#15,1000/23976#23.976,1/24#24,1/25#25,100/2997#29.97,1/30#30");
//props->setProperty("samplerates", "8000,11025,22050,32000,44100,48000");
//props->setProperty("audiobitrates", "32000,96000,128000,160000,192000,224000,256000,320000");
}
}
}
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks