openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
core.h
Go to the documentation of this file.
1 #ifndef __nav_core_h
2 #define __nav_core_h
3 
4 #include <lib/base/object.h>
5 #include <lib/service/iservice.h>
7 #include <connection.h>
8 #include <map>
9 #include <set>
10 #include <lib/dvb/fcc.h>
11 
12 class eNavigation;
13 
14 /* a subset of eNavigation */
15 class pNavigation: public iObject, public sigc::trackable
16 {
17  DECLARE_REF(pNavigation);
18 public:
19  enum RecordType {
24  isFromTimer = 0x10,
28  isAnyRecording = 0xFF
29  };
30 
33 
34  pNavigation(int decoder = 0);
35 
38  RESULT pause(int p);
40 
43  void getRecordings(std::vector<ePtr<iRecordableService> > &recordings, bool simulate=false, RecordType type=isAnyRecording);
44  void getRecordingsServicesOnly(std::vector<eServiceReference> &services, pNavigation::RecordType type=isAnyRecording);
45  void getRecordingsTypesOnly(std::vector<pNavigation::RecordType> &services, pNavigation::RecordType type=isAnyRecording);
47  std::map<ePtr<iRecordableService>, eServiceReference, std::less<iRecordableService*> > getRecordingsServices(RecordType type=isAnyRecording);
48  void navEvent(int event);
49 
50 private:
51  ePtr<eNavigation> m_core;
52  ePtr<eConnection> m_nav_event_connection, m_nav_record_event_connection;
53  void navRecordEvent(ePtr<iRecordableService>, int event);
54 };
55 
56 
57 class eNavigation: public iObject, public sigc::trackable
58 {
59  static eNavigation *instance;
60  DECLARE_REF(eNavigation);
61  int m_decoder;
62  ePtr<iServiceHandler> m_servicehandler;
63 
64  ePtr<iPlayableService> m_runningService;
65  sigc::signal1<void,int> m_event;
66  ePtr<eConnection> m_service_event_conn;
67  void serviceEvent(iPlayableService* service, int event);
68 
69  std::map<ePtr<iRecordableService>, ePtr<eConnection>, std::less<iRecordableService*> > m_recordings;
70  std::map<ePtr<iRecordableService>, eServiceReference, std::less<iRecordableService*> > m_recordings_services;
71  std::map<ePtr<iRecordableService>, pNavigation::RecordType, std::less<iRecordableService*> > m_recordings_types;
72  std::set<ePtr<iRecordableService>, std::less<iRecordableService*> > m_simulate_recordings;
73 
74  sigc::signal2<void,ePtr<iRecordableService>,int> m_record_event;
75  void recordEvent(iRecordableService* service, int event);
76 
77  friend class eFCCServiceManager;
78  ePtr<eFCCServiceManager> m_fccmgr;
79 public:
80 
82  RESULT connectEvent(const sigc::slot1<void,int> &event, ePtr<eConnection> &connection);
83  RESULT connectRecordEvent(const sigc::slot2<void,ePtr<iRecordableService>,int> &event, ePtr<eConnection> &connection);
84 /* int connectServiceEvent(const sigc::slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
86  RESULT stopService(void);
87 
90  void getRecordings(std::vector<ePtr<iRecordableService> > &recordings, bool simulate, pNavigation::RecordType type);
91  void getRecordingsServicesOnly(std::vector<eServiceReference> &services, pNavigation::RecordType type);
92  void getRecordingsTypesOnly(std::vector<pNavigation::RecordType> &services, pNavigation::RecordType type);
93  void getRecordingsSlotIDsOnly(std::vector<int> &slotids, pNavigation::RecordType type);
94  std::map<ePtr<iRecordableService>, eServiceReference, std::less<iRecordableService*> > getRecordingsServices(pNavigation::RecordType type);
95 
96  RESULT pause(int p);
97  eNavigation(iServiceHandler *serviceHandler, int decoder = 0);
98  static eNavigation *getInstance() { return instance; }
99  virtual ~eNavigation();
100 };
101 
102 #endif
Definition: connections.h:74
Definition: fcc.h:31
Definition: core.h:58
void getRecordings(std::vector< ePtr< iRecordableService > > &recordings, bool simulate, pNavigation::RecordType type)
Definition: core.cpp:152
static eNavigation * getInstance()
Definition: core.h:98
eNavigation(iServiceHandler *serviceHandler, int decoder=0)
Definition: core.cpp:232
void getRecordingsServicesOnly(std::vector< eServiceReference > &services, pNavigation::RecordType type)
Definition: core.cpp:167
RESULT getCurrentService(ePtr< iPlayableService > &service)
Definition: core.cpp:62
virtual ~eNavigation()
Definition: core.cpp:242
RESULT recordService(const eServiceReference &ref, ePtr< iRecordableService > &service, bool simulate, pNavigation::RecordType type)
Definition: core.cpp:88
void getRecordingsTypesOnly(std::vector< pNavigation::RecordType > &services, pNavigation::RecordType type)
Definition: core.cpp:178
void getRecordingsSlotIDsOnly(std::vector< int > &slotids, pNavigation::RecordType type)
Definition: core.cpp:189
RESULT playService(const eServiceReference &service)
Definition: core.cpp:30
RESULT pause(int p)
Definition: core.cpp:219
RESULT stopRecordService(ePtr< iRecordableService > &service)
Definition: core.cpp:113
RESULT stopService(void)
Definition: core.cpp:68
RESULT connectEvent(const sigc::slot1< void, int > &event, ePtr< eConnection > &connection)
Definition: core.cpp:50
std::map< ePtr< iRecordableService >, eServiceReference, std::less< iRecordableService * > > getRecordingsServices(pNavigation::RecordType type)
Definition: core.cpp:205
RESULT connectRecordEvent(const sigc::slot2< void, ePtr< iRecordableService >, int > &event, ePtr< eConnection > &connection)
Definition: core.cpp:56
Definition: iservice.h:15
Definition: object.h:15
Definition: iservice.h:978
Definition: iservice.h:1049
Definition: iservice.h:1095
Definition: core.h:16
ePtr< iRecordableService > & SWIG_OUTPUT
Definition: core.h:41
SWIG_VOID(RESULT) getCurrentService(ePtr< iPlayableService > &SWIG_OUTPUT)
RESULT playService(const eServiceReference &service)
Definition: pcore.cpp:20
void getRecordingsTypesOnly(std::vector< pNavigation::RecordType > &services, pNavigation::RecordType type=isAnyRecording)
Definition: pcore.cpp:60
void navEvent(int event)
Definition: pcore.cpp:75
PSignal1< void, int > m_event
Definition: core.h:31
pNavigation(int decoder=0)
Definition: pcore.cpp:8
RecordType
Definition: core.h:19
@ isFromEPGrefresh
Definition: core.h:26
@ isRealRecording
Definition: core.h:20
@ isPseudoRecording
Definition: core.h:22
@ isFromInstantRecording
Definition: core.h:25
@ isFromSpecialJumpFastZap
Definition: core.h:27
@ isFromTimer
Definition: core.h:24
@ isStreaming
Definition: core.h:21
@ isUnknownRecording
Definition: core.h:23
@ isAnyRecording
Definition: core.h:28
ePtr< iRecordableService > bool simulate
Definition: core.h:41
RESULT stopRecordService(ePtr< iRecordableService > &service)
Definition: pcore.cpp:45
void getRecordingsSlotIDsOnly(std::vector< int > &slotids, pNavigation::RecordType type=isAnyRecording)
Definition: pcore.cpp:65
ePtr< iRecordableService > bool RecordType type
Definition: core.h:41
std::map< ePtr< iRecordableService >, eServiceReference, std::less< iRecordableService * > > getRecordingsServices(RecordType type=isAnyRecording)
Definition: pcore.cpp:70
RESULT pause(int p)
Definition: pcore.cpp:30
void getRecordingsServicesOnly(std::vector< eServiceReference > &services, pNavigation::RecordType type=isAnyRecording)
Definition: pcore.cpp:55
void getRecordings(std::vector< ePtr< iRecordableService > > &recordings, bool simulate=false, RecordType type=isAnyRecording)
Definition: pcore.cpp:50
RESULT stopService()
Definition: pcore.cpp:35
PSignal2< void, ePtr< iRecordableService > &, int > m_record_event
Definition: core.h:32
instance
Definition: NavigationInstance.py:2
decoder
Definition: Extensions/MiniTV/plugin.py:9
list ref
Definition: create_picon_e1_to_e2.py:17
p
Definition: upgrade.py:63
int RESULT
Definition: object.h:12
Definition: dvb/scan.h:16