Upstream version 3.03AO

pull/2/head
Stelios Bounanos 2008-09-12 05:51:03 +01:00
rodzic 2b352bc8ff
commit 94606ed69a
4 zmienionych plików z 51 dodań i 48 usunięć

Wyświetl plik

@ -46,6 +46,9 @@ Change Log:
level.
26) Modified "view transmit" signal level to be closer in amplitude to
Rx signal level.
27) Fixed XMLRPC bug in mode.set_by_id and mode.set_by_name calls
28) Added $LOC grid locator field to <EXEC>...</EXEC> calls for return
value ($NAME $QTH $LOC).
3.02
1) Added hamlib interface for rig control

Wyświetl plik

@ -9,7 +9,7 @@ dnl major and minor must be integers; patch may
dnl contain other characters or be empty
m4_define(FLDIGI_MAJOR, [3])
m4_define(FLDIGI_MINOR, [0])
m4_define(FLDIGI_PATCH, [3AN])
m4_define(FLDIGI_PATCH, [3AO])
AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com])

Wyświetl plik

@ -637,13 +637,18 @@ string MACROTEXT::expandMacro(int n)
if (GET) {
size_t pos1 = expanded.find("$NAME");
size_t pos2 = expanded.find("$QTH");
size_t pos3 = expanded.find("$LOC");
if (pos1 != string::npos && pos2 != string::npos) {
pos1 += 5;
inpName->value(expanded.substr(pos1, pos2 - pos1).c_str());
}
if (pos2 != string::npos) {
pos2 += 4;
inpQth->value(expanded.substr(pos2).c_str());
inpQth->value(expanded.substr(pos2, pos3 - pos2).c_str());
}
if (pos3 != string::npos) {
pos3 += 4;
inpLoc->value(expanded.substr(pos3).c_str());
}
GET = false;
return "";

Wyświetl plik

@ -87,7 +87,7 @@ SoundBase::SoundBase()
: sample_frequency(0),
txppm(progdefaults.TX_corr), rxppm(progdefaults.RX_corr),
tx_src_state(0), tx_src_data(0), rx_src_state(0), rx_src_data(0),
snd_buffer(0), src_buffer(0),
snd_buffer(0), src_buffer(0), wrt_buffer(0),
#if USE_SNDFILE
ofCapture(0), ifPlayback(0), ofGenerate(0),
#endif
@ -133,7 +133,7 @@ void SoundBase::get_file_params(const char* def_fname, const char** fname, int*
*format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
break;
case 1:
*format = SF_FORMAT_AU | SF_FORMAT_FLOAT | SF_ENDIAN_CPU;
*format = SF_FORMAT_AU | SF_FORMAT_DOUBLE | SF_ENDIAN_CPU;
break;
case 2:
*format = SF_FORMAT_FLAC | SF_FORMAT_PCM_16;
@ -251,10 +251,13 @@ sf_count_t SoundBase::read_file(SNDFILE* file, double* buf, size_t count)
sf_count_t SoundBase::write_file(SNDFILE* file, double* buf, size_t count)
{
if (capture)
if (capture || !progdefaults.EnableMixer)
return sf_writef_double(file, buf, count);
for (size_t n = 0; n < count; n++) wrt_buffer[n] = buf[n] * 0.1;
return sf_write_double(file, wrt_buffer, count);
else {
for (size_t n = 0; n < count; n++)
wrt_buffer[n] = buf[n] * progStatus.XmtMixer;
return sf_write_double(file, wrt_buffer, count);
}
}
bool SoundBase::format_supported(int format)
@ -309,19 +312,17 @@ SoundOSS::SoundOSS(const char *dev ) {
try {
snd_buffer = new float [2*SND_BUF_LEN];
src_buffer = new float [2*SND_BUF_LEN];
wrt_buffer = new double [SND_BUF_LEN];
wrt_buffer = new double [SND_BUF_LEN];
cbuff = new unsigned char [4 * SND_BUF_LEN];
}
catch (const std::bad_alloc& e) {
LOG_ERROR("Cannot allocate libsamplerate buffers");
throw;
}
for (int i = 0; i < 2*SND_BUF_LEN; i++)
snd_buffer[i] = src_buffer[i] = 0.0;
for (int i = 0; i < SND_BUF_LEN; i++)
wrt_buffer[i] = 0.0;
for (int i = 0; i < 4 * SND_BUF_LEN; i++)
cbuff[i] = 0;
memset(snd_buffer, 0, 2 * SND_BUF_LEN * sizeof(*snd_buffer));
memset(src_buffer, 0, 2 * SND_BUF_LEN * sizeof(*snd_buffer));
memset(wrt_buffer, 0, SND_BUF_LEN * sizeof(*snd_buffer));
memset(cbuff, 0, 4 * SND_BUF_LEN * sizeof(*cbuff));
try {
tx_src_data = new SRC_DATA;
@ -518,12 +519,10 @@ size_t SoundOSS::Read(double *buffer, size_t buffersize)
if (capture)
write_file(ofCapture, buffer, buffersize);
if (playback) {
double vol = 1.0;
read_file(ifPlayback, buffer, buffersize);
if (progdefaults.EnableMixer)
vol = progStatus.RcvMixer;
for (size_t i = 0; i < buffersize; i++)
buffer[i] *= vol;
for (size_t i = 0; i < buffersize; i++)
buffer[i] *= progStatus.RcvMixer;
return buffersize;
}
#endif
@ -790,7 +789,6 @@ SoundPort::SoundPort(const char *in_dev, const char *out_dev)
LOG_ERROR("Cannot create libsamplerate data structures");
throw;
}
try {
src_buffer = new float[OUTPUT_CHANNELS * SND_BUF_LEN];
fbuf = new float[OUTPUT_CHANNELS * SND_BUF_LEN];
@ -800,17 +798,15 @@ SoundPort::SoundPort(const char *in_dev, const char *out_dev)
throw;
}
try {
wrt_buffer = new double [SND_BUF_LEN];
wrt_buffer = new double[SND_BUF_LEN];
}
catch (const std::bad_alloc& e) {
LOG_ERROR("Cannot allocate write buffer");
throw;
}
for (int i = 0; i < SND_BUF_LEN; i++)
wrt_buffer[i]= 0.0;
memset(src_buffer, 0, OUTPUT_CHANNELS * SND_BUF_LEN);
memset(fbuf, 0, OUTPUT_CHANNELS * SND_BUF_LEN);
memset(src_buffer, 0, OUTPUT_CHANNELS * SND_BUF_LEN * sizeof(*src_buffer));
memset(fbuf, 0, OUTPUT_CHANNELS * SND_BUF_LEN * sizeof(*fbuf));
memset(wrt_buffer, 0, SND_BUF_LEN * sizeof(*wrt_buffer));
}
SoundPort::~SoundPort()
@ -965,17 +961,15 @@ size_t SoundPort::Read(double *buf, size_t count)
{
#if USE_SNDFILE
if (playback) {
double vol = 1.0;
read_file(ifPlayback, buf, count);
if (progdefaults.EnableMixer)
vol = progStatus.RcvMixer;
read_file(ifPlayback, buf, count);
if (progdefaults.EnableMixer)
for (size_t i = 0; i < count; i++)
buf[i] *= vol;
if (!capture) {
usleep((useconds_t)ceil((1e6 * count) / req_sample_rate));
return count;
}
}
buf[i] *= progStatus.RcvMixer;
if (!capture) {
usleep((useconds_t)ceil((1e6 * count) / req_sample_rate));
return count;
}
}
#endif
if (rxppm != progdefaults.RX_corr) {
@ -1552,7 +1546,6 @@ SoundPulse::SoundPulse(const char *dev)
LOG_ERROR("Cannot create libsamplerate data structures");
throw;
}
try {
snd_buffer = new float[INPUT_CHANNELS * SND_BUF_LEN];
src_buffer = new float[OUTPUT_CHANNELS * SND_BUF_LEN];
@ -1563,14 +1556,16 @@ SoundPulse::SoundPulse(const char *dev)
throw;
}
try {
wrt_buffer = new double [SND_BUF_LEN];
wrt_buffer = new double[SND_BUF_LEN];
}
catch (const std::bad_alloc& e) {
LOG_ERROR("Cannot allocate write buffer");
throw;
}
for (int i = 0; i < SND_BUF_LEN; i++)
wrt_buffer[i]= 0.0;
memset(snd_buffer, 0, INPUT_CHANNELS * SND_BUF_LEN * sizeof(*snd_buffer));
memset(src_buffer, 0, OUTPUT_CHANNELS * SND_BUF_LEN * sizeof(*src_buffer));
memset(fbuf, 0, MAX(INPUT_CHANNELS, OUTPUT_CHANNELS) * SND_BUF_LEN * sizeof(*fbuf));
memset(wrt_buffer, 0, SND_BUF_LEN * sizeof(*wrt_buffer));
}
SoundPulse::~SoundPulse()
@ -1586,6 +1581,7 @@ int SoundPulse::Open(int mode, int freq)
char sname[32];
int err;
sample_frequency = freq;
for (int i = 0; i < 2; i++) {
src_data_reset(1 << O_RDONLY | 1 << O_WRONLY);
@ -1738,13 +1734,14 @@ size_t SoundPulse::Read(double *buf, size_t count)
{
#if USE_SNDFILE
if (playback) {
double vol = 1.0;
read_file(ifPlayback, buf, count);
if (progdefaults.EnableMixer)
vol = progStatus.RcvMixer;
for (size_t i = 0; i < count; i++)
buf[i] *= vol;
return count;
for (size_t i = 0; i < count; i++)
buf[i] *= progStatus.RcvMixer;
if (!capture) {
usleep((useconds_t)ceil((1e6 * count) / sample_frequency));
return count;
}
}
#endif
@ -1837,12 +1834,10 @@ size_t SoundNull::Read(double *buf, size_t count)
if (capture)
write_file(ofCapture, buf, count);
if (playback) {
double vol = 1.0;
read_file(ifPlayback, buf, count);
if (progdefaults.EnableMixer)
vol = progStatus.RcvMixer;
for (size_t i = 0; i < count; i++)
buf[i] *= vol;
for (size_t i = 0; i < count; i++)
buf[i] *= progStatus.RcvMixer;
}
#endif