switch to new MPL based Fraunhofer FOKUS Public License
[senf.git] / senf / Socket / Protocols / DVB / DVBSocketController.hh
index e92cd4c..ed5d18c 100644 (file)
@@ -2,23 +2,28 @@
 //
 // Copyright (C) 2007
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
-//     Anton Gillert <atx@berlios.de>
 //
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
+// The contents of this file are subject to the Fraunhofer FOKUS Public License
+// Version 1.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at 
+// http://senf.berlios.de/license.html
 //
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// The Fraunhofer FOKUS Public License Version 1.0 is based on, 
+// but modifies the Mozilla Public License Version 1.1.
+// See the full license text for the amendments.
 //
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the
-// Free Software Foundation, Inc.,
-// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// Software distributed under the License is distributed on an "AS IS" basis, 
+// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+// for the specific language governing rights and limitations under the License.
+//
+// The Original Code is Fraunhofer FOKUS code.
+//
+// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. 
+// (registered association), Hansastraße 27 c, 80686 Munich, Germany.
+// All Rights Reserved.
+//
+// Contributor(s):
+//   Anton Gillert <atx@berlios.de>
 
 
 #ifndef HH_SENF_Socket_Protocols_DVB_DVBSocketController_
 #include "DVBFrontendHandle.hh"
 #include "DVBDemuxHandles.hh"
 #include "DVBConfigParser.hh"
-#include "DVBProtocolWrapper.hh"
-#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Utils/Console/Console.hh>
-
-#define MPE_TABLEID 62
+#include <senf/Scheduler/FdEvent.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
 
+///////////////////////////////hh.p////////////////////////////////////////
 namespace senf {
 
+#define MPE_TABLEID 62
+
 /** \brief Helperclass for configuration and controlling DVB devices.
 
      The DVB API provides two methods for tuning. The first method is
@@ -53,41 +58,38 @@ namespace senf {
      You have to find out which parts of these functionality are implemented by your preferred
      device driver by your own.
 */
-    
-    
-    
 class DVBSocketController : boost::noncopyable
 {
 public:
 
-    senf::console::ScopedDirectory<DVBSocketController> dir;
+    console::ScopedDirectory<DVBSocketController> dir;
 
     typedef boost::function<void (const struct dvb_frontend_event & )> Callback;
                                         ///< Callback which is called when an asynchronous tuning succeeds.
 
     DVBSocketController(DVBFrontendHandle frontendHandle_ = DVBFrontendHandle(0,0), const Callback & cb = NULL);
     ~DVBSocketController();
-    
-    senf::DVBDemuxSectionHandle createDVBDemuxSectionHandle(  int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
-    senf::DVBDemuxPESHandle createDVBDemuxPESHandle(  int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
-
-    void addToConsole(senf::DVBDemuxSectionHandle sh);
-                                        ///< Adds an DVBDemuxSectionHandle to the console 
-                                        /**< Allocates the functionality of DVBDemuxSectionProtocol 
-                                             into the folder of the DVBSocketController. If the 
-                                             protocol is closed, or all handles are discarded the 
+
+    DVBDemuxSectionHandle createDVBDemuxSectionHandle(  int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
+    DVBDemuxPESHandle createDVBDemuxPESHandle(  int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
+
+    void addToConsole(DVBDemuxSectionHandle sh);
+                                        ///< Adds an DVBDemuxSectionHandle to the console
+                                        /**< Allocates the functionality of DVBDemuxSectionProtocol
+                                             into the folder of the DVBSocketController. If the
+                                             protocol is closed, or all handles are discarded the
                                              console support will automatically removed.
                                              \param[in] sh handle of a protocol*/
-    
-    void addToConsole(senf::DVBDemuxPESHandle sh);
-                                        ///< Adds an DVBDemuxPESHandle to the console 
+
+    void addToConsole(DVBDemuxPESHandle sh);
+                                        ///< Adds an DVBDemuxPESHandle to the console
                                         /**< Allocates the functionality of DVBDemuxPESProtocol into
                                              the folder of the DVBSocketController. If the protocol
-                                             is closed, or all handles are discarded the console 
+                                             is closed, or all handles are discarded the console
                                              support will automatically removed.
                                              \param[in] sh handle of a protocol*/
-    
-    void tuneToCMD( const std::string & input, const std::string & mode = "async");
+
+    void tuneToCMD(std::string const & input, std::string const & mode = "async");
                                         ///< Tunes a DVB device given by the type of the DVBFrontendHandle
                                         /**< Tunes a DVB device by a channel name or complete
                                              configuration line. This method was created for use
@@ -97,7 +99,7 @@ public:
                                                it would be searched in the config file.
                                              \param[in] mode The mode in which it will tune
                                                "sync" or "async"*/
-    void tuneTo(const std::string & channel);
+    void tuneTo(std::string const & channel);
                                         ///< Tunes a DVB device to a channel
                                         /**< Tunes a DVB device to a channel whose parameters
                                              are stored in a config file. The method determines
@@ -129,7 +131,7 @@ public:
                                         /**< Tunes a DVB-C device in asynchronous mode and calls
                                              the callback if existing. Needs full configuration. */
 
-    dvb_frontend_event tuneTo_sync( const std::string & channel );
+    dvb_frontend_event tuneTo_sync(std::string const & channel );
                                         ///< Tunes a DVB device given by the type of the DVBFrontendHandle
                                         /**< Tunes a DVB device, given by the type of the
                                              DVBFrontendHandle, by a channel name in synchronous mode
@@ -139,7 +141,7 @@ public:
                                              \note The member "dvb_frontend_event.status" should be
                                                correct by the most device driver implementations.
                                                But "dvb_frontend_event.parameters" maybe not and is
-                                               definitly not set by: Cinergy T� (2.6.27),
+                                               definitely not set by: Cinergy T� (2.6.27),
                                                Terratec Cinergy DT USB XS Diversity (2.6.27) */
 
     dvb_frontend_event tuneDVB_S_sync(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate);
@@ -149,7 +151,7 @@ public:
                                              \note The member "dvb_frontend_event.status" should be
                                                correct by the most device driver implementations.
                                                But "dvb_frontend_event.parameters" maybe not and is
-                                               definitly not set by: Cinergy T� (2.6.27),
+                                               definitely not set by: Cinergy T� (2.6.27),
                                                Terratec Cinergy DT USB XS Diversity (2.6.27) */
 
     dvb_frontend_event tuneDVB_T_sync(unsigned int frequency,
@@ -167,7 +169,7 @@ public:
                                              \note The member "dvb_frontend_event.status" should be
                                                correct by the most device driver implementations.
                                                But "dvb_frontend_event.parameters" maybe not and is
-                                               definitly not set by: Cinergy T� (2.6.27),
+                                               definitely not set by: Cinergy T� (2.6.27),
                                                Terratec Cinergy DT USB XS Diversity (2.6.27) */
 
     dvb_frontend_event tuneDVB_C_sync(unsigned int frequency,
@@ -179,7 +181,7 @@ public:
                                              \note The member "dvb_frontend_event.status" should be
                                                correct by the most device driver implementations.
                                                But "dvb_frontend_event.parameters" maybe not and is
-                                               definitly not set by: Cinergy T� (2.6.27),
+                                               definitely not set by: Cinergy T� (2.6.27),
                                                Terratec Cinergy DT USB XS Diversity (2.6.27) */
 
     fe_type_t getType();                ///< Returns the type of the card. The type is defined in frontend.h
@@ -216,10 +218,10 @@ public:
     std::string getTuneInfo(const std::string & conf ="Ssbuf");
                                         ///< Returns a string which shows actual tuning status
                                         /**< <br>"S" prints signal strength (in hex)
-                                             <br>"s" prints singal to noise ration (in hex)
+                                             <br>"s" prints signal to noise ration (in hex)
                                              <br>"b" prints bit error rate (in hex)
                                              <br>"u" prints uncorrected blocks (in hex)
-                                             <br>"f" prints readable overal status e.g. "Has Lock"<br>
+                                             <br>"f" prints readable overall status e.g. "Has Lock"<br>
                                              These characters can be used to form the output. Be
                                              aware, some features may not be supported be your
                                              current driver implementation and could end in throwing
@@ -232,10 +234,15 @@ private:
     static unsigned int controllerNr;
     unsigned int sectionNr;
     unsigned int pesNr;
-    senf::scheduler::FdEvent event;
+    scheduler::FdEvent event;
     void readEvent(int i);
     void initConsole();
 };
 
 }
+
+///////////////////////////////hh.e////////////////////////////////////////
+//#include "DVBSocketController.cci"
+//#include "DVBSocketController.ct"
+//#include "DVBSocketController.cti"
 #endif