summaryrefslogtreecommitdiff
path: root/orkbasecxx/messages/RecordMsg.cpp
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2009-08-14 09:23:07 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2009-08-14 09:23:07 +0000
commite163cf54ac781ad592da8a009876479204966b26 (patch)
tree34a5ad268d1f17971b45f82c8749724cff80ee96 /orkbasecxx/messages/RecordMsg.cpp
parent1cf0cfc8155b0376d35017c4167bece5742fa6af (diff)
Modified the orkaudio API for StartCapture and PauseCapture to carry out their respective operations when the nativecallid is supplied. Added a new API, StopCapture, which causes a session to stop when any of the party, orkuid or nativecallid is provided as a parameter. This API is different from the PauseCapture API in the sense that it actually causes a session to stop and the WAV file is produced. After calling StopCapture, the session cannot be re-started with the StartCapture API (record).
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@633 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/messages/RecordMsg.cpp')
-rw-r--r--orkbasecxx/messages/RecordMsg.cpp46
1 files changed, 42 insertions, 4 deletions
diff --git a/orkbasecxx/messages/RecordMsg.cpp b/orkbasecxx/messages/RecordMsg.cpp
index 35a21b6..6b5688f 100644
--- a/orkbasecxx/messages/RecordMsg.cpp
+++ b/orkbasecxx/messages/RecordMsg.cpp
@@ -17,6 +17,7 @@
#define RECORD_CLASS "record"
#define PAUSE_CLASS "pause"
+#define STOP_CLASS "stop"
void PauseMsg::Define(Serializer* s)
{
@@ -24,6 +25,7 @@ void PauseMsg::Define(Serializer* s)
s->StringValue(OBJECT_TYPE_TAG, pauseClass, true);
s->StringValue(PARTY_PARAM, m_party, false);
s->StringValue(ORKUID_PARAM, m_orkuid, false);
+ s->StringValue(NATIVE_CALLID_PARAM, m_nativecallid, false);
}
CStdString PauseMsg::GetClassName()
@@ -42,8 +44,43 @@ ObjectRef PauseMsg::Process()
ObjectRef ref(msg);
CStdString logMsg;
- logMsg.Format("Pausing capture for party:%s orkuid:%s", m_party, m_orkuid);
- CapturePluginProxy::Singleton()->PauseCapture(m_party, m_orkuid);
+ CapturePluginProxy::Singleton()->PauseCapture(m_party, m_orkuid, m_nativecallid);
+ logMsg.Format("Pausing capture for party:%s orkuid:%s nativecallid:%s", m_party, m_orkuid, m_nativecallid);
+ msg->m_success = true;
+ msg->m_comment = logMsg;
+
+ return ref;
+}
+
+//===================================================
+
+void StopMsg::Define(Serializer* s)
+{
+ CStdString stopClass(STOP_CLASS);
+ s->StringValue(OBJECT_TYPE_TAG, stopClass, true);
+ s->StringValue(PARTY_PARAM, m_party, false);
+ s->StringValue(ORKUID_PARAM, m_orkuid, false);
+ s->StringValue(NATIVE_CALLID_PARAM, m_nativecallid, false);
+}
+
+CStdString StopMsg::GetClassName()
+{
+ return CStdString(STOP_CLASS);
+}
+
+ObjectRef StopMsg::NewInstance()
+{
+ return ObjectRef(new StopMsg);
+}
+
+ObjectRef StopMsg::Process()
+{
+ SimpleResponseMsg* msg = new SimpleResponseMsg;
+ ObjectRef ref(msg);
+ CStdString logMsg;
+
+ CapturePluginProxy::Singleton()->StopCapture(m_party, m_orkuid, m_nativecallid);
+ logMsg.Format("Stopping capture for party:%s orkuid:%s nativecallid:%s", m_party, m_orkuid, m_nativecallid);
msg->m_success = true;
msg->m_comment = logMsg;
@@ -58,6 +95,7 @@ void RecordMsg::Define(Serializer* s)
s->StringValue(OBJECT_TYPE_TAG, recordClass, true);
s->StringValue(PARTY_PARAM, m_party, false);
s->StringValue(ORKUID_PARAM, m_orkuid, false);
+ s->StringValue(NATIVE_CALLID_PARAM, m_nativecallid, false);
}
CStdString RecordMsg::GetClassName()
@@ -76,8 +114,8 @@ ObjectRef RecordMsg::Process()
ObjectRef ref(msg);
CStdString logMsg;
- CapturePluginProxy::Singleton()->StartCapture(m_party, m_orkuid);
- logMsg.Format("Starting capture for party:%s orkuid:%s", m_party, m_orkuid);
+ CapturePluginProxy::Singleton()->StartCapture(m_party, m_orkuid, m_nativecallid);
+ logMsg.Format("Starting capture for party:%s orkuid:%s nativecallid:%s", m_party, m_orkuid, m_nativecallid);
msg->m_success = true;
msg->m_comment = logMsg;