<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16165] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16165">16165</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-05 20:08:25 -0600 (Tue, 05 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor configuration storage/read.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommFSCommpro">freeswitch/trunk/fscomm/FSComm.pro</a></li>
<li><a href="#freeswitchtrunkfscommconfportaudioconfxml">freeswitch/trunk/fscomm/conf/portaudio.conf.xml</a></li>
<li><a href="#freeswitchtrunkfscommprefdialogcpp">freeswitch/trunk/fscomm/prefdialog.cpp</a></li>
<li><a href="#freeswitchtrunkfscommprefdialogh">freeswitch/trunk/fscomm/prefdialog.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommprefportaudiocpp">freeswitch/trunk/fscomm/prefportaudio.cpp</a></li>
<li><a href="#freeswitchtrunkfscommprefportaudioh">freeswitch/trunk/fscomm/prefportaudio.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommFSCommpro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/FSComm.pro (16164 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/FSComm.pro        2010-01-05 22:16:46 UTC (rev 16164)
+++ freeswitch/trunk/fscomm/FSComm.pro        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -26,12 +26,14 @@
</span><span class="cx">     fshost.cpp \
</span><span class="cx">     call.cpp \
</span><span class="cx">     mod_qsettings/mod_qsettings.cpp \
</span><del>-    prefdialog.cpp
</del><ins>+    prefdialog.cpp \
+    prefportaudio.cpp
</ins><span class="cx"> HEADERS += mainwindow.h \
</span><span class="cx">     fshost.h \
</span><span class="cx">     call.h \
</span><span class="cx">     mod_qsettings/mod_qsettings.h \
</span><del>-    prefdialog.h
</del><ins>+    prefdialog.h \
+    prefportaudio.h
</ins><span class="cx"> FORMS += mainwindow.ui \
</span><span class="cx">     prefdialog.ui
</span><span class="cx"> RESOURCES += resources.qrc
</span></span></pre></div>
<a id="freeswitchtrunkfscommconfportaudioconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/conf/portaudio.conf.xml (16164 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/conf/portaudio.conf.xml        2010-01-05 22:16:46 UTC (rev 16164)
+++ freeswitch/trunk/fscomm/conf/portaudio.conf.xml        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -2,10 +2,11 @@
</span><span class="cx">     &lt;section name=&quot;configuration&quot;&gt;
</span><span class="cx">         &lt;configuration name=&quot;portaudio.conf&quot; description=&quot;Soundcard Endpoint&quot;&gt;
</span><span class="cx">             &lt;settings&gt;
</span><del>-                &lt;param name=&quot;indev&quot; value=&quot;${indev}&quot;/&gt;
</del><ins>+                &lt;!-- DO NOT take the # off the devices config --&gt;
+                &lt;param name=&quot;indev&quot; value=&quot;#${indev}&quot;/&gt;
</ins><span class="cx">                 &lt;!-- device to use for output --&gt;
</span><del>-                &lt;param name=&quot;outdev&quot; value=&quot;${outdev}&quot;/&gt;
-                &lt;!--&lt;param name=&quot;ringdev&quot; value=&quot;${ringdev}&quot;/&gt;--&gt;
</del><ins>+                &lt;param name=&quot;outdev&quot; value=&quot;#${outdev}&quot;/&gt;
+                &lt;param name=&quot;ringdev&quot; value=&quot;#${ringdev}&quot;/&gt;
</ins><span class="cx">                 &lt;param name=&quot;ring-file&quot; value=&quot;${ring-file}&quot;/&gt;
</span><span class="cx">                 &lt;param name=&quot;ring-interval&quot; value=&quot;${ring-interval}&quot;/&gt;
</span><span class="cx">                 &lt;param name=&quot;hold-file&quot; value=&quot;${hold-file}&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkfscommprefdialogcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/prefdialog.cpp (16164 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/prefdialog.cpp        2010-01-05 22:16:46 UTC (rev 16164)
+++ freeswitch/trunk/fscomm/prefdialog.cpp        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> #include &lt;QtGui&gt;
</span><span class="cx"> #include &quot;prefdialog.h&quot;
</span><span class="cx"> #include &quot;ui_prefdialog.h&quot;
</span><ins>+#include &quot;prefportaudio.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> PrefDialog::PrefDialog(QWidget *parent) :
</span><span class="cx">     QDialog(parent),
</span><span class="lines">@@ -8,8 +9,10 @@
</span><span class="cx"> {
</span><span class="cx">     ui-&gt;setupUi(this);
</span><span class="cx">     _settings = new QSettings();
</span><del>-    connect(this, SIGNAL(accepted()), this, SLOT(configAccepted()));
-    getPaDevlist();
</del><ins>+    connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
+
+    _mod_portaudio = new PrefPortaudio(ui, this);
+    readConfig();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PrefDialog::~PrefDialog()
</span><span class="lines">@@ -17,129 +20,11 @@
</span><span class="cx">     delete ui;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PrefDialog::configAccepted()
-{
-    _settings-&gt;beginGroup(&quot;FreeSWITCH/conf&quot;);
-
-    _settings-&gt;beginGroup(&quot;portaudio.conf&quot;);
-    _settings-&gt;setValue(&quot;cid-name&quot;, ui-&gt;PaCallerIdNameEdit-&gt;text());
-    _settings-&gt;setValue(&quot;cid-num&quot;, ui-&gt;PaCallerIdNumEdit-&gt;text());
-    _settings-&gt;setValue(&quot;indev&quot;, ui-&gt;PaIndevCombo-&gt;currentIndex());
-    _settings-&gt;setValue(&quot;outdev&quot;, ui-&gt;PaOutdevCombo-&gt;currentIndex());
-    _settings-&gt;setValue(&quot;ringdev&quot;, ui-&gt;PaRingdevCombo-&gt;currentIndex());
-    _settings-&gt;setValue(&quot;ring-file&quot;, ui-&gt;PaRingFileEdit-&gt;text());
-    _settings-&gt;setValue(&quot;ring-interval&quot;, ui-&gt;PaRingIntervalSpin-&gt;value());
-    _settings-&gt;setValue(&quot;hold-file&quot;, ui-&gt;PaHoldFileEdit-&gt;text());
-    _settings-&gt;endGroup();
-
-    _settings-&gt;endGroup();
-
</del><ins>+void PrefDialog::writeConfig()
+{    
+    _mod_portaudio-&gt;writeConfig();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PrefDialog::getPaDevlist()
-{
-    QString result;
-    int errorLine, errorColumn;
-    QString errorMsg;
-
-    if (g_FSHost.sendCmd(&quot;pa&quot;, &quot;devlist xml&quot;, &amp;result) != SWITCH_STATUS_SUCCESS)
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                             tr(&quot;Error querying audio devices.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-
-    if (!_xmlPaDevList.setContent(result, &amp;errorMsg, &amp;errorLine, &amp;errorColumn))
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist.\n%1 (Line:%2, Col:%3).&quot;).arg(errorMsg,
-                                                                                                         errorLine,
-                                                                                                         errorColumn),
-                             QMessageBox::Ok);
-        return;
-    }
-    QDomElement root = _xmlPaDevList.documentElement();
-    if (root.tagName() != &quot;xml&quot;)
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist. Root tag is not &lt;xml&gt;.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-    QDomElement devices = root.firstChildElement(&quot;devices&quot;);
-    if (devices.isNull())
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;devices&gt; tag.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-
-    QDomElement child = devices.firstChildElement();
-    if (child.isNull())
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;device&gt; tag.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-
-    while (!child.isNull())
-    {
-        if (child.tagName() == &quot;device&quot;)
-        {
-            QString id, name, inputs, outputs;
-            id = child.attribute(&quot;id&quot;,&quot;-1&quot;);
-            name = child.attribute(&quot;name&quot;,&quot;Null&quot;);
-            inputs = child.attribute(&quot;inputs&quot;,&quot;0&quot;);
-            outputs = child.attribute(&quot;outputs&quot;,&quot;0&quot;);
-            if (inputs.toInt() != 0)
-                ui-&gt;PaIndevCombo-&gt;addItem(name,inputs.toInt());
-            if (outputs.toInt() != 0)
-            {
-                ui-&gt;PaOutdevCombo-&gt;addItem(name,inputs.toInt());
-                ui-&gt;PaRingdevCombo-&gt;addItem(name,inputs.toInt());
-            }
-        }
-        child = child.nextSiblingElement();
-    }
-
-    QDomElement bindings = root.firstChildElement(&quot;bindings&quot;);
-    if (bindings.isNull())
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;bindings&gt; tag.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-
-    child = devices.firstChildElement();
-    if (child.isNull())
-    {
-        QMessageBox::critical(this, tr(&quot;PortAudio error&quot; ),
-                              tr(&quot;Error parsing output xml from pa devlist. There are no bindings.&quot;),
-                             QMessageBox::Ok);
-        return;
-    }
-
-    while (!child.isNull())
-    {
-        QString id;
-        id = child.attribute(&quot;device&quot;,&quot;-1&quot;);
-
-        if (child.tagName() == &quot;ring&quot;)
-            ui-&gt;PaRingdevCombo-&gt;setCurrentIndex(id.toInt());
-        else if (child.tagName() == &quot;input&quot;)
-            ui-&gt;PaIndevCombo-&gt;setCurrentIndex(id.toInt());
-        else if (child.tagName() == &quot;ring&quot;)
-            ui-&gt;PaOutdevCombo-&gt;setCurrentIndex(id.toInt());
-
-        child = child.nextSiblingElement();
-    }
-
-}
-
</del><span class="cx"> void PrefDialog::changeEvent(QEvent *e)
</span><span class="cx"> {
</span><span class="cx">     QDialog::changeEvent(e);
</span><span class="lines">@@ -151,3 +36,8 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
+void PrefDialog::readConfig()
+{
+    _mod_portaudio-&gt;readConfig();
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommprefdialogh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/prefdialog.h (16164 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/prefdialog.h        2010-01-05 22:16:46 UTC (rev 16164)
+++ freeswitch/trunk/fscomm/prefdialog.h        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -6,6 +6,8 @@
</span><span class="cx"> #include &lt;QSettings&gt;
</span><span class="cx"> #include &lt;fshost.h&gt;
</span><span class="cx"> 
</span><ins>+class PrefPortaudio;
+
</ins><span class="cx"> namespace Ui {
</span><span class="cx">     class PrefDialog;
</span><span class="cx"> }
</span><span class="lines">@@ -20,13 +22,14 @@
</span><span class="cx">     void changeEvent(QEvent *e);
</span><span class="cx"> 
</span><span class="cx"> private slots:
</span><del>-    void configAccepted();
</del><ins>+    void writeConfig();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    void getPaDevlist(void);
</del><ins>+    void readConfig();
+    QSettings *_settings;
</ins><span class="cx">     Ui::PrefDialog *ui;
</span><del>-    QDomDocument _xmlPaDevList;
-    QSettings *_settings;
</del><ins>+    PrefPortaudio *_mod_portaudio;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> #endif // PREFDIALOG_H
</span></span></pre></div>
<a id="freeswitchtrunkfscommprefportaudiocpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/prefportaudio.cpp (0 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/prefportaudio.cpp                                (rev 0)
+++ freeswitch/trunk/fscomm/prefportaudio.cpp        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -0,0 +1,144 @@
</span><ins>+#include &lt;QtGui&gt;
+#include &lt;fshost.h&gt;
+#include &quot;prefportaudio.h&quot;
+
+PrefPortaudio::PrefPortaudio(Ui::PrefDialog *ui, QObject *parent) :
+    QObject(parent),
+    _ui(ui)
+{
+    _settings = new QSettings();
+}
+
+void PrefPortaudio::writeConfig()
+{
+    _settings-&gt;beginGroup(&quot;FreeSWITCH/conf&quot;);
+    _settings-&gt;beginGroup(&quot;portaudio.conf&quot;);
+    _settings-&gt;setValue(&quot;cid-name&quot;, _ui-&gt;PaCallerIdNameEdit-&gt;text());
+    _settings-&gt;setValue(&quot;cid-num&quot;, _ui-&gt;PaCallerIdNumEdit-&gt;text());
+    _settings-&gt;setValue(&quot;indev&quot;, _ui-&gt;PaIndevCombo-&gt;currentIndex());
+    _settings-&gt;setValue(&quot;outdev&quot;, _ui-&gt;PaOutdevCombo-&gt;currentIndex());
+    _settings-&gt;setValue(&quot;ringdev&quot;, _ui-&gt;PaRingdevCombo-&gt;currentIndex());
+    _settings-&gt;setValue(&quot;ring-file&quot;, _ui-&gt;PaRingFileEdit-&gt;text());
+    _settings-&gt;setValue(&quot;ring-interval&quot;, _ui-&gt;PaRingIntervalSpin-&gt;value());
+    _settings-&gt;setValue(&quot;hold-file&quot;, _ui-&gt;PaHoldFileEdit-&gt;text());
+    _settings-&gt;endGroup();
+    _settings-&gt;endGroup();
+}
+
+void PrefPortaudio::readConfig()
+{
+    getPaDevlist();
+    _settings-&gt;beginGroup(&quot;FreeSWITCH/conf&quot;);
+
+    _settings-&gt;beginGroup(&quot;portaudio.conf&quot;);
+    _ui-&gt;PaCallerIdNameEdit-&gt;setText(_settings-&gt;value(&quot;cid-name&quot;).toString());
+    _ui-&gt;PaCallerIdNumEdit-&gt;setText(_settings-&gt;value(&quot;cid-num&quot;).toString());
+    _ui-&gt;PaHoldFileEdit-&gt;setText(_settings-&gt;value(&quot;hold-file&quot;).toString());
+    _ui-&gt;PaRingFileEdit-&gt;setText(_settings-&gt;value(&quot;ring-file&quot;).toString());
+    _ui-&gt;PaRingIntervalSpin-&gt;setValue(_settings-&gt;value(&quot;ring-interval&quot;).toInt());
+    _settings-&gt;endGroup();
+
+    _settings-&gt;endGroup();
+}
+
+void PrefPortaudio::getPaDevlist()
+{
+    QString result;
+    int errorLine, errorColumn;
+    QString errorMsg;
+
+    if (g_FSHost.sendCmd(&quot;pa&quot;, &quot;devlist xml&quot;, &amp;result) != SWITCH_STATUS_SUCCESS)
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                             tr(&quot;Error querying audio devices.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+
+    if (!_xmlPaDevList.setContent(result, &amp;errorMsg, &amp;errorLine, &amp;errorColumn))
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist.\n%1 (Line:%2, Col:%3).&quot;).arg(errorMsg,
+                                                                                                         errorLine,
+                                                                                                         errorColumn),
+                             QMessageBox::Ok);
+        return;
+    }
+    QDomElement root = _xmlPaDevList.documentElement();
+    if (root.tagName() != &quot;xml&quot;)
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist. Root tag is not &lt;xml&gt;.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+    QDomElement devices = root.firstChildElement(&quot;devices&quot;);
+    if (devices.isNull())
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;devices&gt; tag.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+
+    QDomElement child = devices.firstChildElement();
+    if (child.isNull())
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;device&gt; tag.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+
+    while (!child.isNull())
+    {
+        if (child.tagName() == &quot;device&quot;)
+        {
+            QString id, name, inputs, outputs;
+            id = child.attribute(&quot;id&quot;,&quot;-1&quot;);
+            name = child.attribute(&quot;name&quot;,&quot;Null&quot;);
+            inputs = child.attribute(&quot;inputs&quot;,&quot;0&quot;);
+            outputs = child.attribute(&quot;outputs&quot;,&quot;0&quot;);
+            if (inputs.toInt() != 0)
+                _ui-&gt;PaIndevCombo-&gt;addItem(name,inputs.toInt());
+            if (outputs.toInt() != 0)
+            {
+                _ui-&gt;PaOutdevCombo-&gt;addItem(name,inputs.toInt());
+                _ui-&gt;PaRingdevCombo-&gt;addItem(name,inputs.toInt());
+            }
+        }
+        child = child.nextSiblingElement();
+    }
+
+    QDomElement bindings = root.firstChildElement(&quot;bindings&quot;);
+    if (bindings.isNull())
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist. There is no &lt;bindings&gt; tag.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+
+    child = bindings.firstChildElement();
+    if (child.isNull())
+    {
+        QMessageBox::critical(0, tr(&quot;PortAudio error&quot; ),
+                              tr(&quot;Error parsing output xml from pa devlist. There are no bindings.&quot;),
+                             QMessageBox::Ok);
+        return;
+    }
+
+    while (!child.isNull())
+    {
+        QString id = child.attribute(&quot;device&quot;,&quot;-1&quot;);
+        if (child.tagName() == &quot;ring&quot;)
+            _ui-&gt;PaRingdevCombo-&gt;setCurrentIndex(id.toInt());
+        else if (child.tagName() == &quot;input&quot;)
+            _ui-&gt;PaIndevCombo-&gt;setCurrentIndex(id.toInt());
+        else if (child.tagName() == &quot;output&quot;)
+            _ui-&gt;PaOutdevCombo-&gt;setCurrentIndex(id.toInt());
+
+        child = child.nextSiblingElement();
+    }
+
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommprefportaudioh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/prefportaudio.h (0 => 16165)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/prefportaudio.h                                (rev 0)
+++ freeswitch/trunk/fscomm/prefportaudio.h        2010-01-06 02:08:25 UTC (rev 16165)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+#ifndef PREFPORTAUDIO_H
+#define PREFPORTAUDIO_H
+
+#include &lt;QObject&gt;
+#include &lt;QDomDocument&gt;
+#include &quot;ui_prefdialog.h&quot;
+
+class QSettings;
+
+class PrefPortaudio : public QObject
+{
+Q_OBJECT
+public:
+    explicit PrefPortaudio(Ui::PrefDialog *ui, QObject *parent = 0);
+    void writeConfig();
+    void readConfig();
+
+private:
+    void getPaDevlist(void);
+    QSettings *_settings;
+    Ui::PrefDialog *_ui;
+    QDomDocument _xmlPaDevList;
+};
+
+#endif // PREFPORTAUDIO_H
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>