Move minimum frequency check to modem checkSampleRate()

This commit is contained in:
Charles J. Cliffe 2015-11-22 23:38:26 -05:00
parent 7b301fadc1
commit 407abac8e8
5 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,9 @@ std::string ModemAnalog::getType() {
}
int ModemAnalog::checkSampleRate(long long sampleRate, int audioSampleRate) {
if (sampleRate < 1500) {
return 1500;
}
return sampleRate;
}

View File

@ -9,6 +9,9 @@ std::string ModemDigital::getType() {
}
int ModemDigital::checkSampleRate(long long sampleRate, int audioSampleRate) {
if (sampleRate < 1500) {
return 1500;
}
return sampleRate;
}

View File

@ -33,6 +33,8 @@ Modem *ModemFMStereo::factory() {
int ModemFMStereo::checkSampleRate(long long sampleRate, int audioSampleRate) {
if (sampleRate < 100000) {
return 100000;
} else if (sampleRate < 1500) {
return 1500;
} else {
return sampleRate;
}

View File

@ -20,6 +20,9 @@ ModemLSB::~ModemLSB() {
}
int ModemLSB::checkSampleRate(long long sampleRate, int audioSampleRate) {
if (sampleRate < 1500) {
return 1500;
}
if (sampleRate % 2 == 0) {
return sampleRate;
}

View File

@ -20,6 +20,9 @@ ModemUSB::~ModemUSB() {
}
int ModemUSB::checkSampleRate(long long sampleRate, int audioSampleRate) {
if (sampleRate < 1500) {
return 1500;
}
if (sampleRate % 2 == 0) {
return sampleRate;
}