]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add a test sound to test the ringdev.
authorJoão Mesquita <jmesquita@freeswitch.org>
Wed, 6 Jan 2010 04:31:20 +0000 (04:31 +0000)
committerJoão Mesquita <jmesquita@freeswitch.org>
Wed, 6 Jan 2010 04:31:20 +0000 (04:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16169 d0543943-73ff-0310-b7d9-9358b9ac24b2

fscomm/fshost.cpp
fscomm/prefdialog.ui
fscomm/prefportaudio.cpp
fscomm/prefportaudio.h
fscomm/resources.qrc
fscomm/resources/test.wav [new file with mode: 0644]

index 9cd0bd37961eb3d4904a9fec24dda81b51682e1d..6ddca285472c9d0067462d12f1615e2e52bcbe0a 100644 (file)
@@ -59,6 +59,8 @@ void FSHost::run(void)
     if (!conf_dir.exists(".fscomm"))
     {
         conf_dir.mkpath(".fscomm/conf/accounts");
+        conf_dir.mkpath(".fscomm/sounds");
+        QFile::copy(":/sounds/test.wav", QString("%1/.fscomm/sounds/test.wav").arg(QDir::homePath()));
         conf_dir.mkpath(".fscomm/templates");
         QFile rootXML(":/confs/freeswitch.xml");
         QString dest = QString("%1/.fscomm/conf/freeswitch.xml").arg(conf_dir.absolutePath());
index 1f228692c0d98456fc7f6c448e2b62e7428f0e32..63d83ea4c26a49a9e48f35cd791b9cdc32ed8f20 100644 (file)
             <item>
              <widget class="QPushButton" name="PaRingdevTestBtn">
               <property name="enabled">
-               <bool>false</bool>
+               <bool>true</bool>
               </property>
               <property name="maximumSize">
                <size>
index ecd1c603b9201a22dd08a1e255216619c1751db0..16cc01ef23c2f69a45a51fad1bf22b7139562a69 100644 (file)
@@ -11,6 +11,17 @@ PrefPortaudio::PrefPortaudio(Ui::PrefDialog *ui, QObject *parent) :
     connect(_ui->PaHoldFileBtn, SIGNAL(clicked()), this, SLOT(holdFileChoose()));
     connect(_ui->PaOutdevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(outdevChangeDev(int)));
     connect(_ui->PaRingdevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(ringdevChangeDev(int)));
+    connect(_ui->PaRingdevTestBtn, SIGNAL(clicked()), this, SLOT(ringdevTest()));
+}
+
+void PrefPortaudio::ringdevTest()
+{
+    QString result;
+    if (g_FSHost.sendCmd("pa", QString("play %1/.fscomm/sounds/test.wav").arg(QDir::homePath()).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS)
+    {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error testing ringdev on mod_portaudio! %s\n",
+                          result.toAscii().constData());
+    }
 }
 
 void PrefPortaudio::ringdevChangeDev(int dev)
index d427121629260e304a67e864a1c1c5e3e3f78626..9308e8b5dd508ed63ebdb0b43814038b26dae252 100644 (file)
@@ -20,6 +20,7 @@ private slots:
     void holdFileChoose();
     void outdevChangeDev(int);
     void ringdevChangeDev(int);
+    void ringdevTest();
 
 private:
     void getPaDevlist(void);
index 8c6ac288edcb7b28642ba2da9770367782da9d63..2ee05d469355ecffdbea407125a039647aedb421 100644 (file)
@@ -11,4 +11,7 @@
         <file alias="event_socket.conf.xml">conf/event_socket.conf.xml</file>
         <file alias="portaudio.conf.xml">conf/portaudio.conf.xml</file>
     </qresource>
+    <qresource prefix="/sounds">
+        <file alias="test.wav">resources/test.wav</file>
+    </qresource>
 </RCC>
diff --git a/fscomm/resources/test.wav b/fscomm/resources/test.wav
new file mode 100644 (file)
index 0000000..46daf5a
Binary files /dev/null and b/fscomm/resources/test.wav differ