Import Edson's Linux setup code for audio devices from WSPR-X.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3064 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-03-21 14:14:26 +00:00
parent 53c6c15937
commit 250623517b
4 changed files with 20 additions and 4 deletions

View File

@ -41,7 +41,6 @@ void DevSetup::initDlg()
} }
k=0; k=0;
#ifdef WIN32
// Needs work to compile for Linux // Needs work to compile for Linux
for(id=0; id<numDevices; id++ ) { for(id=0; id<numDevices; id++ ) {
pdi=Pa_GetDeviceInfo(id); pdi=Pa_GetDeviceInfo(id);
@ -53,6 +52,7 @@ void DevSetup::initDlg()
sprintf((char*)(pa_device_hostapi),"%s", sprintf((char*)(pa_device_hostapi),"%s",
Pa_GetHostApiInfo(pdi->hostApi)->name); Pa_GetHostApiInfo(pdi->hostApi)->name);
#ifdef WIN32
p1=(char*)""; p1=(char*)"";
p=strstr(pa_device_hostapi,"MME"); p=strstr(pa_device_hostapi,"MME");
if(p!=NULL) p1=(char*)"MME"; if(p!=NULL) p1=(char*)"MME";
@ -67,10 +67,13 @@ void DevSetup::initDlg()
sprintf(p2,"%2d %d %-8s %-39s",id,nchin,p1,pa_device_name); sprintf(p2,"%2d %d %-8s %-39s",id,nchin,p1,pa_device_name);
QString t(p2); QString t(p2);
#else
QString t;
t.sprintf("%2d %d %-8s %-39s",id,nchin,p1,pdi->name);
#endif
ui.comboBoxSndIn->addItem(t); ui.comboBoxSndIn->addItem(t);
} }
} }
#endif
k=0; k=0;
for(id=0; id<numDevices; id++ ) { for(id=0; id<numDevices; id++ ) {
@ -99,8 +102,11 @@ void DevSetup::initDlg()
if(p!=NULL) p1=(char*)"WDM-KS"; if(p!=NULL) p1=(char*)"WDM-KS";
sprintf(p2,"%2d %d %-8s %-39s",id,nchout,p1,pa_device_name); sprintf(p2,"%2d %d %-8s %-39s",id,nchout,p1,pa_device_name);
QString t(p2); QString t(p2);
ui.comboBoxSndOut->addItem(t); #else
QString t;
t.sprintf("%2d %d %-8s %-39s",id,nchin,p1,pdi->name);
#endif #endif
ui.comboBoxSndOut->addItem(t);
} }
} }

View File

@ -28,7 +28,8 @@ OBJS1 = pctile.o graycode.o sort.o ssort.o \
entail.o fano232.o gran.o spec9.o sync9.o decode9.o \ entail.o fano232.o gran.o spec9.o sync9.o decode9.o \
fil3.o redsync.o decoder.o grid2n.o n2grid.o timer.o \ fil3.o redsync.o decoder.o grid2n.o n2grid.o timer.o \
decode9a.o peakdt9.o getlags.o afc9.o fchisq.o \ decode9a.o peakdt9.o getlags.o afc9.o fchisq.o \
twkfreq.o downsam9.o symspec2.o ipcomm.o sleep_msec.o twkfreq.o downsam9.o symspec2.o ipcomm.o sleep_msec.o \
stdmsg.o
libjt9.a: $(OBJS1) libjt9.a: $(OBJS1)
ar cr libjt9.a $(OBJS1) ar cr libjt9.a $(OBJS1)

View File

@ -224,6 +224,7 @@ MainWindow::MainWindow(QWidget *parent) :
if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered(); if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered();
if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); if(ui->actionBlue->isChecked()) on_actionBlue_triggered();
#ifdef WIN32
if(m_pskReporter) { if(m_pskReporter) {
rc=ReporterInitialize(NULL,NULL); rc=ReporterInitialize(NULL,NULL);
if(rc==0) { if(rc==0) {
@ -234,6 +235,7 @@ MainWindow::MainWindow(QWidget *parent) :
msgBox(QString::fromStdWString(buffer)); msgBox(QString::fromStdWString(buffer));
} }
} }
#endif
} // End of MainWindow constructor } // End of MainWindow constructor
//--------------------------------------------------- MainWindow destructor //--------------------------------------------------- MainWindow destructor
@ -466,6 +468,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
m_paInDevice=dlg.m_paInDevice; m_paInDevice=dlg.m_paInDevice;
m_nDevOut=dlg.m_nDevOut; m_nDevOut=dlg.m_nDevOut;
m_paOutDevice=dlg.m_paOutDevice; m_paOutDevice=dlg.m_paOutDevice;
#ifdef WIN32
if(dlg.m_pskReporter!=m_pskReporter) { if(dlg.m_pskReporter!=m_pskReporter) {
if(dlg.m_pskReporter) { if(dlg.m_pskReporter) {
int rc=ReporterInitialize(NULL,NULL); int rc=ReporterInitialize(NULL,NULL);
@ -481,6 +484,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
m_pskReporterInit=false; m_pskReporterInit=false;
} }
} }
#endif
m_pskReporter=dlg.m_pskReporter; m_pskReporter=dlg.m_pskReporter;
if(dlg.m_restartSoundIn) { if(dlg.m_restartSoundIn) {
@ -1056,6 +1060,7 @@ void MainWindow::readFromStdout() //readFromStdout
} }
} }
#ifdef WIN32
if(m_pskReporterInit and b and !m_diskData) { if(m_pskReporterInit and b and !m_diskData) {
// if(m_pskReporterInit and b) { // if(m_pskReporterInit and b) {
int i1=msg.indexOf(" "); int i1=msg.indexOf(" ");
@ -1093,6 +1098,7 @@ void MainWindow::readFromStdout() //readFromStdout
qDebug() << "D:" << QString::fromStdWString(buffer); qDebug() << "D:" << QString::fromStdWString(buffer);
} }
} }
#endif
} }
} }
} }

View File

@ -6,7 +6,10 @@
#include "soundin.h" #include "soundin.h"
#include "soundout.h" #include "soundout.h"
#include "commons.h" #include "commons.h"
#ifdef WIN32
#include "PSKReporter.h" #include "PSKReporter.h"
#endif
//--------------------------------------------------------------- MainWindow //--------------------------------------------------------------- MainWindow
namespace Ui { namespace Ui {