Upstream version 2.11AB

pull/2/head
Stelios Bounanos 2008-05-11 00:59:51 +01:00
rodzic 7c2464d222
commit ffc692c17c
15 zmienionych plików z 100 dodań i 68 usunięć

Wyświetl plik

@ -70,7 +70,14 @@ Change Log:
the filename suffix in the generate/capture/playback code; the filename suffix in the generate/capture/playback code;
uses the fileselector filter value instead. uses the fileselector filter value instead.
30) Update fileselector - Fileselector now remembers previous directory. 30) Update fileselector - Fileselector now remembers previous directory.
31) MFSK bug fixes. The "broken image transmit" was due to stopflag not
being initialised in the mfsk ctor. Image window processing changed
to clearing the widget before redrawing the window.
32) Fix crash with missing mixer device - Call OpenMixer in a try block
and handle the exception.
33) Changed DominoEX-FEC secondary char lookup to a std::map type.
34) Corrected two coding errors which produced compile warnings in
dominoex.cxx and mt63base.cxx
2.10.3) 2.10.3)
1) Corrected memory leak bug. 1) Corrected memory leak bug.

Wyświetl plik

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

Wyświetl plik

@ -296,7 +296,7 @@ void dex::decodeEX(int ch)
int c = ch; int c = ch;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (c & 1 == 1) symbols[3-i] = 255; if ((c & 1) == 1) symbols[3-i] = 255;
else symbols[3-i] = 1; else symbols[3-i] = 1;
c = c / 2; c = c / 2;
} }

Wyświetl plik

@ -1739,7 +1739,6 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
{ tabSoundCard = new Fl_Group(0, 25, 400, 195, "SndCrd"); { tabSoundCard = new Fl_Group(0, 25, 400, 195, "SndCrd");
tabSoundCard->color((Fl_Color)51); tabSoundCard->color((Fl_Color)51);
tabSoundCard->selection_color((Fl_Color)51); tabSoundCard->selection_color((Fl_Color)51);
tabSoundCard->hide();
{ tabsSoundCard = new Fl_Tabs(0, 25, 400, 195); { tabsSoundCard = new Fl_Tabs(0, 25, 400, 195);
tabsSoundCard->selection_color((Fl_Color)10); tabsSoundCard->selection_color((Fl_Color)10);
{ tabAudio = new Fl_Group(0, 50, 400, 170, "Audio devices"); { tabAudio = new Fl_Group(0, 50, 400, 170, "Audio devices");
@ -1840,6 +1839,7 @@ l with your sound hardware.");
menuOutSampleRate->align(FL_ALIGN_RIGHT); menuOutSampleRate->align(FL_ALIGN_RIGHT);
//extern Fl_Menu_Item sample_rate_menu[]; //extern Fl_Menu_Item sample_rate_menu[];
//o->menu(sample_rate_menu); //o->menu(sample_rate_menu);
o->clear_changed();
} // Fl_Choice* menuOutSampleRate } // Fl_Choice* menuOutSampleRate
{ Fl_Choice* o = menuInSampleRate = new Fl_Choice(8, 62, 85, 25, "Capture"); { Fl_Choice* o = menuInSampleRate = new Fl_Choice(8, 62, 85, 25, "Capture");
menuInSampleRate->tooltip("Force a specific sample rate. Select \"Native\" if \"Auto\" does not work wel\ menuInSampleRate->tooltip("Force a specific sample rate. Select \"Native\" if \"Auto\" does not work wel\
@ -1849,6 +1849,7 @@ l with your sound hardware.");
menuInSampleRate->align(FL_ALIGN_RIGHT); menuInSampleRate->align(FL_ALIGN_RIGHT);
//extern Fl_Menu_Item sample_rate_menu[]; //extern Fl_Menu_Item sample_rate_menu[];
//o->menu(sample_rate_menu); //o->menu(sample_rate_menu);
o->clear_changed();
} // Fl_Choice* menuInSampleRate } // Fl_Choice* menuInSampleRate
{ menuSampleConverter = new Fl_Choice(174, 91, 216, 25, "Converter"); { menuSampleConverter = new Fl_Choice(174, 91, 216, 25, "Converter");
menuSampleConverter->down_box(FL_BORDER_BOX); menuSampleConverter->down_box(FL_BORDER_BOX);
@ -1939,6 +1940,7 @@ l with your sound hardware.");
{ tabModems = new Fl_Group(0, 25, 401, 195, "Modem"); { tabModems = new Fl_Group(0, 25, 401, 195, "Modem");
tabModems->color((Fl_Color)51); tabModems->color((Fl_Color)51);
tabModems->selection_color((Fl_Color)51); tabModems->selection_color((Fl_Color)51);
tabModems->hide();
{ tabsModems = new Fl_Tabs(0, 25, 401, 195); { tabsModems = new Fl_Tabs(0, 25, 401, 195);
tabsModems->color((Fl_Color)51); tabsModems->color((Fl_Color)51);
tabsModems->selection_color((Fl_Color)10); tabsModems->selection_color((Fl_Color)10);

Wyświetl plik

@ -671,7 +671,7 @@ o->label((inpQRZuserpassword->type() & FL_SECRET_INPUT) ? "Show" : "Hide");}
} }
Fl_Group tabSoundCard { Fl_Group tabSoundCard {
label SndCrd open label SndCrd open
xywh {0 25 400 195} color 51 selection_color 51 hide xywh {0 25 400 195} color 51 selection_color 51
} { } {
Fl_Tabs tabsSoundCard {open Fl_Tabs tabsSoundCard {open
xywh {0 25 400 195} selection_color 10 xywh {0 25 400 195} selection_color 10
@ -802,15 +802,17 @@ progdefaults.changed = true;} open
tooltip {Force a specific sample rate. Select "Native" if "Auto" does not work well with your sound hardware.} xywh {8 91 85 25} down_box BORDER_BOX align 8 tooltip {Force a specific sample rate. Select "Native" if "Auto" does not work well with your sound hardware.} xywh {8 91 85 25} down_box BORDER_BOX align 8
code0 {//extern Fl_Menu_Item sample_rate_menu[];} code0 {//extern Fl_Menu_Item sample_rate_menu[];}
code1 {//o->menu(sample_rate_menu);} code1 {//o->menu(sample_rate_menu);}
code2 {o->clear_changed();}
} {} } {}
Fl_Choice menuInSampleRate { Fl_Choice menuInSampleRate {
label Capture label Capture
callback {progdefaults.in_sample_rate = o->value() > 1 ? strtol(o->mvalue()->text, 0, 10) : o->value(); callback {progdefaults.in_sample_rate = o->value() > 1 ? strtol(o->mvalue()->text, 0, 10) : o->value();
resetSoundCard(); resetSoundCard();
progdefaults.changed = true;} open progdefaults.changed = true;} open selected
tooltip {Force a specific sample rate. Select "Native" if "Auto" does not work well with your sound hardware.} xywh {8 62 85 25} down_box BORDER_BOX align 8 tooltip {Force a specific sample rate. Select "Native" if "Auto" does not work well with your sound hardware.} xywh {8 62 85 25} down_box BORDER_BOX align 8
code0 {//extern Fl_Menu_Item sample_rate_menu[];} code0 {//extern Fl_Menu_Item sample_rate_menu[];}
code1 {//o->menu(sample_rate_menu);} code1 {//o->menu(sample_rate_menu);}
code2 {o->clear_changed();}
} {} } {}
Fl_Choice menuSampleConverter { Fl_Choice menuSampleConverter {
label Converter label Converter
@ -922,7 +924,7 @@ progdefaults.changed = true;}
} }
Fl_Group tabModems { Fl_Group tabModems {
label Modem open label Modem open
xywh {0 25 401 195} color 51 selection_color 51 xywh {0 25 401 195} color 51 selection_color 51 hide
} { } {
Fl_Tabs tabsModems {open Fl_Tabs tabsModems {open
xywh {0 25 401 195} color 51 selection_color 10 align 9 xywh {0 25 401 195} color 51 selection_color 10 align 9
@ -1081,7 +1083,7 @@ progdefaults.changed = true;}
Fl_Counter valDEX_PATHS { Fl_Counter valDEX_PATHS {
label Paths label Paths
callback {progdefaults.DEX_PATHS = (int)o->value(); callback {progdefaults.DEX_PATHS = (int)o->value();
progdefaults.changed = true;} selected progdefaults.changed = true;}
xywh {20 174 63 21} type Simple minimum 4 maximum 8 step 1 value 5 xywh {20 174 63 21} type Simple minimum 4 maximum 8 step 1 value 5
code0 {o->value(progdefaults.DEX_PATHS);} code0 {o->value(progdefaults.DEX_PATHS);}
} }

Wyświetl plik

@ -1993,7 +1993,13 @@ void enableMixer(bool on)
#else #else
mixer = new MixerBase; mixer = new MixerBase;
#endif #endif
try {
mixer->openMixer(progdefaults.MXdevice.c_str()); mixer->openMixer(progdefaults.MXdevice.c_str());
}
catch (const MixerException& e) {
put_status(e.what(), 5);
goto ret;
}
mixer->PCMVolume(progdefaults.PCMvolume); mixer->PCMVolume(progdefaults.PCMvolume);
mixer->setXmtLevel(progStatus.XmtMixer); //valXmtMixer->value()); mixer->setXmtLevel(progStatus.XmtMixer); //valXmtMixer->value());
@ -2011,6 +2017,7 @@ void enableMixer(bool on)
delete mixer; delete mixer;
mixer = 0; mixer = 0;
} }
ret:
resetMixerControls(); resetMixerControls();
FL_UNLOCK_D(); FL_UNLOCK_D();
} }

Wyświetl plik

@ -26,6 +26,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
#include <map>
#include "confdialog.h" #include "confdialog.h"
#include "status.h" #include "status.h"
@ -41,6 +42,7 @@
using namespace std; using namespace std;
char dommsg[80]; char dommsg[80];
static map<int, unsigned char> mupsksec2pri;
void dominoex::tx_init(SoundBase *sc) void dominoex::tx_init(SoundBase *sc)
{ {
@ -90,6 +92,9 @@ void dominoex::restart()
void dominoex::init() void dominoex::init()
{ {
if (mupsksec2pri.empty())
MuPsk_sec2pri_init();
modem::init(); modem::init();
reset_filters(); reset_filters();
rx_init(); rx_init();
@ -101,6 +106,49 @@ void dominoex::init()
set_scope_mode(Digiscope::DOMDATA); set_scope_mode(Digiscope::DOMDATA);
} }
void dominoex::MuPsk_sec2pri_init(void)
{
int chars[] = { 'A', 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, // À, Á, Â, Ã, Ä, Å
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, -1, // à, á, â, ã, ä, å
'B', 0xdf, -1, // ß
'C', 0xc7, 0xe7, 0xa9, -1, // Ç, ç, ©,
'D', 0xd0, 0xb0, -1, // Ð, °
'E', 0xc6, 0xe6, 0xc8, 0xc9, 0xca, 0xcb, // Æ, æ, È, É, Ê, Ë
0xe8, 0xe9, 0xea, 0xeb, -1, // è, é, ê, ë
'F', 0x192, -1, // ƒ
'I', 0xcc, 0xcd, 0xce, 0xcf, 0xec, 0xed, // Ì, Í, Î, Ï, ì, í
0xee, 0xef, 0xa1, -1, // î, ï, ¡
'L', 0xa3, -1, // £
'N', 0xd1, 0xf1, -1, // Ñ, ñ
'O', 0xf4, 0xf6, 0xf2, 0xd6, 0xf3, 0xd3, // ô, ö, ò, Ö, ó, Ó
0xd4, 0xd2, 0xf5, 0xd5, -1, // Ô, Ò, õ, Õ
'R', 0xae, -1, // ®
'U', 0xd9, 0xda, 0xdb, 0xdc, 0xf9, 0xfa, // Ù, Ú, Û, Ü, ù, ú
0xfb, 0xfc, -1, // û, ü
'X', 0xd7, -1, // ×
'Y', 0xff, 0xfd, 0xdd, -1, // ÿ, ý, Ý
'0', 0xd8, -1, // Ø
'1', 0xb9, -1, // ¹
'2', 0xb2, -1, // ²
'3', 0xb3, -1, // ³
'?', 0xbf, -1, // ¿
'!', 0xa1, -1, // ¡
'<', 0xab, -1, // «
'>', 0xbb, -1, // »
'{', '(', -1,
'}', ')', -1,
'|', '\\'
};
int c = chars[0];
for (size_t i = 1; i < sizeof(chars)/sizeof(*chars); i++) {
if (chars[i] != -1)
mupsksec2pri[chars[i]] = c;
else
c = chars[++i];
}
}
dominoex::~dominoex() dominoex::~dominoex()
{ {
if (hilbert) delete hilbert; if (hilbert) delete hilbert;
@ -609,43 +657,8 @@ int dominoex::tx_process()
unsigned char dominoex::MuPskSec2Pri(int c) unsigned char dominoex::MuPskSec2Pri(int c)
{ {
if (c >= 'a' && c <= 'z') c -= 32; if (c >= 'a' && c <= 'z') c -= 32;
if (c == 'À' || c == 'Á' || c == 'Â' || c == 'Ã' || c == 'Ä' || c == 'Å' ||
c == 'à' || c == 'á' || c == 'â' || c == 'ã' || c == 'ä' || c == 'å') c = mupsksec2pri.find(c) != mupsksec2pri.end() ? mupsksec2pri[c] : c;
c = 'A';
if (c == 'ß') c = 'B';
if (c == 'Ç' || c == 'ç' || c == '©') c = 'C';
if (c == 'Ð' || c == '°') c = 'D';
if (c == 'Æ' || c == 'æ' || c == 'È' || c == 'É' || c == 'Ê' || c == 'Ë' ||
c == 'è' || c == 'é' || c == 'ê' || c == 'ë')
c = 'E';
if (c == 'ƒ') c = 'F';
if (c == 'Ì' || c == 'Í' || c == 'Î' || c == 'Ï' || c == 'ì' || c == 'í' ||
c == 'î' || c == 'ï' || c == '¡')
c = 'I';
if (c == '£') c = 'L';
if (c == 'Ñ' || c == 'ñ') c = 'N';
if (c == 'ô' || c == 'ö' || c == 'ò' || c == 'Ö' || c == 'ó' ||
c == 'Ó' || c == 'Ô' || c == 'Ò' || c == 'õ' || c == 'Õ')
c = 'O';
if (c == '®') c = 'R';
if (c == 'Ù' || c == 'Ú' || c == 'Û' || c == 'Ü' ||
c == 'ù' || c == 'ú' || c == 'û' || c == 252)
if (c == 'ü' || c == 'û' || c == 'ù' || c == 'Ü' ||
c == 'ú' || c == 'Ú' || c == 'Û' || c == 'Ù')
c = 'U';
if (c == '×') c = 'X';
if (c == 'ÿ' || c == 'ý' || c == 'Ý') c = 'Y';
if (c == 'Ø') c = '0';
if (c == '¹') c = '1';
if (c == '²') c = '2';
if (c == '³') c = '3';
if (c == '¿') c = '?';
if (c == '¡') c = '!';
if (c == '«') c = '<';
if (c == '»') c = '>';
if (c == '{') c = '(';
if (c == '}') c = ')';
if (c == '|') c = '\\';
if (c >= 'A' && c <= 'Z') c = c - 'A' + 127; if (c >= 'A' && c <= 'Z') c = c - 'A' + 127;
else if (c >= '0' && c <= '9') c = c - '0' + 14; else if (c >= '0' && c <= '9') c = c - '0' + 14;
@ -710,19 +723,14 @@ void dominoex::decodeMuPskSymbol(unsigned char symbol)
} }
} }
void dominoex::MuPskSoftdecode(complex *bins)
{
}
void dominoex::decodeMuPskEX(int ch) void dominoex::decodeMuPskEX(int ch)
{ {
unsigned char symbols[4]; unsigned char symbols[4];
int c = ch; int c = ch;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (c & 1 == 1) symbols[3-i] = 255; if ((c & 1) == 1) symbols[3-i] = 255;
else symbols[3-i] = -255; else symbols[3-i] = 1;//-255;
c = c / 2; c = c / 2;
} }

Wyświetl plik

@ -154,14 +154,13 @@ private:
// Rx // Rx
unsigned int MuPskPriSecChar(unsigned int c); unsigned int MuPskPriSecChar(unsigned int c);
void decodeMuPskSymbol(unsigned char symbol); void decodeMuPskSymbol(unsigned char symbol);
void MuPskSoftdecode(complex *bins);
void decodeMuPskEX(int c); void decodeMuPskEX(int c);
// Tx // Tx
unsigned char MuPskSec2Pri(int c); unsigned char MuPskSec2Pri(int c);
void sendMuPskEX(unsigned char c, int secondary); void sendMuPskEX(unsigned char c, int secondary);
void MuPskClearbits(); void MuPskClearbits();
void MuPskFlushTx(); void MuPskFlushTx();
void MuPsk_sec2pri_init(void);
public: public:
dominoex (trx_mode md); dominoex (trx_mode md);
~dominoex (); ~dominoex ();

Wyświetl plik

@ -21,6 +21,7 @@
#include "rigclass.h" #include "rigclass.h"
#endif #endif
extern string appname;
extern string HomeDir; extern string HomeDir;
extern string xmlfname; extern string xmlfname;

Wyświetl plik

@ -37,18 +37,19 @@
#endif #endif
class MixerException { class MixerException {
public:
char szError[80]; char szError[80];
int error; int error;
public:
MixerException() { *szError = 0; error = 0; } MixerException() { *szError = 0; error = 0; }
MixerException(int e) { MixerException(int e) {
snprintf(szError, sizeof(szError), "Error: %d, %s", e, strerror(e)); snprintf(szError, sizeof(szError), "Mixer error %d: %s", e, strerror(e));
error = e; error = e;
} }
MixerException(char *s) { MixerException(char *s) {
snprintf(szError, sizeof(szError), "Error: %s", s); snprintf(szError, sizeof(szError), "Mixer error: %s", s);
error = 1; error = 1;
} }
const char* what(void) const { return szError; }
}; };
class MixerBase class MixerBase

Wyświetl plik

@ -74,6 +74,8 @@
using namespace std; using namespace std;
string appname;
string scDevice[2]; string scDevice[2];
char szHomedir[120] = ""; char szHomedir[120] = "";
@ -123,6 +125,7 @@ void restore_streams(void);
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
appname = argv[0];
debug_exec(argv); debug_exec(argv);
CREATE_THREAD_ID(); // only call this once CREATE_THREAD_ID(); // only call this once
SET_THREAD_ID(FLMAIN_TID); SET_THREAD_ID(FLMAIN_TID);

Wyświetl plik

@ -175,6 +175,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
startpic = false; startpic = false;
abortxmt = false; abortxmt = false;
stopflag = false;
bitshreg = 0; bitshreg = 0;
bitstate = 0; bitstate = 0;
@ -1019,6 +1020,8 @@ void load_file(const char *n) {
// load the picture widget with the rgb image // load the picture widget with the rgb image
FL_LOCK_D(); FL_LOCK_D();
picTx->clear();
picTxWin->redraw();
picTx->video(xmtimg, W * H * 3); picTx->video(xmtimg, W * H * 3);
if (print_time_left(W * H * 3, txclr_tooltip, sizeof(txclr_tooltip), "Time needed: ") > 0) if (print_time_left(W * H * 3, txclr_tooltip, sizeof(txclr_tooltip), "Time needed: ") > 0)
btnpicTxSendColor->tooltip(txclr_tooltip); btnpicTxSendColor->tooltip(txclr_tooltip);

Wyświetl plik

@ -109,7 +109,7 @@ void status::saveLastState()
scopeH = scopeview->h(); scopeH = scopeview->h();
} }
Fl_Preferences spref(string(HomeDir).append(STATUS_FILENAME).c_str(), "w1hkj.com", 0); Fl_Preferences spref(HomeDir.c_str(), "w1hkj.com", PACKAGE_TARNAME);
spref.set("version", PACKAGE_VERSION); spref.set("version", PACKAGE_VERSION);
@ -152,8 +152,7 @@ void status::saveLastState()
void status::loadLastState() void status::loadLastState()
{ {
Fl_Preferences spref(string(HomeDir).append(STATUS_FILENAME).c_str(), "w1hkj.com", 0); Fl_Preferences spref(HomeDir.c_str(), "w1hkj.com", PACKAGE_TARNAME);
char version[64]; version[sizeof(version)-1] = '\0'; char version[64]; version[sizeof(version)-1] = '\0';
bLastStateRead = spref.get("version", version, "", sizeof(version)-1); bLastStateRead = spref.get("version", version, "", sizeof(version)-1);
// Skip loading the rest of the status variables if we didn't read a // Skip loading the rest of the status variables if we didn't read a

Wyświetl plik

@ -331,7 +331,7 @@ int MT63encoder::Process(char code) // encode an ASCII character "code"
{ int i,k; { int i,k;
code&=CodeMask; code&=CodeMask;
for(i=0; i<DataCarriers; i++) WalshBuff[i]=0; for(i=0; i<DataCarriers; i++) WalshBuff[i]=0;
if(code<DataCarriers) WalshBuff[code]=1.0; if(code<DataCarriers) WalshBuff[(int)code]=1.0;
else WalshBuff[code-DataCarriers]=(-1.0); else WalshBuff[code-DataCarriers]=(-1.0);
dspWalshInvTrans(WalshBuff,DataCarriers); dspWalshInvTrans(WalshBuff,DataCarriers);
if(IntlvLen) if(IntlvLen)

Wyświetl plik

@ -83,7 +83,6 @@ void psk::rx_init()
bitclk = 0; bitclk = 0;
freqerr = 0.0; freqerr = 0.0;
if (mailserver && progdefaults.PSKmailSweetSpot) sigsearch = SIGSEARCH; if (mailserver && progdefaults.PSKmailSweetSpot) sigsearch = SIGSEARCH;
set_scope_mode(Digiscope::PHASE);
put_MODEstatus(mode); put_MODEstatus(mode);
} }
@ -99,6 +98,7 @@ void psk::init()
{ {
modem::init(); modem::init();
restart(); restart();
set_scope_mode(Digiscope::PHASE);
rx_init(); rx_init();
} }