aboutsummaryrefslogtreecommitdiff
path: root/lib/nav/core.h
blob: 9f7be884dd15c3e1c6c26a2b16658393d03c09ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __nav_core_h
#define __nav_core_h

#include <lib/base/object.h>
#include <lib/service/iservice.h>
#include <connection.h>
#include <map>
#include <set>

class eNavigation: public iObject, public Object
{
	DECLARE_REF(eNavigation);
	ePtr<iServiceHandler> m_servicehandler;

	ePtr<iPlayableService> m_runningService;
	Signal1<void,int> m_event;
	ePtr<eConnection> m_service_event_conn;
	void serviceEvent(iPlayableService* service, int event);

	std::map<ePtr<iRecordableService>, ePtr<eConnection>, std::less<iRecordableService*> > m_recordings;
	std::set<ePtr<iRecordableService>, std::less<iRecordableService*> > m_simulate_recordings;

	Signal2<void,ePtr<iRecordableService>,int> m_record_event;
	void recordEvent(iRecordableService* service, int event);
public:
	
	RESULT playService(const eServiceReference &service);
	RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &connection);
	RESULT connectRecordEvent(const Slot2<void,ePtr<iRecordableService>,int> &event, ePtr<eConnection> &connection);
/*	int connectServiceEvent(const Slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
	RESULT getCurrentService(ePtr<iPlayableService> &service);
	RESULT stopService(void);
	
	RESULT recordService(const eServiceReference &ref, ePtr<iRecordableService> &service, bool simulate=false);
	RESULT stopRecordService(ePtr<iRecordableService> &service);
	PyObject *getRecordings(bool simulate=false);
	
	RESULT pause(int p);
	eNavigation(iServiceHandler *serviceHandler);
	virtual ~eNavigation();
};

#endif