summaryrefslogtreecommitdiff
path: root/orkaudio/messages
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-06-30 19:39:27 +0000
committerHenri Herscher <henri@oreka.org>2006-06-30 19:39:27 +0000
commit868a99733ddb6a44f660f4aab9089fd619f38cfa (patch)
tree487309e2706b8389bc8985283c5d29334343bf7e /orkaudio/messages
parent3868172df25ae59bd0ecc524b782ac4734812891 (diff)
Moved more stuff to orkbasecxx
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@287 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/messages')
-rw-r--r--orkaudio/messages/CaptureMsg.cpp84
-rw-r--r--orkaudio/messages/CaptureMsg.h51
-rw-r--r--orkaudio/messages/DeleteTapeMsg.cpp60
-rw-r--r--orkaudio/messages/DeleteTapeMsg.h33
-rw-r--r--orkaudio/messages/PingMsg.cpp60
-rw-r--r--orkaudio/messages/PingMsg.h46
-rw-r--r--orkaudio/messages/TapeMsg.cpp88
-rw-r--r--orkaudio/messages/TapeMsg.h85
-rw-r--r--orkaudio/messages/TestMsg.cpp53
-rw-r--r--orkaudio/messages/TestMsg.h55
10 files changed, 0 insertions, 615 deletions
diff --git a/orkaudio/messages/CaptureMsg.cpp b/orkaudio/messages/CaptureMsg.cpp
deleted file mode 100644
index f013e1f..0000000
--- a/orkaudio/messages/CaptureMsg.cpp
+++ /dev/null
@@ -1,84 +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
- *
- */
-
-#include "Utils.h"
-#include "CaptureMsg.h"
-//#include "LogManager.h"
-#include "CapturePluginProxy.h"
-
-#define CAPTURE_CLASS "capture"
-#define CAPTURE_RESPONSE_CLASS "captureresponse"
-#define CAPTURE_STATE_PARAM "state"
-#define COMMENT_PARAM "comment"
-
-void CaptureResponseMsg::Define(Serializer* s)
-{
- s->BoolValue(SUCCESS_PARAM, m_success);
- s->StringValue(COMMENT_PARAM, m_comment);
-}
-
-CStdString CaptureResponseMsg::GetClassName()
-{
- return CStdString(CAPTURE_RESPONSE_CLASS);
-}
-
-ObjectRef CaptureResponseMsg::NewInstance()
-{
- return ObjectRef(new CaptureResponseMsg);
-}
-
-//===============================
-
-void CaptureMsg::Define(Serializer* s)
-{
- CStdString captureClass(CAPTURE_CLASS);
- s->StringValue(OBJECT_TYPE_TAG, captureClass, true);
- s->StringValue(CAPTURE_PORT_PARAM, m_capturePort, true);
- s->EnumValue(CAPTURE_STATE_PARAM, (int&)m_eventType, CaptureEvent::EventTypeToEnum, CaptureEvent::EventTypeToString, true);
-}
-
-
-CStdString CaptureMsg::GetClassName()
-{
- return CStdString(CAPTURE_CLASS);
-}
-
-ObjectRef CaptureMsg::NewInstance()
-{
- return ObjectRef(new CaptureMsg);
-}
-
-ObjectRef CaptureMsg::Process()
-{
- CaptureResponseMsg* msg = new CaptureResponseMsg;
- ObjectRef ref(msg);
-
- if(m_eventType == CaptureEvent::EtStart)
- {
- CapturePluginProxySingleton::instance()->StartCapture(m_capturePort);
- msg->m_success = true;
- }
- else if(m_eventType == CaptureEvent::EtStop)
- {
- CapturePluginProxySingleton::instance()->StopCapture(m_capturePort);
- msg->m_success = true;
- }
- else
- {
- msg->m_success = false;
- msg->m_comment = CAPTURE_STATE_PARAM;
- msg->m_comment += " needs to be start or stop";
- }
- return ref;
-}
-
diff --git a/orkaudio/messages/CaptureMsg.h b/orkaudio/messages/CaptureMsg.h
deleted file mode 100644
index 782f70f..0000000
--- a/orkaudio/messages/CaptureMsg.h
+++ /dev/null
@@ -1,51 +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 __CAPTUREMSG_H__
-#define __CAPTUREMSG_H__
-
-#include "messages/SyncMessage.h"
-#include "messages/AsyncMessage.h"
-#include "AudioCapture.h"
-
-
-class CaptureResponseMsg : public AsyncMessage
-{
-public:
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- bool m_success;
- CStdString m_comment;
-};
-
-class CaptureMsg : public SyncMessage
-{
-public:
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- ObjectRef Process();
-
- CaptureEvent::EventTypeEnum m_eventType;
- CStdString m_capturePort;
-};
-
-#endif
-
diff --git a/orkaudio/messages/DeleteTapeMsg.cpp b/orkaudio/messages/DeleteTapeMsg.cpp
deleted file mode 100644
index 9dc8dae..0000000
--- a/orkaudio/messages/DeleteTapeMsg.cpp
+++ /dev/null
@@ -1,60 +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
- *
- */
-
-#include "DeleteTapeMsg.h"
-#include "messages/AsyncMessage.h"
-
-#define DELETE_TAPE_CLASS "deletetape"
-
-void DeleteTapeMsg::Define(Serializer* s)
-{
- CStdString deleteTapeClass(DELETE_TAPE_CLASS);
- s->StringValue(OBJECT_TYPE_TAG, deleteTapeClass, true);
- s->StringValue(FILENAME_PARAM, m_filename, true);
-}
-
-
-CStdString DeleteTapeMsg::GetClassName()
-{
- return CStdString(DELETE_TAPE_CLASS);
-}
-
-ObjectRef DeleteTapeMsg::NewInstance()
-{
- return ObjectRef(new DeleteTapeMsg);
-}
-
-ObjectRef DeleteTapeMsg::Process()
-{
- SimpleResponseMsg* msg = new SimpleResponseMsg;
- ObjectRef ref(msg);
-
- // Check that the audio file to delete is actually an audio file
- if(m_filename.Find('/') != -1 && (m_filename.Find(".pcm") != -1 || m_filename.Find(".wav") != -1 ))
- {
- if (ACE_OS::unlink((PCSTR)m_filename) == -1)
- {
- msg->m_success = false;
- msg->m_comment = "could not delete file";
- }
-
- }
- else
- {
- msg->m_success = false;
- msg->m_comment = "filename not valid";
- }
-
- return ref;
-}
-
diff --git a/orkaudio/messages/DeleteTapeMsg.h b/orkaudio/messages/DeleteTapeMsg.h
deleted file mode 100644
index 33fb9ae..0000000
--- a/orkaudio/messages/DeleteTapeMsg.h
+++ /dev/null
@@ -1,33 +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 __DELETETAPEMSG_H__
-#define __DELETETAPEMSG_H__
-
-#include "messages/SyncMessage.h"
-
-class DeleteTapeMsg : public SyncMessage
-{
-public:
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- ObjectRef Process();
-
- CStdString m_filename;
-};
-
-#endif
-
diff --git a/orkaudio/messages/PingMsg.cpp b/orkaudio/messages/PingMsg.cpp
deleted file mode 100644
index 1f90bbe..0000000
--- a/orkaudio/messages/PingMsg.cpp
+++ /dev/null
@@ -1,60 +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
- *
- */
-
-#include "PingMsg.h"
-
-#define PING_CLASS "ping"
-#define PING_RESPONSE_CLASS "pingresponse"
-
-void PingResponseMsg::Define(Serializer* s)
-{
- s->BoolValue(SUCCESS_PARAM, m_success);
-}
-
-CStdString PingResponseMsg::GetClassName()
-{
- return CStdString(PING_RESPONSE_CLASS);
-}
-
-ObjectRef PingResponseMsg::NewInstance()
-{
- return ObjectRef(new PingResponseMsg);
-}
-
-//===============================
-
-void PingMsg::Define(Serializer* s)
-{
- CStdString pingClass(PING_CLASS);
- s->StringValue(OBJECT_TYPE_TAG, pingClass, true);
-}
-
-
-CStdString PingMsg::GetClassName()
-{
- return CStdString(PING_CLASS);
-}
-
-ObjectRef PingMsg::NewInstance()
-{
- return ObjectRef(new PingMsg);
-}
-
-ObjectRef PingMsg::Process()
-{
- PingResponseMsg* msg = new PingResponseMsg;
- ObjectRef ref(msg);
- msg->m_success = true;
- return ref;
-}
-
diff --git a/orkaudio/messages/PingMsg.h b/orkaudio/messages/PingMsg.h
deleted file mode 100644
index 21b659a..0000000
--- a/orkaudio/messages/PingMsg.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 __PINGMSG_H__
-#define __PINGMSG_H__
-
-#include "messages/SyncMessage.h"
-#include "messages/AsyncMessage.h"
-
-
-class PingResponseMsg : public AsyncMessage
-{
-public:
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- bool m_success;
-};
-
-class PingMsg : public SyncMessage
-{
-public:
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- ObjectRef Process();
-};
-
-#endif
-
diff --git a/orkaudio/messages/TapeMsg.cpp b/orkaudio/messages/TapeMsg.cpp
deleted file mode 100644
index b624d08..0000000
--- a/orkaudio/messages/TapeMsg.cpp
+++ /dev/null
@@ -1,88 +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
- *
- */
-
-#include "Utils.h"
-#include "TapeMsg.h"
-#include "ConfigManager.h"
-
-TapeMsg::TapeMsg()
-{
- // Here is where default values are set
- m_timestamp = 0;
- m_direction = CaptureEvent::DirectionToString(CaptureEvent::DirUnkn);
- m_duration = 0;
- m_serviceName = CONFIG.m_serviceName;
-}
-
-void TapeMsg::Define(Serializer* s)
-{
- DefineMessage(s);
-
- CStdString tapeMessageName(TAPE_MESSAGE_NAME);
- s->StringValue(OBJECT_TYPE_TAG, tapeMessageName, true);
- s->StringValue(REC_ID_PARAM, m_recId, true);
- s->StringValue(STAGE_PARAM, m_stage, true);
- s->StringValue(CAPTURE_PORT_PARAM, m_capturePort, true);
- s->IntValue(TIMESTAMP_PARAM, (int&)m_timestamp, true);
- s->StringValue(FILENAME_PARAM, m_fileName, true);
- s->StringValue(LOCALPARTY_PARAM, m_localParty);
- s->StringValue(LOCALENTRYPOINT_PARAM, m_localEntryPoint);
- s->StringValue(REMOTEPARTY_PARAM, m_remoteParty);
- s->StringValue(DIRECTION_PARAM, m_direction);
- s->IntValue(DURATION_PARAM, m_duration);
- s->StringValue(SERVICE_PARAM, m_serviceName);
-
- s->StringValue(LOCAL_IP_PARAM, m_localIp);
- s->StringValue(REMOTE_IP_PARAM, m_remoteIp);
- //s->StringValue(LOCAL_MAC_PARAM, m_localMac);
- //s->StringValue(REMOTE_MAC_PARAM, m_remoteMac);
-}
-
-void TapeMsg::Validate()
-{
-}
-
-CStdString TapeMsg::GetClassName()
-{
- return CStdString(TAPE_MESSAGE_NAME);
-}
-
-ObjectRef TapeMsg::NewInstance()
-{
- return ObjectRef(new TapeMsg);
-}
-
-
-//==========================================================
-TapeResponse::TapeResponse()
-{
- m_deleteTape = false;
-}
-
-
-void TapeResponse::Define(Serializer* s)
-{
- SimpleResponseMsg::Define(s);
- s->BoolValue("deletetape", m_deleteTape);
-}
-
-CStdString TapeResponse::GetClassName()
-{
- return CStdString("taperesponse");
-}
-
-ObjectRef TapeResponse::NewInstance()
-{
- return ObjectRef(new TapeResponse);
-}
-
diff --git a/orkaudio/messages/TapeMsg.h b/orkaudio/messages/TapeMsg.h
deleted file mode 100644
index 3165bb4..0000000
--- a/orkaudio/messages/TapeMsg.h
+++ /dev/null
@@ -1,85 +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 __TAPEMSG_H__
-#define __TAPEMSG_H__
-
-#include "messages/SyncMessage.h"
-#include "messages/AsyncMessage.h"
-#include "AudioTape.h"
-
-#define TAPE_MESSAGE_NAME "tape"
-#define REC_ID_PARAM "recid"
-#define FILENAME_PARAM "filename"
-#define STAGE_PARAM "stage"
-#define LOCALPARTY_PARAM "localparty"
-#define REMOTEPARTY_PARAM "remoteparty"
-#define DIRECTION_PARAM "direction"
-#define LOCALENTRYPOINT_PARAM "localentrypoint"
-#define DURATION_PARAM "duration"
-#define SERVICE_PARAM "service"
-#define LOCAL_IP_PARAM "localip"
-#define REMOTE_IP_PARAM "remoteip"
-#define LOCAL_MAC_PARAM "localmac"
-#define REMOTE_MAC_PARAM "remotemac"
-
-class TapeMsg : public SyncMessage
-{
-public:
- TapeMsg();
-
- void Define(Serializer* s);
- void Validate();
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- CStdString m_recId;
- CStdString m_stage;
- time_t m_timestamp;
- CStdString m_fileName;
- CStdString m_capturePort;
- CStdString m_localParty;
- CStdString m_localEntryPoint;
- CStdString m_remoteParty;
- CStdString m_direction;
- CStdString m_loginString;
- int m_duration;
- CStdString m_serviceName;
- CStdString m_localIp;
- CStdString m_remoteIp;
- CStdString m_localMac;
- CStdString m_remoteMac;
-};
-
-typedef boost::shared_ptr<TapeMsg> TapeMsgRef;
-
-/** A TapeResponse is a response to TapeMsg
-*/
-class TapeResponse : public SimpleResponseMsg
-{
-public:
- TapeResponse();
- void Define(Serializer* s);
- inline void Validate() {};
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- bool m_deleteTape;
-};
-
-#endif
-
diff --git a/orkaudio/messages/TestMsg.cpp b/orkaudio/messages/TestMsg.cpp
deleted file mode 100644
index 68e2f3e..0000000
--- a/orkaudio/messages/TestMsg.cpp
+++ /dev/null
@@ -1,53 +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
- *
- */
-
-#include "Utils.h"
-#include "TestMsg.h"
-
-TestMsg::TestMsg()
-{
- // Here is where default values are set
- m_timestamp = 0;
-}
-
-void TestMsg::Define(Serializer* s)
-{
- CStdString testMessageName("test");
- s->StringValue("test", testMessageName, true);
- s->StringValue(STAGE_PARAM, m_stage, true);
- s->StringValue(CAPTURE_PORT_PARAM, m_capturePort, true);
- s->IntValue(TIMESTAMP_PARAM, (int&)m_timestamp, true);
- s->StringValue(FILENAME_PARAM, m_fileName, true);
-
- s->StringValue(LOCALPARTY_PARAM, m_localParty);
- s->StringValue(LOCALENTRYPOINT_PARAM, m_localEntryPoint);
- s->StringValue(REMOTEPARTY_PARAM, m_remoteParty);
- s->StringValue(DIRECTION_PARAM, m_direction);
- s->CsvValue("csv", m_csv);
- s->DateValue("date", m_time);
-}
-
-void TestMsg::Validate()
-{
-}
-
-CStdString TestMsg::GetClassName()
-{
- return CStdString("test");
-}
-
-ObjectRef TestMsg::NewInstance()
-{
- return ObjectRef(new TestMsg);
-}
-
diff --git a/orkaudio/messages/TestMsg.h b/orkaudio/messages/TestMsg.h
deleted file mode 100644
index 13aed71..0000000
--- a/orkaudio/messages/TestMsg.h
+++ /dev/null
@@ -1,55 +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 __TESTMSG_H__
-#define __TESTMSG_H__
-
-#include <list>
-#include "messages/SyncMessage.h"
-
-#define FILENAME_PARAM "filename"
-#define STAGE_PARAM "stage"
-#define LOCALPARTY_PARAM "localparty"
-#define REMOTEPARTY_PARAM "remoteparty"
-#define DIRECTION_PARAM "direction"
-#define LOCALENTRYPOINT_PARAM "localentrypoint"
-
-class TestMsg : public SyncMessage
-{
-public:
- TestMsg();
-
- void Define(Serializer* s);
- void Validate();
-
- CStdString GetClassName();
- ObjectRef NewInstance();
- inline ObjectRef Process() {return ObjectRef();};
-
- CStdString m_stage;
- time_t m_timestamp;
- CStdString m_fileName;
- CStdString m_capturePort;
- CStdString m_localParty;
- CStdString m_localEntryPoint;
- CStdString m_remoteParty;
- CStdString m_direction;
- CStdString m_loginString;
- std::list<CStdString> m_csv;
- time_t m_time;
-};
-
-typedef boost::shared_ptr<TestMsg> TestMsgRef;
-
-#endif
-