diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2007-08-15 11:07:29 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2007-08-15 11:07:29 +0000 |
commit | bbf71ad0d6ec0795bbeb38dd8ec9dc5e5d00792a (patch) | |
tree | 1a21598cff5dcd74bf7beb6f80c5fb645913b85b /orkbasecxx/Config.cpp | |
parent | 2bb9acafea271a124e42c3f0221bcf3fe9144afa (diff) |
Configuration options AudioFilePermissions, AudioFileOwner and AudioFileGroup added to specify the permissions, file owner and file group of audio files produced
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@465 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/Config.cpp')
-rw-r--r-- | orkbasecxx/Config.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/orkbasecxx/Config.cpp b/orkbasecxx/Config.cpp index 75f36f7..8deb8ae 100644 --- a/orkbasecxx/Config.cpp +++ b/orkbasecxx/Config.cpp @@ -41,6 +41,9 @@ Config::Config() m_trackerTcpPort = TRACKER_TCP_PORT_DEFAULT; m_trackerServicename = TRACKER_SERVICENAME_DEFAULT; m_audioOutputPath = AUDIO_OUTPUT_PATH_DEFAULT; + m_audioFilePermissions = strtol(AUDIO_FILE_PERMISSIONS_DEFAULT, NULL, 8); + m_audioFileOwner = AUDIO_FILE_OWNER_DEFAULT; + m_audioFileGroup = AUDIO_FILE_GROUP_DEFAULT; m_immediateProcessingQueueSize = IMMEDIATE_PROCESSING_QUEUE_SIZE_DEFAULT; m_batchProcessingQueueSize = BATCH_PROCESSING_QUEUE_SIZE_DEFAULT; m_batchProcessingEnhancePriority = BATCH_PROCESSING_ENHANCE_PRIORITY_DEFAULT; @@ -103,6 +106,14 @@ void Config::Define(Serializer* s) } } + s->StringValue(AUDIO_FILE_PERMISSIONS_PARAM, m_audioFilePermissionsStr); + if(m_audioFilePermissionsStr.size()) + { + m_audioFilePermissions = strtoul(m_audioFilePermissionsStr.c_str(), NULL, 8); + } + + s->StringValue(AUDIO_FILE_OWNER_PARAM, m_audioFileOwner); + s->StringValue(AUDIO_FILE_GROUP_PARAM, m_audioFileGroup); s->IntValue(IMMEDIATE_PROCESSING_QUEUE_SIZE_PARAM, m_immediateProcessingQueueSize); s->IntValue(BATCH_PROCESSING_QUEUE_SIZE_PARAM, m_batchProcessingQueueSize); s->BoolValue(BATCH_PROCESSING_ENHANCE_PRIORITY_PARAM, m_batchProcessingEnhancePriority); @@ -148,6 +159,21 @@ void Config::Validate() { throw CStdString(CStdString("Config::Validate: please choose between audio segmentation and VAD ! Both cannot be true at the same time")); } + + if(m_audioFilePermissions == 0) + { + int perm10; + + perm10 = strtoul(m_audioFilePermissionsStr.c_str(), NULL, 10); + if(perm10 < 0 || perm10 > 511) + { + CStdString exc; + + exc.Format("Config::Validate: please set valid permissions the AudioFilePermissions paramiter in config.xml - %s is not a valid file permission", m_audioFilePermissionsStr); + + throw(CStdString(exc)); + } + } } CStdString Config::GetClassName() |