summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-06-21 21:06:13 +0000
committerHenri Herscher <henri@oreka.org>2006-06-21 21:06:13 +0000
commit2da3fde0f17f0df3ac54559badadefcc347126e5 (patch)
tree7a9c3107dbf33df2bbebd44d97e62894c5a80cd1
parent77a00908352320ba499b2760e709c2313c1df292 (diff)
Moved ConfigManager and LogManager stuff to orkbasecxx
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@280 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/AudioCapturePlugin.h48
-rw-r--r--orkaudio/Config.cpp124
-rw-r--r--orkaudio/Config.h117
-rw-r--r--orkaudio/ConfigManager.cpp112
-rw-r--r--orkaudio/ConfigManager.h38
-rw-r--r--orkaudio/LogManager.cpp58
-rw-r--r--orkaudio/LogManager.h46
-rw-r--r--orkaudio/OrkAudio.dsp28
-rw-r--r--orkbasecxx/AudioCapture.h2
-rw-r--r--orkbasecxx/AudioCapturePlugin.h11
-rw-r--r--orkbasecxx/Config.h2
-rw-r--r--orkbasecxx/ConfigManager.h2
-rw-r--r--orkbasecxx/LogManager.h3
-rw-r--r--orkbasecxx/MultiThreadedServer.h2
-rw-r--r--orkbasecxx/Object.h3
-rw-r--r--orkbasecxx/OrkBase.dsp36
-rw-r--r--orkbasecxx/OrkBase.h18
-rw-r--r--orkbasecxx/Utils.h2
-rw-r--r--orkbasecxx/dll.h10
-rw-r--r--orkbasecxx/messages/Message.h2
-rw-r--r--orkbasecxx/serializers/Serializer.h3
21 files changed, 69 insertions, 598 deletions
diff --git a/orkaudio/AudioCapturePlugin.h b/orkaudio/AudioCapturePlugin.h
deleted file mode 100644
index e52fe97..0000000
--- a/orkaudio/AudioCapturePlugin.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#ifndef __AUDIOCAPTUREPLUGIN_H__
-#define __AUDIOCAPTUREPLUGIN_H__
-
-#include "AudioCapture.h"
-#include "LogManager.h"
-#include "xercesc/dom/DOMNode.hpp"
-
-using namespace XERCES_CPP_NAMESPACE;
-
-#ifdef WIN32
-#define __CDECL__ __cdecl
-#else
-#define __CDECL__
-#endif
-
-#define AUDIO_CAPTURE_PLUGIN_INTERFACE_VERSION 1
-
-// Callback definitions
-typedef void (__CDECL__*AudioChunkCallBackFunction)(AudioChunkRef, CStdString& capturePort);
-typedef void (__CDECL__*CaptureEventCallBackFunction)(CaptureEventRef, CStdString& capturePort);
-
-
-// Exported functions definitions
-typedef void (__CDECL__* RegisterCallBacksFunction)(AudioChunkCallBackFunction, CaptureEventCallBackFunction, OrkLogManager*);
-typedef void (__CDECL__* InitializeFunction)();
-typedef void (__CDECL__* RunFunction)();
-typedef void (__CDECL__* ShutdownFunction)();
-typedef void (__CDECL__* ConfigureFunction)(DOMNode*);
-typedef void (__CDECL__* StartCaptureFunction)(CStdString& port);
-typedef void (__CDECL__* StopCaptureFunction)(CStdString& port);
-
-
-
-#endif
-
diff --git a/orkaudio/Config.cpp b/orkaudio/Config.cpp
deleted file mode 100644
index f394624..0000000
--- a/orkaudio/Config.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
-
-#include "ace/OS_NS_unistd.h"
-#include "Utils.h"
-#include "serializers/Serializer.h"
-#include "Config.h"
-
-Config::Config()
-{
- m_log = log4cxx::Logger::getLogger("config");
-
- m_logMessages = LOG_MESSAGES_DEFAULT;
- m_logRms = LOG_RMS_DEFAULT;
- m_enableReporting = ENABLE_REPORTING_DEFAULT;
- m_capturePluginPath = CAPTURE_PLUGIN_PATH_DEFAULT;
- m_storageAudioFormat = STORAGE_AUDIO_FORMAT_DEFAULT;
- m_numBatchThreads = NUM_BATCH_THREADS_DEFAULT;
- m_deleteNativeFile = DELETE_NATIVE_FILE_DEFAULT;
- m_audioChunkDefaultSize = AUDIO_CHUNK_DEFAULT_SIZE_DEFAULT;
- m_audioSegmentation = AUDIO_SEGMENTATION_DEFAULT;
- m_audioSegmentDuration = AUDIO_SEGMENT_DURATION_DEFAULT;
- m_vad = VAD_DEFAULT;
- m_vadHighThresholdDb = VAD_HIGH_THRESHOLD_DB_DEFAULT;
- m_vadLowThresholdDb = VAD_LOW_THRESHOLD_DB_DEFAULT;
- m_vadHoldOnSec = VAD_HOLD_ON_SEC_DEFAULT;
- m_trackerHostname = TRACKER_HOSTNAME_DEFAULT;
- m_trackerTcpPort = TRACKER_TCP_PORT_DEFAULT;
- m_trackerServicename = TRACKER_SERVICENAME_DEFAULT;
- m_audioOutputPath = AUDIO_OUTPUT_PATH_DEFAULT;
- m_immediateProcessingQueueSize = IMMEDIATE_PROCESSING_QUEUE_SIZE_DEFAULT;
- m_batchProcessingQueueSize = BATCH_PROCESSING_QUEUE_SIZE_DEFAULT;
- m_batchProcessingEnhancePriority = BATCH_PROCESSING_ENHANCE_PRIORITY_DEFAULT;
- m_deleteFailedCaptureFile = DELETE_FAILED_CAPTURE_FILE_DEFAULT;
-
- char hostname[40];
- ACE_OS::hostname(hostname, 40);
- //ACE_OS::hostname(hostname, HOSTNAME_BUF_LEN);
- m_serviceName = CStdString("orkaudio-") + hostname;
-
- m_reportingRetryDelay = 5;
- m_clientTimeout = 5;
-}
-
-void Config::Define(Serializer* s)
-{
- s->BoolValue(LOG_MESSAGES_PARAM, m_logMessages);
- s->BoolValue(LOG_RMS_PARAM, m_logRms);
- s->BoolValue(ENABLE_REPORTING_PARAM, m_enableReporting);
- s->StringValue(CAPTURE_PLUGIN_PARAM, m_capturePlugin);
- s->StringValue(CAPTURE_PLUGIN_PATH_PARAM, m_capturePluginPath);
- s->EnumValue(STORAGE_AUDIO_FORMAT_PARAM, (int&)m_storageAudioFormat, FileFormatToEnum, FileFormatToString);
- s->IntValue(NUM_BATCH_THREADS_PARAM, m_numBatchThreads);
- s->BoolValue(DELETE_NATIVE_FILE_PARAM, m_deleteNativeFile);
- s->IntValue(AUDIO_CHUNK_DEFAULT_SIZE_PARAM, m_audioChunkDefaultSize);
- s->BoolValue(AUDIO_SEGMENTATION_PARAM, m_audioSegmentation);
- s->IntValue(AUDIO_SEGMENT_DURATION_PARAM, m_audioSegmentDuration);
- s->BoolValue(VAD_PARAM, m_vad);
- s->DoubleValue(VAD_HIGH_THRESHOLD_DB_PARAM, m_vadHighThresholdDb);
- s->DoubleValue(VAD_LOW_THRESHOLD_DB_PARAM, m_vadLowThresholdDb);
- s->DoubleValue(VAD_HOLD_ON_SEC_PARAM, m_vadHoldOnSec);
- s->StringValue(TRACKER_HOSTNAME_PARAM, m_trackerHostname);
- s->IntValue(TRACKER_TCP_PORT_PARAM, m_trackerTcpPort);
- s->StringValue(TRACKER_SERVICENAME_PARAM, m_trackerServicename);
- s->StringValue(SERVICE_NAME_PARAM, m_serviceName);
- s->IntValue(REPORTING_RETRY_DELAY_PARAM, m_reportingRetryDelay);
- s->IntValue(CLIENT_TIMEOUT_PARAM, m_clientTimeout);
- s->StringValue(AUDIO_OUTPUT_PATH_PARAM, m_audioOutputPath);
- 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);
- s->BoolValue(DELETE_FAILED_CAPTURE_FILE_PARAM, m_deleteFailedCaptureFile);
-}
-
-void Config::Validate()
-{
- if (m_storageAudioFormat <= FfUnknown || m_storageAudioFormat >= FfInvalid)
- {
- throw CStdString(CStdString("Config::Validate: value out of range:") + STORAGE_AUDIO_FORMAT_PARAM);
- }
- if (m_numBatchThreads > 2)
- {
- LOG4CXX_WARN(m_log, "It is not recommended to have more batch threads than CPUs");
- }
- if (m_vadHighThresholdDb < -45.0 || m_vadHighThresholdDb>0.0)
- {
- throw CStdString(CStdString("Config::Validate: value out of range:") + VAD_HIGH_THRESHOLD_DB_PARAM);
- }
- if (m_vadLowThresholdDb < -45.0 || m_vadLowThresholdDb>0.0)
- {
- throw CStdString(CStdString("Config::Validate: value out of range:") + VAD_LOW_THRESHOLD_DB_PARAM);
- }
- if (m_vadHighThresholdDb < m_vadLowThresholdDb)
- {
- throw CStdString(CStdString("Config::Validate: ") + VAD_LOW_THRESHOLD_DB_PARAM + " should be lower than " + VAD_HIGH_THRESHOLD_DB_PARAM);
- }
- if (m_vad && m_audioSegmentation)
- {
- throw CStdString(CStdString("Config::Validate: please choose between audio segmentation and VAD ! Both cannot be true at the same time"));
- }
-}
-
-CStdString Config::GetClassName()
-{
- return CStdString("Config");
-}
-
-ObjectRef Config::NewInstance()
-{
- return ObjectRef(new Config);
-}
-
diff --git a/orkaudio/Config.h b/orkaudio/Config.h
deleted file mode 100644
index e910586..0000000
--- a/orkaudio/Config.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#ifndef __CONFIG_H__
-#define __CONFIG_H__
-
-#include "StdString.h"
-#include "Object.h"
-#include "AudioCapture.h"
-#include <log4cxx/logger.h>
-
-
-#define LOG_MESSAGES_PARAM "LogMessages"
-#define LOG_MESSAGES_DEFAULT false
-#define CAPTURE_PLUGIN_PARAM "CapturePlugin"
-#define CAPTURE_PLUGIN_DEFAULT ""
-#define CAPTURE_PLUGIN_PATH_PARAM "CapturePluginPath"
-#define CAPTURE_PLUGIN_PATH_DEFAULT "AudioCapturePlugins"
-#define STORAGE_AUDIO_FORMAT_PARAM "StorageAudioFormat"
-#define STORAGE_AUDIO_FORMAT_DEFAULT FfGsm
-#define NUM_BATCH_THREADS_PARAM "NumBatchThreads"
-#define NUM_BATCH_THREADS_DEFAULT 1
-#define DELETE_NATIVE_FILE_PARAM "DeleteNativeFile"
-#define DELETE_NATIVE_FILE_DEFAULT true
-#define ENABLE_REPORTING_PARAM "EnableReporting"
-#define ENABLE_REPORTING_DEFAULT true
-#define AUDIO_CHUNK_DEFAULT_SIZE_PARAM "AudioChunkDefaultSize"
-#define AUDIO_CHUNK_DEFAULT_SIZE_DEFAULT 8000
-#define AUDIO_SEGMENTATION_PARAM "AudioSegmentation"
-#define AUDIO_SEGMENTATION_DEFAULT false
-#define AUDIO_SEGMENT_DURATION_PARAM "AudioSegmentDuration"
-#define AUDIO_SEGMENT_DURATION_DEFAULT 60
-#define LOG_RMS_PARAM "LogRms"
-#define LOG_RMS_DEFAULT false
-#define VAD_PARAM "VAD"
-#define VAD_DEFAULT false
-#define VAD_HIGH_THRESHOLD_DB_PARAM "VadHighThresholdDb"
-#define VAD_HIGH_THRESHOLD_DB_DEFAULT -12.2
-#define VAD_LOW_THRESHOLD_DB_PARAM "VadLowThresholdDb"
-#define VAD_LOW_THRESHOLD_DB_DEFAULT -12.5
-#define VAD_HOLD_ON_SEC_PARAM "VadHoldOnSec"
-#define VAD_HOLD_ON_SEC_DEFAULT 4
-#define TRACKER_HOSTNAME_PARAM "TrackerHostname"
-#define TRACKER_HOSTNAME_DEFAULT "localhost"
-#define TRACKER_TCP_PORT_PARAM "TrackerTcpPort"
-#define TRACKER_TCP_PORT_DEFAULT 8080
-#define TRACKER_SERVICENAME_PARAM "TrackerServicename"
-#define TRACKER_SERVICENAME_DEFAULT "orktrack"
-#define SERVICE_NAME_PARAM "ServiceName"
-#define REPORTING_RETRY_DELAY_PARAM "ReportingRetryDelay"
-#define CLIENT_TIMEOUT_PARAM "ClientTimeout"
-#define AUDIO_OUTPUT_PATH_PARAM "AudioOutputPath"
-#define AUDIO_OUTPUT_PATH_DEFAULT "."
-#define IMMEDIATE_PROCESSING_QUEUE_SIZE_PARAM "ImmediateProcessingQueueSize"
-#define IMMEDIATE_PROCESSING_QUEUE_SIZE_DEFAULT 10000
-#define BATCH_PROCESSING_QUEUE_SIZE_PARAM "BatchProcessingQueueSize"
-#define BATCH_PROCESSING_QUEUE_SIZE_DEFAULT 20000
-#define BATCH_PROCESSING_ENHANCE_PRIORITY_PARAM "BatchProcessingEnhancePriority"
-#define BATCH_PROCESSING_ENHANCE_PRIORITY_DEFAULT false
-#define DELETE_FAILED_CAPTURE_FILE_PARAM "DeleteFailedCaptureFile"
-#define DELETE_FAILED_CAPTURE_FILE_DEFAULT false
-
-class Config : public Object
-{
-public:
- Config();
- void Define(Serializer* s);
- void Validate();
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- bool m_logMessages;
- bool m_logRms;
- bool m_enableReporting;
- CStdString m_capturePlugin;
- CStdString m_capturePluginPath;
- int m_numBatchThreads;
- bool m_deleteNativeFile;
- int m_audioChunkDefaultSize;
- bool m_audioSegmentation;
- int m_audioSegmentDuration;
- FileFormatEnum m_storageAudioFormat;
- bool m_vad;
- double m_vadHighThresholdDb;
- double m_vadLowThresholdDb;
- double m_vadHoldOnSec;
- CStdString m_trackerHostname;
- CStdString m_trackerServicename;
- int m_trackerTcpPort;
- CStdString m_serviceName;
- int m_reportingRetryDelay;
- int m_clientTimeout;
- CStdString m_audioOutputPath;
- int m_immediateProcessingQueueSize;
- int m_batchProcessingQueueSize;
- bool m_batchProcessingEnhancePriority;
- bool m_deleteFailedCaptureFile;
-
-private:
- log4cxx::LoggerPtr m_log;
-};
-
-
-#endif
-
diff --git a/orkaudio/ConfigManager.cpp b/orkaudio/ConfigManager.cpp
deleted file mode 100644
index a599bfa..0000000
--- a/orkaudio/ConfigManager.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
-
-#include "Utils.h"
-#include <xercesc/parsers/XercesDOMParser.hpp>
-#include <xercesc/dom/DOMWriter.hpp>
-#include <xercesc/dom/DOMImplementation.hpp>
-#include <xercesc/dom/DOMImplementationRegistry.hpp>
-#include "serializers/DomSerializer.h"
-#include "ConfigManager.h"
-
-#define CONFIG_FILE_NAME "config.xml"
-#define ETC_CONFIG_FILE_NAME "/etc/orkaudio/config.xml"
-
-
-void ConfigManager::Initialize()
-{
- bool failed = false;
- m_configTopNode = NULL;
-
- try
- {
- char* cfgFilename = "";
- FILE* file = ACE_OS::fopen(CONFIG_FILE_NAME, "r");
- if(file)
- {
- // config.xml exists in the current directory
- cfgFilename = CONFIG_FILE_NAME;
- fclose(file);
- }
- else
- {
- // config.xml could not be found in the current directory, try to find it in system configuration directory
- cfgFilename = ETC_CONFIG_FILE_NAME;
- }
-
- XMLPlatformUtils::Initialize();
- XercesDOMParser *parser = new XercesDOMParser;
- parser->parse(cfgFilename);
- DOMNode *doc = NULL;
- doc = parser->getDocument();
-
- if (doc)
- {
- DOMNode *firstChild = doc->getFirstChild();
- if (firstChild)
- {
- m_configTopNode = firstChild;
- m_config.DeSerializeDom(firstChild);
-
- /*
- // Write out config to a file
- DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XStr("Core").unicodeForm());
- XERCES_CPP_NAMESPACE::DOMDocument* myDoc;
- myDoc = impl->createDocument(
- 0, // root element namespace URI.
- XStr("root").unicodeForm(), // root element name
- 0); // document type object (DTD).
- m_config.SerializeDom(myDoc);
- CStdString toto = DomSerializer::DomNodeToString(myDoc);
- FILE* file = fopen("zzz.xml", "w");
- fwrite((PCSTR)toto,1,toto.GetLength(),file);
- fclose(file);
- */
- }
- else
- {
- LOG4CXX_ERROR(LOG.configLog, CStdString("Could not parse config file:") + CONFIG_FILE_NAME);
- failed = true;
- }
- }
- else
- {
- LOG4CXX_WARN(LOG.configLog, CStdString("Could not find config file:") + CONFIG_FILE_NAME);
- }
- }
- catch (const CStdString& e)
- {
- LOG4CXX_ERROR(LOG.configLog, e);
- failed = true;
- }
- catch(const XMLException& e)
- {
- LOG4CXX_ERROR(LOG.configLog, e.getMessage());
- failed = true;
- }
- if (failed)
- {
- exit(0);
- }
-}
-
-
-void ConfigManager::AddConfigureFunction(ConfigureFunction configureFunction)
-{
- m_configureFunction = configureFunction;
- // Cal the external configure callback straight away
- m_configureFunction(m_configTopNode);
-}
-
diff --git a/orkaudio/ConfigManager.h b/orkaudio/ConfigManager.h
deleted file mode 100644
index a3eb42b..0000000
--- a/orkaudio/ConfigManager.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#ifndef __CONFIGMANAGER_H__
-#define __CONFIGMANAGER_H__
-
-#include "ace/Singleton.h"
-#include "Config.h"
-#include "AudioCapturePlugin.h"
-
-class ConfigManager
-{
-public:
- void Initialize();
- void AddConfigureFunction(ConfigureFunction);
-
- Config m_config;
-private:
- ConfigureFunction m_configureFunction;
- DOMNode* m_configTopNode;
-};
-
-typedef ACE_Singleton<ConfigManager, ACE_Thread_Mutex> ConfigManagerSingleton;
-
-#define CONFIG ConfigManagerSingleton::instance()->m_config
-
-#endif
-
diff --git a/orkaudio/LogManager.cpp b/orkaudio/LogManager.cpp
deleted file mode 100644
index 3092f85..0000000
--- a/orkaudio/LogManager.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
-
-#include "LogManager.h"
-#include <log4cxx/propertyconfigurator.h>
-#include <log4cxx/basicconfigurator.h>
-#include <log4cxx/logmanager.h>
-
-void OrkLogManager::Initialize()
-{
- BasicConfigurator::configure();
-
- char* logCfgFilename = "";
- FILE* file = ACE_OS::fopen("logging.properties", "r");
- if(file)
- {
- // logging.properties exists in the current directory
- logCfgFilename = "logging.properties";
- fclose(file);
- }
- else
- {
- // logging.properties could not be found in the current directory, try to find it in system configuration directory
- logCfgFilename = "/etc/orkaudio/logging.properties";
- }
-
- // If this one fails, the above default configuration stays valid
- PropertyConfigurator::configure(logCfgFilename);
-
- rootLog = Logger::getLogger("root");
- topLog = Logger::getLogger("top");
- immediateProcessingLog = Logger::getLogger("immediateProcessing");
- batchProcessingLog = Logger::getLogger("batchProcessing");
- portLog = Logger::getLogger("port");
- fileLog = Logger::getLogger("file");
- reportingLog = Logger::getLogger("reporting");
- configLog = Logger::getLogger("config");
- tapelistLog = Logger::getLogger("tapelist");
- tapeLog = Logger::getLogger("tape");
-}
-
-void OrkLogManager::Shutdown()
-{
- log4cxx::LogManager::shutdown();
-}
-
diff --git a/orkaudio/LogManager.h b/orkaudio/LogManager.h
deleted file mode 100644
index 70aadc1..0000000
--- a/orkaudio/LogManager.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Oreka -- A media capture and retrieval platform
- *
- * Copyright (C) 2005, orecx LLC
- *
- * http://www.orecx.com
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License.
- * Please refer to http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#ifndef __LOGMANAGER_H__
-#define __LOGMANAGER_H__
-
-#include <log4cxx/logger.h>
-#include "ace/Singleton.h"
-
-using namespace log4cxx;
-
-
-class OrkLogManager
-{
-public:
- void Initialize();
- void Shutdown();
-
- LoggerPtr rootLog;
- LoggerPtr topLog;
- LoggerPtr immediateProcessingLog;
- LoggerPtr batchProcessingLog;
- LoggerPtr portLog;
- LoggerPtr fileLog;
- LoggerPtr reportingLog;
- LoggerPtr configLog;
- LoggerPtr tapelistLog;
- LoggerPtr tapeLog;
-};
-
-typedef ACE_Singleton<OrkLogManager, ACE_Thread_Mutex> OrkLogManagerSingleton;
-
-#define LOG (*OrkLogManagerSingleton::instance())
-
-#endif
-
diff --git a/orkaudio/OrkAudio.dsp b/orkaudio/OrkAudio.dsp
index c78995f..b674391 100644
--- a/orkaudio/OrkAudio.dsp
+++ b/orkaudio/OrkAudio.dsp
@@ -171,10 +171,6 @@ SOURCE=.\App.h
# End Source File
# Begin Source File
-SOURCE=.\AudioCapturePlugin.h
-# End Source File
-# Begin Source File
-
SOURCE=.\AudioTape.cpp
# End Source File
# Begin Source File
@@ -207,22 +203,6 @@ SOURCE=.\CapturePort.h
# End Source File
# Begin Source File
-SOURCE=.\Config.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Config.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ConfigManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ConfigManager.h
-# End Source File
-# Begin Source File
-
SOURCE=.\Daemon.cpp
# End Source File
# Begin Source File
@@ -239,14 +219,6 @@ SOURCE=.\ImmediateProcessing.h
# End Source File
# Begin Source File
-SOURCE=.\LogManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\LogManager.h
-# End Source File
-# Begin Source File
-
SOURCE=.\OrkAudio.cpp
# End Source File
# Begin Source File
diff --git a/orkbasecxx/AudioCapture.h b/orkbasecxx/AudioCapture.h
index d671145..8d5562d 100644
--- a/orkbasecxx/AudioCapture.h
+++ b/orkbasecxx/AudioCapture.h
@@ -16,7 +16,7 @@
#include "time.h"
#include "StdString.h"
-#include "OrkBase.h"
+#include "dll.h"
#include "boost/shared_ptr.hpp"
diff --git a/orkbasecxx/AudioCapturePlugin.h b/orkbasecxx/AudioCapturePlugin.h
index e52fe97..8162dc0 100644
--- a/orkbasecxx/AudioCapturePlugin.h
+++ b/orkbasecxx/AudioCapturePlugin.h
@@ -14,17 +14,18 @@
#ifndef __AUDIOCAPTUREPLUGIN_H__
#define __AUDIOCAPTUREPLUGIN_H__
+#include "dll.h"
#include "AudioCapture.h"
#include "LogManager.h"
#include "xercesc/dom/DOMNode.hpp"
using namespace XERCES_CPP_NAMESPACE;
-#ifdef WIN32
-#define __CDECL__ __cdecl
-#else
-#define __CDECL__
-#endif
+//#ifdef WIN32
+//#define __CDECL__ __cdecl
+//#else
+//#define __CDECL__
+//#endif
#define AUDIO_CAPTURE_PLUGIN_INTERFACE_VERSION 1
diff --git a/orkbasecxx/Config.h b/orkbasecxx/Config.h
index e910586..2587416 100644
--- a/orkbasecxx/Config.h
+++ b/orkbasecxx/Config.h
@@ -70,7 +70,7 @@
#define DELETE_FAILED_CAPTURE_FILE_PARAM "DeleteFailedCaptureFile"
#define DELETE_FAILED_CAPTURE_FILE_DEFAULT false
-class Config : public Object
+class DLL_IMPORT_EXPORT Config : public Object
{
public:
Config();
diff --git a/orkbasecxx/ConfigManager.h b/orkbasecxx/ConfigManager.h
index a3eb42b..aeccf35 100644
--- a/orkbasecxx/ConfigManager.h
+++ b/orkbasecxx/ConfigManager.h
@@ -18,7 +18,7 @@
#include "Config.h"
#include "AudioCapturePlugin.h"
-class ConfigManager
+class DLL_IMPORT_EXPORT ConfigManager
{
public:
void Initialize();
diff --git a/orkbasecxx/LogManager.h b/orkbasecxx/LogManager.h
index 70aadc1..e0887d8 100644
--- a/orkbasecxx/LogManager.h
+++ b/orkbasecxx/LogManager.h
@@ -16,11 +16,12 @@
#include <log4cxx/logger.h>
#include "ace/Singleton.h"
+#include "dll.h"
using namespace log4cxx;
-class OrkLogManager
+class DLL_IMPORT_EXPORT OrkLogManager
{
public:
void Initialize();
diff --git a/orkbasecxx/MultiThreadedServer.h b/orkbasecxx/MultiThreadedServer.h
index b004007..8f9fcd1 100644
--- a/orkbasecxx/MultiThreadedServer.h
+++ b/orkbasecxx/MultiThreadedServer.h
@@ -19,7 +19,7 @@
#include <log4cxx/logger.h>
-#include "OrkBase.h"
+#include "dll.h"
/** This server accepts permanent telnet like connections.
commands are accepted in "single line" format.
diff --git a/orkbasecxx/Object.h b/orkbasecxx/Object.h
index ba8128e..eb61451 100644
--- a/orkbasecxx/Object.h
+++ b/orkbasecxx/Object.h
@@ -14,7 +14,8 @@
#ifndef __OBJECT_H__
#define __OBJECT_H__
-#include "OrkBase.h"
+#include "dll.h"
+#include "StdString.h"
#include "boost/shared_ptr.hpp"
#include "xercesc/dom/DOMNode.hpp"
diff --git a/orkbasecxx/OrkBase.dsp b/orkbasecxx/OrkBase.dsp
index 79a3091..cd6e2da 100644
--- a/orkbasecxx/OrkBase.dsp
+++ b/orkbasecxx/OrkBase.dsp
@@ -244,6 +244,30 @@ SOURCE=.\AudioCapture.h
# End Source File
# Begin Source File
+SOURCE=.\AudioCapturePlugin.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Config.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ConfigManager.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ConfigManager.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\dll.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Filter.cpp
# End Source File
# Begin Source File
@@ -260,6 +284,14 @@ SOURCE=.\g711.h
# End Source File
# Begin Source File
+SOURCE=.\LogManager.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LogManager.h
+# End Source File
+# Begin Source File
+
SOURCE=.\MultiThreadedServer.cpp
# End Source File
# Begin Source File
@@ -315,10 +347,6 @@ SOURCE=.\OrkBase.cpp
# End Source File
# Begin Source File
-SOURCE=.\OrkBase.h
-# End Source File
-# Begin Source File
-
SOURCE=.\OrkClient.cpp
# End Source File
# Begin Source File
diff --git a/orkbasecxx/OrkBase.h b/orkbasecxx/OrkBase.h
index 95f1ef6..1a199c6 100644
--- a/orkbasecxx/OrkBase.h
+++ b/orkbasecxx/OrkBase.h
@@ -13,14 +13,14 @@
#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
-#ifdef WIN32
- #ifdef BUILD_ORKBASE
- #define DLL_IMPORT_EXPORT __declspec( dllexport )
- #else
- #define DLL_IMPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define DLL_IMPORT_EXPORT
-#endif
+//#ifdef WIN32
+// #ifdef BUILD_ORKBASE
+// #define DLL_IMPORT_EXPORT __declspec( dllexport )
+// #else
+// #define DLL_IMPORT_EXPORT __declspec( dllimport )
+// #endif
+//#else
+// #define DLL_IMPORT_EXPORT
+//#endif
#include "StdString.h"
diff --git a/orkbasecxx/Utils.h b/orkbasecxx/Utils.h
index 7c14f28..691d330 100644
--- a/orkbasecxx/Utils.h
+++ b/orkbasecxx/Utils.h
@@ -23,7 +23,7 @@
#include "ace/OS_NS_time.h"
#include "StdString.h"
-#include "OrkBase.h"
+#include "dll.h"
//============================================
// String related stuff
diff --git a/orkbasecxx/dll.h b/orkbasecxx/dll.h
index 7dff4e9..5966e2b 100644
--- a/orkbasecxx/dll.h
+++ b/orkbasecxx/dll.h
@@ -2,6 +2,16 @@
#define __DLL_H__
#ifdef WIN32
+ #ifdef BUILD_ORKBASE
+ #define DLL_IMPORT_EXPORT __declspec( dllexport )
+ #else
+ #define DLL_IMPORT_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define DLL_IMPORT_EXPORT
+#endif
+
+#ifdef WIN32
#define __CDECL__ __cdecl
#else
#define __CDECL__
diff --git a/orkbasecxx/messages/Message.h b/orkbasecxx/messages/Message.h
index ede5077..99ec887 100644
--- a/orkbasecxx/messages/Message.h
+++ b/orkbasecxx/messages/Message.h
@@ -19,7 +19,7 @@
#pragma warning( disable: 4018 ) // signed/unsigned mismatch
//#endif
-#include "OrkBase.h"
+#include "dll.h"
#include "ace/OS_NS_time.h"
#include "ace/OS_NS_unistd.h"
diff --git a/orkbasecxx/serializers/Serializer.h b/orkbasecxx/serializers/Serializer.h
index a63af1a..d8f00cc 100644
--- a/orkbasecxx/serializers/Serializer.h
+++ b/orkbasecxx/serializers/Serializer.h
@@ -16,10 +16,11 @@
#pragma warning( disable: 4786 ) // disables truncated symbols in browse-info warning
-#include "OrkBase.h"
+#include "dll.h"
#include <map>
#include <list>
#include "boost/shared_ptr.hpp"
+#include "StdString.h"
typedef int (*StringToEnumFunction)(CStdString&);
typedef CStdString (*EnumToStringFunction)(int);