From 72fda6ebe7d6245b57178441c6355eb9d2402747 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Mon, 30 Jul 2007 14:32:19 +0000 Subject: Added non-lookback recording mode. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@458 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkbasecxx/messages/Makefile.am | 4 +-- orkbasecxx/messages/Message.h | 2 ++ orkbasecxx/messages/RecordMsg.cpp | 51 +++++++++++++++++++++++++++++++++++++++ orkbasecxx/messages/RecordMsg.h | 34 ++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 orkbasecxx/messages/RecordMsg.cpp create mode 100644 orkbasecxx/messages/RecordMsg.h (limited to 'orkbasecxx/messages') diff --git a/orkbasecxx/messages/Makefile.am b/orkbasecxx/messages/Makefile.am index aba1c8e..8c56f9e 100644 --- a/orkbasecxx/messages/Makefile.am +++ b/orkbasecxx/messages/Makefile.am @@ -2,8 +2,8 @@ METASOURCES = AUTO noinst_LTLIBRARIES = libmessages.la libmessages_la_SOURCES = AsyncMessage.cpp Message.cpp \ SyncMessage.cpp CaptureMsg.cpp DeleteTapeMsg.cpp \ - PingMsg.cpp TapeMsg.cpp + PingMsg.cpp TapeMsg.cpp RecordMsg.cpp #libmessages_la_LIBADD = -L/projects/ext/xmlrpc++/xmlrpc++0.7/ -lXmlRpc -INCLUDES = -I@top_srcdir@ +INCLUDES = -I@top_srcdir@ -I../../orkaudio AM_CXXFLAGS = -D_REENTRANT diff --git a/orkbasecxx/messages/Message.h b/orkbasecxx/messages/Message.h index 1abfcc0..de1275b 100644 --- a/orkbasecxx/messages/Message.h +++ b/orkbasecxx/messages/Message.h @@ -32,6 +32,8 @@ #define TIMESTAMP_PARAM "timestamp" #define CAPTURE_PORT_PARAM "captureport" #define FILENAME_PARAM "filename" +#define ORKUID_PARAM "orkuid" +#define PARTY_PARAM "party" #define SUCCESS_PARAM "sucess" #define SUCCESS_DEFAULT true diff --git a/orkbasecxx/messages/RecordMsg.cpp b/orkbasecxx/messages/RecordMsg.cpp new file mode 100644 index 0000000..46f3778 --- /dev/null +++ b/orkbasecxx/messages/RecordMsg.cpp @@ -0,0 +1,51 @@ +/* + * 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 + * + */ + +#include "RecordMsg.h" +#include "messages/AsyncMessage.h" +#include "CapturePluginProxy.h" + +#define RECORD_CLASS "record" + +void RecordMsg::Define(Serializer* s) +{ + CStdString recordClass(RECORD_CLASS); + s->StringValue(OBJECT_TYPE_TAG, recordClass, true); + s->StringValue(PARTY_PARAM, m_party, true); +} + + +CStdString RecordMsg::GetClassName() +{ + return CStdString(RECORD_CLASS); +} + +ObjectRef RecordMsg::NewInstance() +{ + return ObjectRef(new RecordMsg); +} + +ObjectRef RecordMsg::Process() +{ + SimpleResponseMsg* msg = new SimpleResponseMsg; + ObjectRef ref(msg); + CStdString logMsg; + + logMsg.Format("Starting capture for %s", m_party); + CapturePluginProxy::Singleton()->StartCapture(m_party); + msg->m_success = true; + msg->m_comment = logMsg; + + return ref; +} + diff --git a/orkbasecxx/messages/RecordMsg.h b/orkbasecxx/messages/RecordMsg.h new file mode 100644 index 0000000..35803be --- /dev/null +++ b/orkbasecxx/messages/RecordMsg.h @@ -0,0 +1,34 @@ +/* + * 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 __RECORDMSG_H__ +#define __RECORDMSG_H__ + +#include "messages/SyncMessage.h" +#include "AudioCapture.h" + +class DLL_IMPORT_EXPORT_ORKBASE RecordMsg : public SyncMessage +{ +public: + void Define(Serializer* s); + inline void Validate() {}; + + CStdString GetClassName(); + ObjectRef NewInstance(); + ObjectRef Process(); + + CStdString m_party; +}; + +#endif + -- cgit v1.2.3