[ekiga] CodecList: Added a method to check for the presence of a codec.



commit 9728698b18beae7a14cf4294af49b13d9bd8889f
Author: Damien Sandras <dsandras seconix com>
Date:   Tue Dec 30 16:21:01 2014 +0100

    CodecList: Added a method to check for the presence of a codec.

 lib/engine/protocol/codec-description.cpp |   14 ++++++++++++++
 lib/engine/protocol/codec-description.h   |    6 ++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/protocol/codec-description.cpp b/lib/engine/protocol/codec-description.cpp
index e3000bf..47661df 100644
--- a/lib/engine/protocol/codec-description.cpp
+++ b/lib/engine/protocol/codec-description.cpp
@@ -124,6 +124,20 @@ CodecList::append (const CodecDescription& descr)
 }
 
 
+bool
+CodecList::find (const std::string & display_name)
+{
+  for (iterator it = begin ();
+       it != end ();
+       it++) {
+
+    if ((*it).display_name == display_name)
+      return true;
+  }
+
+  return false;
+}
+
 void
 CodecList::remove (iterator it)
 {
diff --git a/lib/engine/protocol/codec-description.h b/lib/engine/protocol/codec-description.h
index 4fa243d..0c6804f 100644
--- a/lib/engine/protocol/codec-description.h
+++ b/lib/engine/protocol/codec-description.h
@@ -163,6 +163,12 @@ namespace Ekiga
        */
       void remove (iterator it);
 
+      /* Return true if there is a codec with the given display name
+       * @param display_name is the nice name like in known-codecs.h
+       * @return true or false
+       */
+      bool find (const std::string & display_name);
+
       /** Return the list of audio codecs descriptions in the current CodecList
        * @return the list of audio CodecDescription
        */


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