<!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][16302] </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=16302">16302</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-13 23:05:32 -0600 (Wed, 13 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre><a href="http://jira.freeswitch.org/browse/FSPHONE-1">FSPHONE-1</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommfshostcpp">freeswitch/trunk/fscomm/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefdialogui">freeswitch/trunk/fscomm/preferences/prefdialog.ui</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefportaudiocpp">freeswitch/trunk/fscomm/preferences/prefportaudio.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefportaudioh">freeswitch/trunk/fscomm/preferences/prefportaudio.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (16301 => 16302)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-01-14 04:54:03 UTC (rev 16301)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-01-14 05:05:32 UTC (rev 16302)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> QThread(parent)
</span><span class="cx"> {
</span><span class="cx"> /* Initialize libs & globals */
</span><del>- printf("Initializing globals...\n");
</del><ins>+ qDebug() << "Initializing globals..." << endl;
</ins><span class="cx"> switch_core_setrlimits();
</span><span class="cx"> switch_core_set_globals();
</span><span class="cx">
</span><span class="lines">@@ -116,14 +116,14 @@
</span><span class="cx"> createFolders();
</span><span class="cx">
</span><span class="cx"> /* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */
</span><del>- printf("Initializing core...\n");
</del><ins>+ qDebug() << "Initializing core..." << endl;
</ins><span class="cx"> /* Initialize the core and load modules, that will startup FS completely */
</span><span class="cx"> if (switch_core_init(flags, console, &err) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx"> fprintf(stderr, "Failed to initialize FreeSWITCH's core: %s\n", err);
</span><span class="cx"> emit coreLoadingError(err);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- printf("Everything OK, Entering runtime loop.\n");
</del><ins>+ qDebug() << "Everything OK, Entering runtime loop ..." << endl;
</ins><span class="cx">
</span><span class="cx"> if (switch_event_bind("FSHost", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, eventHandlerCallback, NULL) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> destroy_status = switch_core_destroy();
</span><span class="cx"> if (destroy_status == SWITCH_STATUS_SUCCESS)
</span><span class="cx"> {
</span><del>- printf("We have properly shutdown the core.\n");
</del><ins>+ qDebug() << "We have properly shutdown the core." << endl;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.ui (16301 => 16302)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-14 04:54:03 UTC (rev 16301)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-14 05:05:32 UTC (rev 16302)
</span><span class="lines">@@ -865,6 +865,48 @@
</span><span class="cx"> </item>
</span><span class="cx"> </layout>
</span><span class="cx"> </item>
</span><ins>+ <item row="4" column="1">
+ <widget class="QPushButton" name="PaRefreshDevListBtn">
+ <property name="text">
+ <string>Refresh DevList</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QPushButton" name="PaLoopTestBtn">
+ <property name="text">
+ <string>Loop Test</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="PaSampleRateEdit">
+ <property name="text">
+ <string>16000</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QLineEdit" name="PaCodecMSEdit">
+ <property name="text">
+ <string>10</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_40">
+ <property name="text">
+ <string>Sample Rate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_41">
+ <property name="text">
+ <string>Codec MS</string>
+ </property>
+ </widget>
+ </item>
</ins><span class="cx"> </layout>
</span><span class="cx"> </widget>
</span><span class="cx"> </item>
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefportaudiocpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefportaudio.cpp (16301 => 16302)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefportaudio.cpp        2010-01-14 04:54:03 UTC (rev 16301)
+++ freeswitch/trunk/fscomm/preferences/prefportaudio.cpp        2010-01-14 05:05:32 UTC (rev 16302)
</span><span class="lines">@@ -9,9 +9,12 @@
</span><span class="cx"> _settings = new QSettings();
</span><span class="cx"> connect(_ui->PaRingFileBtn, SIGNAL(clicked()), this, SLOT(ringFileChoose()));
</span><span class="cx"> connect(_ui->PaHoldFileBtn, SIGNAL(clicked()), this, SLOT(holdFileChoose()));
</span><ins>+ connect(_ui->PaIndevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(indevChangeDev(int)));
</ins><span class="cx"> connect(_ui->PaOutdevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(outdevChangeDev(int)));
</span><span class="cx"> connect(_ui->PaRingdevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(ringdevChangeDev(int)));
</span><span class="cx"> connect(_ui->PaRingdevTestBtn, SIGNAL(clicked()), this, SLOT(ringdevTest()));
</span><ins>+ connect(_ui->PaLoopTestBtn, SIGNAL(clicked()), this, SLOT(loopTest()));
+ connect(_ui->PaRefreshDevListBtn, SIGNAL(clicked()), this, SLOT(refreshDevList()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PrefPortaudio::ringdevTest()
</span><span class="lines">@@ -24,9 +27,51 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PrefPortaudio::ringdevChangeDev(int dev)
</del><ins>+void PrefPortaudio::loopTest()
</ins><span class="cx"> {
</span><span class="cx"> QString result;
</span><ins>+ _ui->PaLoopTestBtn->setEnabled(false);
+ if (g_FSHost.sendCmd("pa", "looptest", &result) != SWITCH_STATUS_SUCCESS)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error running looptest on mod_portaudio! %s\n",
+ result.toAscii().constData());
+ }
+ _ui->PaLoopTestBtn->setEnabled(true);
+}
+
+void PrefPortaudio::refreshDevList()
+{
+ QString result;
+ if (g_FSHost.sendCmd("pa", "rescan", &result) != SWITCH_STATUS_SUCCESS)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error rescaning sound device on mod_portaudio! %s\n",
+ result.toAscii().constData());
+ }
+ //clear combox
+ _ui->PaIndevCombo->clear();
+ _ui->PaOutdevCombo->clear();
+ _ui->PaRingdevCombo->clear();
+ getPaDevlist();
+}
+
+void PrefPortaudio::indevChangeDev(int index)
+{
+ QString result;
+ int dev = _ui->PaIndevCombo->itemData(index, Qt::UserRole).toInt();
+ if (g_FSHost.sendCmd("pa", QString("indev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting ringdev to #%d on mod_portaudio!\n", dev);
+ QMessageBox::critical(0, tr("Unable to change device."),
+ tr("There was an error changing the ringdev.\nPlease report this bug."),
+ QMessageBox::Ok);
+
+ }
+}
+
+void PrefPortaudio::ringdevChangeDev(int index)
+{
+ QString result;
+ int dev = _ui->PaRingdevCombo->itemData(index, Qt::UserRole).toInt();
</ins><span class="cx"> if (g_FSHost.sendCmd("pa", QString("ringdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS)
</span><span class="cx"> {
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting ringdev to #%d on mod_portaudio!\n", dev);
</span><span class="lines">@@ -37,9 +82,10 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PrefPortaudio::outdevChangeDev(int dev)
</del><ins>+void PrefPortaudio::outdevChangeDev(int index)
</ins><span class="cx"> {
</span><span class="cx"> QString result;
</span><ins>+ int dev = _ui->PaRingdevCombo->itemData(index, Qt::UserRole).toInt();
</ins><span class="cx"> if (g_FSHost.sendCmd("pa", QString("outdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS)
</span><span class="cx"> {
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting outdev to #%d on mod_portaudio!\n", dev);
</span><span class="lines">@@ -89,13 +135,21 @@
</span><span class="cx"> int ring_interval = _settings->value("ring-interval").toInt();
</span><span class="cx"> int nring_interval = _ui->PaRingIntervalSpin->value();
</span><span class="cx">
</span><ins>+ QString sample_rate = _settings->value("sample-rate").toString();
+ QString nsample_rate = _ui->PaSampleRateEdit->text();
+
+ QString codec_ms = _settings->value("codec-ms").toString();
+ QString ncodec_ms = _ui->PaCodecMSEdit->text();
+
</ins><span class="cx"> QString result;
</span><span class="cx">
</span><span class="cx"> if (cid_name != ncid_name ||
</span><span class="cx"> cid_num != ncid_num ||
</span><span class="cx"> hold_file != nhold_file ||
</span><span class="cx"> ring_file != nring_file ||
</span><del>- ring_interval != nring_interval)
</del><ins>+ ring_interval != nring_interval ||
+ sample_rate != nsample_rate||
+ codec_ms != ncodec_ms)
</ins><span class="cx"> {
</span><span class="cx"> if (g_FSHost.sendCmd("reload", "mod_portaudio", &result) == SWITCH_STATUS_SUCCESS)
</span><span class="cx"> {
</span><span class="lines">@@ -104,6 +158,8 @@
</span><span class="cx"> _settings->setValue("ring-file", nring_file);
</span><span class="cx"> _settings->setValue("ring-interval", nring_interval);
</span><span class="cx"> _settings->setValue("hold-file", nhold_file);
</span><ins>+ _settings->setValue("sample-rate", nsample_rate);
+ _settings->setValue("codec-ms", ncodec_ms);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -114,11 +170,11 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- int nindev = _ui->PaIndevCombo->currentIndex();
</del><ins>+ int nindev = _ui->PaIndevCombo->itemData(_ui->PaIndevCombo->currentIndex(), Qt::UserRole).toInt();
</ins><span class="cx"> int indev = _settings->value("indev").toInt();
</span><del>- int noutdev = _ui->PaOutdevCombo->currentIndex();
</del><ins>+ int noutdev = _ui->PaOutdevCombo->itemData(_ui->PaOutdevCombo->currentIndex(), Qt::UserRole).toInt();
</ins><span class="cx"> int outdev = _settings->value("outdev").toInt();
</span><del>- int nringdev = _ui->PaRingdevCombo->currentIndex();
</del><ins>+ int nringdev = _ui->PaRingdevCombo->itemData(_ui->PaRingdevCombo->currentIndex(), Qt::UserRole).toInt();
</ins><span class="cx"> int ringdev = _settings->value("ringdev").toInt();
</span><span class="cx">
</span><span class="cx"> if (nindev != indev)
</span><span class="lines">@@ -161,6 +217,8 @@
</span><span class="cx"> _ui->PaHoldFileEdit->setText(_settings->value("hold-file").toString());
</span><span class="cx"> _ui->PaRingFileEdit->setText(_settings->value("ring-file").toString());
</span><span class="cx"> _ui->PaRingIntervalSpin->setValue(_settings->value("ring-interval").toInt());
</span><ins>+ _ui->PaSampleRateEdit->setText(_settings->value("sample-rate").toString());
+ _ui->PaCodecMSEdit->setText(_settings->value("codec-ms").toString());
</ins><span class="cx"> _settings->endGroup();
</span><span class="cx">
</span><span class="cx"> _settings->endGroup();
</span><span class="lines">@@ -260,19 +318,29 @@
</span><span class="cx"> {
</span><span class="cx"> for(int itemId=0; itemId<_ui->PaRingdevCombo->count(); itemId++)
</span><span class="cx"> {
</span><del>- if (itemId == _ui->PaRingdevCombo->itemData(itemId,Qt::UserRole).toInt())
</del><ins>+ if (id == _ui->PaRingdevCombo->itemData(itemId,Qt::UserRole))
</ins><span class="cx"> {
</span><ins>+ //setCurrentIndex triggers currentIndexChanged signal, hmmm...
</ins><span class="cx"> _ui->PaRingdevCombo->setCurrentIndex(itemId);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> else if (child.tagName() == "input")
</span><del>- _ui->PaIndevCombo->setCurrentIndex(id.toInt());
</del><ins>+ {
+ for(int itemId=0; itemId<_ui->PaRingdevCombo->count(); itemId++)
+ {
+ if (id == _ui->PaIndevCombo->itemData(itemId,Qt::UserRole))
+ {
+ _ui->PaIndevCombo->setCurrentIndex(itemId);
+ break;
+ }
+ }
+ }
</ins><span class="cx"> else if (child.tagName() == "output")
</span><span class="cx"> for(int itemId=0; itemId<_ui->PaOutdevCombo->count(); itemId++)
</span><span class="cx"> {
</span><del>- if (itemId == _ui->PaOutdevCombo->itemData(itemId,Qt::UserRole).toInt())
</del><ins>+ if (id == _ui->PaOutdevCombo->itemData(itemId,Qt::UserRole))
</ins><span class="cx"> {
</span><span class="cx"> _ui->PaOutdevCombo->setCurrentIndex(itemId);
</span><span class="cx"> break;
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefportaudioh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefportaudio.h (16301 => 16302)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefportaudio.h        2010-01-14 04:54:03 UTC (rev 16301)
+++ freeswitch/trunk/fscomm/preferences/prefportaudio.h        2010-01-14 05:05:32 UTC (rev 16302)
</span><span class="lines">@@ -18,10 +18,12 @@
</span><span class="cx"> private slots:
</span><span class="cx"> void ringFileChoose();
</span><span class="cx"> void holdFileChoose();
</span><ins>+ void indevChangeDev(int);
</ins><span class="cx"> void outdevChangeDev(int);
</span><span class="cx"> void ringdevChangeDev(int);
</span><span class="cx"> void ringdevTest();
</span><del>-
</del><ins>+ void loopTest();
+ void refreshDevList();
</ins><span class="cx"> private:
</span><span class="cx"> void getPaDevlist(void);
</span><span class="cx"> QSettings *_settings;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>