Upstream version 1.36b

pull/2/head
Stelios Bounanos 2007-07-21 13:15:41 +01:00
rodzic 54de891c56
commit f2e8c9a210
19 zmienionych plików z 1019 dodań i 581 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
Change Log:
1.35 1) Increased TxPPM to +/- 50000 to match the RxPPM range
1.36 1) Increased TxPPM to +/- 50000 to match the RxPPM range
2) Changed all audio i/o to separate 2 channel control (stereo)
3) Added right channel CW QRQ signal
4) Added right channel pseudo FSK signal
@ -13,12 +13,17 @@ Change Log:
10) Added "Test" capability to save Rx or Tx waveforms in ".wav"
format and to play them back for testing modem decoders.
11) Replaced text editing widgets with new widgets capable of cut,
copy and paste.
copy and paste.
===> temporarily disabled pending resolution of cpu% problem
12) Added new functions on text widget popup menus
13) Added a QSY undo (right button press)
14) Added a who is this capability to waterfall -- press right
button and hold on a signal and decoding occurs on that signal.
Release and decoding returns to normal tracking point.
15) This release requires libsndfile, libportaudio and libportaudiocpp
The new libraries provide portaudio sound card mapping, and the
ability to save and playback wav files (when fldigi is run as:
fldigi TEST).
1.34 1) Cleaned up unused code segments
2) Modified CW decoder to allow setting upper and lower limits on
Tx WPM

Wyświetl plik

@ -90,4 +90,8 @@
#define Wstatus (WNOM - Wmode - Ws2n - Wimd - Wwarn - bwAfcOnOff - bwSqlOnOff)
//remove the comment delimiter to enable experimental psk250 and qpsk250 modes
#define USE250
#endif

Plik diff jest za duży Load Diff

Wyświetl plik

@ -6,61 +6,165 @@
#define LEFT_MARGIN 3
#define RIGHT_MARGIN 3
const int oldWidth = w();
#ifdef DEBUG
printf("Fl_Text_Display::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
#endif // DEBUG
const int oldWidth = w();
#ifdef DEBUG
printf(" oldWidth=%d, mContinuousWrap=%d, mWrapMargin=%d\n", oldWidth,
mContinuousWrap, mWrapMargin);
#endif // DEBUG
Fl_Widget::resize(X,Y,W,H);
if (!buffer()) return;
X += Fl::box_dx(box());
Y += Fl::box_dy(box());
W -= Fl::box_dw(box());
H -= Fl::box_dh(box());
mHScrollBar->clear_visible();
mVScrollBar->resize(mVScrollBar->x(), mVScrollBar->y(),
mVScrollBar->w(), mVScrollBar->h() + scrollbar_width());
text_area.x = X+LEFT_MARGIN;
text_area.y = Y+BOTTOM_MARGIN;
text_area.w = W-LEFT_MARGIN-RIGHT_MARGIN;
text_area.h = H-TOP_MARGIN-BOTTOM_MARGIN;
int i;
text_area.h += scrollbar_width();
if (scrollbar_align() & FL_ALIGN_TOP)
text_area.y -= scrollbar_width();
mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y,
text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
/* Find the new maximum font height for this text display */
for (i = 0, mMaxsize = fl_height(textfont(), textsize()); i < mNStyles; i++)
mMaxsize = max(mMaxsize, fl_height(mStyleTable[i].font, mStyleTable[i].size));
// did we have scrollbars initially?
int hscrollbarvisible = mHScrollBar->visible();
int vscrollbarvisible = mVScrollBar->visible();
if (mContinuousWrap && !mWrapMargin && W!=oldWidth) {
int oldFirstChar = mFirstChar;
mNBufferLines = count_lines(0, buffer()->length(), true);
mFirstChar = line_start(mFirstChar);
mTopLineNum = count_lines(0, mFirstChar, true)+1;
absolute_top_line_number(oldFirstChar);
}
// try without scrollbars first
mVScrollBar->clear_visible();
mHScrollBar->clear_visible();
int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize;
if (nvlines < 1) nvlines = 1;
if (mNVisibleLines != nvlines) {
mNVisibleLines = nvlines;
if (mLineStarts) delete[] mLineStarts;
mLineStarts = new int [mNVisibleLines];
}
int again_ = 1;
for (int again = 1; again;) {
again = 0;
/* In continuous wrap mode, a change in width affects the total number of
lines in the buffer, and can leave the top line number incorrect, and
the top character no longer pointing at a valid line start */
if (mContinuousWrap && !mWrapMargin && W!=oldWidth) {
int oldFirstChar = mFirstChar;
mNBufferLines = count_lines(0, buffer()->length(), true);
mFirstChar = line_start(mFirstChar);
mTopLineNum = count_lines(0, mFirstChar, true)+1;
absolute_top_line_number(oldFirstChar);
calc_line_starts(0, mNVisibleLines);
calc_last_char();
#ifdef DEBUG
printf(" mNBufferLines=%d\n", mNBufferLines);
#endif // DEBUG
}
/* reallocate and update the line starts array, which may have changed
size and / or contents. */
int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize;
if (nvlines < 1) nvlines = 1;
if (mNVisibleLines != nvlines) {
mNVisibleLines = nvlines;
if (mLineStarts) delete[] mLineStarts;
mLineStarts = new int [mNVisibleLines];
}
// user request to change viewport
if (mTopLineNumHint != mTopLineNum || mHorizOffsetHint != mHorizOffset)
scroll_(mTopLineNumHint, mHorizOffsetHint);
calc_line_starts(0, mNVisibleLines);
calc_last_char();
// everything will fit in the viewport
if (mNBufferLines < mNVisibleLines || mBuffer == NULL || mBuffer->length() == 0)
scroll_(1, mHorizOffset);
/* if empty lines become visible, there may be an opportunity to
display more text by scrolling down */
else while (mLineStarts[mNVisibleLines-2] == -1)
scroll_(mTopLineNum-1, mHorizOffset);
// figure the scrollbars
if (scrollbar_width()) {
/* Decide if the vertical scroll bar needs to be visible */
if (scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) &&
mNBufferLines >= mNVisibleLines - 1)
{
mVScrollBar->set_visible();
if (scrollbar_align() & FL_ALIGN_LEFT) {
text_area.x = X+scrollbar_width()+LEFT_MARGIN;
text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
mVScrollBar->resize(X, text_area.y-TOP_MARGIN, scrollbar_width(),
text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
} else {
text_area.x = X+LEFT_MARGIN;
text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
mVScrollBar->resize(X+W-scrollbar_width(), text_area.y-TOP_MARGIN,
scrollbar_width(), text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
}
}
// in case horizontal offset is now greater than longest line
int maxhoffset = max(0, longest_vline()-text_area.w);
if (mHorizOffset > maxhoffset)
scroll_(mTopLineNumHint, maxhoffset);
/*
Decide if the horizontal scroll bar needs to be visible. If there
is a vertical scrollbar, a horizontal is always created too. This
is because the alternatives are unatractive:
* Dynamically creating a horizontal scrollbar based on the currently
visible lines is what the original nedit does, but it always wastes
space for the scrollbar even when it's not used. Since the FLTK
widget dynamically allocates the space for the scrollbar and
rearranges the widget to make room for it, this would create a very
visually displeasing "bounce" effect when the vertical scrollbar is
dragged. Trust me, I tried it and it looks really bad.
* The other alternative would be to keep track of what the longest
line in the entire buffer is and base the scrollbar on that. I
didn't do this because I didn't see any easy way to do that using
the nedit code and this could involve a lengthy calculation for
large buffers. If an efficient and non-costly way of doing this
can be found, this might be a way to go.
*/
/* WAS: Suggestion: Try turning the horizontal scrollbar on when
you first see a line that is too wide in the window, but then
don't turn it off (ie mix both of your solutions). */
if (!mContinuousWrap && scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) &&
(mVScrollBar->visible() || longest_vline() > text_area.w))
{
if (!mHScrollBar->visible()) {
mHScrollBar->set_visible();
again = 1; // loop again to see if we now need vert. & recalc sizes
}
if (scrollbar_align() & FL_ALIGN_TOP) {
text_area.y = Y + scrollbar_width()+TOP_MARGIN;
text_area.h = H - scrollbar_width()-TOP_MARGIN-BOTTOM_MARGIN;
mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y,
text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
} else {
text_area.y = Y+TOP_MARGIN;
text_area.h = H - scrollbar_width()-TOP_MARGIN-BOTTOM_MARGIN;
mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y+H-scrollbar_width(),
text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
}
} else if (again_ == 1) { // loop once more
again_ = 0;
again = 1;
}
}
}
mTopLineNumHint = mTopLineNum;
mHorizOffsetHint = mHorizOffset;
display_insert_position_hint = 0;
// user request to change viewport
if (mTopLineNumHint != mTopLineNum || mHorizOffsetHint != mHorizOffset)
scroll_(mTopLineNumHint, mHorizOffsetHint);
if (mContinuousWrap)
redraw();
// everything will fit in the viewport
if (mNBufferLines < mNVisibleLines || mBuffer == NULL || mBuffer->length() == 0)
scroll_(1, mHorizOffset);
/* if empty lines become visible, there may be an opportunity to
display more text by scrolling down */
else while (mLineStarts[mNVisibleLines-2] == -1)
scroll_(mTopLineNum-1, mHorizOffset);
update_v_scrollbar();
update_h_scrollbar();
// user request to display insert position
if (display_insert_position_hint)
display_insert();
// in case horizontal offset is now greater than longest line
int maxhoffset = max(0, longest_vline()-text_area.w);
if (mHorizOffset > maxhoffset)
scroll_(mTopLineNumHint, maxhoffset);
mTopLineNumHint = mTopLineNum;
mHorizOffsetHint = mHorizOffset;
display_insert_position_hint = 0;
if (mContinuousWrap ||
hscrollbarvisible != mHScrollBar->visible() ||
vscrollbarvisible != mVScrollBar->visible())
redraw();
update_v_scrollbar();
update_h_scrollbar();

Wyświetl plik

@ -22,6 +22,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// ----------------------------------------------------------------------------
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdlib.h>
#include <string>
@ -58,6 +62,7 @@
#include "globals.h"
#include "misc.h"
//#include "help.h"
#include "TextView.h"
#include "Config.h"
#include "configuration.h"
@ -141,10 +146,10 @@ void startup_modem(modem *m)
if (m == feld_modem ||
m == feld_FMmodem ||
m == feld_FM105modem ) {
ReceiveText->Hide();
ReceiveText->hide();
FHdisp->show();
} else {
ReceiveText->Show();
ReceiveText->show();
FHdisp->hide();
}
Fl::unlock();
@ -301,6 +306,19 @@ void cb_mnuPSK125(Fl_Menu_*, void*) {
initPSK125();
}
void initPSK250()
{
clearStatus();
if(!psk250_modem)
psk250_modem = new psk(MODE_PSK250);
startup_modem (psk250_modem);
progStatus.saveModeState(MODE_PSK250);
}
void cb_mnuPSK250(Fl_Menu_*, void*) {
initPSK250();
}
void initQPSK31()
{
clearStatus();
@ -340,6 +358,19 @@ void cb_mnuQPSK125(Fl_Menu_*, void*) {
initQPSK125();
}
void initQPSK250()
{
clearStatus();
if (!qpsk250_modem)
qpsk250_modem = new psk(MODE_QPSK250);
startup_modem (qpsk250_modem);
progStatus.saveModeState(MODE_QPSK250);
}
void cb_mnuQPSK250(Fl_Menu_*, void*) {
initQPSK250();
}
void initRTTY()
{
clearStatus();
@ -984,43 +1015,40 @@ Fl_Menu_Item menu_[] = {
{"qpsk 63", 0, (Fl_Callback*)cb_mnuQPSK63, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 29
{"psk 125", 0, (Fl_Callback*)cb_mnuPSK125, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 30
{"qpsk 125", 0, (Fl_Callback*)cb_mnuQPSK125, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 31
{0,0,0,0,0,0,0,0,0}, // 32
{"Olivia", 0, (Fl_Callback*)cb_mnuOlivia, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 33
{"rtty", 0, (Fl_Callback*)cb_mnuRTTY, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 34
{"Throb", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 35
{"Throb 1", 0, (Fl_Callback*)cb_mnuTHROB1, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 36
{"Throb 2", 0, (Fl_Callback*)cb_mnuTHROB2, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 37
{"Throb 4", 0, (Fl_Callback*)cb_mnuTHROB4, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 38
{"ThrobX 1", 0, (Fl_Callback*)cb_mnuTHROBX1, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 39
{"ThrobX 2", 0, (Fl_Callback*)cb_mnuTHROBX2, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 40
{"ThrobX 4", 0, (Fl_Callback*)cb_mnuTHROBX4, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 41
{0,0,0,0,0,0,0,0,0}, // 42
{"WWV", 0, (Fl_Callback*)cb_mnuWWV, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 43
{"Freq Analysis", 0, (Fl_Callback*)cb_mnuANALYSIS, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 44
{0,0,0,0,0,0,0,0,0}, // 45
{"Configure", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 46
{"Defaults", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 47
{"Fonts", 0, (Fl_Callback*)cb_mnuConfigFonts, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 48
{"Interface", 0, (Fl_Callback*)cb_mnuConfigInterface, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 49
{"Operator", 0, (Fl_Callback*)cb_mnuConfigOperator, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 50
{"Sound Card", 0, (Fl_Callback*)cb_mnuConfigSoundCard, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 51
{"Waterfall", 0, (Fl_Callback*)cb_mnuConfigWaterfall, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 52
{0,0,0,0,0,0,0,0,0}, // 53
{"Modems", 0, (Fl_Callback*)cb_mnuConfigModems, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 54
{"Save Config", 0, (Fl_Callback*)cb_mnuSaveConfig, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 55
{0,0,0,0,0,0,0,0,0}, // 56
{" ", 0, 0, 0, FL_MENU_INACTIVE, FL_NORMAL_LABEL, 0, 14, 0}, // 57
{"Rig", 0, (Fl_Callback*)cb_mnuRig, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 58
{"psk 250", 0, (Fl_Callback*)cb_mnuPSK250, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 32
{"qpsk 250", 0, (Fl_Callback*)cb_mnuQPSK250, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 33
{0,0,0,0,0,0,0,0,0}, // 34
{"Olivia", 0, (Fl_Callback*)cb_mnuOlivia, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 35
{"rtty", 0, (Fl_Callback*)cb_mnuRTTY, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 36
{"Throb", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 37
{"Throb 1", 0, (Fl_Callback*)cb_mnuTHROB1, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 38
{"Throb 2", 0, (Fl_Callback*)cb_mnuTHROB2, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 39
{"Throb 4", 0, (Fl_Callback*)cb_mnuTHROB4, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 40
{"ThrobX 1", 0, (Fl_Callback*)cb_mnuTHROBX1, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 41
{"ThrobX 2", 0, (Fl_Callback*)cb_mnuTHROBX2, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 42
{"ThrobX 4", 0, (Fl_Callback*)cb_mnuTHROBX4, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 43
{0,0,0,0,0,0,0,0,0}, // 44
{"WWV", 0, (Fl_Callback*)cb_mnuWWV, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 45
{"Freq Analysis", 0, (Fl_Callback*)cb_mnuANALYSIS, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 46
{0,0,0,0,0,0,0,0,0}, // 47
{"Configure", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 48
{"Defaults", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 49
{"Fonts", 0, (Fl_Callback*)cb_mnuConfigFonts, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 50
{"Interface", 0, (Fl_Callback*)cb_mnuConfigInterface, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 51
{"Operator", 0, (Fl_Callback*)cb_mnuConfigOperator, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 52
{"Sound Card", 0, (Fl_Callback*)cb_mnuConfigSoundCard, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 53
{"Waterfall", 0, (Fl_Callback*)cb_mnuConfigWaterfall, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 54
{0,0,0,0,0,0,0,0,0}, // 55
{"Modems", 0, (Fl_Callback*)cb_mnuConfigModems, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 56
{"Save Config", 0, (Fl_Callback*)cb_mnuSaveConfig, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 57
{0,0,0,0,0,0,0,0,0}, // 58
{" ", 0, 0, 0, FL_MENU_INACTIVE, FL_NORMAL_LABEL, 0, 14, 0}, // 59
{"Test", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 60
{"Capture", 0, (Fl_Callback*)cb_mnuCapture, 0, FL_MENU_TOGGLE, FL_NORMAL_LABEL, 0, 14, 0}, // 61
{"Generate", 0, (Fl_Callback*)cb_mnuGenerate, 0, FL_MENU_TOGGLE, FL_NORMAL_LABEL, 0, 14, 0}, // 62
{"Playback", 0, (Fl_Callback*)cb_mnuPlayback, 0, FL_MENU_TOGGLE, FL_NORMAL_LABEL, 0, 14, 0}, // 63
{"Rig", 0, (Fl_Callback*)cb_mnuRig, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 60
{" ", 0, 0, 0, FL_MENU_INACTIVE, FL_NORMAL_LABEL, 0, 14, 0}, // 61
{"Help", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 62
{"About", 0, (Fl_Callback*)cb_mnuAbout, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 63
{0,0,0,0,0,0,0,0,0}, // 64
{"Help", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0}, // 65
{"About", 0, (Fl_Callback*)cb_mnuAbout, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, // 66
{0,0,0,0,0,0,0,0,0}, // 67
{0,0,0,0,0,0,0,0,0}, // 68
{0,0,0,0,0,0,0,0,0}, // 65
};
Fl_Menu_Bar *mnu;
@ -1029,31 +1057,27 @@ void activate_rig_menu_item(bool b)
{
if (b) {
bSaveFreqList = true;
menu_[58].activate();
menu_[60].activate();
} else {
menu_[58].deactivate();
menu_[60].deactivate();
if (rigcontrol)
rigcontrol->hide();
}
mnu->redraw();
}
void activate_test_menu_item(bool b)
{
if (b)
menu_[60].show();
else
menu_[60].hide();
mnu->redraw();
}
void create_fl_digi_main() {
int Y = 0;
fl_digi_main = new Fl_Double_Window(WNOM, HNOM, "fldigi");
mnu = new Fl_Menu_Bar(0, 0, WNOM - 142, Hmenu);
mnu->menu(menu_);
#ifndef USE250
menu_[32].hide();
menu_[33].hide();
#endif
btnTune = new Fl_Button(WNOM - 142, 0, 60, Hmenu, "TUNE");
btnTune->type(FL_TOGGLE_BUTTON);
btnTune->callback(cbTune, 0);
@ -1115,7 +1139,6 @@ void create_fl_digi_main() {
int sw = 15;
Fl_Group *MixerFrame = new Fl_Group(0,Y,sw, Hrcvtxt + Hxmttxt);
// valRcvMixer = new Fl_Slider(0, Y, sw, (Hrcvtxt + Hxmttxt)/2 - 15, "R");
valRcvMixer = new Fl_Slider(0, Y, sw, (Htext)/2, "");
valRcvMixer->type(FL_VERT_NICE_SLIDER);
valRcvMixer->color(fl_rgb_color(0,110,30));
@ -1123,7 +1146,6 @@ void create_fl_digi_main() {
valRcvMixer->selection_color(fl_rgb_color(255,255,0));
valRcvMixer->range(1.0,0.0);
valRcvMixer->callback( (Fl_Callback *)cb_RcvMixer);
// valXmtMixer = new Fl_Slider(0, Y + (Hrcvtxt + Hxmttxt)/2, sw, (Hrcvtxt + Hxmttxt)/2 - 15, "T");
valXmtMixer = new Fl_Slider(0, Y + (Htext)/2, sw, (Htext)/2, "");
valXmtMixer->type(FL_VERT_NICE_SLIDER);
valXmtMixer->color(fl_rgb_color(110,0,30));
@ -1321,22 +1343,30 @@ void put_rx_char(unsigned int data)
{
static bool nulinepending = false;
const char **asc = ascii;
if (mailclient || mailserver)
rxmsgid = msgget( (key_t) 9876, 0666);
if (mailclient || mailserver || rxmsgid != -1)
asc = ascii2;
if (data == '\r') {
ReceiveText->add(asc['\n' & 0x7F],1);
ReceiveText->add(asc['\n' & 0x7F], TextBase::RCV);
nulinepending = true;
} else if (nulinepending && data == '\r') {
ReceiveText->add(asc['\n' & 0x7F],1);
ReceiveText->add(asc['\n' & 0x7F], TextBase::RCV);
} else if (nulinepending && data == '\n') {
nulinepending = false;
} else if (nulinepending && data != '\n') {
ReceiveText->add(asc[data & 0x7F], 1);
ReceiveText->add(asc[data & 0x7F], TextBase::RCV);
nulinepending = false;
} else {
ReceiveText->add(asc[data & 0x7F],1);
ReceiveText->add(asc[data & 0x7F], TextBase::RCV);
}
if ( rxmsgid != -1) {
rxmsgst.msg_type = 1;
rxmsgst.c = data & 0x7F;
msgsnd (rxmsgid, (void *)&rxmsgst, 1, IPC_NOWAIT);
}
if (Maillogfile)
Maillogfile->log_to_file(cLogfile::LOG_RX, asc[data & 0x7F]);
if (logging)
@ -1480,7 +1510,7 @@ void put_echo_char(unsigned int data)
{
static bool nulinepending = false;
const char **asc = ascii;
if (mailclient || mailserver)
if (mailclient || mailserver || arqmode)
asc = ascii2;
if (data == '\r' && nulinepending) // reject multiple CRs
return;
@ -1488,7 +1518,7 @@ void put_echo_char(unsigned int data)
if (nulinepending && data == '\n') {
nulinepending = false;
}
ReceiveText->add(asc[data & 0x7F],4);
ReceiveText->add(asc[data & 0x7F], TextBase::XMT);
if (Maillogfile)
Maillogfile->log_to_file(cLogfile::LOG_TX, asc[data & 0x7F]);
if (logging)

Wyświetl plik

@ -42,6 +42,8 @@ const char *mode_names[] = {
"QPSK63",
"PSK125",
"QPSK-125",
"PSK-250",
"QPSK-250",
"MT63",
"FELDHELL",
"FSK-HELL",

Wyświetl plik

@ -29,6 +29,7 @@
#undef CLAMP
#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
using namespace std;
id::~id()
{

Wyświetl plik

@ -5,6 +5,9 @@
// Copyright (C) 2006
// Dave Freese, W1HKJ
//
// Copyright (C) 2007
// Stelios Bounanos, 2E0DLX
//
// This file is part of fldigi.
//
// fldigi is free software; you can redistribute it and/or modify
@ -25,12 +28,6 @@
#ifndef _TextView_H
#define _TextView_H
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include "threads.h"
/* fltk includes */
@ -41,125 +38,147 @@
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Text_Editor.H>
using namespace std;
#if (FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 1 && \
FL_PATCH_VERSION == 7 || FL_PATCH_VERSION == 8) && \
!defined(NO_HSCROLLBAR_KLUDGE)
# define HSCROLLBAR_KLUDGE
#else
# warning "Not suppressing horizontal scrollbars with this version of fltk"
# undef HSCROLLBAR_KLUDGE
#endif
///
/// The text widgets base class.
/// This class implements a basic text editing widget based on Fl_Text_Editor.
///
class TextBase : public Fl_Text_Editor
{
public:
class TextView : public Fl_Text_Display
///
/// Text styles used for highlighting
///
enum text_attr_e {
DEFAULT = 'A', ///< Default text style
RCV, ///< Received text style
XMT, ///< Transmitted text style
SKIP, ///< Skipped text style
CTRL, ///< Control character style
NSTYLES = 5
};
typedef enum text_attr_e text_attr_t;
public:
TextBase(int x, int y, int w, int h, const char *l = 0);
virtual ~TextBase() { delete tbuf; delete sbuf; }
virtual int handle(int event) { return Fl_Text_Editor::handle(event); };
virtual void add(const char *s, text_attr_t attr = DEFAULT) { insert(s); }
void clear(void) { tbuf->text(""); sbuf->text(""); }
void setFont(Fl_Font f, text_attr_t attr = NSTYLES);
void setFontSize(int s, text_attr_t attr = NSTYLES);
void setFontColor(Fl_Color c, text_attr_t attr = NSTYLES);
void cursorON(void) { show_cursor(); }
virtual void resize(int X, int Y, int W, int H);
protected:
void set_style(text_attr_t attr, Fl_Font f, int s, Fl_Color c,
int set = SET_FONT | SET_SIZE | SET_COLOR);
void readFile(void);
void saveFile(void);
char *get_word(int x, int y);
void show_context_menu(void);
virtual void menu_cb(int val) { }
int reset_wrap_col(void);
private:
TextBase();
TextBase(const TextBase &t);
protected:
enum set_style_op_e { SET_FONT = 1 << 0, SET_SIZE = 1 << 1, SET_COLOR = 1 << 2 };
enum { RESIZING = 1 << 0 };
Fl_Text_Buffer *tbuf; ///< text buffer
Fl_Text_Buffer *sbuf; ///< style buffer
Fl_Text_Display::Style_Table_Entry styles[NSTYLES];
Fl_Menu_Item *context_menu;
int popx, popy;
bool wrap;
int wrap_col;
int max_lines;
};
///
/// A TextBase subclass to display received & transmitted text
///
class TextView : public TextBase
{
public:
TextView(int x, int y, int w, int h, const char *l = 0);
~TextView();
int handle(int event);
void add(char c, int attr = 0);
void add(const char *s, int attr = 0);
void clear(void);
void Show(void) { show(); }
void Hide(void) { hide(); }
void setFont(Fl_Font f) { setFont(-1, f); }
void setFontSize(int s) { setFontSize(-1, s); }
void setFontColor(Fl_Color c) { setFontColor(-1, c); }
void setFont(int n, Fl_Font f);
void setFontSize(int n, int s);
void setFontColor(int n, Fl_Color c);
#ifdef HSCROLLBAR_KLUDGE
void resize(int X, int Y, int W, int H);
#endif
public:
enum TV_ATTR {RCV, XMT};
enum { NSTYLES = 16 };
virtual int handle(int event);
virtual void add(char c, text_attr_t attr = DEFAULT);
virtual void add(const char *s, text_attr_t attr = DEFAULT);
protected:
enum { RX_MENU_QRZ_THIS, RX_MENU_CALL, RX_MENU_NAME, RX_MENU_QTH,
RX_MENU_LOC, RX_MENU_RST_IN, RX_MENU_DIV, RX_MENU_CLEAR,
RX_MENU_COPY, RX_MENU_SAVE, RX_MENU_WRAP };
void draw(void);
void menu_cb(int val);
static void changed_cb(int pos, int nins, int ndel, int nsty,
const char *dtext, void *arg);
char *get_word(int x, int y);
void saveFile(void);
void clipboard_copy(void);
virtual void menu_cb(int val);
static void changed_cb(int pos, int nins, int ndel, int nsty,
const char *dtext, void *arg);
void change_keybindings(void);
private:
TextView();
TextView(const TextView &t);
protected:
Fl_Text_Buffer *tbuf, *sbuf;
static Fl_Text_Display::Style_Table_Entry styles[NSTYLES];
static Fl_Menu_Item viewmenu[];
int popx, popy;
bool wrap;
static Fl_Menu_Item view_menu[];
};
class TextEdit : public Fl_Text_Editor
///
/// A TextBase subclass to display and edit text to be transmitted
///
class TextEdit : public TextBase
{
public:
TextEdit(int x, int y, int w, int h, const char *l = 0);
~TextEdit();
int handle(int event);
void add(const char *s, int attr = 1);
void clear(void);
int nextChar(void);
void setFont(int n, Fl_Font f);
void setFontSize(int n, int s);
void setFontColor(int n, Fl_Color c);
void setFont(Fl_Font f) { setFont(-1, f); }
void setFontSize(int s) { setFontSize(-1, s); }
void setFontColor(Fl_Color c) { setFontColor(-1, c); }
void cursorON(void);
#ifdef HSCROLLBAR_KLUDGE
void resize(int X, int Y, int W, int H);
#endif
public:
enum { NSTYLES = 16 };
virtual int handle(int event);
virtual void add(const char *s, text_attr_t attr = DEFAULT);
void clear(void);
int nextChar(void);
protected:
enum { TX_MENU_TX, TX_MENU_RX, TX_MENU_MFSK16_IMG, TX_MENU_CLEAR,
TX_MENU_CUT, TX_MENU_COPY, TX_MENU_PASTE, TX_MENU_READ,
TX_MENU_WRAP };
int handle_key(int key);
void readFile(void);
static void changed_cb(int pos, int nins, int ndel, int nsty,
const char *dtext, void *arg);
void menu_cb(int val);
void change_keybindings(void);
static int kf_default(int c, Fl_Text_Editor* e);
static int kf_enter(int c, Fl_Text_Editor* e);
static int kf_delete(int c, Fl_Text_Editor* e);
static int kf_cut(int c, Fl_Text_Editor* e);
static int kf_paste(int c, Fl_Text_Editor* e);
TX_MENU_WRAP
};
int handle_key(int key);
virtual void menu_cb(int val);
static void changed_cb(int pos, int nins, int ndel, int nsty,
const char *dtext, void *arg);
void change_keybindings(void);
static int kf_default(int c, Fl_Text_Editor* e);
static int kf_enter(int c, Fl_Text_Editor* e);
static int kf_delete(int c, Fl_Text_Editor* e);
static int kf_cut(int c, Fl_Text_Editor* e);
static int kf_paste(int c, Fl_Text_Editor* e);
private:
TextEdit();
TextEdit(const TextEdit &t);
protected:
Fl_Text_Buffer *tbuf, *sbuf;
static Fl_Text_Display::Style_Table_Entry styles[NSTYLES];
static Fl_Menu_Item editmenu[];
bool PauseBreak;
int txpos;
static int *ptxpos;
int bkspaces;
int popx, popy;
bool wrap;
static Fl_Menu_Item edit_menu[];
bool PauseBreak;
int txpos;
static int *ptxpos;
int bkspaces;
};
///
/// A lock class meant to be instantiated on the stack to acquire a lock which
/// is released when the object goes out of scope.
/// The no-arg ctor calls Fl::lock(), and the Fl_Mutex ctor locks that mutex.
///
class autolock
{
public:
@ -167,7 +186,7 @@ public:
autolock(Fl_Mutex *m_) : m(m_) { fl_lock(m); }
~autolock() { if (m) fl_unlock(m); else Fl::unlock(); }
private:
autolock(const autolock &a);
autolock(const autolock &a); // no copying
Fl_Mutex *m;
};

Wyświetl plik

@ -133,9 +133,11 @@ extern void initMFSK16();
extern void initPSK31();
extern void initPSK63();
extern void initPSK125();
extern void initPSK250();
extern void initQPSK31();
extern void initQPSK63();
extern void initQPSK125();
extern void initQPSK250();
extern void initRTTY();
extern void initOLIVIA();
extern void initDOMINOEX4();

Wyświetl plik

@ -46,6 +46,8 @@ enum trx_mode {
MODE_QPSK63,
MODE_PSK125,
MODE_QPSK125,
MODE_PSK250,
MODE_QPSK250,
MODE_MT63,
MODE_FELDHELL,
MODE_FSKHELL,

Wyświetl plik

@ -49,7 +49,7 @@ private:
void make_pulse();
void make_tones();
void send(long int);
void sendchars(string);
void sendchars(std::string);
public:
id(modem *md);

Wyświetl plik

@ -28,9 +28,7 @@ extern Fl_Thread trx_thread;
extern state_t trx_state;
extern modem *active_modem;
extern string HomeDir;
extern string PskMailDir;
extern string xmlfname;
extern bool gmfskmail;
extern std::string scDevice;
extern PTT *push2talk;
@ -40,11 +38,30 @@ extern Rig *xcvr;
extern cLogfile *Maillogfile;
extern cLogfile *logfile;
extern string PskMailDir;
extern bool gmfskmail;
extern bool arqmode;
extern string ArqFilename;
extern bool mailclient;
extern bool mailserver;
extern bool pskmail_text_available;
extern char pskmail_get_char();
extern void pskmail_loop(void *);
struct RXMSGSTRUC {
long int msg_type;
char c;
};
struct TXMSGSTRUC {
long int msg_type;
char buffer[BUFSIZ];
};
extern RXMSGSTRUC rxmsgst;
extern int rxmsgid;
extern TXMSGSTRUC txmsgst;
extern int txmsgid;
#endif

Wyświetl plik

@ -141,9 +141,11 @@ extern modem *feld_CMTmodem;
extern modem *psk31_modem;
extern modem *psk63_modem;
extern modem *psk125_modem;
extern modem *psk250_modem;
extern modem *qpsk31_modem;
extern modem *qpsk63_modem;
extern modem *qpsk125_modem;
extern modem *qpsk250_modem;
extern modem *rtty_modem;
extern modem *olivia_modem;
extern modem *dominoex4_modem;

Wyświetl plik

@ -1,6 +1,6 @@
#ifndef _VERSION_H
#define _VERSION_H
#define FLDIGI_VERSION "1.35R"
#define FLDIGI_VERSION "1.36b"
#endif

Wyświetl plik

@ -20,6 +20,11 @@
//
// Please report all bugs and problems to "w1hkj@w1hkj.com".
//
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <FL/Fl_Shared_Image.H>
#ifdef PORTAUDIO
#include <portaudiocpp/PortAudioCpp.hxx>
@ -54,11 +59,10 @@ char szHomedir[120] = "";
char szPskMailDir[120] = "";
string PskMailDir;
string PskMailFile;
string ArqFilename;
string HomeDir;
string xmlfname;
bool testmenu = false;
bool gmfskmail = false;
PTT *push2talk = (PTT *)0;
@ -71,31 +75,23 @@ cLogfile *logfile = 0;;
cLogfile *Maillogfile = (cLogfile *)0;
FILE *server;
FILE *client;
bool mailserver = false, mailclient = false;
bool mailserver = false, mailclient = false, arqmode = false;
extern void start_pskmail();
int main(int argc, char ** argv) {
RXMSGSTRUC rxmsgst;
int rxmsgid = -1;
if (argc == 2)
if (strcasecmp(argv[1], "TEST") == 0)
testmenu = true;
TXMSGSTRUC txmsgst;
int txmsgid = -1;
fl_filename_expand(szHomedir, 119, "$HOME/.fldigi/");
if (fl_filename_isdir(szHomedir) == 0)
HomeDir = "./";
else
HomeDir = szHomedir;
xmlfname = HomeDir;
xmlfname.append("rig.xml");
string lfname = HomeDir;
lfname.append("fldigi.log");
logfile = new cLogfile(lfname);
logfile->log_to_file_start();
void arqchecks()
{
txmsgid = msgget( (key_t) 6789, 0666 );
if (txmsgid != -1)
return;
fl_filename_expand(szPskMailDir, 119, "$HOME/pskmail.files/");
PskMailDir = szPskMailDir;
PskMailFile = PskMailDir;
PskMailFile += "PSKmailserver";
ifstream testFile;
@ -131,6 +127,24 @@ int main(int argc, char ** argv) {
}
}
}
}
int main(int argc, char ** argv) {
fl_filename_expand(szHomedir, 119, "$HOME/.fldigi/");
if (fl_filename_isdir(szHomedir) == 0)
HomeDir = "./";
else
HomeDir = szHomedir;
xmlfname = HomeDir;
xmlfname.append("rig.xml");
string lfname = HomeDir;
lfname.append("fldigi.log");
logfile = new cLogfile(lfname);
logfile->log_to_file_start();
arqchecks();
Fl::lock(); // start the gui thread!!
Fl::visual(FL_RGB); // insure 24 bit color operation
@ -140,8 +154,6 @@ int main(int argc, char ** argv) {
rigcontrol = createRigDialog();
create_fl_digi_main();
activate_test_menu_item(testmenu);
createConfig();
macros.loadDefault();
@ -218,15 +230,15 @@ int main(int argc, char ** argv) {
std::cout << "Starting pskmail transport layer" << std::endl; fflush(stdout);
string PskMailLogName = PskMailDir;
if (gmfskmail == false)
PskMailLogName += "mail-io.log";
else
if (gmfskmail == true)
PskMailLogName += "gMFSK.log";
else
PskMailLogName += "mail-io.log";
Maillogfile = new cLogfile(PskMailLogName.c_str());
Maillogfile->log_to_file_start();
Fl::add_timeout(10.0, pskmail_loop);
}
Fl::add_timeout(1.0, pskmail_loop);
return Fl::run();
}

Wyświetl plik

@ -4,6 +4,9 @@
#include <iostream>
#include <string>
#include <ctime>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "main.h"
#include "configuration.h"
@ -104,13 +107,50 @@ void mailZDT(string &s)
#define TIMEOUT 180 // 3 minutes
void process_msgque()
{
int nbytes = msgrcv (txmsgid, (void *)&txmsgst, BUFSIZ, 0, IPC_NOWAIT);
if (nbytes > 0) {
mailtext = txmsgst.buffer;
parse_mailtext();
if (mailtext.length() > 0) {
if (mailserver && progdefaults.PSKmailSweetSpot)
active_modem->set_freq(progdefaults.PSKsweetspot);
pText = mailtext.begin();
pskmail_text_available = true;
active_modem->set_stopflag(false);
fl_lock(&trx_mutex);
trx_state = STATE_TX;
fl_unlock(&trx_mutex);
wf->set_XmtRcvBtn(true);
}
}
}
void check_formail() {
time_t start_time, prog_time;
string sAutoFile = PskMailDir;
if (gmfskmail == false)
sAutoFile += "pskmail_out";
else
txmsgid = msgget( (key_t) 6789, 0666 );
if (txmsgid != -1) {
process_msgque();
arqmode = true;
return;
}
arqmode = false;
if (! (mailserver || mailclient) )
return;
if (gmfskmail == true)
sAutoFile += "gmfsk_autofile";
else
sAutoFile += "pskmail_out";
ifstream autofile(sAutoFile.c_str());
if(autofile) {
mailtext = "";
@ -162,6 +202,13 @@ char pskmail_get_char()
if (pText != mailtext.end())
return *pText++;
rxmsgid = msgget( (key_t) 9876, 0666 );
if ( rxmsgid != -1) {
rxmsgst.msg_type = 1;
rxmsgst.c = 0x06; // tell arq client that transmit complete
msgsnd (rxmsgid, (void *)&rxmsgst, 1, IPC_NOWAIT);
}
pskmail_text_available = false;
return 0x03; // tells psk modem to return to rx
}

Wyświetl plik

@ -138,16 +138,16 @@ psk::psk(trx_mode pskmode) : modem()
_qpsk = true;
dcdbits = 128;
break;
// case MODE_PSK256:
// symbollen = 32;
// _qpsk = false;
// dcdbits = 256;
// break;
// case MODE_QPSK256:
// symbollen = 32;
// _qpsk = true;
// dcdbits = 256;
// break;
case MODE_PSK250:
symbollen = 32;
_qpsk = false;
dcdbits = 256;
break;
case MODE_QPSK250:
symbollen = 32;
_qpsk = true;
dcdbits = 256;
break;
default:
mode = MODE_BPSK31;
symbollen = 256;
@ -586,3 +586,4 @@ int psk::tx_process()
}

Wyświetl plik

@ -16,9 +16,11 @@ modem *feld_CMTmodem = 0;
modem *psk31_modem = 0;
modem *psk63_modem = 0;
modem *psk125_modem = 0;
modem *psk250_modem = 0;
modem *qpsk31_modem = 0;
modem *qpsk63_modem = 0;
modem *qpsk125_modem = 0;
modem *qpsk250_modem = 0;
modem *olivia_modem = 0;
modem *rtty_modem = 0;
modem *dominoex4_modem = 0;

Wyświetl plik

@ -1152,6 +1152,14 @@ int waterfall::handle(int event) {
wfdisp->redrawCursor();
restoreFocus();
break;
case FL_MIDDLE_MOUSE:
if (event == FL_DRAG)
break;
bool toggle = !active_modem->get_afcOnOff();
active_modem->set_afcOnOff(toggle);
extern Fl_Light_Button *afconoff;
afconoff->value(toggle);
break;
}
break;
case FL_RELEASE:
@ -1168,6 +1176,12 @@ int waterfall::handle(int event) {
break;
}
break;
case FL_MOUSEWHEEL:
if (Fl::event_dy() > 0 || Fl::event_dx() > 0)
active_modem->searchUp();
else if (Fl::event_dy() < 0 || Fl::event_dx() < 0)
active_modem->searchDown();
break;
}
return 1;
} else if (wfdisp->wantcursor == true) {