Utils/Console: Add short help to 'ls' output
[senf.git] / Socket / Protocols / DVB / DVBDemuxHandles.hh
index aae5d80..9b4b73a 100644 (file)
@@ -23,8 +23,8 @@
 /** \file
     \brief DVBDemuxHandles public header */
 
-#ifndef HH_DVBDemuxHandles_
-#define HH_DVBDemuxHandles_ 1
+#ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
+#define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
 
 // Custom includes
 #include "../../../Socket/FramingPolicy.hh"
@@ -34,6 +34,9 @@
 #include "DVBDemuxSocketProtocol.hh"
 
 //#include "DVBDemuxHandles.mpp"
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/shared_ptr.hpp>
+#include <iostream>
 ///////////////////////////////hh.p////////////////////////////////////////
 
 namespace senf {
@@ -49,12 +52,41 @@ namespace senf {
         NotWriteablePolicy
         >::policy DVBDemux_Policy;   ///< Socket Policy for xxxx
 
-    /** \brief xxx
+    /** \brief Baseclass of various DVBProtocolWrappers which are defined in DVBProtocolWrapper.hh 
      */
+    class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
+        public:
+            DVBProtocolWrapper(){}
+            virtual ~DVBProtocolWrapper(){}
+    };
+    /** \brief Baseclass for DVBSocketProtocols which want use Wrappers for console. 
+    */
+    class DVBSocketProtocol : public virtual SocketProtocol {
+private:
+        boost::shared_ptr<DVBProtocolWrapper> wrap_;
+public:
+        DVBSocketProtocol() {}
+        ~DVBSocketProtocol() {}
+        
+        void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)/**< Binds a wrapper to a DVBProtocol, 
+                                                                        so if it is closed the functionality of the wrapper is automatically removed from console.*/ 
+        {
+            wrap_ = wrap;
+        }
+        virtual void close(){
+            wrap_.reset();
+            SocketProtocol::close();
+
+        }
+    };
+    
+    
     class DVBDemuxSectionSocketProtocol
         : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
-          public DVBDemuxSocketProtocol
+          public DVBDemuxSocketProtocol, 
+          public DVBSocketProtocol
     {
+    
     public:
         ///////////////////////////////////////////////////////////////////////////
         // internal interface
@@ -75,7 +107,13 @@ namespace senf {
 
         ///@}
         
-        void setSectionFilter(struct dmx_sct_filter_params *filter) const;    
+        void setSectionFilter(unsigned short int pid, 
+                unsigned char filter= 0x3e,
+                unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC, 
+                unsigned char mask = 0xff, 
+                unsigned char mode =0x00,
+                unsigned int timeout =0x00) const;
+        
     };
 
     typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
@@ -86,7 +124,8 @@ namespace senf {
      */
     class DVBDemuxPESSocketProtocol
         : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
-          public DVBDemuxSocketProtocol
+          public DVBDemuxSocketProtocol,
+          public DVBSocketProtocol
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
@@ -108,7 +147,7 @@ namespace senf {
 
         ///@}
         
-        void setPESFilter(struct dmx_pes_filter_params *filter) const;    
+        void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;    
     };
 
     typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;