Upstream version 1.35M

pull/2/head
Stelios Bounanos 2007-06-22 23:25:46 +01:00
rodzic 33f4b49107
commit 3be91c169f
21 zmienionych plików z 1025 dodań i 2011 usunięć

Wyświetl plik

@ -9,18 +9,6 @@ Change Log:
7) Added PSKmail tab and control to allow disabling the automatic
return to the PSK sweet spot if running a mail server
8) Added "Save To" menu item on received text popup menu.
9) Added relative sizing of Rx / Tx text widgets to state memory
10) Added hidden Menus "Test / Capture / Generate / Playback"
Capture - captures current audio input stream to file "capture.snd"
Generate - sends current audio output stream to file "generate.snd"
Playback - reads audio stream from file "playback.snd" in lieu of
the audio sound card
These provide the ability to make repetitive tests of various modems
by playing back a known audio stream.
If you capture an audio stream and then copy the file to playback.snd
you can then play that audio stream back. The stream will loop repitively
until the playback is turned off.
The three menu items, Capture, Generate and Playback are all toggle menu items.
1.34 1) Cleaned up unused code segments
2) Modified CW decoder to allow setting upper and lower limits on
Tx WPM

46
INSTALL 100644
Wyświetl plik

@ -0,0 +1,46 @@
A single makefile is used to create various compile strategies for fldigi
make
builds fldigi with hamlib support
make clean
removes all vestiges of prior builds
make CFG=hamlib-debug
builds fldigi with hamlib support and gdb debug information
make CFG=hamlib-local
builds fldigi with hamlib support and fltk_jpeg, fltk_png and
fltk_z compiled into the fltk library
make CFG=nhl
builds fldigi without hamlib support
make CFG=nhl-debug
builds fldigi without hamlib supoort but with gdb debug
information
make CFG=nhl-local
builds fldigi without hamlib support but with fltk_jpeg, fltk_png
and fltk_z compiled into the fltk library
All make's place the object files in ./Objects and the target executable
in ./Install
The ./Install directory also contains icons suitable for both desktop and
menu use.
Copy the executable file fldigi to a directory that your shell can routinely
access for executable files. I have a ~/bin directory that holds all of my
local executables.
If you plan on using fldigi with pskmail then you should create a separate
directory with a single file in it to start:
o PSKmailclient, or PSKmailserver, depending on your desired pskmail
service.
o then you should execute Fldigi from this directory, preferably from
a terminal window
After first use you will find a $HOME/.fldigi directory created with
all of the files needed for fldigi to run and be configured.

Wyświetl plik

@ -23,7 +23,8 @@ ifneq (,$(findstring nhl-local, $(CFG)))
endif
#PROJECT = fldigi
CC = "/usr/bin/g++"
CC = g++
#"/usr/bin/g++"
OBJ_DIR = ./Objects
OUTPUT_DIR = ./Install
@ -118,44 +119,44 @@ endef
.PHONY: print_header directories
ifeq ($(CTARG),hamlib)
CFLAGS = $(CCFLAGS)
LDFLAGS = $(DYN_LDFLAGS)
CFLAGS = $(CCFLAGS) -DPORTAUDIO
LDFLAGS = $(DYN_LDFLAGS) -lportaudiocpp
$(TARGET): print_header directories $(SRC_OBJS) $(HAMLIB_OBJS)
$(CC) -s -o $(OUTPUT_DIR)/$(TARGET) $(SRC_OBJS) $(HAMLIB_OBJS) $(LDFLAGS) $(HAMLIBS)
endif
ifeq ($(CTARG),hamlib-local)
CFLAGS = $(CCFLAGS)
LDFLAGS = $(STATIC_LDFLAGS)
CFLAGS = $(CCFLAGS) -DPORTAUDIO
LDFLAGS = $(STATIC_LDFLAGS) -lportaudiocpp
$(TARGET): print_header directories $(SRC_OBJS) $(HAMLIB_OBJS)
$(CC) -s -o $(OUTPUT_DIR)/$(TARGET) $(SRC_OBJS) $(HAMLIB_OBJS) $(LDFLAGS) $(HAMLIBS) $(IMGLIBS)
endif
ifeq ($(CTARG),hamlib-debug)
CFLAGS = $(CCFLAGS) -g
LDFLAGS = $(DYN_LDFLAGS)
CFLAGS = $(CCFLAGS) -g -DPORTAUDIO
LDFLAGS = $(DYN_LDFLAGS) -lportaudiocpp
OBJS = $(SRC_OBJS) $(HAMLIB_OBJS)
$(TARGET): print_header directories $(SRC_OBJS) $(HAMLIB_OBJS)
$(CC) -o $(OUTPUT_DIR)/$(TARGET) $(OBJS) $(LDFLAGS) $(HAMLIBS)
endif
ifeq ($(CTARG),nhl)
CFLAGS = $(CCFLAGS) -DNOHAMLIB
LDFLAGS = $(DYN_LDFLAGS)
CFLAGS = $(CCFLAGS) -DNOHAMLIB -DPORTAUDIO
LDFLAGS = $(DYN_LDFLAGS) -lportaudiocpp
$(TARGET): print_header directories $(SRC_OBJS)
$(CC) -s -o $(OUTPUT_DIR)/$(TARGET) $(SRC_OBJS) $(LDFLAGS)
endif
ifeq ($(CTARG),nhl-local)
CFLAGS = $(CCFLAGS) -DNOHAMLIB
LDFLAGS = $(STATIC_LDFLAGS)
CFLAGS = $(CCFLAGS) -DNOHAMLIB -DPORTAUDIO
LDFLAGS = $(STATIC_LDFLAGS) /usr/local/lib/libportaudiocpp.a /usr/local/lib/libportaudio.a
$(TARGET): print_header directories $(SRC_OBJS)
$(CC) -s -o $(OUTPUT_DIR)/$(TARGET) $(SRC_OBJS) $(LDFLAGS) $(IMGLIBS)
endif
ifeq ($(CTARG),nhl-debug)
CFLAGS = $(CCFLAGS) -DNOHAMLIB -g
LDFLAGS = $(DYN_LDFLAGS)
CFLAGS = $(CCFLAGS) -DNOHAMLIB -DPORTAUDIO -g
LDFLAGS = $(DYN_LDFLAGS) -lportaudiocpp
$(TARGET): print_header directories $(SRC_OBJS)
$(CC) -o $(OUTPUT_DIR)/$(TARGET) $(SRC_OBJS) $(LDFLAGS)
endif

Wyświetl plik

@ -396,27 +396,9 @@ progdefaults.changed = true;
Fl_Group *tabSoundCard=(Fl_Group *)0;
static void cb_btnDsp(Fl_Round_Button* o, void*) {
if (o->value() == 1) {
btnDsp[1]->value(0);
resetSoundCard(0);
} else {
o->value(1);
}
progdefaults.changed = true;
}
Fl_Tabs *tabsSoundCard=(Fl_Tabs *)0;
Fl_Round_Button *btnDsp[2]={(Fl_Round_Button *)0};
static void cb_btnDsp1(Fl_Round_Button* o, void*) {
if (o->value() == 1) {
btnDsp[0]->value(0);
resetSoundCard(1);
} else {
o->value(1);
}
progdefaults.changed = true;
}
Fl_Group *tabMixer=(Fl_Group *)0;
Fl_Light_Button *btnLineIn=(Fl_Light_Button *)0;
@ -455,6 +437,24 @@ static void cb_valPCMvolume(Fl_Value_Slider* o, void*) {
progdefaults.changed = true;
}
Fl_Input_Choice *menuMix=(Fl_Input_Choice *)0;
static void cb_menuMix(Fl_Input_Choice* o, void*) {
progdefaults.MXdevice = o->value();
enableMixer(false);
enableMixer(true);
progdefaults.changed = true;
}
Fl_Check_Button *btnMixer=(Fl_Check_Button *)0;
static void cb_btnMixer(Fl_Check_Button* o, void*) {
enableMixer(o->value());
progdefaults.changed = true;
}
Fl_Group *tabAudio=(Fl_Group *)0;
Fl_Spinner *cntRxRateCorr=(Fl_Spinner *)0;
static void cb_cntRxRateCorr(Fl_Spinner* o, void*) {
@ -476,6 +476,48 @@ static void cb_cntTxOffset(Fl_Spinner* o, void*) {
progdefaults.changed = true;
}
Fl_Group *AudioIO=(Fl_Group *)0;
static void cb_btnAudioIO(Fl_Round_Button* o, void*) {
btnAudioIO[1]->value(0);
o->value(1);
menuOSSDev->activate();
menuPADev->deactivate();
scDevice = menuOSSDev->value();
progdefaults.btnAudioIOis = 0;
progdefaults.changed = true;
resetSoundCard();
}
Fl_Round_Button *btnAudioIO[2]={(Fl_Round_Button *)0};
static void cb_btnAudioIO1(Fl_Round_Button* o, void*) {
btnAudioIO[0]->value(0);
o->value(1);
menuPADev->activate();
menuOSSDev->deactivate();
scDevice = menuPADev->value();
progdefaults.btnAudioIOis = 1;
progdefaults.changed = true;
resetSoundCard();
}
Fl_Input_Choice *menuOSSDev=(Fl_Input_Choice *)0;
static void cb_menuOSSDev(Fl_Input_Choice* o, void*) {
scDevice = progdefaults.OSSdevice = o->value();
resetSoundCard();
progdefaults.changed = true;
}
Fl_Input_Choice *menuPADev=(Fl_Input_Choice *)0;
static void cb_menuPADev(Fl_Input_Choice* o, void*) {
scDevice = progdefaults.PAdevice = o->value();
resetSoundCard();
progdefaults.changed = true;
}
Fl_Value_Input *valCWsweetspot=(Fl_Value_Input *)0;
static void cb_valCWsweetspot(Fl_Value_Input* o, void*) {
@ -862,7 +904,7 @@ static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200
o->color(FL_DARK2);
o->selection_color((Fl_Color)51);
o->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE);
{ Fl_Tabs* o = tabsConfigure = new Fl_Tabs(0, 0, 401, 220);
{ Fl_Tabs* o = tabsConfigure = new Fl_Tabs(0, 0, 405, 220);
o->color(FL_DARK1);
o->selection_color((Fl_Color)9);
{ Fl_Group* o = tabOperator = new Fl_Group(0, 25, 400, 195, "Oper");
@ -1145,33 +1187,23 @@ static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200
}
o->end();
}
{ Fl_Group* o = tabSoundCard = new Fl_Group(0, 25, 400, 195, "SndCrd");
{ Fl_Group* o = tabSoundCard = new Fl_Group(0, 25, 405, 195, "SndCrd");
o->color((Fl_Color)51);
o->selection_color((Fl_Color)51);
{ Fl_Group* o = new Fl_Group(0, 27, 400, 190);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
{ Fl_Group* o = new Fl_Group(5, 35, 395, 115, "Mixer");
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
{ Fl_Round_Button* o = btnDsp[0] = new Fl_Round_Button(20, 60, 55, 20, "dsp");
o->down_box(FL_DIAMOND_DOWN_BOX);
o->value(1);
o->selection_color((Fl_Color)2);
o->callback((Fl_Callback*)cb_btnDsp);
}
{ Fl_Round_Button* o = btnDsp[1] = new Fl_Round_Button(20, 90, 55, 20, "dsp1");
o->down_box(FL_DIAMOND_DOWN_BOX);
o->selection_color((Fl_Color)2);
o->callback((Fl_Callback*)cb_btnDsp1);
}
{ Fl_Light_Button* o = btnLineIn = new Fl_Light_Button(125, 59, 74, 22, "Line In");
{ Fl_Tabs* o = tabsSoundCard = new Fl_Tabs(0, 25, 405, 195);
o->selection_color((Fl_Color)10);
{ Fl_Group* o = tabMixer = new Fl_Group(0, 50, 400, 170, "Mixer");
o->color((Fl_Color)51);
o->selection_color((Fl_Color)51);
o->hide();
{ Fl_Light_Button* o = btnLineIn = new Fl_Light_Button(295, 64, 74, 22, "Line In");
o->selection_color((Fl_Color)3);
o->callback((Fl_Callback*)cb_btnLineIn);
}
{ Fl_Light_Button* o = btnMicIn = new Fl_Light_Button(125, 89, 74, 22, "Mic In");
{ Fl_Light_Button* o = btnMicIn = new Fl_Light_Button(295, 94, 74, 22, "Mic In");
o->callback((Fl_Callback*)cb_btnMicIn);
}
{ Fl_Value_Slider* o = valPCMvolume = new Fl_Value_Slider(14, 120, 340, 21, "PCM");
{ Fl_Value_Slider* o = valPCMvolume = new Fl_Value_Slider(19, 125, 340, 21, "PCM");
o->type(5);
o->color((Fl_Color)26);
o->selection_color((Fl_Color)1);
@ -1182,34 +1214,68 @@ static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200
o->callback((Fl_Callback*)cb_valPCMvolume);
o->align(FL_ALIGN_RIGHT);
}
{ Fl_Input_Choice* o = menuMix = new Fl_Input_Choice(105, 90, 110, 25, "Device");
o->callback((Fl_Callback*)cb_menuMix);
o->value(progdefaults.MXdevice.c_str());
}
{ Fl_Check_Button* o = btnMixer = new Fl_Check_Button(55, 61, 25, 25, "Manage mixer");
o->down_box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_btnMixer);
o->value(progdefaults.EnableMixer);
}
o->end();
}
{ Fl_Group* o = tabAudio = new Fl_Group(0, 50, 400, 170, "Audio");
o->color((Fl_Color)51);
o->selection_color((Fl_Color)51);
{ Fl_Spinner* o = cntRxRateCorr = new Fl_Spinner(299, 161, 75, 24, "RX ppm:");
o->callback((Fl_Callback*)cb_cntRxRateCorr);
o->step(1);
o->minimum(-50000);
o->maximum(50000);
}
{ Fl_Spinner* o = cntTxRateCorr = new Fl_Spinner(299, 190, 75, 24, "TX ppm:");
o->callback((Fl_Callback*)cb_cntTxRateCorr);
o->step(1);
o->minimum(-50000);
o->maximum(50000);
}
{ Fl_Spinner* o = cntTxOffset = new Fl_Spinner(177, 190, 45, 24, "Tx offset:");
o->callback((Fl_Callback*)cb_cntTxOffset);
o->value(progdefaults.TxOffset);
o->step(1);
o->minimum(-50);
o->maximum(50);
}
{ Fl_Group* o = AudioIO = new Fl_Group(0, 55, 140, 70, "I/O");
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
{ Fl_Round_Button* o = btnAudioIO[0] = new Fl_Round_Button(25, 70, 25, 25, "OSS");
o->down_box(FL_DIAMOND_DOWN_BOX);
o->selection_color((Fl_Color)1);
o->callback((Fl_Callback*)cb_btnAudioIO);
}
{ Fl_Round_Button* o = btnAudioIO[1] = new Fl_Round_Button(25, 95, 25, 25, "PortAudio");
o->down_box(FL_DIAMOND_DOWN_BOX);
o->selection_color((Fl_Color)1);
o->callback((Fl_Callback*)cb_btnAudioIO1);
}
o->end();
}
{ Fl_Input_Choice* o = menuOSSDev = new Fl_Input_Choice(155, 60, 110, 25, "OSS device");
o->callback((Fl_Callback*)cb_menuOSSDev);
o->align(FL_ALIGN_RIGHT);
o->value(progdefaults.OSSdevice.c_str());
}
{ Fl_Input_Choice* o = menuPADev = new Fl_Input_Choice(155, 90, 110, 25, "PortAudio device");
o->callback((Fl_Callback*)cb_menuPADev);
o->align(FL_ALIGN_RIGHT);
o->value(progdefaults.PAdevice.c_str());
}
o->end();
}
o->end();
}
{ Fl_Group* o = new Fl_Group(5, 150, 395, 65, "Sound Card");
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
{ Fl_Spinner* o = cntRxRateCorr = new Fl_Spinner(294, 156, 75, 24, "RX ppm:");
o->callback((Fl_Callback*)cb_cntRxRateCorr);
o->step(1);
o->minimum(-50000);
o->maximum(50000);
}
{ Fl_Spinner* o = cntTxRateCorr = new Fl_Spinner(294, 185, 75, 24, "TX ppm:");
o->callback((Fl_Callback*)cb_cntTxRateCorr);
o->step(1);
o->minimum(-50000);
o->maximum(50000);
}
o->end();
}
{ Fl_Spinner* o = cntTxOffset = new Fl_Spinner(172, 185, 45, 24, "Tx offset:");
o->callback((Fl_Callback*)cb_cntTxOffset);
o->value(progdefaults.TxOffset);
o->step(1);
o->minimum(-50);
o->maximum(50);
}
o->end();
}
{ Fl_Group* o = new Fl_Group(0, 25, 400, 195, "Misc");

Wyświetl plik

@ -31,10 +31,10 @@ static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200
code {} {}
Fl_Window {} {
label {fldigi - config} open
xywh {498 127 400 255} type Double color 45 selection_color 51 align 80 visible
xywh {361 556 400 255} type Double color 45 selection_color 51 align 80 visible
} {
Fl_Tabs tabsConfigure {open
xywh {0 0 401 220} color 47 selection_color 9
xywh {0 0 405 220} color 47 selection_color 9
} {
Fl_Group tabOperator {
label Oper
@ -461,37 +461,15 @@ progdefaults.changed = true;}
}
Fl_Group tabSoundCard {
label SndCrd open
xywh {0 25 400 195} color 51 selection_color 51
xywh {0 25 405 195} color 51 selection_color 51
} {
Fl_Group {} {open
xywh {0 27 400 190} align 21
Fl_Tabs tabsSoundCard {open
xywh {0 25 405 195} selection_color 10
} {
Fl_Group {} {
Fl_Group tabMixer {
label Mixer open
xywh {5 35 395 115} box ENGRAVED_FRAME align 21
xywh {0 50 400 170} color 51 selection_color 51 hide
} {
Fl_Round_Button {btnDsp[0]} {
label dsp
callback {if (o->value() == 1) {
btnDsp[1]->value(0);
resetSoundCard(0);
} else {
o->value(1);
}
progdefaults.changed = true;}
xywh {20 60 55 20} down_box DIAMOND_DOWN_BOX value 1 selection_color 2
}
Fl_Round_Button {btnDsp[1]} {
label dsp1
callback {if (o->value() == 1) {
btnDsp[0]->value(0);
resetSoundCard(1);
} else {
o->value(1);
}
progdefaults.changed = true;}
xywh {20 90 55 20} down_box DIAMOND_DOWN_BOX selection_color 2
}
Fl_Light_Button btnLineIn {
label {Line In}
callback {if (o->value() == 1) {
@ -504,7 +482,7 @@ progdefaults.changed = true;}
progdefaults.LineIn = false;
}
progdefaults.changed = true;}
xywh {125 59 74 22} selection_color 3
xywh {295 64 74 22} selection_color 3
code0 {extern void setMixerInput(int);}
}
Fl_Light_Button btnMicIn {
@ -519,50 +497,112 @@ progdefaults.changed = true;}
progdefaults.MicIn = false;
}
progdefaults.changed = true;}
xywh {125 89 74 22}
xywh {295 94 74 22}
}
Fl_Value_Slider valPCMvolume {
label PCM
callback {setPCMvolume(o->value());
progdefaults.changed = true;}
xywh {14 120 340 21} type {Horz Knob} color 26 selection_color 1 align 8 maximum 100 step 1 value 80 textsize 14
xywh {19 125 340 21} type {Horz Knob} color 26 selection_color 1 align 8 maximum 100 step 1 value 80 textsize 14
code0 {extern void setPCMvolume(double);}
}
}
}
Fl_Group {} {
label {Sound Card} open
xywh {5 150 395 65} box ENGRAVED_FRAME align 21
} {
Fl_Spinner cntRxRateCorr {
label {RX ppm:}
callback {progdefaults.RX_corr = (int)o->value();
Fl_Input_Choice menuMix {
label Device
callback {progdefaults.MXdevice = o->value();
enableMixer(false);
enableMixer(true);
progdefaults.changed = true;} open
xywh {105 90 110 25}
code0 {o->value(progdefaults.MXdevice.c_str());}
} {}
Fl_Check_Button btnMixer {
label {Manage mixer}
callback {enableMixer(o->value());
progdefaults.changed = true;}
xywh {294 156 75 24}
code0 {o->step(1);}
code1 {o->minimum(-50000);}
code2 {o->maximum(50000);}
xywh {55 61 25 25} down_box DOWN_BOX
code0 {extern void resetMixerControls();}
code1 {o->value(progdefaults.EnableMixer);}
}
}
Fl_Spinner cntTxRateCorr {
label {TX ppm:}
callback {progdefaults.TX_corr = (int)o->value();
Fl_Group tabAudio {
label Audio open
xywh {0 50 400 170} color 51 selection_color 51
} {
Fl_Spinner cntRxRateCorr {
label {RX ppm:}
callback {progdefaults.RX_corr = (int)o->value();
progdefaults.changed = true;}
xywh {294 185 75 24}
code0 {o->step(1);}
code1 {o->minimum(-50000);}
code2 {o->maximum(50000);}
xywh {299 161 75 24}
code0 {o->step(1);}
code1 {o->minimum(-50000);}
code2 {o->maximum(50000);}
}
Fl_Spinner cntTxRateCorr {
label {TX ppm:}
callback {progdefaults.TX_corr = (int)o->value();
progdefaults.changed = true;}
xywh {299 190 75 24}
code0 {o->step(1);}
code1 {o->minimum(-50000);}
code2 {o->maximum(50000);}
}
Fl_Spinner cntTxOffset {
label {Tx offset:}
callback {progdefaults.TxOffset = (int)o->value();
progdefaults.changed = true;}
xywh {177 190 45 24}
code0 {o->value(progdefaults.TxOffset);}
code1 {o->step(1);}
code2 {o->minimum(-50);}
code3 {o->maximum(50);}
}
Fl_Group AudioIO {
label {I/O} open
xywh {0 55 140 70} box ENGRAVED_FRAME align 21
} {
Fl_Round_Button {btnAudioIO[0]} {
label OSS
callback {btnAudioIO[1]->value(0);
o->value(1);
menuOSSDev->activate();
menuPADev->deactivate();
scDevice = menuOSSDev->value();
progdefaults.btnAudioIOis = 0;
progdefaults.changed = true;
resetSoundCard();}
xywh {25 70 25 25} down_box DIAMOND_DOWN_BOX selection_color 1
}
Fl_Round_Button {btnAudioIO[1]} {
label PortAudio
callback {btnAudioIO[0]->value(0);
o->value(1);
menuPADev->activate();
menuOSSDev->deactivate();
scDevice = menuPADev->value();
progdefaults.btnAudioIOis = 1;
progdefaults.changed = true;
resetSoundCard();}
xywh {25 95 25 25} down_box DIAMOND_DOWN_BOX selection_color 1
}
}
Fl_Input_Choice menuOSSDev {
label {OSS device}
callback {scDevice = progdefaults.OSSdevice = o->value();
resetSoundCard();
progdefaults.changed = true;} open
xywh {155 60 110 25} align 8
code0 {o->value(progdefaults.OSSdevice.c_str());}
} {}
Fl_Input_Choice menuPADev {
label {PortAudio device}
callback {scDevice = progdefaults.PAdevice = o->value();
resetSoundCard();
progdefaults.changed = true;} open selected
xywh {155 90 110 25} align 8
code0 {o->value(progdefaults.PAdevice.c_str());}
} {}
}
}
Fl_Spinner cntTxOffset {
label {Tx offset:}
callback {progdefaults.TxOffset = (int)o->value();
progdefaults.changed = true;} selected
xywh {172 185 45 24}
code0 {o->value(progdefaults.TxOffset);}
code1 {o->step(1);}
code2 {o->minimum(-50);}
code3 {o->maximum(50);}
}
}
Fl_Group {} {
label Misc open

Wyświetl plik

@ -1,140 +0,0 @@
// generated by Fast Light User Interface Designer (fluid) version 1.0107
#ifndef Config_h
#define Config_h
#include <FL/Fl.H>
#include "globals.h"
#include "modem.h"
#include "configuration.h"
extern Fl_Double_Window *dlgConfig;
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Tabs.H>
extern Fl_Tabs *tabsConfigure;
#include <FL/Fl_Group.H>
extern Fl_Group *tabOperator;
#include <FL/Fl_Input.H>
extern Fl_Input *inpMyCallsign;
extern Fl_Input *inpMyName;
extern Fl_Input *inpMyQth;
extern Fl_Input *inpMyLocator;
#include <FL/Fl_Check_Button.H>
extern Fl_Check_Button *btnUseLeadingZeros;
#include <FL/Fl_Value_Input.H>
extern Fl_Value_Input *nbrContestStart;
extern Fl_Value_Input *nbrContestDigits;
extern Fl_Group *tabWaterfall;
extern Fl_Check_Button *btnBlackman;
extern Fl_Check_Button *btnHamming;
extern Fl_Check_Button *btnHanning;
extern Fl_Check_Button *btnTriangular;
extern Fl_Check_Button *btnUseCursorLines;
extern Fl_Check_Button *btnUseBWTracks;
extern Fl_Check_Button *btnUseCursorCenterLine;
extern Fl_Check_Button *btnViewXmtSignal;
#include "colorbox.h"
extern colorbox *Palette;
#include <FL/Fl_Button.H>
extern Fl_Button *btnColor[9];
extern Fl_Button *btnLoadPalette;
extern Fl_Button *btnSavePalette;
extern Fl_Group *tabInterface;
#include <FL/Fl_Round_Button.H>
extern Fl_Input *inpTTYdev;
extern Fl_Round_Button *btnRTSptt;
extern Fl_Round_Button *btnDTRptt;
extern Fl_Round_Button *btnRTSplusV;
extern Fl_Round_Button *btnDTRplusV;
#include <FL/Fl_Box.H>
extern Fl_Round_Button *btnPTT[5];
extern Fl_Check_Button *chkUSEHAMLIB;
extern Fl_Check_Button *chkUSEMEMMAP;
extern Fl_ComboBox *cboHamlibRig;
extern Fl_Input *inpRIGdev;
#include <FL/Fl_Choice.H>
extern Fl_Choice *mnuBaudRate;
extern Fl_Check_Button *chkUSERIGCAT;
extern Fl_Button *btnInit_Interface;
extern Fl_Check_Button *btnQRZnotavailable;
extern Fl_Check_Button *btnQRZsocket;
extern Fl_Check_Button *btnQRZcdrom;
extern Fl_Group *tabSoundCard;
extern Fl_Round_Button *btnDsp[2];
#include <FL/Fl_Light_Button.H>
extern void setMixerInput(int);
extern Fl_Light_Button *btnLineIn;
extern Fl_Light_Button *btnMicIn;
#include <FL/Fl_Value_Slider.H>
extern void setPCMvolume(double);
extern Fl_Value_Slider *valPCMvolume;
#include <FL/Fl_Spinner.H>
extern Fl_Spinner *cntRxRateCorr;
extern Fl_Spinner *cntTxRateCorr;
extern Fl_Spinner *cntTxOffset;
extern Fl_Value_Input *valCWsweetspot;
extern Fl_Value_Input *valRTTYsweetspot;
extern Fl_Value_Input *valPSKsweetspot;
extern Fl_Check_Button *btnStartAtSweetSpot;
extern Fl_Check_Button *btnsendid;
extern Fl_Group *tabModems;
extern Fl_Tabs *tabsModems;
extern Fl_Group *tabCW;
extern Fl_Value_Slider *sldrCWbandwidth;
#include <FL/Fl_Counter.H>
extern Fl_Counter *cntCWrange;
extern Fl_Check_Button *btnCWrcvTrack;
#include <FL/Fl_Value_Output.H>
extern Fl_Value_Output *valCWrcvWPM;
#include <FL/Fl_Progress.H>
extern Fl_Progress *prgsCWrcvWPM;
extern Fl_Value_Slider *sldrCWxmtWPM;
extern Fl_Counter *cntCWlowerlimit;
extern Fl_Counter *cntCWupperlimit;
extern Fl_Counter *cntCWweight;
extern Fl_Counter *cntCWdash2dot;
extern Fl_Counter *cntCWrisetime;
extern Fl_Counter *cntCWdefWPM;
extern Fl_Group *tabCWQSK;
extern Fl_Check_Button *btnQSK;
extern Fl_Counter *cntPreTiming;
extern Fl_Counter *cntPostTiming;
extern Fl_Group *tabDomEX;
extern Fl_Input *txtSecondary;
extern Fl_Button *btnRestartDomEX;
extern Fl_Counter *valDominoEX_BW;
extern Fl_Group *tabFeld;
#include "fontdef.h"
extern Fl_Choice *selHellFont;
extern Fl_Value_Slider *sldrHellBW;
extern Fl_Check_Button *btnHellXmtWidth;
extern Fl_Check_Button *btnHellRcvWidth;
extern Fl_Check_Button *btnBlackboard;
extern Fl_Check_Button *btnHellFastAttack;
extern Fl_Check_Button *btnHellSlowAttack;
extern Fl_Check_Button *btnFeldHellIdle;
extern Fl_Group *tabOlivia;
extern Fl_Choice *mnuOlivia_Tones;
extern Fl_Choice *mnuOlivia_Bandwidth;
extern Fl_Button *btnRestartOlivia;
extern Fl_Check_Button *btnPSKmailSweetSpot;
extern Fl_Group *tabRTTY;
extern Fl_Choice *selShift;
extern Fl_Choice *selBaud;
extern Fl_Choice *selBits;
extern Fl_Choice *selParity;
extern Fl_Choice *selStopBits;
extern Fl_Check_Button *chkPseudoFSK;
extern Fl_Button *btnRestartRtty;
extern Fl_Check_Button *btnCRCRLF;
extern Fl_Check_Button *btnAUTOCRLF;
extern Fl_Counter *cntrAUTOCRLF;
extern Fl_Check_Button *btnRTTY_USB;
extern Fl_Round_Button *btnRTTYafc[3];
extern Fl_Check_Button *btnPreferXhairScope;
#include <FL/Fl_Return_Button.H>
extern Fl_Return_Button *btnCloseConfig;
extern Fl_Button *btnSaveConfig;
Fl_Double_Window* ConfigureDialog();
void openConfig();
void closeDialog();
void createConfig();
#endif

Wyświetl plik

@ -30,10 +30,12 @@
#include <FL/fl_ask.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Tile.H>
#include "version.h"
#include "waterfall.h"
#include "raster.h"
#include "main.h"
#include "threads.h"
#include "trx.h"
@ -78,6 +80,7 @@ cMixer mixer;
Fl_Button *btnTune = (Fl_Button *)0;
Fl_Tile *TiledGroup = (Fl_Tile *)0;
//Fl_Group *TiledGroup = (Fl_Group *)0;
TextView *ReceiveText=(TextView *)0;
TextEdit *TransmitText=(TextEdit *)0;
Fl_Text_Buffer *rcvBuffer = (Fl_Text_Buffer *)0;
@ -115,6 +118,7 @@ bool altMacros = false;
bool bSaveFreqList = false;
string strMacroName[10];
waterfall *wf = (waterfall *)0;
Digiscope *digiscope = (Digiscope *)0;
Fl_Slider *sldrSquelch = (Fl_Slider *)0;
@ -1044,7 +1048,6 @@ void activate_test_menu_item(bool b)
mnu->redraw();
}
void create_fl_digi_main() {
int Y = 0;
fl_digi_main = new Fl_Double_Window(WNOM, HNOM, "fldigi");
@ -1112,7 +1115,7 @@ 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, (Htext)/2 - 15, "R");
// 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));
@ -1120,7 +1123,7 @@ 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 + (Htext)/2, sw, (Htext)/2 - 15, "T");
// 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));
@ -1132,8 +1135,9 @@ void create_fl_digi_main() {
valXmtMixer->deactivate();
MixerFrame->end();
Fl_Tile *TiledGroup = new Fl_Tile(sw, Y, WNOM-sw, Htext);
Fl_Box *minbox = new Fl_Box(sw,Y + 66, WNOM-sw, Htext - 66 - 32);
Fl_Tile *TiledGroup = new Fl_Tile(sw, Y, WNOM-sw, Hrcvtxt + Hxmttxt);
// Fl_Group *TiledGroup = new Fl_Group(sw, Y, WNOM-sw, Hrcvtxt + Hxmttxt);
Fl_Box *minbox = new Fl_Box(sw,Y + 66, WNOM-sw, Hxmttxt + Hrcvtxt - 66 - 32);
minbox->hide();
ReceiveText = new TextView(sw, Y, WNOM-sw, Hrcvtxt, "");
@ -1178,23 +1182,19 @@ void create_fl_digi_main() {
wfpack->type(1);
wf = new waterfall(0, Y, Wwfall, Hwfall);
wf->end();
int Wscope = Hwfall - BTN_HEIGHT - 2 * BEZEL;
Fl_Pack *ypack = new Fl_Pack( WNOM - Wscope, Y,
Wscope, Hwfall);
Fl_Pack *ypack = new Fl_Pack(WNOM-(Hwfall-22), Y, Hwfall-22, Hwfall);
ypack->type(0);
digiscope = new Digiscope ( WNOM - Wscope, Y,
Wscope,
Wscope);
digiscope = new Digiscope (WNOM-(Hwfall-22), Y, Hwfall-22, Hwfall-22);
pgrsSquelch = new Fl_Progress(
WNOM - Wscope, Y + Wscope,
Wscope, (BTN_HEIGHT + 2*BEZEL) / 2, "");
WNOM-(Hwfall-22), Y + Hwfall - 22,
Hwfall - 22, 10, "");
pgrsSquelch->color(FL_BACKGROUND2_COLOR, FL_DARK_GREEN);
sldrSquelch = new Fl_Slider(
FL_HOR_NICE_SLIDER,
WNOM - Wscope, Y + Wscope + BEZEL + (BTN_HEIGHT + 2*BEZEL) / 2,
Wscope, (BTN_HEIGHT + 2*BEZEL) / 2, "");
WNOM-(Hwfall-22), Y + Hwfall - 12,
Hwfall - 22, 12, "");
sldrSquelch->minimum(0);
sldrSquelch->maximum(100);
@ -1208,7 +1208,7 @@ void create_fl_digi_main() {
Fl_Group::current()->resizable(wf);
wfpack->end();
Y += (Hwfall + 2);
Fl_Pack *hpack = new Fl_Pack(0, Y, WNOM, Hstatus);
hpack->type(1);
MODEstatus = new Fl_Button(0,Hmenu+Hrcvtxt+Hxmttxt+Hwfall, Wmode, Hstatus, "");
@ -1278,6 +1278,7 @@ void display_metric(double metric)
void put_cwRcvWPM(double wpm)
{
// if (!prgsCWrcvWPM) return;
int U = progdefaults.CWupperlimit;
int L = progdefaults.CWlowerlimit;
double dWPM = 100.0*(wpm - L)/(U - L);
@ -1518,14 +1519,11 @@ void resetDOMEX() {
void enableMixer(bool on)
{
string mix = "/dev/mixer";
Fl::lock();
if (btnDsp[1]->value() == true) mix += '1';
if (on) {
progdefaults.EnableMixer = true;
mixer.openMixer(mix.c_str());
valRcvMixer->activate();
valXmtMixer->activate();
mixer.openMixer(progdefaults.MXdevice.c_str());
mixer.PCMVolume(progdefaults.PCMvolume/100.0);
mixer.setXmtLevel(valXmtMixer->value());
mixer.setRcvGain(valRcvMixer->value());
@ -1538,12 +1536,31 @@ void enableMixer(bool on)
}else{
progdefaults.EnableMixer = false;
mixer.closeMixer();
valRcvMixer->deactivate();
valXmtMixer->deactivate();
}
resetMixerControls();
Fl::unlock();
}
void resetMixerControls()
{
if (progdefaults.EnableMixer) {
valRcvMixer->activate();
valXmtMixer->activate();
menuMix->activate();
btnLineIn->activate();
btnMicIn->activate();
valPCMvolume->activate();
}
else {
valRcvMixer->deactivate();
valXmtMixer->deactivate();
menuMix->deactivate();
btnLineIn->deactivate();
btnMicIn->deactivate();
valPCMvolume->deactivate();
}
}
void setPCMvolume(double vol)
{
mixer.PCMVolume(vol/100.0);
@ -1566,17 +1583,13 @@ void setMixerInput(int dev)
mixer.SetCurrentInputSource(n);
}
void resetSoundCard(int n) {
string scd = "/dev/dsp";
if (n == 1) scd += '1';
if (scd != scDevice) {
enableMixer(false);
scDevice = scd;
trx_reset(scDevice.c_str());
progdefaults.SCdevice = scDevice;
enableMixer(true);
}
void resetSoundCard()
{
enableMixer(false);
trx_reset(scDevice.c_str());
progdefaults.SCdevice = scDevice;
if (progdefaults.EnableMixer)
enableMixer(true);
}
void setReverse(int rev) {

Wyświetl plik

@ -1,718 +0,0 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0107
header_name {.h}
code_name {.cxx}
decl {\#include "main.h"} {}
decl {\#include "globals.h"} {public
}
decl {\#include "modem.h"} {public
}
decl {\#include "configuration.h"} {public
}
decl {Fl_Double_Window *dlgConfig;} {public
}
Function {ConfigureDialog()} {open
} {
code {static char *szShifts = "23|85|160|170|182|200|240|350|425|850";
static char *szBauds = "45|45.45|50|56|75|100|110|150|200|300";
static char *szSelBits = "5 (baudot)|7 (ascii)|8 (ascii)";
static char *szParity = "none|even|odd|zero|one";
static char *szStopBits = "1|1.5|2";
static char *szOliviaTones = "2|4|8|16|32|64|128|256";
static char *szOliviaBandwidth = "125|250|500|1000|2000";
static char *szPreFilters = "None (rect)|Blackman|Hamming|Hanning|Triangular";
static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200|230400|460800";} {}
code {} {}
Fl_Window {} {
label {fldigi - config} open
xywh {589 49 400 255} type Double align 80 visible
} {
Fl_Tabs tabsConfigure {open
xywh {0 0 475 220} selection_color 9
} {
Fl_Group tabOperator {
label Oper
xywh {0 25 400 195} hide
} {
Fl_Input inpMyCallsign {
label {Callsign:}
xywh {78 36 85 24}
}
Fl_Input inpMyName {
label {Name:}
xywh {78 62 120 24}
}
Fl_Input inpMyQth {
label {Qth:}
xywh {78 89 312 24}
}
Fl_Input inpMyLocator {
label {Locator:}
xywh {78 116 85 24}
}
Fl_Group {} {
label {Contest Setup}
xywh {5 145 390 70} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnUseLeadingZeros {
label {Use Leading Zeros}
callback {progdefaults.UseLeadingZeros = o->value();}
xywh {42 175 165 15} down_box DOWN_BOX value 1
}
Fl_Value_Input nbrContestStart {
label {Starting \#:}
callback {progdefaults.ContestStart = (int)o->value();}
xywh {216 170 45 24} align 1 minimum 1 maximum 10000 step 1 value 1
}
Fl_Value_Input nbrContestDigits {
label {\# of digits:}
callback {progdefaults.ContestDigits = (int)o->value();}
xywh {298 170 45 24} align 1 minimum 1 maximum 5 step 1 value 3
}
}
}
Fl_Group tabWaterfall {
label {W-fall}
xywh {0 25 400 195} hide
} {
Fl_Choice inpPreFilter {
label {FFT Prefilter}
callback {progdefaults.initWFPrefilter(o->value());} open
xywh {45 61 141 25} down_box BORDER_BOX align 5
code0 {o->add(szPreFilters);}
code1 {o->value(0);}
} {}
Fl_Button btnSpectrum {
label Spectrum
callback {fl_color_chooser("Spectrum",
progdefaults.red,
progdefaults.green,
progdefaults.blue);
wf->setcolors();}
xywh {255 61 90 25}
code0 {\#include <FL/Fl_Color_Chooser.H>}
}
Fl_Check_Button btnMultiColorWF {
label {Multi-color}
callback {progdefaults.MultiColorWF = o->value();
wf->setcolors();}
tooltip {Use multi-color waterfall} xywh {255 101 120 20} down_box DOWN_BOX
code1 {o->value(progdefaults.MultiColorWF);}
}
Fl_Check_Button btnUseCursorLines {
label {Use Cursor BW Lines}
callback {progdefaults.UseCursorLines = o->value();}
xywh {45 101 165 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseCursorLines);}
}
Fl_Check_Button btnUseBWTracks {
label {Use BW Tracks}
callback {progdefaults.UseBWTracks = o->value();}
xywh {45 129 140 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseBWTracks);}
}
Fl_Check_Button btnUseCursorCenterLine {
label {Use Cursor Center Line}
callback {progdefaults.UseCursorCenterLine = o->value();}
xywh {45 158 140 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseCursorCenterLine);}
}
Fl_Check_Button btnViewXmtSignal {
label {View Xmt Signal}
callback {progdefaults.viewXmtSignal=o->value();}
xywh {45 187 133 15} down_box DOWN_BOX
code0 {o->value(progdefaults.viewXmtSignal);}
}
}
Fl_Group tabInterface {
label RigCtl
xywh {0 25 400 195} hide
} {
Fl_Group {} {
label Ptt open
xywh {10 31 185 179} box ENGRAVED_FRAME align 21
} {
Fl_Round_Button {btnPTT[0]} {
label none
callback {btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {25 52 64 15} down_box DIAMOND_DOWN_BOX value 1 selection_color 1
}
Fl_Round_Button {btnPTT[1]} {
label Hamlib
callback {btnPTT[0]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {107 53 67 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Round_Button {btnPTT[2]} {
label Memmap
callback {btnPTT[1]->value(0);
btnPTT[0]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {25 73 85 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Round_Button {btnPTT[3]} {
label RigCAT
callback {btnPTT[0]->value(0);
btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {107 74 85 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Group {} {open
xywh {12 95 180 88} box ENGRAVED_FRAME align 21
} {
Fl_Round_Button {btnPTT[4]} {
label TTY
callback {btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[0]->value(0);
o->value(1);}
xywh {17 103 52 14} down_box DIAMOND_DOWN_BOX selection_color 1
}
Fl_Input inpTTYdev {
xywh {66 100 120 22}
}
Fl_Round_Button {btnRTSDTR[0]} {
label RTS
callback {btnRTSDTR[1]->value(0);
btnRTSDTR[2]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {36 139 64 15} down_box DOWN_BOX value 1
}
Fl_Round_Button {btnRTSDTR[1]} {
label DTR
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[2]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {36 164 64 15} down_box DOWN_BOX
}
Fl_Round_Button {btnRTSDTR[2]} {
label BOTH
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[1]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {98 139 64 15} down_box DOWN_BOX
}
Fl_Round_Button {btnRTSDTR[3]} {
label {DTR=+V}
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[1]->value(0);
btnRTSDTR[2]->value(0);
o->value(1);}
xywh {98 164 64 15} down_box DOWN_BOX
}
}
Fl_Check_Button chkPTT_reverse {
label {PTT reverse}
xywh {37 188 110 15} down_box DOWN_BOX
}
}
Fl_Group {} {
label {Rig Control} open
xywh {195 31 200 151} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button chkUSEHAMLIB {
label Hamlib
callback {if (o->value() == 1) {
chkUSEMEMMAP->value(0);
chkUSERIGCAT->value(0);
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
btnPTT[1]->activate();
} else {
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
}
btnPTT[0]->value(1);}
xywh {205 75 19 15} down_box DOWN_BOX align 8
}
Fl_Check_Button chkUSEMEMMAP {
label Memmap
callback {if(o->value() == 1){
chkUSEHAMLIB->value(0);
chkUSERIGCAT->value(0);
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
btnPTT[2]->activate();
} else {
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
}
btnPTT[0]->value(1);}
xywh {205 56 19 15} down_box DOWN_BOX align 8
}
Fl_Box cboHamlibRig {
label {Rig:}
xywh {230 101 160 22} box DOWN_BOX color 7 align 4
code0 {\#include "combo.h"}
class Fl_ComboBox
}
Fl_Input inpRIGdev {
label {Device:}
xywh {269 126 120 22}
}
Fl_Choice mnuBaudRate {
label {Baud Rate:} open
xywh {288 153 100 22} down_box BORDER_BOX
code0 {o->add(szBaudRates);}
} {}
Fl_Check_Button chkUSERIGCAT {
label RigCAT
callback {if (o->value() == 1) {
chkUSEHAMLIB->value(0);
chkUSEMEMMAP->value(0);
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
btnPTT[3]->activate();
} else {
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
}
btnPTT[0]->value(1);}
xywh {305 56 19 15} down_box DOWN_BOX align 8
}
}
Fl_Button btnInit_Interface {
label Initialize
callback {progdefaults.initInterface();}
xywh {308 185 80 24}
}
}
Fl_Group {} {
label QRZ
xywh {0 25 400 195} hide
} {
Fl_Check_Button btnQRZnotavailable {
label {QRZ not available}
callback {if (o->value() == 1) {
btnQRZcdrom->value(0);
btnQRZsocket->value(0);
progdefaults.QRZ = 0;
}}
xywh {31 50 200 20} down_box DOWN_BOX value 1
code0 {if (progdefaults.QRZ == 0) o->value(1); else o->value(0);}
}
Fl_Check_Button btnQRZsocket {
label {QRZ internet connection}
callback {if (o->value() == 1) {
btnQRZcdrom->value(0);
btnQRZnotavailable->value(0);
progdefaults.QRZ = 1;
}}
xywh {32 103 200 20} down_box DOWN_BOX
code0 {if (progdefaults.QRZ == 1) o->value(1); else o->value(0);}
}
Fl_Check_Button btnQRZcdrom {
label {QRZ cdrom}
callback {if (o->value() == 1) {
btnQRZsocket->value(0);
btnQRZnotavailable->value(0);
progdefaults.QRZ = 2;
}}
xywh {31 76 200 20} down_box DOWN_BOX
code0 {if (progdefaults.QRZ == 2) o->value(1); else o->value(0);}
}
}
Fl_Group tabSoundCard {
label SndCrd
xywh {0 25 400 195} hide
} {
Fl_Group {} {
label {Sound Card Settings} open
xywh {5 35 390 180} box ENGRAVED_FRAME align 21
} {
Fl_Input inpSCdevice {
label {SC dev:}
xywh {262 65 121 24}
code0 {o->value("/dev/dsp");}
}
Fl_Spinner cntRxRateCorr {
label {RX rate corr:}
xywh {103 65 65 24}
code0 {o->step(1);}
code1 {o->minimum(-5000);}
code2 {o->maximum(5000);}
}
Fl_Spinner cntTxRateCorr {
label {TX rate corr:}
xywh {103 101 65 24}
code0 {o->step(1);}
code1 {o->minimum(-5000);}
code2 {o->maximum(5000);}
}
Fl_Box {} {
label ppm
xywh {171 67 30 22}
}
Fl_Box {} {
label ppm
xywh {171 101 30 22}
}
Fl_Button btnSoundCardReset {
label Reset
callback {resetSoundCard();}
xywh {320 175 59 25}
}
Fl_Check_Button btnsendid {
label {Transmit Mode Identifier}
callback {progdefaults.sendid=o->value();}
xywh {35 150 70 15} down_box DOWN_BOX
}
}
}
Fl_Group {} {
label Misc
xywh {0 25 400 195} hide
} {
Fl_Group {} {
label {Sweet Spot} open
xywh {5 30 390 90} box ENGRAVED_FRAME align 21
} {
Fl_Value_Input valCWsweetspot {
label CW
callback {progdefaults.CWsweetspot=o->value();}
xywh {50 59 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.CWsweetspot);}
}
Fl_Value_Input valRTTYsweetspot {
label RTTY
callback {progdefaults.RTTYsweetspot=o->value();}
xywh {182 59 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.RTTYsweetspot);}
}
Fl_Value_Input valPSKsweetspot {
label {PSK etal}
callback {progdefaults.PSKsweetspot=o->value();}
xywh {315 59 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.PSKsweetspot);}
}
Fl_Check_Button btnStartAtSweetSpot {
label {Start New Modem at Sweet Spot}
callback {progdefaults.StartAtSweetSpot = o->value();}
xywh {49 88 246 25} down_box DOWN_BOX value 1
code0 {o->value(progdefaults.StartAtSweetSpot);}
}
}
}
Fl_Group tabModems {
label Modems
xywh {0 25 401 195}
} {
Fl_Tabs tabsModems {open
xywh {0 25 401 195} color 50 selection_color 10 align 9
} {
Fl_Group tabCW {
label CW
xywh {0 50 400 170}
} {
Fl_Group {} {open
xywh {5 60 390 85} box ENGRAVED_FRAME
} {
Fl_Light_Button btnCWrcvTrack {
label Track
callback {active_modem->set_cwTrack(btnCWrcvTrack->value());}
xywh {324 68 60 20} value 1
}
Fl_Progress prgsCWrcvWPM {
xywh {101 68 217 20} color 8 selection_color 110 align 0
}
Fl_Value_Slider sldrCWxmtWPM {
label TxWPM
callback {active_modem->set_cwXmtWPM(sldrCWxmtWPM->value());}
xywh {65 90 254 20} type {Horz Knob} color 17 align 4 minimum 1 maximum 200 step 1 value 20 textsize 14
}
Fl_Value_Output valCWrcvWPM {
label RxWPM
xywh {65 68 36 20} color 7
}
Fl_Value_Slider sldrCWbandwidth {
label BW
callback {if (active_modem->get_mode() == MODE_CW)
active_modem->set_bandwidth(sldrCWbandwidth->value());}
xywh {65 116 254 20} type {Horz Knob} color 23 align 4 minimum 10 maximum 500 step 10 value 150 textsize 14
}
Fl_Counter cntCWweight {
label {Wt (%)}
callback {progdefaults.CWweight=(int)o->value();}
xywh {328 115 56 20} type Simple align 1 minimum 25 maximum 75 step 1 value 50
code0 {o->value(progdefaults.CWweight);}
}
}
Fl_Group {} {
label {CW Keyline Use} open
xywh {5 145 216 70} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnUseCWkeylineDTR {
label {CW-DTR}
callback {progdefaults.useCWkeylineDTR=o->value();
if (o->value() == 1) {
btnUseCWkeylineRTS->value(0);
progdefaults.useCWkeylineRTS = 0;
}}
xywh {110 161 80 24} down_box DOWN_BOX
code0 {o->value(progdefaults.useCWkeylineDTR);}
}
Fl_Check_Button btnUseCWkeylineRTS {
label {CW-RTS}
callback {progdefaults.useCWkeylineRTS=o->value();
if (o->value() == 1) {
btnUseCWkeylineDTR->value(0);
progdefaults.useCWkeylineDTR = 0;
}} selected
xywh {20 161 80 24} down_box DOWN_BOX
code0 {o->value(progdefaults.useCWkeylineRTS);}
}
Fl_Box {} {
label {Caution: for WPM < 40 only}
xywh {10 186 205 20}
}
}
Fl_Group {} {open
xywh {220 145 175 70} box ENGRAVED_FRAME
} {
Fl_Input txtCWFSKport {
label {Port:}
callback {progdefaults.CWFSKport = o->value();}
xywh {270 151 75 24} when 1
code0 {o->value(progdefaults.CWFSKport.c_str());}
}
Fl_Button btnInitCWFSKport {
label {Init Port}
callback {if (KeyLine) {
KeyLine->closeIO();
KeyLine->openIO();
}}
xywh {270 183 77 25}
code0 {\#include "modeIO.h"}
}
}
}
Fl_Group tabDomEX {
label DomEX
xywh {0 50 401 170} hide
} {
Fl_Input txtSecondary {
label {Secondary Text}
xywh {20 75 360 44} type Multiline align 5
}
Fl_Button btnRestartDomEX {
label Restart
callback {progdefaults.storeDefaults();
resetDOMEX();}
xywh {300 172 79 28}
}
Fl_Counter valDominoEX_BW {
label {BW factor:}
callback {progdefaults.DOMINOEX_BW=o->value();}
xywh {25 134 63 21} type Simple minimum 1 maximum 2 step 0.1 value 1
code0 {o->value(progdefaults.DOMINOEX_BW);}
}
}
Fl_Group tabFeld {
label Feld
xywh {0 50 400 170} hide
} {
Fl_Choice selHellFont {
label {Feld Hell Font:}
callback {progdefaults.feldfontnbr=o->value();} open
xywh {175 62 122 20} down_box BORDER_BOX labelfont 4 textfont 4
code0 {\#include "fontdef.h"}
code1 {o->add(szFeldFonts);}
code2 {o->value(progdefaults.feldfontnbr);}
} {}
Fl_Value_Slider sldrHellBW {
label {Filter BW}
callback {if (active_modem->get_mode() == MODE_FELDHELL)
active_modem->set_bandwidth(sldrHellBW->value());}
xywh {30 190 345 20} type Horizontal color 215 align 5 minimum 50 maximum 600 step 5 value 245 textsize 14
}
Fl_Check_Button btnHellXmtWidth {
label {2x Xmt Width}
xywh {40 93 113 15} down_box DOWN_BOX
}
Fl_Check_Button btnHellRcvWidth {
label {1/2 x Rcv Width}
xywh {40 113 130 15} down_box DOWN_BOX
}
Fl_Check_Button btnBlackboard {
label blackboard
xywh {40 134 100 15} down_box DOWN_BOX
}
Fl_Group {} {
label {Pulse Shape} open
xywh {175 90 195 85} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnHellFastAttack {
label {Fast Attack (2 msec)}
callback {if (o->value() == 1)
btnHellSlowAttack->value(0);
else
btnHellSlowAttack->value(1);}
xywh {185 110 169 15} down_box DOWN_BOX
code0 {o->value(0);}
}
Fl_Check_Button btnHellSlowAttack {
label {Slow Attack (4 msec)}
callback {if (o->value() == 1)
btnHellFastAttack->value(0);
else
btnHellFastAttack->value(1);}
xywh {185 131 70 15} down_box DOWN_BOX value 1
code0 {o->value(1);}
}
}
Fl_Check_Button btnFeldHellIdle {
label {Xmt (.) Idle Char}
callback {progdefaults.FELD_IDLE=o->value();}
xywh {40 155 70 15} down_box DOWN_BOX value 1
code0 {o->value(progdefaults.FELD_IDLE);}
}
}
Fl_Group tabMfsk {
label MFSK
xywh {0 50 400 170} hide
} {
Fl_Check_Button btnTxNBpicture {
label {Narrow Band Picture Mode (fldigi experimental)}
callback {progdefaults.TxNBpicture = o->value();}
xywh {35 75 345 20} down_box DOWN_BOX
code0 {o->value(progdefaults.TxNBpicture);}
}
}
Fl_Group tabOlivia {
label Olivia
xywh {0 50 400 170} hide
} {
Fl_Choice mnuOlivia_Tones {
label {Tones:} open
xywh {90 72 85 20} down_box BORDER_BOX
code0 {o->add(szOliviaTones);}
code1 {o->value(2);}
} {}
Fl_Choice mnuOlivia_Bandwidth {
label {Bandwidth:} open
xywh {270 72 85 20} down_box BORDER_BOX
code0 {o->add(szOliviaBandwidth);}
code1 {o->value(2);}
} {}
Fl_Button btnRestartOlivia {
label Restart
callback {progdefaults.storeDefaults();
resetOLIVIA();}
xywh {300 172 79 28}
}
}
Fl_Group tabRTTY {
label RTTY
xywh {0 50 400 170} hide
} {
Fl_Choice selShift {
label {Shift:} open
xywh {58 65 77 24} down_box BORDER_BOX
code0 {o->add(szShifts);}
} {}
Fl_Choice selBaud {
label {Baud:} open
xywh {58 95 77 24} down_box BORDER_BOX
code0 {o->add(szBauds);}
} {}
Fl_Choice selBits {
label {Bits:} open
xywh {179 65 77 24} down_box BORDER_BOX
code0 {o->add(szSelBits);}
} {}
Fl_Choice selParity {
label {Parity:} open
xywh {179 95 77 24} down_box BORDER_BOX
code0 {o->add(szParity);}
} {}
Fl_Choice selStopBits {
label {Stop Bits:} open
xywh {179 122 77 24} down_box BORDER_BOX
code0 {o->add(szStopBits);}
} {}
Fl_Check_Button chkMsbFirst {
label {Send msb first}
xywh {140 151 120 24} down_box DOWN_BOX
}
Fl_Button btnRestartRtty {
label Restart
callback {progdefaults.storeDefaults();
resetRTTY();}
xywh {300 180 79 28}
}
Fl_Check_Button btnCRCRLF {
label {CR-CR-LF}
xywh {16 155 115 15} down_box DOWN_BOX when 6
}
Fl_Check_Button btnAUTOCRLF {
label AutoCRLF
xywh {16 184 125 15} down_box DOWN_BOX
}
Fl_Counter cntrAUTOCRLF {
label {after:}
xywh {142 181 65 20} type Simple align 4 minimum 68 maximum 80 step 1 value 72
}
Fl_Check_Button btnRTTY_USB {
label {RTTY is USB}
callback {progdefaults.RTTY_USB = o->value();}
xywh {272 153 109 20} down_box DOWN_BOX
code0 {o->value(progdefaults.RTTY_USB);}
}
}
}
}
}
Fl_Return_Button btnCloseConfig {
label Close
callback {closeDialog();}
xywh {285 225 100 25}
}
Fl_Button btnSaveConfig {
label {Save Config}
callback {progdefaults.saveDefaults();}
xywh {15 225 100 25}
}
}
}
Function {openConfig()} {open return_type void
} {
code {if (!dlgConfig) dlgConfig = ConfigureDialog();
progdefaults.loadDefaults();} {}
}
Function {closeDialog()} {open return_type void
} {
code {if (dlgConfig) dlgConfig->hide();} {}
}
Function {createConfig()} {open return_type void
} {
code {if (!dlgConfig) dlgConfig = ConfigureDialog();} {}
}

Wyświetl plik

@ -1,756 +0,0 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0107
header_name {.h}
code_name {.cxx}
decl {\#include "main.h"} {}
decl {\#include "globals.h"} {public
}
decl {\#include "modem.h"} {public
}
decl {\#include "configuration.h"} {public
}
decl {Fl_Double_Window *dlgConfig;} {public
}
Function {ConfigureDialog()} {open
} {
code {static char *szShifts = "23|85|160|170|182|200|240|350|425|850";
static char *szBauds = "45|45.45|50|56|75|100|110|150|200|300";
static char *szSelBits = "5 (baudot)|7 (ascii)|8 (ascii)";
static char *szParity = "none|even|odd|zero|one";
static char *szStopBits = "1|1.5|2";
static char *szOliviaTones = "2|4|8|16|32|64|128|256";
static char *szOliviaBandwidth = "125|250|500|1000|2000";
static char *szPreFilters = "None (rect)|Blackman|Hamming|Hanning|Triangular";
static char *szBaudRates = "300|600|1200|2400|4800|9600|19200|38400|57600|115200|230400|460800";} {}
code {} {}
Fl_Window {} {
label {fldigi - config} open
xywh {493 48 400 255} type Double align 80 visible
} {
Fl_Tabs tabsConfigure {open
xywh {0 6 397 217} selection_color 9
} {
Fl_Group tabOperator {
label Oper
xywh {5 30 390 190} hide
} {
Fl_Input inpMyCallsign {
label {Callsign:}
xywh {78 36 85 24}
}
Fl_Input inpMyName {
label {Name:}
xywh {78 62 120 24}
}
Fl_Input inpMyQth {
label {Qth:}
xywh {78 89 312 24}
}
Fl_Input inpMyLocator {
label {Locator:}
xywh {78 116 85 24}
}
Fl_Group {} {
label {Contest Setup} open
xywh {5 145 390 75} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnUseLeadingZeros {
label {Use Leading Zeros}
callback {progdefaults.UseLeadingZeros = o->value();}
xywh {35 175 165 15} down_box DOWN_BOX value 1
}
Fl_Value_Input nbrContestStart {
label {Starting \#:}
callback {progdefaults.ContestStart = (int)o->value();}
xywh {315 155 45 25} minimum 1 maximum 10000 step 1 value 1
}
Fl_Value_Input nbrContestDigits {
label {\# of digits:}
callback {progdefaults.ContestDigits = (int)o->value();}
xywh {315 185 45 25} minimum 1 maximum 5 step 1 value 3
}
}
}
Fl_Group tabWaterfall {
label {W-fall}
xywh {5 30 390 190} hide
} {
Fl_Choice inpPreFilter {
label {FFT Prefilter}
callback {progdefaults.initWFPrefilter(o->value());} open
xywh {55 75 141 25} down_box BORDER_BOX align 5
code0 {o->add(szPreFilters);}
code1 {o->value(0);}
} {}
Fl_Button btnSpectrum {
label Spectrum
callback {fl_color_chooser("Spectrum",
progdefaults.red,
progdefaults.green,
progdefaults.blue);
wf->setcolors();}
xywh {250 75 90 25}
code0 {\#include <FL/Fl_Color_Chooser.H>}
}
Fl_Check_Button btnMultiColorWF {
label {Multi-color}
callback {progdefaults.MultiColorWF = o->value();
wf->setcolors();}
tooltip {Use multi-color waterfall} xywh {250 115 120 20} down_box DOWN_BOX
code1 {o->value(progdefaults.MultiColorWF);}
}
Fl_Check_Button btnUseCursorLines {
label {Use Cursor BW Lines}
callback {progdefaults.UseCursorLines = o->value();}
xywh {55 115 165 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseCursorLines);}
}
Fl_Check_Button btnUseBWTracks {
label {Use BW Tracks}
callback {progdefaults.UseBWTracks = o->value();}
xywh {55 139 140 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseBWTracks);}
}
Fl_Check_Button btnUseCursorCenterLine {
label {Use Cursor Center Line}
callback {progdefaults.UseCursorCenterLine = o->value();}
xywh {55 164 140 20} down_box DOWN_BOX
code0 {o->value(progdefaults.UseCursorCenterLine);}
}
Fl_Check_Button btnViewXmtSignal {
label {View Xmt Signal}
callback {progdefaults.viewXmtSignal=o->value();}
xywh {55 189 133 15} down_box DOWN_BOX
code0 {o->value(progdefaults.viewXmtSignal);}
}
}
Fl_Group tabInterface {
label RigCtl
xywh {5 28 390 190} hide
} {
Fl_Group {} {
label Ptt open
xywh {10 36 185 179} box ENGRAVED_FRAME align 21
} {
Fl_Round_Button {btnPTT[0]} {
label none
callback {btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {25 57 64 15} down_box DIAMOND_DOWN_BOX value 1 selection_color 1
}
Fl_Round_Button {btnPTT[1]} {
label Hamlib
callback {btnPTT[0]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {107 58 67 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Round_Button {btnPTT[2]} {
label Memmap
callback {btnPTT[1]->value(0);
btnPTT[0]->value(0);
btnPTT[3]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {25 78 85 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Round_Button {btnPTT[3]} {
label RigCAT
callback {btnPTT[0]->value(0);
btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[4]->value(0);
o->value(1);}
xywh {107 79 85 15} down_box DIAMOND_DOWN_BOX selection_color 1 deactivate
}
Fl_Group {} {open
xywh {12 100 180 88} box ENGRAVED_FRAME align 21
} {
Fl_Round_Button {btnPTT[4]} {
label TTY
callback {btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
btnPTT[0]->value(0);
o->value(1);}
xywh {17 108 52 14} down_box DIAMOND_DOWN_BOX selection_color 1
}
Fl_Input inpTTYdev {
xywh {66 105 120 22}
}
Fl_Round_Button {btnRTSDTR[0]} {
label RTS
callback {btnRTSDTR[1]->value(0);
btnRTSDTR[2]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {36 144 64 15} down_box DOWN_BOX value 1
}
Fl_Round_Button {btnRTSDTR[1]} {
label DTR
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[2]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {36 169 64 15} down_box DOWN_BOX
}
Fl_Round_Button {btnRTSDTR[2]} {
label BOTH
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[1]->value(0);
btnRTSDTR[3]->value(0);
o->value(1);}
xywh {98 144 64 15} down_box DOWN_BOX
}
Fl_Round_Button {btnRTSDTR[3]} {
label {DTR=+V}
callback {btnRTSDTR[0]->value(0);
btnRTSDTR[1]->value(0);
btnRTSDTR[2]->value(0);
o->value(1);}
xywh {98 169 64 15} down_box DOWN_BOX
}
}
Fl_Check_Button chkPTT_reverse {
label {PTT reverse}
xywh {37 193 110 15} down_box DOWN_BOX
}
}
Fl_Group {} {
label {Rig Control} open
xywh {195 36 200 151} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button chkUSEHAMLIB {
label Hamlib
callback {if (o->value() == 1) {
chkUSEMEMMAP->value(0);
chkUSERIGCAT->value(0);
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
btnPTT[1]->activate();
} else {
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
}
btnPTT[0]->value(1);}
xywh {205 80 19 15} down_box DOWN_BOX align 8
}
Fl_Check_Button chkUSEMEMMAP {
label Memmap
callback {if(o->value() == 1){
chkUSEHAMLIB->value(0);
chkUSERIGCAT->value(0);
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
btnPTT[2]->activate();
} else {
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
}
btnPTT[0]->value(1);}
xywh {205 61 19 15} down_box DOWN_BOX align 8
}
Fl_Box cboHamlibRig {
label {Rig:}
xywh {230 106 160 22} box DOWN_BOX color 7 align 4
code0 {\#include "combo.h"}
class Fl_ComboBox
}
Fl_Input inpRIGdev {
label {Device:}
xywh {269 131 120 22}
}
Fl_Choice mnuBaudRate {
label {Baud Rate:} open
xywh {288 158 100 22} down_box BORDER_BOX
code0 {o->add(szBaudRates);}
} {}
Fl_Check_Button chkUSERIGCAT {
label RigCAT
callback {if (o->value() == 1) {
chkUSEHAMLIB->value(0);
chkUSEMEMMAP->value(0);
btnPTT[1]->value(0);
btnPTT[1]->deactivate();
btnPTT[2]->value(0);
btnPTT[2]->deactivate();
btnPTT[3]->activate();
} else {
btnPTT[3]->value(0);
btnPTT[3]->deactivate();
}
btnPTT[0]->value(1);}
xywh {305 61 19 15} down_box DOWN_BOX align 8
}
}
Fl_Button btnInit_Interface {
label Initialize
callback {progdefaults.initInterface();}
xywh {308 190 80 24}
}
}
Fl_Group {} {
label QRZ open
xywh {5 29 390 190} hide
} {
Fl_Check_Button btnQRZnotavailable {
label {QRZ not available}
callback {if (o->value() == 1) {
btnQRZcdrom->value(0);
btnQRZsocket->value(0);
progdefaults.QRZ = 0;
}}
xywh {31 50 200 20} down_box DOWN_BOX value 1
code0 {if (progdefaults.QRZ == 0) o->value(1); else o->value(0);}
}
Fl_Check_Button btnQRZsocket {
label {QRZ internet connection}
callback {if (o->value() == 1) {
btnQRZcdrom->value(0);
btnQRZnotavailable->value(0);
progdefaults.QRZ = 1;
}}
xywh {32 103 200 20} down_box DOWN_BOX
code0 {if (progdefaults.QRZ == 1) o->value(1); else o->value(0);}
}
Fl_Check_Button btnQRZcdrom {
label {QRZ cdrom}
callback {if (o->value() == 1) {
btnQRZsocket->value(0);
btnQRZnotavailable->value(0);
progdefaults.QRZ = 2;
}}
xywh {31 76 200 20} down_box DOWN_BOX
code0 {if (progdefaults.QRZ == 2) o->value(1); else o->value(0);}
}
}
Fl_Group tabSoundCard {
label SndCrd
xywh {5 28 392 190} hide
} {
Fl_Group {} {
label {Sound Card Settings} open
xywh {5 35 385 95} box ENGRAVED_FRAME align 21
} {
Fl_Input inpSCdevice {
label {SC dev:}
xywh {262 61 121 24}
code0 {o->value("/dev/dsp");}
}
Fl_Spinner cntRxRateCorr {
label {RX rate corr:}
xywh {103 61 65 24}
code0 {o->step(1);}
code1 {o->minimum(-5000);}
code2 {o->maximum(5000);}
}
Fl_Spinner cntTxRateCorr {
label {TX rate corr:}
xywh {103 91 65 24}
code0 {o->step(1);}
code1 {o->minimum(-5000);}
code2 {o->maximum(5000);}
}
Fl_Box {} {
label ppm
xywh {171 59 30 22}
}
Fl_Box {} {
label ppm
xywh {171 93 30 22}
}
Fl_Button btnSoundCardReset {
label Reset
callback {resetSoundCard();}
xywh {310 95 59 25}
}
}
Fl_Group {} {
label {Multi-tone Identifier} open
xywh {5 135 385 80} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnsendid {
label {Transmit Mode Identifier}
callback {progdefaults.sendid=o->value();}
xywh {30 168 70 15} down_box DOWN_BOX
}
}
}
Fl_Group tabModems {
label Modems open
xywh {0 28 395 195}
} {
Fl_Tabs tabsModems {open
xywh {0 28 395 192} color 50 selection_color 10 align 9
} {
Fl_Group tabCW {
label CW
xywh {5 50 385 170} hide
} {
Fl_Light_Button btnCWrcvTrack {
label Track
callback {active_modem->set_cwTrack(btnCWrcvTrack->value());}
xywh {306 91 60 20} value 1
}
Fl_Progress prgsCWrcvWPM {
label WPM
xywh {86 91 217 20} color 8 selection_color 110 align 1
}
Fl_Value_Slider sldrCWxmtWPM {
label Xmt
callback {active_modem->set_cwXmtWPM(sldrCWxmtWPM->value());}
xywh {50 113 254 20} type {Horz Knob} color 17 align 4 minimum 1 maximum 200 step 1 value 20 textsize 14
}
Fl_Value_Output valCWrcvWPM {
label Rcv
xywh {50 91 36 20} color 7
}
Fl_Value_Slider sldrCWbandwidth {
label BW
callback {if (active_modem->get_mode() == MODE_CW)
active_modem->set_bandwidth(sldrCWbandwidth->value());}
xywh {50 135 254 20} type {Horz Knob} color 23 align 4 minimum 10 maximum 500 step 10 value 150 textsize 14
}
Fl_Counter cntCWweight {
label {Weight (%)}
callback {progdefaults.CWweight=(int)o->value();}
xywh {50 160 56 20} type Simple align 8 minimum 25 maximum 75 step 1 value 50
code0 {o->value(progdefaults.CWweight);}
}
}
Fl_Group tabDomEX {
label DomEX
xywh {10 50 380 160} hide
} {
Fl_Input txtSecondary {
label {Secondary Text}
xywh {20 75 360 44} type Multiline align 5
}
Fl_Button btnRestartDomEX {
label Restart
callback {progdefaults.storeDefaults();
resetDOMEX();}
xywh {300 172 79 28}
}
Fl_Counter valDominoEX_BW {
label {BW factor:}
callback {progdefaults.DOMINOEX_BW=o->value();}
xywh {25 134 63 21} type Simple minimum 1 maximum 2 step 0.1 value 1
code0 {o->value(progdefaults.DOMINOEX_BW);}
}
}
Fl_Group tabFeld {
label Feld
xywh {5 50 385 160} hide
} {
Fl_Choice selHellFont {
label {Feld Hell Font:}
callback {progdefaults.feldfontnbr=o->value();} open
xywh {175 62 122 20} down_box BORDER_BOX labelfont 4 textfont 4
code0 {\#include "fontdef.h"}
code1 {o->add(szFeldFonts);}
code2 {o->value(progdefaults.feldfontnbr);}
} {}
Fl_Value_Slider sldrHellBW {
label {Filter BW}
callback {if (active_modem->get_mode() == MODE_FELDHELL)
active_modem->set_bandwidth(sldrHellBW->value());}
xywh {30 190 345 20} type Horizontal color 215 align 5 minimum 50 maximum 600 step 5 value 245 textsize 14
}
Fl_Check_Button btnHellXmtWidth {
label {2x Xmt Width}
xywh {40 93 113 15} down_box DOWN_BOX
}
Fl_Check_Button btnHellRcvWidth {
label {1/2 x Rcv Width}
xywh {40 113 130 15} down_box DOWN_BOX
}
Fl_Check_Button btnBlackboard {
label blackboard
xywh {40 134 100 15} down_box DOWN_BOX
}
Fl_Group {} {
label {Pulse Shape} open
xywh {175 90 195 85} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnHellFastAttack {
label {Fast Attack (2 msec)}
callback {if (o->value() == 1)
btnHellSlowAttack->value(0);
else
btnHellSlowAttack->value(1);}
xywh {185 110 169 15} down_box DOWN_BOX
code0 {o->value(0);}
}
Fl_Check_Button btnHellSlowAttack {
label {Slow Attack (4 msec)}
callback {if (o->value() == 1)
btnHellFastAttack->value(0);
else
btnHellFastAttack->value(1);}
xywh {185 131 70 15} down_box DOWN_BOX value 1
code0 {o->value(1);}
}
}
Fl_Check_Button btnFeldHellIdle {
label {Xmt (.) Idle Char}
callback {progdefaults.FELD_IDLE=o->value();}
xywh {40 155 70 15} down_box DOWN_BOX value 1
code0 {o->value(progdefaults.FELD_IDLE);}
}
}
Fl_Group tabMfsk {
label MFSK open
xywh {10 50 380 160} hide
} {
Fl_Check_Button btnTxNBpicture {
label {Narrow Band Picture Mode (fldigi experimental)}
callback {progdefaults.TxNBpicture = o->value();}
xywh {35 75 345 20} down_box DOWN_BOX
code0 {o->value(progdefaults.TxNBpicture);}
}
}
Fl_Group tabOlivia {
label Olivia open
xywh {10 50 381 160} hide
} {
Fl_Choice mnuOlivia_Tones {
label {Tones:} open
xywh {90 72 85 20} down_box BORDER_BOX
code0 {o->add(szOliviaTones);}
code1 {o->value(2);}
} {}
Fl_Choice mnuOlivia_Bandwidth {
label {Bandwidth:} open
xywh {270 72 85 20} down_box BORDER_BOX
code0 {o->add(szOliviaBandwidth);}
code1 {o->value(2);}
} {}
Fl_Button btnRestartOlivia {
label Restart
callback {progdefaults.storeDefaults();
resetOLIVIA();}
xywh {300 172 79 28}
}
}
Fl_Group tabRTTY {
label RTTY open
xywh {10 50 381 160} hide
} {
Fl_Choice selShift {
label {Shift:} open
xywh {58 65 77 24} down_box BORDER_BOX
code0 {o->add(szShifts);}
} {}
Fl_Choice selBaud {
label {Baud:} open
xywh {58 95 77 24} down_box BORDER_BOX
code0 {o->add(szBauds);}
} {}
Fl_Choice selBits {
label {Bits:} open
xywh {179 65 77 24} down_box BORDER_BOX
code0 {o->add(szSelBits);}
} {}
Fl_Choice selParity {
label {Parity:} open
xywh {179 95 77 24} down_box BORDER_BOX
code0 {o->add(szParity);}
} {}
Fl_Choice selStopBits {
label {Stop Bits:} open
xywh {179 122 77 24} down_box BORDER_BOX
code0 {o->add(szStopBits);}
} {}
Fl_Check_Button chkMsbFirst {
label {Send msb first}
xywh {140 151 120 24} down_box DOWN_BOX
}
Fl_Button btnRestartRtty {
label Restart
callback {progdefaults.storeDefaults();
resetRTTY();}
xywh {300 180 79 28}
}
Fl_Check_Button btnCRCRLF {
label {CR-CR-LF}
xywh {16 155 115 15} down_box DOWN_BOX when 6
}
Fl_Check_Button btnAUTOCRLF {
label AutoCRLF
xywh {16 184 125 15} down_box DOWN_BOX
}
Fl_Counter cntrAUTOCRLF {
label {after:}
xywh {142 181 65 20} type Simple align 4 minimum 68 maximum 80 step 1 value 72
}
Fl_Check_Button btnRTTY_USB {
label {RTTY is USB}
callback {progdefaults.RTTY_USB = o->value();}
xywh {272 153 109 20} down_box DOWN_BOX
code0 {o->value(progdefaults.RTTY_USB);}
}
}
Fl_Group {} {
label Misc open
xywh {10 50 381 166}
} {
Fl_Group {} {
label {Sweet Spot} open
xywh {15 56 370 49} box ENGRAVED_FRAME align 21
} {
Fl_Value_Input valCWsweetspot {
label CW
callback {progdefaults.CWsweetspot=o->value();}
xywh {50 76 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.CWsweetspot);}
}
Fl_Value_Input valRTTYsweetspot {
label RTTY
callback {progdefaults.RTTYsweetspot=o->value();}
xywh {182 76 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.RTTYsweetspot);}
}
Fl_Value_Input valPSKsweetspot {
label {PSK etal}
callback {progdefaults.PSKsweetspot=o->value();}
xywh {315 76 65 20} minimum 200 maximum 4000 step 1 value 1000
code0 {o->value(progdefaults.PSKsweetspot);}
}
}
Fl_Group {} {
label {FSK/CW keylines} open
xywh {15 104 370 112} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnUseCWkeylineDTR {
label {CW-DTR}
callback {progdefaults.useCWkeylineDTR=o->value();
if (o->value() == 1) {
btnUseCWkeyline->value(0);
progdefaults.useCWkeyline = 0;
btnUseFSKkeylineDTR->value(0);
progdefaults.useFSKkeylineDTR = 0;
}}
xywh {110 183 80 22} down_box DOWN_BOX
code0 {o->value(progdefaults.useCWkeyline);}
}
Fl_Check_Button btnUseFSKkeyline {
label {FSK-RTS}
callback {progdefaults.useFSKkeyline=o->value();
if (o->value() == 1) {
btnUseFSKkeylineDTR->value(0);
progdefaults.useFSKkeylineDTR = 0;
btnUseCWkeyline->value(0);
progdefaults.useCWkeyline = 0;
btnUSE_UART->value(0);
progdefaults.useUART = 0;
}}
xywh {29 156 80 22} down_box DOWN_BOX
code0 {o->value(progdefaults.useFSKkeyline);}
}
Fl_Check_Button btnFSKisLSB {
label {FSK - LSB}
callback {progdefaults.FSKisLSB=o->value();}
xywh {285 156 80 22} down_box DOWN_BOX value 1
code0 {o->value(progdefaults.FSKisLSB);}
}
Fl_Input txtCWFSKport {
label {Port:}
callback {progdefaults.CWFSKport = o->value();}
xywh {60 129 121 22} when 1
code0 {o->value(progdefaults.CWFSKport.c_str());}
}
Fl_Button btnInitCWFSKport {
label {Init Port}
callback {if (KeyLine) {
KeyLine->closeIO();
KeyLine->openIO();
}}
xywh {289 127 77 25}
code0 {\#include "modeIO.h"}
}
Fl_Check_Button btnUSE_UART {
label {FSK- TxD}
callback {progdefaults.useUART=o->value();
if (o->value() == 1) {
btnUseFSKkeyline->value(0);
progdefaults.useFSKkeyline = 0;
btnUseCWkeylineDTR->value(0);
progdefaults.useCWkeylineDTR = 0;
}} selected
xywh {195 156 80 22} down_box DOWN_BOX
code0 {o->value(progdefaults.useUART);}
}
Fl_Check_Button btnUseCWkeyline {
label {CW-RTS}
callback {progdefaults.useCWkeyline=o->value();
if (o->value() == 1) {
btnUseCWkeylineDTR->value(0);
progdefaults.useCWkeylineDTR = 0;
btnUseFSKkeyline->value(0);
progdefaults.useFSKkeyline = 0;
}}
xywh {29 183 80 22} down_box DOWN_BOX
code0 {o->value(progdefaults.useCWkeyline);}
}
Fl_Check_Button btnUseFSKkeylineDTR {
label {FSK-DTR}
callback {progdefaults.useFSKkeylineDTR=o->value();
if (o->value() == 1) {
btnUseFSKkeyline->value(0);
progdefaults.useFSKkeyline = 0;
btnUseCWkeylineDTR->value(0);
progdefaults.useCWkeylineDTR = 0;
btnUSE_UART->value(0);
progdefaults.useUART = 0;
}}
xywh {110 156 80 22} down_box DOWN_BOX
code0 {o->value(progdefaults.useFSKkeylineDTR);}
}
}
}
}
}
}
Fl_Return_Button btnCloseConfig {
label Close
callback {closeDialog();}
xywh {285 226 100 24}
}
Fl_Button btnSaveConfig {
label {Save Config}
callback {progdefaults.saveDefaults();}
xywh {15 226 100 24}
}
}
}
Function {openConfig()} {open return_type void
} {
code {if (!dlgConfig) dlgConfig = ConfigureDialog();
progdefaults.loadDefaults();} {}
}
Function {closeDialog()} {open return_type void
} {
code {if (dlgConfig) dlgConfig->hide();} {}
}
Function {createConfig()} {open return_type void
} {
code {if (!dlgConfig) dlgConfig = ConfigureDialog();} {}
}

Wyświetl plik

@ -58,7 +58,8 @@ extern Fl_Check_Button *btnQRZnotavailable;
extern Fl_Check_Button *btnQRZsocket;
extern Fl_Check_Button *btnQRZcdrom;
extern Fl_Group *tabSoundCard;
extern Fl_Round_Button *btnDsp[2];
extern Fl_Tabs *tabsSoundCard;
extern Fl_Group *tabMixer;
#include <FL/Fl_Light_Button.H>
extern void setMixerInput(int);
extern Fl_Light_Button *btnLineIn;
@ -66,10 +67,19 @@ extern Fl_Light_Button *btnMicIn;
#include <FL/Fl_Value_Slider.H>
extern void setPCMvolume(double);
extern Fl_Value_Slider *valPCMvolume;
#include <FL/Fl_Input_Choice.H>
extern Fl_Input_Choice *menuMix;
extern void resetMixerControls();
extern Fl_Check_Button *btnMixer;
extern Fl_Group *tabAudio;
#include <FL/Fl_Spinner.H>
extern Fl_Spinner *cntRxRateCorr;
extern Fl_Spinner *cntTxRateCorr;
extern Fl_Spinner *cntTxOffset;
extern Fl_Group *AudioIO;
extern Fl_Round_Button *btnAudioIO[2];
extern Fl_Input_Choice *menuOSSDev;
extern Fl_Input_Choice *menuPADev;
extern Fl_Value_Input *valCWsweetspot;
extern Fl_Value_Input *valRTTYsweetspot;
extern Fl_Value_Input *valPSKsweetspot;

Wyświetl plik

@ -107,7 +107,10 @@ struct configuration {
string PTTdev;
string secText;
// Sound card
int btnAudioIOis;
string SCdevice;
string OSSdevice;
string PAdevice;
int RX_corr;
int TX_corr;
int TxOffset;
@ -121,6 +124,7 @@ struct configuration {
int timeout;
// Mixer configuration
string MXdevice;
double RcvMixer;
double XmtMixer;
bool MicIn;

Wyświetl plik

@ -40,7 +40,6 @@
#include <FL/Fl_Tile.H>
#include "combo.h"
#include "TextView.h"
#include "raster.h"
#include "waterfall.h"
@ -116,7 +115,7 @@ extern void put_echo_char(unsigned int data);
extern void resetRTTY();
extern void resetOLIVIA();
extern void resetDOMEX();
extern void resetSoundCard(int);
extern void resetSoundCard();
extern void restoreFocus();
extern void setReverse(int);
extern void clearQSO();

Wyświetl plik

@ -7,6 +7,8 @@
#include <stdio.h>
#include <sys/time.h>
#include <string>
#include <sstream>
#include <glob.h>
#include <FL/Fl_Double_Window.H>
#include <FL/filename.H>
@ -21,7 +23,6 @@
#include "rigclass.h"
#endif
extern Fl_Mutex trx_mutex;
extern Fl_Cond trx_cond;
extern Fl_Thread trx_thread;
@ -31,7 +32,6 @@ extern string HomeDir;
extern string PskMailDir;
extern string xmlfname;
extern bool gmfskmail;
extern bool testmenu;
extern std::string scDevice;
extern PTT *push2talk;

Wyświetl plik

@ -15,9 +15,13 @@
#include <sys/soundcard.h>
#include <math.h>
#include <iostream>
#include <fstream>
#include <string>
#include <fstream.h>
#include <iostream.h>
#ifdef PORTAUDIO
#include <portaudiocpp/PortAudioCpp.hxx>
#endif
#include "samplerate/samplerate.h"
@ -29,7 +33,7 @@
#define SND_BUF_LEN 65536
//#define SRC_BUF_LEN (8*SND_BUF_LEN)
using namespace std;
#define powerof2(n) ((((n) - 1) & (n)) == 0)
class SndException {
public:
@ -48,6 +52,44 @@ public:
class cSound {
protected:
int txppm;
int rxppm;
// for interface to the samplerate resampling library
SRC_STATE *tx_src_state;
SRC_DATA *tx_src_data;
SRC_STATE *rx_src_state;
SRC_DATA *rx_src_data;
float *snd_buffer;
float *src_buffer;
bool capture;
bool playback;
bool generate;
ofstream ofGenerate;
ofstream ofCapture;
fstream ifPlayback;
void writeGenerate(double *buff, int count);
void writeCapture(double *buff, int count);
int readPlayback(double *buff, int count);
public:
cSound();
virtual ~cSound();
virtual int Open(int mode, int freq = 8000) = 0;
virtual void Close() = 0;
virtual int write_samples(double *, int) = 0;
virtual int write_stereo(double *, double *, int) = 0;
virtual int Read(double *, int) = 0;
void Capture(bool on);
void Playback(bool on);
void Generate(bool on);
};
class cSoundOSS : public cSound {
private:
std::string device;
int device_fd;
@ -57,14 +99,9 @@ private:
int channels;
int play_format;
int sample_frequency;
int txppm;
int rxppm;
int mode;
bool formatok;
bool capture;
bool playback;
bool generate;
unsigned char *cbuff;
void getVersion();
void getCapabilities();
@ -76,33 +113,19 @@ private:
int BufferSize(int);
bool wait_till_finished();
bool reset_device();
// for interface to the samplerate resampling library
SRC_STATE *tx_src_state;
SRC_DATA *tx_src_data;
SRC_STATE *rx_src_state;
SRC_DATA *rx_src_data;
float *snd_buffer;
float *src_buffer;
unsigned char *cbuff;
ofstream ofGenerate;
ofstream ofCapture;
fstream ifPlayback;
void writeGenerate(double *buff, int count);
void writeCapture(double *buff, int count);
int readPlayback(double *buff, int count);
public:
cSound(const char *dev = "/dev/dsp");
~cSound();
int Open(int mode, int freq = 8000, int nchan = 2);
cSoundOSS(const char *dev = "/dev/dsp");
~cSoundOSS();
int Open(int mode, int freq = 8000);
void Close();
int Write(unsigned char *, int);
int write_samples(double *, int);
int write_stereo(double *, double *, int);
int Read(unsigned char *, int);
int Read(double *, int);
private:
int Read(unsigned char *, int);
int Write(unsigned char *, int);
int Fd() { return device_fd; }
int Frequency() { return sample_frequency;};
int Version() {return version;};
@ -111,10 +134,48 @@ public:
int Channels() { return channels;};
int Format() { return play_format;};
bool FormatOK() { return formatok;};
void Capture(bool on);
void Playback(bool on);
void Generate(bool on);
};
#ifdef PORTAUDIO
class cSoundPA : public cSound
{
public:
cSoundPA(const char *dev);
~cSoundPA();
int Open(int mode, int freq = 8000);
void Close();
int write_samples(double *buf, int count);
int write_stereo(double *bufleft, double *bufright, int count);
int Read(double *buf, int count);
private:
void resample(float *buf, int count, int max = 0);
void init_stream(void);
void adjust_stream(void);
double get_best_srate(void);
static unsigned ceil2(unsigned n);
static unsigned floor2(unsigned n);
private:
std::string device;
portaudio::System &sys;
portaudio::BlockingStream stream;
portaudio::DirectionSpecificStreamParameters in_params;
portaudio::DirectionSpecificStreamParameters out_params;
portaudio::StreamParameters stream_params;
unsigned frames_per_buffer;
unsigned max_frames_per_buffer;
double req_sample_rate;
double dev_sample_rate;
float *fbuf;
int open_mode;
static double std_sample_rates[];
};
#endif // PORTAUDIO
#endif

Wyświetl plik

@ -1,6 +1,6 @@
#ifndef _VERSION_H
#define _VERSION_H
#define FLDIGI_VERSION "1.35L"
#define FLDIGI_VERSION "1.35M"
#endif

Wyświetl plik

@ -21,6 +21,9 @@
// Please report all bugs and problems to "w1hkj@w1hkj.com".
//
#include <FL/Fl_Shared_Image.H>
#ifdef PORTAUDIO
#include <portaudiocpp/PortAudioCpp.hxx>
#endif
#include "main.h"
#include "waterfall.h"
#include "fft.h"
@ -56,6 +59,8 @@ string xmlfname;
bool testmenu = false;
bool gmfskmail = false;
PTT *push2talk = (PTT *)0;
#ifndef NOHAMLIB
Rig *xcvr = (Rig *)0;
@ -63,7 +68,6 @@ Rig *xcvr = (Rig *)0;
cLogfile *logfile = 0;;
bool gmfskmail = false;
cLogfile *Maillogfile = (cLogfile *)0;
FILE *server;
FILE *client;
@ -72,6 +76,10 @@ extern void start_pskmail();
int main(int argc, char ** argv) {
if (argc == 2)
if (strcasecmp(argv[1], "TEST") == 0)
testmenu = true;
fl_filename_expand(szHomedir, 119, "$HOME/.fldigi/");
if (fl_filename_isdir(szHomedir) == 0)
HomeDir = "./";
@ -128,11 +136,7 @@ int main(int argc, char ** argv) {
Fl::visual(FL_RGB); // insure 24 bit color operation
fl_register_images();
Fl::set_fonts(0);
if (argc == 2)
if (strcasecmp(argv[1], "TEST") == 0)
testmenu = true;
rigcontrol = createRigDialog();
create_fl_digi_main();
@ -152,7 +156,53 @@ int main(int argc, char ** argv) {
progdefaults.btnRTSDTRis,
progdefaults.btnPTTREVis );
scDevice = progdefaults.SCdevice;
#ifndef PORTAUDIO
scDevice = progdefaults.SCdevice;
#else
if (progdefaults.btnAudioIOis == 0)
scDevice = progdefaults.OSSdevice;
else if (progdefaults.btnAudioIOis == 1)
scDevice = progdefaults.PAdevice;
#endif
glob_t gbuf;
glob("/dev/dsp*", 0, NULL, &gbuf);
for (size_t i = 0; i < gbuf.gl_pathc; i++)
menuOSSDev->add(gbuf.gl_pathv[i]);
#ifdef PORTAUDIO
portaudio::AutoSystem autoSys;
portaudio::System &sys = portaudio::System::instance();
for (portaudio::System::DeviceIterator idev = sys.devicesBegin();
idev != sys.devicesEnd(); ++idev) {
ostringstream o;
string s;
string::size_type i = 0;
o << idev->index();
s += o.str() + '-' + idev->name();
while ((i = s.find('/', i)) != string::npos) {
s.insert(i, 1, '\\');
i += 2;
}
menuPADev->add(s.c_str());
}
btnAudioIO[1]->activate();
#endif
glob("/dev/mixer*", 0, NULL, &gbuf);
for (size_t i = 0; i < gbuf.gl_pathc; i++)
menuMix->add(gbuf.gl_pathv[i]);
globfree(&gbuf);
if (progdefaults.MXdevice == "") {
int n = 0;
progdefaults.MXdevice = "/dev/mixer";
if (sscanf(progdefaults.SCdevice.c_str(), "/dev/dsp%d", &n) == 1)
progdefaults.MXdevice += n;
menuMix->value(progdefaults.MXdevice.c_str());
}
resetMixerControls();
trx_start(scDevice.c_str());
progdefaults.initInterface();

Wyświetl plik

@ -110,7 +110,10 @@ configuration progdefaults = {
"/dev/ttyS0", // PTTdev
"fldigi ", // secondary text
// Sound card
0, // int btnAudioIOis
"/dev/dsp", // string SCdevice;
"/dev/dsp", // string OSSdevice;
"0-/dev/dsp", // string PAdevice;
0, // int RX_corr;
0, // int TX_corr;
0, // int TxOffset;
@ -123,6 +126,7 @@ configuration progdefaults = {
0, // int macronumber;
0, // int timeout;
"", // string MXdevice
0.8, // double RcvMixer;
0.6, // double XmtMixer;
false, // bool MicIn;
@ -270,7 +274,10 @@ void configuration::writeDefaultsXML()
writeXMLstr(f, "PTTDEV", PTTdev);
writeXMLstr(f, "SECONDARYTEXT", secText);
writeXMLint(f, "AUDIOIO", btnAudioIOis);
writeXMLstr(f, "SCDEVICE", SCdevice);
writeXMLstr(f, "OSSDEVICE", OSSdevice);
writeXMLstr(f, "PADEVICE", PAdevice);
writeXMLint(f, "RXCORR", RX_corr);
writeXMLint(f, "TXCORR", TX_corr);
writeXMLint(f, "TXOFFSET", TxOffset);
@ -280,6 +287,7 @@ void configuration::writeDefaultsXML()
writeXMLbool(f, "USETIMER", useTimer);
writeXMLint(f, "MACRONUMBER", macronumber);
writeXMLint(f, "TIMEOUT", timeout);
writeXMLstr(f, "MXDEVICE", MXdevice);
writeXMLdbl(f, "RCVMIXER", RcvMixer);
writeXMLdbl(f, "XMTMIXER", XmtMixer);
writeXMLdbl(f, "PCMVOLUME", PCMvolume);
@ -409,6 +417,10 @@ void configuration::writeDefaults(ofstream &f)
f << PseudoFSK << endl;
f << PSKmailSweetSpot << endl;
f << TxOffset << endl;
f << MXdevice << endl;
f << btnAudioIOis << endl;
f << OSSdevice << endl;
f << PAdevice << endl;
}
void configuration::readDefaults(ifstream &f)
@ -522,6 +534,10 @@ void configuration::readDefaults(ifstream &f)
f >> PseudoFSK;
f >> PSKmailSweetSpot;
f >> TxOffset;
f >> MXdevice;
f >> btnAudioIOis;
f >> OSSdevice;
f >> PAdevice;
}
void configuration::loadDefaults() {
@ -766,28 +782,30 @@ int configuration::openDefaults() {
valRcvMixer->value(RcvMixer);
valXmtMixer->value(XmtMixer);
valPCMvolume->value(PCMvolume);
// btnEnableMixer->value(EnableMixer);
btnLineIn->value(0);
btnMicIn->value(0);
if (MicIn == true)
btnMicIn->value(1);
if (LineIn == true)
btnLineIn->value(1);
btnDsp[0]->value(0);
btnDsp[1]->value(0);
if (SCdevice == "/dev/dsp") {
btnDsp[0]->value(1);
} else if (SCdevice == "/dev/dsp1") {
btnDsp[1]->value(1);
}
btnMicIn->value(MicIn);
btnLineIn->value(LineIn);
btnAudioIO[0]->value(0);
btnAudioIO[0]->value(0);
btnAudioIO[btnAudioIOis]->value(1);
menuOSSDev->value(OSSdevice.c_str());
menuPADev->value(PAdevice.c_str());
if (btnAudioIOis == 1)
menuPADev->activate();
btnMixer->value(EnableMixer);
resetMixerControls();
menuMix->value(MXdevice.c_str());
cntRxRateCorr->value(RX_corr);
cntTxRateCorr->value(TX_corr);
cntTxOffset->value(TxOffset);
Fl::unlock();
enableMixer(true);//EnableMixer);
enableMixer(EnableMixer);
ReceiveText->setFont((Fl_Font)Font);
ReceiveText->setFontSize(FontSize);

Wyświetl plik

@ -123,8 +123,7 @@ void status::initLastState()
else
active_modem->set_freq(progdefaults.PSKsweetspot);
//std::cout << ReceiveText->h() << std::endl;
//std::cout << RxTextHeight << std::endl;
fl_digi_main->resize(mainX, mainY, mainW, mainH);
int X, Y, W, H, Yx, Hx;
X = ReceiveText->x();
@ -138,8 +137,6 @@ void status::initLastState()
FHdisp->resize(X,Y,W,RxTextHeight);
TransmitText->resize(X, Y + RxTextHeight, W, H + Hx - RxTextHeight);
// TiledGroup->position( 0, ReceiveText->h(), 0, RxTextHeight);
fl_digi_main->resize(mainX, mainY, mainW, mainH);
if (rigShown == true) {
if (!rigcontrol)
createRigDialog();

Wyświetl plik

@ -283,7 +283,6 @@ void psk::searchUp()
void psk::afc()
{
double error, ftest, sigpwr, noise;
static int cntdown = 0;
if (mailserver && progdefaults.PSKmailSweetSpot)
ftest = wf->peakFreq((int)progdefaults.PSKsweetspot, (int) bandwidth);
else
@ -293,7 +292,6 @@ void psk::afc()
// fast search for peak signal frequency
if (sigsearch) {
freqerr = 0.0;
cntdown = 16;
if (sigpwr/noise > 2.0) {//afcthreshold) {
if (!mailserver || (mailserver && !progdefaults.PSKmailSweetSpot) ||
(mailserver && (fabs(progdefaults.PSKsweetspot - ftest) < 15))) {
@ -313,14 +311,11 @@ void psk::afc()
error += 2 * M_PI;
if (error > M_PI / 2)
error -= 2 * M_PI;
if (cntdown > 0) cntdown--;
if (cntdown)
freqerr = decayavg( freqerr, error * ((samplerate / (symbollen * 2 * M_PI)/16)), 2);
else
freqerr = decayavg( freqerr, error * ((samplerate / (symbollen * 2 * M_PI)/16)), 16);
error *= ((samplerate / (symbollen * 2 * M_PI)/16));
freqerr = decayavg( freqerr, error, 8);//32);
frequency -= freqerr;
set_freq (frequency);
//sprintf(phasemsg,"%5.4f %5.4f %8.2f", error, freqerr, frequency);
//sprintf(phasemsg,"%5.4f %8.2f", freqerr, frequency);
//put_status(phasemsg);
} else if (mailserver && progdefaults.PSKmailSweetSpot)
sigsearch = 3;
@ -328,6 +323,8 @@ void psk::afc()
void psk::rx_symbol(complex symbol)
{
// double phase, error;
// int bits, n;
int n;
phase = (prevsymbol % symbol).arg();
prevsymbol = symbol;

Wyświetl plik

@ -1,20 +1,94 @@
#include "sound.h"
#include "configuration.h"
cSound::cSound(const char *dev ) {
device = dev;
capture = playback = generate = false;
#ifdef MAX
#undef MAX
#endif
tx_src_state = 0;
tx_src_data = 0;
rx_src_state = 0;
rx_src_data = 0;
cbuff = 0;
snd_buffer = 0;
src_buffer = 0;
txppm = progdefaults.TX_corr;
rxppm = progdefaults.RX_corr;
#ifdef MIN
#undef MIN
#endif
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
cSound::cSound()
: 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)
{
capture = playback = generate = false;
}
cSound::~cSound()
{
if (snd_buffer) delete [] snd_buffer;
if (src_buffer) delete [] src_buffer;
if (tx_src_data) delete tx_src_data;
if (rx_src_data) delete rx_src_data;
if (rx_src_state) src_delete (rx_src_state);
if (tx_src_state) src_delete (tx_src_state);
}
void cSound::Capture(bool on)
{
if (on)
ofCapture.open("capture.snd");
else
ofCapture.close();
capture = on;
}
void cSound::Playback(bool on)
{
if (on) {
ifPlayback.open("playback.snd", ios::in | ios::binary);
if (ifPlayback.is_open() == true)
playback = true;
return;
} else
ifPlayback.close();
playback = false;
}
void cSound::Generate(bool on)
{
if (on)
ofGenerate.open("generate.snd");
else
ofGenerate.close();
generate = on;
}
void cSound::writeGenerate(double *buff, int count)
{
char *cbuff = (char *)buff;
ofGenerate.write(cbuff, count * sizeof(double) );
}
void cSound::writeCapture(double *buff, int count)
{
char *cbuff = (char *)buff;
ofCapture.write(cbuff, count * sizeof(double) );
}
int cSound::readPlayback(double *buff, int count)
{
char *cbuff = (char *)buff;
if (ifPlayback.eof() == true) {
ifPlayback.close();
ifPlayback.open("playback.snd", ios::in | ios::binary);
}
ifPlayback.read(cbuff, count * sizeof(double) );
return count;
}
cSoundOSS::cSoundOSS(const char *dev ) {
device = dev;
cbuff = 0;
try {
Open(O_RDONLY);
getVersion();
@ -27,28 +101,51 @@ cSound::cSound(const char *dev ) {
<< " <" << device.c_str()
<< ">" << std::endl;
}
try {
int err;
snd_buffer = new float [2*SND_BUF_LEN];
src_buffer = new float [2*SND_BUF_LEN];
cbuff = new unsigned char [4 * SND_BUF_LEN];
if (!snd_buffer || !src_buffer || !cbuff)
throw("Cannot create src buffers");
for (int i = 0; i < 2*SND_BUF_LEN; i++)
snd_buffer[i] = src_buffer[i] = 0.0;
for (int i = 0; i < 4 * SND_BUF_LEN; i++)
cbuff[i] = 0;
tx_src_data = new SRC_DATA;
rx_src_data = new SRC_DATA;
if (!tx_src_data || !rx_src_data)
throw("Cannot create source data structures");
rx_src_state = src_new(SRC_SINC_FASTEST, 2, &err);
if (rx_src_state == 0)
throw(src_strerror(err));
tx_src_state = src_new(SRC_SINC_FASTEST, 2, &err);
if (tx_src_state == 0)
throw(src_strerror(err));
rx_src_data->src_ratio = 1.0/(1.0 + rxppm/1e6);
src_set_ratio ( rx_src_state, 1.0/(1.0 + rxppm/1e6));
tx_src_data->src_ratio = 1.0 + txppm/1e6;
src_set_ratio ( tx_src_state, 1.0 + txppm/1e6);
}
catch (SndException){
exit(1);
};
}
cSound::~cSound()
cSoundOSS::~cSoundOSS()
{
Close();
if (cbuff) delete [] cbuff;
if (snd_buffer) delete [] snd_buffer;
if (src_buffer) delete [] src_buffer;
if (tx_src_data) delete tx_src_data;
if (rx_src_data) delete rx_src_data;
if (rx_src_state) src_delete (rx_src_state);
if (tx_src_state) src_delete (tx_src_state);
tx_src_state = 0;
tx_src_data = 0;
rx_src_state = 0;
rx_src_data = 0;
cbuff = 0;
snd_buffer = 0;
src_buffer = 0;
}
void cSound::setfragsize()
void cSoundOSS::setfragsize()
{
int sndparam;
// Try to get ~100ms worth of samples per fragment
@ -65,7 +162,7 @@ void cSound::setfragsize()
throw errno;
}
int cSound::Open(int md, int freq, int nchan)
int cSoundOSS::Open(int md, int freq)
{
mode = md;
try {
@ -73,61 +170,18 @@ int cSound::Open(int md, int freq, int nchan)
if (device_fd == -1)
throw SndException(errno);
Format(AFMT_S16_LE); // default: 16 bit little endian
Channels(nchan); // 2 channels is default
Frequency(freq); // 8000 Hz is default
// Channels(1); // 1 channel
Channels(2); // 2 channels
Frequency(freq);
setfragsize();
}
catch (...) {
throw;
}
if (cbuff) delete [] cbuff;
if (snd_buffer) delete [] snd_buffer;
if (src_buffer) delete [] src_buffer;
if (tx_src_data) delete tx_src_data;
if (rx_src_data) delete rx_src_data;
if (rx_src_state) src_delete (rx_src_state);
if (tx_src_state) src_delete (tx_src_state);
try {
int err;
snd_buffer = new float [channels * SND_BUF_LEN];
src_buffer = new float [channels * SND_BUF_LEN];
cbuff = new unsigned char [channels * 2 * SND_BUF_LEN];
if (!snd_buffer || !src_buffer || !cbuff)
throw("Cannot create src buffers");
for (int i = 0; i < channels * SND_BUF_LEN; i++)
snd_buffer[i] = src_buffer[i] = 0.0;
for (int i = 0; i < channels * 2 * SND_BUF_LEN; i++)
cbuff[i] = 0;
tx_src_data = new SRC_DATA;
rx_src_data = new SRC_DATA;
if (!tx_src_data || !rx_src_data)
throw("Cannot create source data structures");
rx_src_state = src_new(SRC_SINC_FASTEST, channels, &err);
if (rx_src_state == 0)
throw(src_strerror(err));
tx_src_state = src_new(SRC_SINC_FASTEST, channels, &err);
if (tx_src_state == 0)
throw(src_strerror(err));
rx_src_data->src_ratio = 1.0/(1.0 + rxppm/1e6);
src_set_ratio ( rx_src_state, 1.0/(1.0 + rxppm/1e6));
tx_src_data->src_ratio = 1.0 + txppm/1e6;
src_set_ratio ( tx_src_state, 1.0 + txppm/1e6);
}
catch (SndException){
exit(1);
};
return device_fd;
}
void cSound::Close()
void cSoundOSS::Close()
{
if (device_fd == -1)
return;
@ -135,7 +189,7 @@ void cSound::Close()
device_fd = -1;
}
void cSound::getVersion()
void cSoundOSS::getVersion()
{
version = 0;
#ifndef __FreeBSD__
@ -146,7 +200,7 @@ void cSound::getVersion()
#endif
}
void cSound::getCapabilities()
void cSoundOSS::getCapabilities()
{
capability_mask = 0;
if (ioctl(device_fd, SNDCTL_DSP_GETCAPS, &capability_mask) == -1) {
@ -155,7 +209,7 @@ void cSound::getCapabilities()
}
}
void cSound::getFormats()
void cSoundOSS::getFormats()
{
format_mask = 0;
if (ioctl(device_fd, SNDCTL_DSP_GETFMTS, &format_mask) == -1) {
@ -164,7 +218,7 @@ void cSound::getFormats()
}
}
void cSound::Format(int format)
void cSoundOSS::Format(int format)
{
play_format = format;
if (ioctl(device_fd, SNDCTL_DSP_SETFMT, &play_format) == -1) {
@ -175,7 +229,7 @@ void cSound::Format(int format)
formatok = true;
}
void cSound::Channels(int nuchannels)
void cSoundOSS::Channels(int nuchannels)
{
channels = nuchannels;
if (ioctl(device_fd, SNDCTL_DSP_CHANNELS, &channels) == -1) {
@ -184,7 +238,7 @@ void cSound::Channels(int nuchannels)
}
}
void cSound::Frequency(int frequency)
void cSoundOSS::Frequency(int frequency)
{
sample_frequency = frequency;
if (ioctl(device_fd, SNDCTL_DSP_SPEED, &sample_frequency) == -1) {
@ -193,7 +247,7 @@ void cSound::Frequency(int frequency)
}
}
int cSound::BufferSize( int seconds )
int cSoundOSS::BufferSize( int seconds )
{
int bytes_per_channel = 0;
switch (play_format) {
@ -217,7 +271,7 @@ int cSound::BufferSize( int seconds )
return seconds * sample_frequency * bytes_per_channel * channels;
}
bool cSound::wait_till_finished()
bool cSoundOSS::wait_till_finished()
{
if (ioctl(device_fd, SNDCTL_DSP_POST, 1) == -1 )
return false;
@ -226,7 +280,7 @@ bool cSound::wait_till_finished()
return true; /* all sound has been played */
}
bool cSound::reset_device()
bool cSoundOSS::reset_device()
{
if (ioctl(device_fd, SNDCTL_DSP_RESET, 0) == -1) {
device_fd = -1;
@ -235,14 +289,14 @@ bool cSound::reset_device()
return 1; /* sounddevice has been reset */
}
int cSound::Write(unsigned char *buffer, int buffersize)
int cSoundOSS::Write(unsigned char *buffer, int buffersize)
{
if (device_fd == -1)
return -1;
return write (device_fd, buffer, buffersize);
}
int cSound::Read(unsigned char *buffer, int buffersize)
int cSoundOSS::Read(unsigned char *buffer, int buffersize)
{
if (device_fd == -1)
return -1;
@ -250,7 +304,7 @@ int cSound::Read(unsigned char *buffer, int buffersize)
return read (device_fd, buffer, buffersize);
}
int cSound::Read(double *buffer, int buffersize)
int cSoundOSS::Read(double *buffer, int buffersize)
{
short int *ibuff = (short int *)cbuff;
int numread;
@ -271,9 +325,13 @@ int cSound::Read(double *buffer, int buffersize)
}
if (capture) writeCapture( buffer, buffersize);
else if (playback) readPlayback( buffer, buffersize);
if (rxppm == 0 || playback)
if (playback) {
readPlayback( buffer, buffersize);
return buffersize;
}
if (rxppm == 0)
return buffersize;
// process using samplerate library
@ -296,13 +354,13 @@ int cSound::Read(double *buffer, int buffersize)
}
int cSound::write_samples(double *buf, int count)
int cSoundOSS::write_samples(double *buf, int count)
{
int retval;
short int *wbuff;
unsigned char *p;
if (generate) writeGenerate( buf, count);
if (generate) writeGenerate( buf, count );
if (device_fd == -1 || count <= 0)
return -1;
@ -358,7 +416,7 @@ int cSound::write_samples(double *buf, int count)
return retval;
}
int cSound::write_stereo(double *bufleft, double *bufright, int count)
int cSoundOSS::write_stereo(double *bufleft, double *bufright, int count)
{
int retval;
short int *wbuff;
@ -424,59 +482,325 @@ int cSound::write_stereo(double *bufleft, double *bufright, int count)
}
void cSound::Capture(bool on)
#ifdef PORTAUDIO
cSoundPA::cSoundPA(const char *dev)
: device(dev), sys(portaudio::System::instance()),
frames_per_buffer(0), fbuf(0)
{
if (on)
ofCapture.open("capture.snd");
else
ofCapture.close();
capture = on;
rx_src_data = new SRC_DATA;
tx_src_data = new SRC_DATA;
if (!rx_src_data || !tx_src_data)
throw("Cannot create source data structures");
snd_buffer = new float[2 * SND_BUF_LEN];
src_buffer = new float[2 * SND_BUF_LEN];
fbuf = new float[2 * SND_BUF_LEN];
if (!snd_buffer || !src_buffer || !fbuf)
throw("could not allocate buffers");
memset(snd_buffer, 0, 2 * SND_BUF_LEN);
memset(src_buffer, 0, 2 * SND_BUF_LEN);
memset(fbuf, 0, 2 * SND_BUF_LEN);
}
void cSound::Playback(bool on)
cSoundPA::~cSoundPA()
{
// std::cout << "Playback " << on << endl;
if (on) {
ifPlayback.open("playback.snd", ios::in | ios::binary);
if (ifPlayback.is_open() == true)
playback = true;
return;
} else
ifPlayback.close();
playback = false;
Close();
delete [] fbuf;
}
void cSound::Generate(bool on)
int cSoundPA::Open(int mode, int freq)
{
if (on)
ofGenerate.open("generate.snd");
else
ofGenerate.close();
generate = on;
open_mode = mode;
req_sample_rate = freq;
Close();
init_stream();
int err;
if (mode == O_RDONLY) {
stream_params.setOutputParameters(portaudio::DirectionSpecificStreamParameters::null());
if (rx_src_state)
src_delete(rx_src_state);
rx_src_state = src_new(SRC_SINC_FASTEST, 2, &err);
if (!rx_src_state)
throw(src_strerror(err));
rx_src_data->src_ratio = req_sample_rate / (dev_sample_rate * (1.0 + rxppm / 1e6));
}
else if (mode == O_WRONLY) {
stream_params.setInputParameters(portaudio::DirectionSpecificStreamParameters::null());
if (tx_src_state)
src_delete(tx_src_state);
tx_src_state = src_new(SRC_SINC_FASTEST, 2, &err);
if (!tx_src_state)
throw(src_strerror(err));
tx_src_data->src_ratio = dev_sample_rate * (1.0 + txppm / 1e6) / req_sample_rate;
}
else
return -1;
if (dev_sample_rate != req_sample_rate)
cerr << "PA_debug: resampling " << dev_sample_rate
<< " <-> " << req_sample_rate << endl;
stream.open(stream_params);
stream.start();
return 0;
}
void cSound::writeGenerate(double *buff, int count)
void cSoundPA::Close(void)
{
char *cbuff = (char *)buff;
ofGenerate.write(cbuff, count * sizeof(double) );
if (stream.isOpen()) {
stream.stop();
stream.close();
}
}
void cSound::writeCapture(double *buff, int count)
int cSoundPA::Read(double *buf, int count)
{
char *cbuff = (char *)buff;
ofCapture.write(cbuff, count * sizeof(double) );
}
int ncount = (int)floor(MIN(count, SND_BUF_LEN) / rx_src_data->src_ratio);
int cSound::readPlayback(double *buff, int count)
{
char *cbuff = (char *)buff;
if (ifPlayback.eof() == true) {
ifPlayback.close();
ifPlayback.open("playback.snd", ios::in | ios::binary);
try {
stream.read(fbuf, ncount);
}
catch (const portaudio::PaException &e) {
cerr << e.what() << endl;
if (strstr(e.what(), "rflow"))
adjust_stream();
}
if (capture) writeCapture( buf, count);
if (playback) {
readPlayback( buf, count);
return count;
}
ifPlayback.read(cbuff, count * sizeof(double) );
// std::cout << count << " " << ifPlayback.tellg() << endl;
return count;
float *rbuf = fbuf;
if (req_sample_rate != dev_sample_rate || rxppm != progdefaults.RX_corr) {
resample(rbuf, ncount, count);
rbuf = rx_src_data->data_out;
count = rx_src_data->output_frames_gen;
}
for (int i = 0; i < count; i++)
buf[i] = rbuf[2*i];
return count;
}
int cSoundPA::write_samples(double *buf, int count)
{
if (generate) writeGenerate( buf, count );
for (int i = 0; i < count; i++)
fbuf[2*i] = fbuf[2*i + 1] = buf[i];
float *wbuf = fbuf;
if (req_sample_rate != dev_sample_rate || txppm != progdefaults.TX_corr) {
resample(wbuf, count);
wbuf = tx_src_data->data_out;
count = tx_src_data->output_frames_gen;
}
try {
stream.write(wbuf, count);
}
catch (const portaudio::PaException &e) {
cerr << e.what() << endl;
if (strstr(e.what(), "rflow"))
adjust_stream();
}
return count;
}
int cSoundPA::write_stereo(double *bufleft, double *bufright, int count)
{
if (generate) writeGenerate( bufleft, count );
for (int i = 0; i < count; i++) {
fbuf[2*i] = bufleft[i];
fbuf[2*i + 1] = bufright[i];
}
float *wbuf = fbuf;
if (req_sample_rate != dev_sample_rate || txppm != progdefaults.TX_corr) {
resample(wbuf, count);
wbuf = tx_src_data->data_out;
count = tx_src_data->output_frames_gen;
}
try {
stream.write(wbuf, count);
}
catch (const portaudio::PaException &e) {
cerr << e.what() << endl;
if (strstr(e.what(), "rflow"))
adjust_stream();
}
return count;
}
void cSoundPA::resample(float *buf, int count, int max)
{
if (open_mode == O_RDONLY) {
if (rxppm != progdefaults.RX_corr) {
rxppm = progdefaults.RX_corr;
rx_src_data->src_ratio = req_sample_rate
/ dev_sample_rate
* (1.0 + rxppm / 1e6);
src_set_ratio(rx_src_state, rx_src_data->src_ratio);
}
rx_src_data->data_in = buf;
rx_src_data->input_frames = count;
rx_src_data->data_out = snd_buffer;
rx_src_data->output_frames = max ? max : SND_BUF_LEN;
rx_src_data->end_of_input = 0;
src_process(rx_src_state, rx_src_data);
}
else if (open_mode == O_WRONLY) {
if (txppm != progdefaults.TX_corr) {
txppm = progdefaults.TX_corr;
tx_src_data->src_ratio = dev_sample_rate
* (1.0 + txppm / 1e6)
/ req_sample_rate;
src_set_ratio(tx_src_state, tx_src_data->src_ratio);
}
tx_src_data->data_in = buf;
tx_src_data->input_frames = count;
tx_src_data->data_out = src_buffer;
tx_src_data->output_frames = max ? max : SND_BUF_LEN;
tx_src_data->end_of_input = 0;
src_process(tx_src_state, tx_src_data);
}
}
void cSoundPA::init_stream(void)
{
PaDeviceIndex ndev;
istringstream ist(device);
if (!(ist >> ndev))
ndev = 0;
bool found = false;
portaudio::System::DeviceIterator idev;
for (idev = sys.devicesBegin(); idev != sys.devicesEnd(); ++idev) {
if (idev->index() == ndev) {
found = true;
break;
}
}
if (!found) {
idev = sys.devicesBegin();
cerr << "PA_debug: could not find device " << ndev << endl;
}
cerr << "PA_debug: using device " << idev->index() << " \""
<< idev->name() << '"' << endl;
in_params.setDevice(*idev);
in_params.setNumChannels(2);
in_params.setSampleFormat(portaudio::FLOAT32, true);
in_params.setSuggestedLatency(idev->defaultHighInputLatency());
in_params.setHostApiSpecificStreamInfo(NULL);
out_params.setDevice(*idev);
out_params.setNumChannels(2);
out_params.setSampleFormat(portaudio::FLOAT32, true);
out_params.setSuggestedLatency(idev->defaultHighOutputLatency());
out_params.setHostApiSpecificStreamInfo(NULL);
stream_params.clearFlags();
stream_params.setInputParameters(in_params);
stream_params.setOutputParameters(out_params);
dev_sample_rate = get_best_srate();
stream_params.setSampleRate(dev_sample_rate);
max_frames_per_buffer = ceil2(MIN(SND_BUF_LEN, (unsigned)(SCBLOCKSIZE *
dev_sample_rate / req_sample_rate)));
stream_params.setFramesPerBuffer(frames_per_buffer);
cerr << "PA_debug: max_frames_per_buffer = " << max_frames_per_buffer << endl;
}
void cSoundPA::adjust_stream(void)
{
if (frames_per_buffer == max_frames_per_buffer)
return;
frames_per_buffer = stream_params.framesPerBuffer();
if (frames_per_buffer)
frames_per_buffer *= 2;
else
frames_per_buffer = SCBLOCKSIZE;
if (!powerof2(frames_per_buffer))
frames_per_buffer = ceil2(frames_per_buffer);
frames_per_buffer = MIN(max_frames_per_buffer, frames_per_buffer);
cerr << "PA_debug: adjusting frames_per_buffer to "
<< frames_per_buffer << endl;
stream_params.setFramesPerBuffer(frames_per_buffer);
Close();
stream.open(stream_params);
stream.start();
}
double cSoundPA::std_sample_rates[] = { -1, 8000, 9600, 11025, 12000,
16000, 22050, 24000, 32000,
44100, 48000, 88200, 96000 };
// Return the hardware-supported sample rate that is closest to the one
// requested by the modem. This needs to be a little smarter; atm it simply
// goes through the array, and may even try the same rate twice.
double cSoundPA::get_best_srate(void)
{
int asize = sizeof(std_sample_rates) / sizeof(std_sample_rates[0]);
std_sample_rates[0] = req_sample_rate;
for (int i = 0; i < asize; i++) {
portaudio::StreamParameters sp(in_params, out_params,
std_sample_rates[i],
0, paNoFlag);
cerr << "PA_debug: trying " << std_sample_rates[i] << " Hz" << endl;
if (sp.isSupported())
return sp.sampleRate();
}
throw("could not find a supported sample rate");
return -1;
}
// Return smallest power of 2 greater than n
unsigned cSoundPA::ceil2(unsigned n)
{
--n;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return n + 1;
}
// Return the biggest power of 2 less than n
unsigned cSoundPA::floor2(unsigned n)
{
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return n - (n >> 1);
}
#endif // PORTAUDIO

Wyświetl plik

@ -231,7 +231,14 @@ void trx_reset_loop()
delete scard;
scard = 0;
}
scard = new cSound(trx_scdev.c_str());
#ifdef PORTAUDIO
if (progdefaults.btnAudioIOis == 1)
scard = new cSoundPA(trx_scdev.c_str());
else
scard = new cSoundOSS(trx_scdev.c_str());
#else
scard = new cSoundOSS(trx_scdev.c_str());
#endif
trx_state = STATE_RX;
}
@ -282,7 +289,14 @@ void trx_start(const char *scdev)
}
if (scard) delete scard;
scard = new cSound(scdev);
#ifdef PORTAUDIO
if (progdefaults.btnAudioIOis == 1)
scard = new cSoundPA(scdev);
else
scard = new cSoundOSS(scdev);
#else
scard = new cSoundOSS(scdev);
#endif
trx_state = STATE_RX;
_trx_tune = 0;