ekiga r6258 - in trunk: . lib/engine/protocol/skel



Author: dsandras
Date: Sat May 17 18:37:09 2008
New Revision: 6258
URL: http://svn.gnome.org/viewvc/ekiga?rev=6258&view=rev

Log:
Changed architecture, a CallManager now uses ProtocolManagers to
handle actions and settings. Methods that need to be supported by
all implemented CallManagers and ProtocolManagers are defined in the
base classes. It is still a work in progress.


Added:
   trunk/lib/engine/protocol/skel/protocol-manager.h
Modified:
   trunk/ChangeLog
   trunk/lib/engine/protocol/skel/Makefile.am
   trunk/lib/engine/protocol/skel/call-core.cpp
   trunk/lib/engine/protocol/skel/call-core.h
   trunk/lib/engine/protocol/skel/call-manager.h

Modified: trunk/lib/engine/protocol/skel/Makefile.am
==============================================================================
--- trunk/lib/engine/protocol/skel/Makefile.am	(original)
+++ trunk/lib/engine/protocol/skel/Makefile.am	Sat May 17 18:37:09 2008
@@ -13,6 +13,7 @@
 	$(protocol_dir)/call-manager.h		\
 	$(protocol_dir)/call.h			\
 	$(protocol_dir)/call-core.cpp		\
+	$(protocol_dir)/protocol-manager.h	\
 	$(protocol_dir)/codec-description.h	\
 	$(protocol_dir)/codec-description.cpp
 

Modified: trunk/lib/engine/protocol/skel/call-core.cpp
==============================================================================
--- trunk/lib/engine/protocol/skel/call-core.cpp	(original)
+++ trunk/lib/engine/protocol/skel/call-core.cpp	Sat May 17 18:37:09 2008
@@ -99,20 +99,6 @@
 }
 
 
-bool CallCore::send_message (std::string uri, 
-                             std::string message)
-{
-  for (std::set<CallManager *>::iterator iter = managers.begin ();
-       iter != managers.end ();
-       iter++) {
-    if ((*iter)->send_message (uri, message))
-      return true;
-  }
-
-  return false;
-}
-
-
 void CallCore::add_call (Call *call, CallManager *manager)
 {
   call->ringing.connect (sigc::bind (sigc::mem_fun (this, &CallCore::on_ringing_call), call, manager));

Modified: trunk/lib/engine/protocol/skel/call-core.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call-core.h	(original)
+++ trunk/lib/engine/protocol/skel/call-core.h	Sat May 17 18:37:09 2008
@@ -159,9 +159,10 @@
        * @return: true if the operation could be handled 
        *          (that does not mean the message got though)
        */
+      /*
       bool send_message (const std::string uri, 
                          const std::string message);
-
+*/
       /** See call-manager.h for API 
        */
       sigc::signal<void, CallManager &, std::string, std::string> im_failed;

Modified: trunk/lib/engine/protocol/skel/call-manager.h
==============================================================================
--- trunk/lib/engine/protocol/skel/call-manager.h	(original)
+++ trunk/lib/engine/protocol/skel/call-manager.h	Sat May 17 18:37:09 2008
@@ -54,13 +54,17 @@
     {
 
   public:
+
       class Interface
         {
       public:
+          std::string voip_protocol;
           std::string protocol;
           std::string interface;
+          bool publish;
           unsigned port;
         };
+      typedef std::list<CallManager::Interface> InterfaceList;
 
 
       /* The constructor
@@ -80,7 +84,7 @@
        * @param: An uri
        * @return: true if a Ekiga::Call could be created
        */
-      virtual bool dial (const std::string uri) = 0; 
+      virtual bool dial (const std::string & uri) = 0; 
 
 
       /*
@@ -90,24 +94,18 @@
       /**
        * @return the protocol name
        */
-      virtual const std::string & get_protocol_name () const = 0;
-
+      virtual const std::list<std::string> & get_protocol_names () const = 0;
 
       /**
        * @return the interface on which we are accepting calls. Generally,
        * under the form protocol:IP:port.
        */
-      virtual const Interface & get_interface () const = 0;
+      virtual const CallManager::InterfaceList get_interfaces () const = 0;
 
 
       /*
-       * Mandatory Settings
-       */
-
-      /** Return the list of available codecs
-       * @return a set of the codecs and their descriptions
+       * Misc
        */
-      virtual CodecList get_codecs () = 0;
 
       /** Enable the given codecs
        * @param codecs is a set of the codecs and their descriptions
@@ -117,6 +115,64 @@
        */
       virtual void set_codecs (CodecList & codecs) = 0; 
 
+      /** Return the list of available codecs
+       * @return a set of the codecs and their descriptions
+       */
+      virtual const Ekiga::CodecList & get_codecs () const = 0;
+
+      /** Set the display name used on outgoing calls
+       * @param name is the display name to use.
+       */
+      virtual void set_display_name (const std::string & name) = 0;
+
+      /** Return the display name used on outgoing calls
+       */
+      virtual const std::string & get_display_name () const = 0;
+
+      /** Enable echo cancellation
+       * @param enabled is true if echo cancellation should be enabled, false
+       * otherwise.
+       */
+      virtual void set_echo_cancellation (bool enabled) = 0;
+
+      /** Get echo cancellation setting
+       * @return true if echo cancellation is enabled.
+       */
+      virtual bool get_echo_cancellation () const = 0;
+
+      /** Enable silence detection
+       * @param enabled is true if silence detection should be enabled, false
+       * otherwise.
+       */
+      virtual void set_silence_detection (bool enabled) = 0;
+
+      /** Get silence detection setting
+       * @return true if silence detection is enabled.
+       */
+      virtual bool get_silence_detection () const = 0;
+
+      /** Set maximum jitter 
+       * @param max_val is the maximum jitter for calls in seconds.
+       */
+      virtual void set_maximum_jitter (unsigned max_val) = 0;
+
+      /** Get maximum jitter 
+       * @return the maximum jitter for calls in seconds.
+       */
+      virtual unsigned get_maximum_jitter () const = 0;
+
+      /** Set delay before dropping an incoming call 
+       * @param delay is the delay after which the call should be rejected
+       * (or forwarded if supported by the CallManager).
+       */
+      virtual void set_reject_delay (unsigned delay) = 0;
+
+      /** Get delay before dropping an incoming call
+       * @return the delay in seconds after which a call should be rejected
+       * (or forwarded if supported by the CallManager).
+       */
+      virtual unsigned get_reject_delay () const = 0;
+
 
       /*
        * INSTANT MESSAGING 
@@ -126,8 +182,8 @@
        * @param: uri    : where to send the message
        *         message: what to send to the remote peer
        */
-      virtual bool send_message (const std::string uri, 
-                                 const std::string message) = 0;
+      //virtual bool send_message (const std::string uri, 
+                                 //const std::string message) = 0;
 
       /** This signal is emitted when the transmission of a message failed
        * @param: uri    : where the message could not be sent
@@ -171,9 +227,6 @@
        *         info contains information about the registration status
        */
       sigc::signal<void, std::string, Ekiga::CallCore::RegistrationState, std::string> registration_event;
-
-  private :
-      std::string uri_type;
     };
 
 /**

Added: trunk/lib/engine/protocol/skel/protocol-manager.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/protocol/skel/protocol-manager.h	Sat May 17 18:37:09 2008
@@ -0,0 +1,119 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+
+ * 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. 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.
+ *
+ * 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.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Ekiga is licensed under the GPL license and as a special exception, you
+ * have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
+ * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
+ * programs, as long as you do follow the requirements of the GNU GPL for all
+ * the rest of the software thus combined.
+ */
+
+
+/*
+ *                         protocol-manager.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2007 by Damien Sandras 
+ *   copyright            : (c) 2007 by Damien Sandras
+ *   description          : Declaration of the interface of a protocol manager
+ *                          implementation backend. A call manager handles calls
+ *                          thanks to various protocol-managers.
+ *
+ */
+
+
+#ifndef __PROTOCOL_MANAGER_H__
+#define __PROTOCOL_MANAGER_H__
+
+#include "call-core.h"
+
+namespace Ekiga
+{
+
+/**
+ * @addtogroup calls
+ * @{
+ */
+
+  class ProtocolManager
+    {
+
+  public:
+
+      /* The constructor
+       */
+      ProtocolManager () {};
+
+      /* The destructor
+       */
+      ~ProtocolManager () {}
+
+
+      /*                 
+       * CALL MANAGEMENT 
+       */               
+
+      /** Create a call based on the remote uri given as parameter
+       * @param: An uri
+       * @return: true if a Ekiga::Call could be created
+       */
+      virtual bool dial (const std::string & uri) = 0; 
+
+
+      /*
+       * PROTOCOL INFORMATION
+       */
+
+      /** Return the protcol name
+       * @return the protocol name
+       */
+      virtual const std::string & get_protocol_name () const = 0;
+
+
+      /*
+       * Misc
+       */
+
+      /** Return the listen interface
+       * @return the interface on which we are accepting calls. Generally,
+       * under the form protocol:IP:port.
+       */
+      virtual const Ekiga::CallManager::Interface & get_listen_interface () const = 0;
+
+      /** Set the DTMF mode to use to send DTMFs
+       * @param mode is the desired DTMF mode
+       */
+      virtual void set_dtmf_mode (unsigned mode) = 0;
+
+      /** Return the current DTMF mode
+       * @return the desired DTMF mode
+       */
+      virtual unsigned get_dtmf_mode () const = 0;
+
+      /** Set the port to listen to for incoming calls
+       * @param port is the port on which we should bind
+       */
+      virtual bool set_listen_port (unsigned port) = 0;
+    };
+
+/**
+ * @}
+ */
+
+};
+
+#endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]