aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-17 00:21:37 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-17 00:21:37 +0000
commit8eadc0e09e19713d6c2b1c12aa2946042cfafabe (patch)
treeb6dd283d81fda8313bdcb3762d9a8f6969454268
parenta2c5f9998376a5877aef36e410921908ab8605ba (diff)
downloadenigma2-8eadc0e09e19713d6c2b1c12aa2946042cfafabe.tar.gz
enigma2-8eadc0e09e19713d6c2b1c12aa2946042cfafabe.zip
add channel events, like EOF
-rw-r--r--lib/dvb/dvb.cpp18
-rw-r--r--lib/dvb/dvb.h5
-rw-r--r--lib/dvb/idvb.h6
3 files changed, 29 insertions, 0 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index f20ce8a2..6a0211ec 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -607,6 +607,17 @@ void eDVBChannel::frontendStateChanged(iDVBFrontend*fe)
}
}
+void eDVBChannel::pvrEvent(int event)
+{
+ switch (event)
+ {
+ case eFilePushThread::evtEOF:
+ eDebug("eDVBChannel: End of file!");
+ m_event(this, evtEOF);
+ break;
+ }
+}
+
void eDVBChannel::AddUse()
{
++m_use_count;
@@ -658,6 +669,12 @@ RESULT eDVBChannel::connectStateChange(const Slot1<void,iDVBChannel*> &stateChan
return 0;
}
+RESULT eDVBChannel::connectEvent(const Slot2<void,iDVBChannel*,int> &event, ePtr<eConnection> &connection)
+{
+ connection = new eConnection((iDVBChannel*)this, m_event.connect(event));
+ return 0;
+}
+
RESULT eDVBChannel::getState(int &state)
{
state = m_state;
@@ -733,6 +750,7 @@ RESULT eDVBChannel::playFile(const char *file)
m_pvr_thread = new eFilePushThread();
m_pvr_thread->start(m_pvr_fd_src, m_pvr_fd_dst);
+ CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
return 0;
}
diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h
index 23dd7778..511ef9aa 100644
--- a/lib/dvb/dvb.h
+++ b/lib/dvb/dvb.h
@@ -206,6 +206,8 @@ public:
eDVBChannelID getChannelID() { return m_channel_id; }
RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection);
+ RESULT connectEvent(const Slot2<void,iDVBChannel*,int> &eventChange, ePtr<eConnection> &connection);
+
RESULT getState(int &state);
RESULT setCIRouting(const eDVBCIRouting &routing);
@@ -229,6 +231,7 @@ private:
ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
eDVBChannelID m_channel_id;
Signal1<void,iDVBChannel*> m_stateChanged;
+ Signal2<void,iDVBChannel*,int> m_event;
int m_state;
/* for channel list */
@@ -239,6 +242,8 @@ private:
/* for PVR playback */
eFilePushThread *m_pvr_thread;
+ void pvrEvent(int event);
+
int m_pvr_fd_src, m_pvr_fd_dst;
eDVBTSTools m_tstools;
diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h
index 399abaa5..8aa3391d 100644
--- a/lib/dvb/idvb.h
+++ b/lib/dvb/idvb.h
@@ -388,7 +388,13 @@ public:
state_ok, /* ok */
state_release /* channel is being shut down. */
};
+
+ enum
+ {
+ evtEOF, evtFailed
+ };
virtual RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection)=0;
+ virtual RESULT connectEvent(const Slot2<void,iDVBChannel*,int> &eventChange, ePtr<eConnection> &connection)=0;
virtual RESULT getState(int &state)=0;
/* demux capabilities */