ekiga r5902 - trunk/lib/engine/protocol/skel



Author: dsandras
Date: Sat Jan 12 22:20:20 2008
New Revision: 5902
URL: http://svn.gnome.org/viewvc/ekiga?rev=5902&view=rev

Log:
Added method to build an Ekiga::CodecList from a GSList *.


Modified:
   trunk/lib/engine/protocol/skel/Makefile.am
   trunk/lib/engine/protocol/skel/codec-description.cpp
   trunk/lib/engine/protocol/skel/codec-description.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 Jan 12 22:20:20 2008
@@ -2,7 +2,7 @@
 
 protocol_dir = $(top_srcdir)/lib/engine/protocol/skel
 
-AM_CPPFLAGS = $(SIGC_CFLAGS)
+AM_CPPFLAGS = $(SIGC_CFLAGS) $(GLIB_CFLAGS)
 
 INCLUDES = \
 	-I$(top_srcdir)/lib/engine/include \
@@ -16,4 +16,4 @@
 	$(protocol_dir)/codec-description.h	\
 	$(protocol_dir)/codec-description.cpp
 
-libgmprotocol_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS)
+libgmprotocol_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GLIB_LIBS)

Modified: trunk/lib/engine/protocol/skel/codec-description.cpp
==============================================================================
--- trunk/lib/engine/protocol/skel/codec-description.cpp	(original)
+++ trunk/lib/engine/protocol/skel/codec-description.cpp	Sat Jan 12 22:20:20 2008
@@ -123,3 +123,20 @@
 
   return val.str ();
 }
+
+
+CodecList::CodecList (GSList *codecs_config)
+{
+  GSList *codecs_config_it = NULL;
+  
+  codecs_config_it = (GSList *) codecs_config;
+  while (codecs_config_it) {
+
+
+    Ekiga::CodecDescription d = Ekiga::CodecDescription ((char *) codecs_config_it->data);
+    if (!d.name.empty ())
+      (*this).push_back (d);
+
+    codecs_config_it = g_slist_next (codecs_config_it);
+  }
+}

Modified: trunk/lib/engine/protocol/skel/codec-description.h
==============================================================================
--- trunk/lib/engine/protocol/skel/codec-description.h	(original)
+++ trunk/lib/engine/protocol/skel/codec-description.h	Sat Jan 12 22:20:20 2008
@@ -39,6 +39,8 @@
 #include <iostream>
 #include <list>
 
+#include <glib.h>
+
 namespace Ekiga {
 
   /** This class holds the representation of a codec. 
@@ -50,7 +52,7 @@
   public:
 
       /** Create an empty codec description
-       */
+      */
       CodecDescription ();
 
       /** Create a codec description based on the parameters
@@ -80,26 +82,39 @@
 
 
       /** name is the codec name as defined in the RFC
-       */
+      */
       std::string name;
 
       /** rate is the clock rate 
-       */
+      */
       unsigned rate;
 
       /** active is true if the codec is active
-       */
+      */
       bool active;
 
       /** audio is true if it reprensents an audio codec
-       */
+      */
       bool audio;
 
       /** protocols is a list of protocols supported by the codec
-       */
+      */
       std::list<std::string> protocols;
     };
 
-  typedef std::list<CodecDescription> CodecList;
+
+  class CodecList : public std::list<CodecDescription>
+    {
+  public :
+
+      /** Constructor that creates an empty CodecList
+       */
+      CodecList () {};
+
+      /** Constructor that creates a CodecList from a GSList whose elements
+       * are CodecDescription objects formatted as a string.
+       */
+      CodecList (GSList *);
+    };
 }
 #endif



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