From a170d9df1f2a54e282a8fe99697c920450d351da Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 28 May 2013 19:16:25 +0000 Subject: [PATCH] 1. Correct the listings of Audio In and Audio Out devices, on unix-like platforms. 2. This might be temporary: set Audio output on unix platforms to stereo, i.e., channels=2. On my Ubuntu system, at least, this makes it play correctly on all of the relevant audio devices in the list, including hardware and virtual (".asoundrc-implemented") devices. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3317 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 8 +++++--- mainwindow.cpp | 2 +- soundout.cpp | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 1c3155136..b8836f8b7 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -64,7 +64,8 @@ void DevSetup::initDlg() QString t(p2); #else QString t; - t.sprintf("%2d %d %-8s %-39s",id,nchin,p1,pdi->name); + t.sprintf("%2d %d %-8s %-39s",id,nchin, + Pa_GetHostApiInfo(pdi->hostApi)->name,pdi->name); #endif ui.comboBoxSndIn->addItem(t); } @@ -84,7 +85,7 @@ void DevSetup::initDlg() #ifdef WIN32 // Needs work to compile for Linux p1=(char*)""; - p=strstr(pa_device_hostapi,"MME"); + p=strstr(pa_device_hostapi,"MME");Pa_GetHostApiInfo(pdi->hostApi)->name if(p!=NULL) p1=(char*)"MME"; p=strstr(pa_device_hostapi,"Direct"); @@ -99,7 +100,8 @@ void DevSetup::initDlg() QString t(p2); #else QString t; - t.sprintf("%2d %d %-8s %-39s",id,nchin,p1,pdi->name); + t.sprintf("%2d %d %-8s %-39s",id,nchout, + Pa_GetHostApiInfo(pdi->hostApi)->name,pdi->name); #endif ui.comboBoxSndOut->addItem(t); } diff --git a/mainwindow.cpp b/mainwindow.cpp index fe6054f65..813d50268 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------- MainWindow +//------------------------------------------------------------ MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h" diff --git a/soundout.cpp b/soundout.cpp index 2d2eefb89..31f67bcab 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -143,6 +143,9 @@ void SoundOutThread::run() outParam.device=m_nDevOut; //Output device number outParam.channelCount=1; //Number of analog channels +#ifdef unix + outParam.channelCount=2; //Number of analog channels +#endif outParam.sampleFormat=paInt16; //Send short ints to PortAudio outParam.suggestedLatency=0.05; outParam.hostApiSpecificStreamInfo=NULL;