+RESULT eNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service)
+{
+ assert(m_servicehandler);
+ RESULT res = m_servicehandler->record(ref, service);
+ eDebug("record: %d", res);
+ if (res)
+ service = 0;
+ else
+ {
+ ePtr<eConnection> conn;
+ service->connectEvent(slot(*this, &eNavigation::recordEvent), conn);
+ m_recordings[service]=conn;
+ }
+ return res;
+}
+
+RESULT eNavigation::stopRecordService(ePtr<iRecordableService> &service)
+{
+ service->stop();
+ std::map<ePtr<iRecordableService>, ePtr<eConnection> >::iterator it =
+ m_recordings.find(service);
+ if (it != m_recordings.end())
+ {
+ m_recordings.erase(it);
+ /* send stop event */
+ m_record_event(service, iRecordableService::evEnd);
+ return 0;
+ }
+
+ eDebug("try to stop non running recording!!"); // this should not happen
+ return -1;
+}
+
+PyObject *eNavigation::getRecordings(void)
+{
+ ePyObject result = PyList_New(m_recordings.size());
+ int pos=0;
+ for (std::map<ePtr<iRecordableService>, ePtr<eConnection> >::iterator it(m_recordings.begin()); it != m_recordings.end(); ++it)
+ PyList_SET_ITEM(result, pos++, NEW_iRecordableServicePtr(it->first));
+ return result;
+}
+