mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 19:55:20 -05:00
Tidy up unused files and move platform specific files
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4549 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
065483e283
commit
5a56cbdedb
@ -823,10 +823,10 @@ if (NOT is_debug_build)
|
||||
"${wsjtx_BINARY_DIR}/postflight.sh")
|
||||
set (CMAKE_POSTUPGRADE_SCRIPT
|
||||
"${wsjtx_BINARY_DIR}/postupgrade.sh")
|
||||
configure_file ("${wsjtx_SOURCE_DIR}/postflight.sh.in"
|
||||
"${wsjtx_BINARY_DIR}/postflight.sh")
|
||||
configure_file ("${wsjtx_SOURCE_DIR}/postupgrade.sh.in"
|
||||
"${wsjtx_BINARY_DIR}/postupgrade.sh")
|
||||
configure_file ("${wsjtx_SOURCE_DIR}/Darwin/postflight.sh.in"
|
||||
"${CMAKE_POSTFLIGHT_SCRIPT}")
|
||||
configure_file ("${wsjtx_SOURCE_DIR}/Darwin/postupgrade.sh.in"
|
||||
"${CMAKE_POSTUPGRADE_SCRIPT}")
|
||||
endif ()
|
||||
|
||||
if (APPLE OR WIN32)
|
||||
|
@ -1,30 +0,0 @@
|
||||
+ + + This Software is released under the "Simplified BSD License" + + +
|
||||
Copyright 2010 Moe Wheatley. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY Moe Wheatley ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL Moe Wheatley OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressed or implied, of Moe Wheatley.
|
@ -1,10 +0,0 @@
|
||||
[Setup]
|
||||
AppName="QtSupport for MAP65"
|
||||
AppVerName=QtSupport
|
||||
DefaultDirName=C:\MAP65
|
||||
|
||||
[Files]
|
||||
Source: "c:\Users\joe\map65\QtSupport\*.dll"; DestDir: "{app}"; Flags: onlyifdoesntexist
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
69
ffft.f
69
ffft.f
@ -1,69 +0,0 @@
|
||||
subroutine ffft(d,npts,isign,ireal)
|
||||
|
||||
C Fourier transform of length npts=2**k, performed in place.
|
||||
C Input data in array d, treated as complex if ireal=0, and as real if ireal=1.
|
||||
C In either case the transform values are returned in array d, treated as
|
||||
C complex. The DC term is d(1), and d(npts/2+1) is the term at the Nyquist
|
||||
C frequency. The basic algorithm is the same as Norm Brenner's FOUR1, and
|
||||
C uses radix-2 transforms.
|
||||
|
||||
C J. H. Taylor, Princeton University.
|
||||
|
||||
complex d(npts),t,w,wstep,tt,uu
|
||||
data pi/3.14159265359/
|
||||
|
||||
C Shuffle the data to bit-reversed order.
|
||||
|
||||
imax=npts/(ireal+1)
|
||||
irev=1
|
||||
do 5 i=1,imax
|
||||
if(i.ge.irev) go to 2
|
||||
t=d(i)
|
||||
d(i)=d(irev)
|
||||
d(irev)=t
|
||||
2 mmax=imax/2
|
||||
3 if(irev.le.mmax) go to 5
|
||||
irev=irev-mmax
|
||||
mmax=mmax/2
|
||||
if(mmax.ge.1) go to 3
|
||||
5 irev=irev+mmax
|
||||
|
||||
C The radix-2 transform begins here.
|
||||
|
||||
api=isign*pi/2.
|
||||
mmax=1
|
||||
6 istep=2*mmax
|
||||
wstep=cmplx(-2.*sin(api/mmax)**2,sin(2.*api/mmax))
|
||||
w=1.
|
||||
do 9 m=1,mmax
|
||||
|
||||
C This in the inner-most loop -- optimization here is important!
|
||||
do 8 i=m,imax,istep
|
||||
t=w*d(i+mmax)
|
||||
d(i+mmax)=d(i)-t
|
||||
8 d(i)=d(i)+t
|
||||
|
||||
9 w=w*(1.+wstep)
|
||||
mmax=istep
|
||||
if(mmax.lt.imax) go to 6
|
||||
|
||||
if(ireal.eq.0) return
|
||||
|
||||
C Now complete the last stage of a doubled-up real transform.
|
||||
|
||||
jmax=imax/2 + 1
|
||||
wstep=cmplx(-2.*sin(isign*pi/npts)**2,sin(isign*pi/imax))
|
||||
w=1.0
|
||||
d(imax+1)=d(1)
|
||||
|
||||
do 10 j=1,jmax
|
||||
uu=cmplx(real(d(j))+real(d(2+imax-j)),aimag(d(j)) -
|
||||
+ aimag(d(2+imax-j)))
|
||||
tt=w*cmplx(aimag(d(j))+aimag(d(2+imax-j)),-real(d(j)) +
|
||||
+ real(d(2+imax-j)))
|
||||
d(j)=uu+tt
|
||||
d(2+imax-j)=conjg(uu-tt)
|
||||
10 w=w*(1.+wstep)
|
||||
|
||||
return
|
||||
end
|
259
getdev.cpp
259
getdev.cpp
@ -1,259 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#define MAXDEVICES 100
|
||||
#include <string.h>
|
||||
#include <portaudio.h>
|
||||
#include <QDebug>
|
||||
|
||||
//------------------------------------------------------- pa_get_device_info
|
||||
int pa_get_device_info (int n,
|
||||
void *pa_device_name,
|
||||
void *pa_device_hostapi,
|
||||
double *pa_device_max_speed,
|
||||
double *pa_device_min_speed,
|
||||
int *pa_device_max_bytes,
|
||||
int *pa_device_min_bytes,
|
||||
int *pa_device_max_channels,
|
||||
int *pa_device_min_channels )
|
||||
{
|
||||
|
||||
(void) n ;
|
||||
(void) pa_device_name;
|
||||
(void) pa_device_hostapi;
|
||||
(void) pa_device_max_speed;
|
||||
(void) pa_device_min_speed;
|
||||
(void) pa_device_max_bytes;
|
||||
(void) pa_device_min_bytes;
|
||||
(void) pa_device_max_channels;
|
||||
(void) pa_device_min_channels;
|
||||
const PaDeviceInfo *deviceInfo;
|
||||
PaError pa_err;
|
||||
PaStreamParameters inputParameters;
|
||||
int i,j, speed_warning;
|
||||
int minBytes, maxBytes;
|
||||
double maxStandardSampleRate;
|
||||
double minStandardSampleRate;
|
||||
int minInputChannels;
|
||||
int maxInputChannels;
|
||||
|
||||
// negative terminated list
|
||||
static double standardSampleRates[] = {8000.0, 9600.0,
|
||||
11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0,
|
||||
44100.0, 48000.0, 88200.0, 96000.0, 192000.0, -1};
|
||||
// *******************************************************
|
||||
|
||||
|
||||
*pa_device_max_speed=0;
|
||||
*pa_device_min_speed=0;
|
||||
*pa_device_max_bytes=0;
|
||||
*pa_device_min_bytes=0;
|
||||
*pa_device_max_channels=0;
|
||||
*pa_device_min_channels=0;
|
||||
minInputChannels=0;
|
||||
if(n >= Pa_GetDeviceCount() ) return -1;
|
||||
deviceInfo = Pa_GetDeviceInfo(n);
|
||||
if (deviceInfo->maxInputChannels==0) return -1;
|
||||
sprintf((char*)(pa_device_name),"%s",deviceInfo->name);
|
||||
sprintf((char*)(pa_device_hostapi),"%s",
|
||||
Pa_GetHostApiInfo( deviceInfo->hostApi )->name);
|
||||
speed_warning=0;
|
||||
|
||||
// bypass bug in Juli@ ASIO driver:
|
||||
// this driver hangs after a Pa_IsFormatSupported call
|
||||
i = strncmp(deviceInfo->name, "ASIO 2.0 - ESI Juli@", 19);
|
||||
if (i == 0) {
|
||||
minStandardSampleRate=44100;
|
||||
maxStandardSampleRate=192000;
|
||||
minBytes=1;
|
||||
maxBytes=4;
|
||||
maxInputChannels= deviceInfo->maxInputChannels;
|
||||
minInputChannels= 1;
|
||||
goto end_pa_get_device_info;
|
||||
}
|
||||
|
||||
// Investigate device capabilities.
|
||||
// Check min and max samplerates with 16 bit data.
|
||||
maxStandardSampleRate=0;
|
||||
minStandardSampleRate=0;
|
||||
inputParameters.device = n;
|
||||
inputParameters.channelCount = deviceInfo->maxInputChannels;
|
||||
inputParameters.sampleFormat = paInt16;
|
||||
inputParameters.suggestedLatency = 0;
|
||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
// ************************************************************************
|
||||
//filter for portaudio Windows hostapi's with non experts.
|
||||
//only allow ASIO or WASAPI or WDM-KS
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name, "ASIO", 4);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name,
|
||||
"Windows WASAPI", 14);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name,
|
||||
"Windows WDM-KS", 14);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
speed_warning=1;
|
||||
end_filter_hostapi:;
|
||||
|
||||
// ************************************************************************
|
||||
i=0;
|
||||
while(standardSampleRates[i] > 0 && minStandardSampleRate==0) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
standardSampleRates[i] );
|
||||
if(pa_err == paDeviceUnavailable) return -1;
|
||||
if(pa_err == paInvalidDevice) return -1;
|
||||
if(pa_err == paFormatIsSupported ) {
|
||||
minStandardSampleRate=standardSampleRates[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(minStandardSampleRate == 0) return -1;
|
||||
j=i;
|
||||
while(standardSampleRates[i] > 0 ) i++;
|
||||
i--;
|
||||
|
||||
while(i >= j && maxStandardSampleRate==0) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
standardSampleRates[i] );
|
||||
if(pa_err == paDeviceUnavailable) return -1;
|
||||
if(pa_err == paInvalidDevice) return -1;
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
maxStandardSampleRate=standardSampleRates[i];
|
||||
}
|
||||
i--;
|
||||
}
|
||||
|
||||
// check if min SampleRate = max SampleRate
|
||||
if(maxStandardSampleRate==0 && (minStandardSampleRate != 0)) {
|
||||
maxStandardSampleRate= minStandardSampleRate;
|
||||
}
|
||||
|
||||
// check min and max bytes
|
||||
minBytes=2;
|
||||
maxBytes=2;
|
||||
inputParameters.sampleFormat = paUInt8;
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
minBytes=1;
|
||||
}
|
||||
inputParameters.sampleFormat = paInt32;
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
maxBytes=4;
|
||||
}
|
||||
|
||||
// check min channel count
|
||||
maxInputChannels= deviceInfo->maxInputChannels;
|
||||
inputParameters.channelCount = 1;
|
||||
inputParameters.sampleFormat = paInt16;
|
||||
pa_err=paFormatIsSupported+32000;
|
||||
while(pa_err != paFormatIsSupported &&
|
||||
( inputParameters.channelCount < (maxInputChannels+1)) ) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
inputParameters.channelCount++;
|
||||
}
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
minInputChannels=inputParameters.channelCount-1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
end_pa_get_device_info:;
|
||||
|
||||
*pa_device_max_speed=maxStandardSampleRate;
|
||||
*pa_device_min_speed=minStandardSampleRate;
|
||||
*pa_device_max_bytes=maxBytes;
|
||||
*pa_device_min_bytes=minBytes;
|
||||
*pa_device_max_channels= maxInputChannels;
|
||||
*pa_device_min_channels= minInputChannels;
|
||||
|
||||
return speed_warning;
|
||||
}
|
||||
|
||||
|
||||
void paInputDevice(int id, char* hostAPI_DeviceName, int* minChan,
|
||||
int* maxChan, int* minSpeed, int* maxSpeed)
|
||||
{
|
||||
int i;
|
||||
char pa_device_name[128];
|
||||
char pa_device_hostapi[128];
|
||||
double pa_device_max_speed;
|
||||
double pa_device_min_speed;
|
||||
int pa_device_max_bytes;
|
||||
int pa_device_min_bytes;
|
||||
int pa_device_max_channels;
|
||||
int pa_device_min_channels;
|
||||
char p2[50];
|
||||
char *p,*p1;
|
||||
static int iret, valid_dev_cnt;
|
||||
|
||||
iret=pa_get_device_info (id,
|
||||
&pa_device_name,
|
||||
&pa_device_hostapi,
|
||||
&pa_device_max_speed,
|
||||
&pa_device_min_speed,
|
||||
&pa_device_max_bytes,
|
||||
&pa_device_min_bytes,
|
||||
&pa_device_max_channels,
|
||||
&pa_device_min_channels);
|
||||
|
||||
if (iret >= 0 ) {
|
||||
valid_dev_cnt++;
|
||||
|
||||
p1=(char*)"";
|
||||
p=strstr(pa_device_hostapi,"MME");
|
||||
if(p!=NULL) p1=(char*)"MME";
|
||||
p=strstr(pa_device_hostapi,"Direct");
|
||||
if(p!=NULL) p1=(char*)"DirectX";
|
||||
p=strstr(pa_device_hostapi,"WASAPI");
|
||||
if(p!=NULL) p1=(char*)"WASAPI";
|
||||
p=strstr(pa_device_hostapi,"ASIO");
|
||||
if(p!=NULL) p1=(char*)"ASIO";
|
||||
p=strstr(pa_device_hostapi,"WDM-KS");
|
||||
if(p!=NULL) p1=(char*)"WDM-KS";
|
||||
|
||||
sprintf(p2,"%-8s %-39s",p1,pa_device_name);
|
||||
for(i=0; i<50; i++) {
|
||||
hostAPI_DeviceName[i]=p2[i];
|
||||
if(p2[i]==0) break;
|
||||
}
|
||||
*minChan=pa_device_min_channels;
|
||||
*maxChan=pa_device_max_channels;
|
||||
*minSpeed=(int)pa_device_min_speed;
|
||||
*maxSpeed=(int)pa_device_max_speed;
|
||||
} else {
|
||||
for(i=0; i<50; i++) {
|
||||
hostAPI_DeviceName[i]=0;
|
||||
}
|
||||
*minChan=0;
|
||||
*maxChan=0;
|
||||
*minSpeed=0;
|
||||
*maxSpeed=0;
|
||||
}
|
||||
}
|
||||
|
||||
void getDev(int* numDevices0, char hostAPI_DeviceName[][50],
|
||||
int minChan[], int maxChan[],
|
||||
int minSpeed[], int maxSpeed[])
|
||||
{
|
||||
int i,id,numDevices;
|
||||
int minch,maxch,minsp,maxsp;
|
||||
char apidev[256];
|
||||
|
||||
numDevices=Pa_GetDeviceCount();
|
||||
*numDevices0=numDevices;
|
||||
|
||||
for(id=0; id<numDevices; id++) {
|
||||
paInputDevice(id,apidev,&minch,&maxch,&minsp,&maxsp);
|
||||
for(i=0; i<50; i++) {
|
||||
hostAPI_DeviceName[id][i]=apidev[i];
|
||||
}
|
||||
hostAPI_DeviceName[id][49]=0;
|
||||
minChan[id]=minch;
|
||||
maxChan[id]=maxch;
|
||||
minSpeed[id]=minsp;
|
||||
maxSpeed[id]=maxsp;
|
||||
}
|
||||
}
|
Binary file not shown.
BIN
libfftw3f_win.a
BIN
libfftw3f_win.a
Binary file not shown.
BIN
libpskreporter.a
BIN
libpskreporter.a
Binary file not shown.
@ -1,56 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void paInputDevice(int id, char* hostAPI_DeviceName, int* minChan,
|
||||
int* maxChan, int* minSpeed, int* maxSpeed)
|
||||
{
|
||||
int i, j, k;
|
||||
char pa_device_name[128];
|
||||
char pa_device_hostapi[128];
|
||||
double pa_device_max_speed;
|
||||
double pa_device_min_speed;
|
||||
int pa_device_max_bytes;
|
||||
int pa_device_min_bytes;
|
||||
int pa_device_max_channels;
|
||||
int pa_device_min_channels;
|
||||
char p2[50];
|
||||
char *p,*p1;
|
||||
static int iret, numDevices, valid_dev_cnt;
|
||||
|
||||
iret=pa_get_device_info (id,
|
||||
&pa_device_name,
|
||||
&pa_device_hostapi,
|
||||
&pa_device_max_speed,
|
||||
&pa_device_min_speed,
|
||||
&pa_device_max_bytes,
|
||||
&pa_device_min_bytes,
|
||||
&pa_device_max_channels,
|
||||
&pa_device_min_channels);
|
||||
|
||||
if (iret >= 0 ) {
|
||||
valid_dev_cnt++;
|
||||
|
||||
p1="";
|
||||
p=strstr(pa_device_hostapi,"MME");
|
||||
if(p!=NULL) p1="MME";
|
||||
p=strstr(pa_device_hostapi,"Direct");
|
||||
if(p!=NULL) p1="DirectX";
|
||||
p=strstr(pa_device_hostapi,"WASAPI");
|
||||
if(p!=NULL) p1="WASAPI";
|
||||
p=strstr(pa_device_hostapi,"ASIO");
|
||||
if(p!=NULL) p1="ASIO";
|
||||
p=strstr(pa_device_hostapi,"WDM-KS");
|
||||
if(p!=NULL) p1="WDM-KS";
|
||||
|
||||
sprintf(p2,"%-8s %-39s",p1,pa_device_name);
|
||||
for(i=0; i<50; i++) {
|
||||
hostAPI_DeviceName[i]=p2[i];
|
||||
if(p2[i]==0) break;
|
||||
}
|
||||
*minChan=pa_device_min_channels;
|
||||
*maxChan=pa_device_max_channels;
|
||||
*minSpeed=(int)pa_device_min_speed;
|
||||
*maxSpeed=(int)pa_device_max_speed;
|
||||
}
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
#include <portaudio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MAX_LATENCY 20
|
||||
|
||||
PaStream *in_stream;
|
||||
//------------------------------------------------------- pa_get_device_info
|
||||
int pa_get_device_info (int n,
|
||||
void *pa_device_name,
|
||||
void *pa_device_hostapi,
|
||||
double *pa_device_max_speed,
|
||||
double *pa_device_min_speed,
|
||||
int *pa_device_max_bytes,
|
||||
int *pa_device_min_bytes,
|
||||
int *pa_device_max_channels,
|
||||
int *pa_device_min_channels )
|
||||
{
|
||||
|
||||
(void) n ;
|
||||
(void) pa_device_name;
|
||||
(void) pa_device_hostapi;
|
||||
(void) pa_device_max_speed;
|
||||
(void) pa_device_min_speed;
|
||||
(void) pa_device_max_bytes;
|
||||
(void) pa_device_min_bytes;
|
||||
(void) pa_device_max_channels;
|
||||
(void) pa_device_min_channels;
|
||||
const PaDeviceInfo *deviceInfo;
|
||||
PaError pa_err;
|
||||
PaStreamParameters inputParameters;
|
||||
int i,j, speed_warning;
|
||||
int minBytes, maxBytes;
|
||||
double maxStandardSampleRate;
|
||||
double minStandardSampleRate;
|
||||
int minInputChannels;
|
||||
int maxInputChannels;
|
||||
|
||||
// negative terminated list
|
||||
static double standardSampleRates[] = {8000.0, 9600.0,
|
||||
11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0,
|
||||
44100.0, 48000.0, 88200.0, 96000.0, 192000.0, -1};
|
||||
// *******************************************************
|
||||
|
||||
|
||||
*pa_device_max_speed=0;
|
||||
*pa_device_min_speed=0;
|
||||
*pa_device_max_bytes=0;
|
||||
*pa_device_min_bytes=0;
|
||||
*pa_device_max_channels=0;
|
||||
*pa_device_min_channels=0;
|
||||
minInputChannels=0;
|
||||
if(n >= Pa_GetDeviceCount() ) return -1;
|
||||
deviceInfo = Pa_GetDeviceInfo(n);
|
||||
if (deviceInfo->maxInputChannels==0) return -1;
|
||||
sprintf((char*)(pa_device_name),"%s",deviceInfo->name);
|
||||
sprintf((char*)(pa_device_hostapi),"%s",
|
||||
Pa_GetHostApiInfo( deviceInfo->hostApi )->name);
|
||||
speed_warning=0;
|
||||
|
||||
// bypass bug in Juli@ ASIO driver:
|
||||
// this driver hangs after a Pa_IsFormatSupported call
|
||||
i = strncmp(deviceInfo->name, "ASIO 2.0 - ESI Juli@", 19);
|
||||
if (i == 0) {
|
||||
minStandardSampleRate=44100;
|
||||
maxStandardSampleRate=192000;
|
||||
minBytes=1;
|
||||
maxBytes=4;
|
||||
maxInputChannels= deviceInfo->maxInputChannels;
|
||||
minInputChannels= 1;
|
||||
goto end_pa_get_device_info;
|
||||
}
|
||||
|
||||
// Investigate device capabilities.
|
||||
// Check min and max samplerates with 16 bit data.
|
||||
maxStandardSampleRate=0;
|
||||
minStandardSampleRate=0;
|
||||
inputParameters.device = n;
|
||||
inputParameters.channelCount = deviceInfo->maxInputChannels;
|
||||
inputParameters.sampleFormat = paInt16;
|
||||
inputParameters.suggestedLatency = 0;
|
||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
// ************************************************************************
|
||||
//filter for portaudio Windows hostapi's with non experts.
|
||||
//only allow ASIO or WASAPI or WDM-KS
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name, "ASIO", 4);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name,
|
||||
"Windows WASAPI", 14);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
i = strncmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name,
|
||||
"Windows WDM-KS", 14);
|
||||
if (i==0 ) goto end_filter_hostapi;
|
||||
speed_warning=1;
|
||||
end_filter_hostapi:;
|
||||
|
||||
// ************************************************************************
|
||||
i=0;
|
||||
while(standardSampleRates[i] > 0 && minStandardSampleRate==0) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
standardSampleRates[i] );
|
||||
if(pa_err == paDeviceUnavailable) return -1;
|
||||
if(pa_err == paInvalidDevice) return -1;
|
||||
if(pa_err == paFormatIsSupported ) {
|
||||
minStandardSampleRate=standardSampleRates[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(minStandardSampleRate == 0) return -1;
|
||||
j=i;
|
||||
while(standardSampleRates[i] > 0 ) i++;
|
||||
i--;
|
||||
while(i >= j && maxStandardSampleRate==0) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
standardSampleRates[i] );
|
||||
if(pa_err == paDeviceUnavailable) return -1;
|
||||
if(pa_err == paInvalidDevice) return -1;
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
maxStandardSampleRate=standardSampleRates[i];
|
||||
}
|
||||
i--;
|
||||
}
|
||||
|
||||
// check if min SampleRate = max SampleRate
|
||||
if(maxStandardSampleRate==0 && (minStandardSampleRate != 0)) {
|
||||
maxStandardSampleRate= minStandardSampleRate;
|
||||
}
|
||||
|
||||
// check min and max bytes
|
||||
minBytes=2;
|
||||
maxBytes=2;
|
||||
inputParameters.sampleFormat = paUInt8;
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
minBytes=1;
|
||||
}
|
||||
inputParameters.sampleFormat = paInt32;
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
maxBytes=4;
|
||||
}
|
||||
|
||||
// check min channel count
|
||||
maxInputChannels= deviceInfo->maxInputChannels;
|
||||
inputParameters.channelCount = 1;
|
||||
inputParameters.sampleFormat = paInt16;
|
||||
pa_err=paFormatIsSupported+32000;
|
||||
while(pa_err != paFormatIsSupported &&
|
||||
( inputParameters.channelCount < (maxInputChannels+1)) ) {
|
||||
pa_err=Pa_IsFormatSupported(&inputParameters, NULL,
|
||||
maxStandardSampleRate );
|
||||
inputParameters.channelCount++;
|
||||
}
|
||||
if( pa_err == paFormatIsSupported ) {
|
||||
minInputChannels=inputParameters.channelCount-1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
end_pa_get_device_info:;
|
||||
|
||||
*pa_device_max_speed=maxStandardSampleRate;
|
||||
*pa_device_min_speed=minStandardSampleRate;
|
||||
*pa_device_max_bytes=maxBytes;
|
||||
*pa_device_min_bytes=minBytes;
|
||||
*pa_device_max_channels= maxInputChannels;
|
||||
*pa_device_min_channels= minInputChannels;
|
||||
|
||||
return speed_warning;
|
||||
}
|
Loading…
Reference in New Issue
Block a user