kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Upstream version 2.08G
rodzic
3756b2e155
commit
34f68be951
|
@ -4,7 +4,7 @@
|
|||
# Copyright (C) 2007 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([fldigi], [2.08F], [w1hkj AT w1hkj DOT com])
|
||||
AC_INIT([fldigi], [2.08G], [w1hkj AT w1hkj DOT com])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AM_INIT_AUTOMAKE([-Wall foreign 1.9.6])
|
||||
AM_MAINTAINER_MODE
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Fldigi
|
||||
GenericName=Amateur Radio Digital Modem
|
||||
Comment=Amateur Radio Sound Card Communications
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <FL/Fl_Image.H>
|
||||
#include <FL/Fl_Tile.H>
|
||||
#include <FL/x.H>
|
||||
#include <FL/Fl_Help_Dialog.H>
|
||||
|
||||
#include "waterfall.h"
|
||||
#include "raster.h"
|
||||
|
@ -83,6 +84,40 @@
|
|||
#include "qrunner.h"
|
||||
|
||||
Fl_Double_Window *fl_digi_main=(Fl_Double_Window *)0;
|
||||
Fl_Help_Dialog *help_dialog = (Fl_Help_Dialog *)0;
|
||||
|
||||
void fldigi_help(string theHelp) {
|
||||
if (!help_dialog)
|
||||
help_dialog = new Fl_Help_Dialog();
|
||||
|
||||
string htmlHelp =
|
||||
"<HTML>"//\n"
|
||||
"<HEAD>"//\n"
|
||||
"<TITLE>fldigi Help</TITLE>"//\n"
|
||||
"</HEAD>"//\n"
|
||||
"<BODY BGCOLOR='#ffffff'>"//\n"
|
||||
"<FONT FACE=fixed, SIZE=18>"
|
||||
"<P><TT>";
|
||||
string postHelp =
|
||||
"</TT></P>"//\n"
|
||||
"</BODY>";//\n";
|
||||
string sHelp;
|
||||
for (size_t i = 0; i < theHelp.length(); i++)
|
||||
if (theHelp[i] == '\n') {
|
||||
if (theHelp[i+1] == '\n') {
|
||||
sHelp += "</TT></P><P><TT>";
|
||||
i++;
|
||||
} else
|
||||
sHelp += "<BR>";//"\n<BR>";
|
||||
} else
|
||||
sHelp += theHelp[i];
|
||||
htmlHelp += sHelp;
|
||||
htmlHelp += postHelp;
|
||||
|
||||
help_dialog->value(htmlHelp.c_str());
|
||||
|
||||
help_dialog->show();
|
||||
}
|
||||
|
||||
cMixer mixer;
|
||||
|
||||
|
@ -609,20 +644,18 @@ void cb_mnuCmdLineHelp(Fl_Widget*, void*)
|
|||
{
|
||||
extern std::string option_help;
|
||||
|
||||
fl_message_font(FL_SCREEN, FL_NORMAL_SIZE - 1);
|
||||
fl_message("%s", option_help.c_str());
|
||||
fl_message_font(FL_HELVETICA, FL_NORMAL_SIZE);
|
||||
fldigi_help(option_help);
|
||||
// fl_message_font(FL_SCREEN, FL_NORMAL_SIZE - 1);
|
||||
// fl_message("%s", option_help.c_str());
|
||||
// fl_message_font(FL_HELVETICA, FL_NORMAL_SIZE);
|
||||
|
||||
restoreFocus();
|
||||
}
|
||||
|
||||
void cb_mnuBuildInfo(Fl_Widget*, void*)
|
||||
{
|
||||
extern void print_versions(std::ostream&);
|
||||
|
||||
std::ostringstream ss;
|
||||
print_versions(ss);
|
||||
std::string s = ss.str();
|
||||
extern std::string version_text;
|
||||
std::string s = version_text;
|
||||
std::string::size_type i = 0;
|
||||
|
||||
// escape the at chars
|
||||
|
@ -631,9 +664,10 @@ void cb_mnuBuildInfo(Fl_Widget*, void*)
|
|||
i += 2;
|
||||
}
|
||||
|
||||
fl_message_font(FL_SCREEN, FL_NORMAL_SIZE - 1);
|
||||
fl_message("%s", s.c_str());
|
||||
fl_message_font(FL_HELVETICA, FL_NORMAL_SIZE);
|
||||
fldigi_help(s);
|
||||
// fl_message_font(FL_SCREEN, FL_NORMAL_SIZE - 1);
|
||||
// fl_message("%s", s.c_str());
|
||||
// fl_message_font(FL_HELVETICA, FL_NORMAL_SIZE);
|
||||
|
||||
restoreFocus();
|
||||
}
|
||||
|
@ -997,7 +1031,7 @@ void make_pixmap(Pixmap *xpm, const char **data)
|
|||
w.make_current();
|
||||
|
||||
Fl_Pixmap icon(data);
|
||||
int maxd = max(icon.w(), icon.h());
|
||||
int maxd = MAX(icon.w(), icon.h());
|
||||
*xpm = fl_create_offscreen(maxd, maxd);
|
||||
|
||||
fl_begin_offscreen(*xpm);
|
||||
|
|
|
@ -37,11 +37,6 @@
|
|||
#include "Config.h"
|
||||
#include "qrunner.h"
|
||||
|
||||
#undef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#undef CLAMP
|
||||
#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
|
||||
|
||||
char feldmsg[80];
|
||||
|
||||
void feld::tx_init(cSound *sc)
|
||||
|
|
|
@ -12,7 +12,15 @@ extern "C" {
|
|||
#ifndef powerof2
|
||||
# define powerof2(n) ((((n) - 1) & (n)) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef CLAMP
|
||||
# define CLAMP(x, low, high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
|
||||
|
|
203
src/main.cxx
203
src/main.cxx
|
@ -101,15 +101,16 @@ int rxmsgid = -1;
|
|||
TXMSGSTRUC txmsgst;
|
||||
int txmsgid = -1;
|
||||
|
||||
string option_help;
|
||||
string option_help, version_text;
|
||||
|
||||
qrunner *cbq[NUM_QRUNNER_THREADS];
|
||||
|
||||
void arqchecks(void);
|
||||
void generate_option_help(void);
|
||||
int parse_args(int argc, char **argv, int& idx);
|
||||
void print_versions(std::ostream& s);
|
||||
void generate_version_text(void);
|
||||
void debug_exec(char** argv);
|
||||
void string_wrap(std::string& s, unsigned c);
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
|
@ -133,6 +134,8 @@ int main(int argc, char ** argv)
|
|||
HomeDir = szHomedir;
|
||||
|
||||
generate_option_help();
|
||||
generate_version_text();
|
||||
string_wrap(version_text, 80);
|
||||
int arg_idx;
|
||||
if (Fl::args(argc, argv, arg_idx, parse_args) != argc) {
|
||||
cerr << PACKAGE_NAME << ": unrecognized option `" << argv[arg_idx]
|
||||
|
@ -288,127 +291,93 @@ void generate_option_help(void) {
|
|||
|
||||
|
||||
ostringstream help;
|
||||
int width = 37;
|
||||
help << "Usage:\n " << PACKAGE_NAME << " [option...]\n";
|
||||
// int width = 72;
|
||||
help << "Usage:\n"
|
||||
<< " " << PACKAGE_NAME << " [option...]\n\n";
|
||||
|
||||
help << '\n' << PACKAGE_NAME << " options:\n"
|
||||
help << PACKAGE_NAME << " options:\n\n"
|
||||
|
||||
<< " --config-dir DIRECTORY\n"
|
||||
<< " Look for configuration files in DIRECTORY\n"
|
||||
<< " The default is: " << HomeDir << "\n\n"
|
||||
|
||||
<< " --rx-ipc-key KEY" << "Set the receive message queue key\n"
|
||||
<< " May be given in hex if prefixed with \"0x\"\n"
|
||||
<< " The default is: " << progdefaults.rx_msgid
|
||||
<< " or 0x" << hex << progdefaults.rx_msgid << dec << "\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --config-dir DIRECTORY"
|
||||
<< "Look for configuration files in DIRECTORY\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "The default is: " << HomeDir << '\n'
|
||||
<< " --tx-ipc-key KEY" << "Set the transmit message queue key\n"
|
||||
<< " May be given in hex if prefixed with \"0x\"\n"
|
||||
<< " The default is: " << progdefaults.tx_msgid
|
||||
<< " or 0x" << hex << progdefaults.tx_msgid << dec << "\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --rx-ipc-key KEY" << "Set the receive message queue key\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "May be given in hex if prefixed with \"0x\"\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "The default is: " << progdefaults.rx_msgid
|
||||
<< " or 0x" << hex << progdefaults.rx_msgid << dec << '\n'
|
||||
<< " --version\n"
|
||||
<< " Print version information\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --tx-ipc-key KEY" << "Set the transmit message queue key\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "May be given in hex if prefixed with \"0x\"\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "The default is: " << progdefaults.tx_msgid
|
||||
<< " or 0x" << hex << progdefaults.tx_msgid << dec << '\n'
|
||||
<< " --help\n"
|
||||
<< " Print this option help\n\n";
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --version" << "Print version information\n"
|
||||
// Fl::help looks ugly so we'll write our own
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --help" << "Print this option help\n";
|
||||
help << "Standard FLTK options:\n\n"
|
||||
|
||||
<< " -bg COLOR, -background COLOR\n"
|
||||
<< " Set the background color\n"
|
||||
|
||||
// Fl::help looks ugly so we'll write our own
|
||||
<< " -bg2 COLOR, -background2 COLOR\n"
|
||||
<< " Set the secondary (text) background color\n\n"
|
||||
|
||||
help << "\nStandard FLTK options:\n"
|
||||
<< " -di DISPLAY, -display DISPLAY\n"
|
||||
<< " Set the X display to use DISPLAY,\n"
|
||||
<< " format is ``host:n.n''\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -bg COLOR, -background COLOR"
|
||||
<< "Set the background color\n"
|
||||
<< " -dn, -dnd or -nodn, -nodnd\n"
|
||||
<< " Enable or disable drag and drop copy and\n"
|
||||
<< " paste in text fields\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -bg2 COLOR, -background2 COLOR"
|
||||
<< "Set the secondary (text) background color\n"
|
||||
<< " -fg COLOR, -foreground COLOR\n"
|
||||
<< " Set the foreground color\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -di, -display DISPLAY"
|
||||
<< "Set the X display to use\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "DISPLAY format is ``host:n.n''\n"
|
||||
<< " -g GEOMETRY, -geometry GEOMETRY\n"
|
||||
<< " Set the initial window size and position\n"
|
||||
<< " GEOMETRY format is ``WxH+X+Y''\n"
|
||||
<< " ** " << PACKAGE_NAME << " may override this settting **\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -dn, -dnd or -nodn, -nodnd"
|
||||
<< "Enable or disable drag and drop copy and\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "paste in text fields\n"
|
||||
<< " -i, -iconic\n"
|
||||
<< " Start " << PACKAGE_NAME << " in iconified state\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -fg COLOR, -foreground COLOR"
|
||||
<< "Set the foreground color\n"
|
||||
<< " -k, -kbd or -nok, -nokbd\n"
|
||||
<< " Enable or disable visible keyboard focus in non-text widgets\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -g GEOMETRY, -geometry GEOMETRY"
|
||||
<< "Set the initial window size and position\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "GEOMETRY format is ``WxH+X+Y''\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "** " << PACKAGE_NAME << " may override this settting **\n"
|
||||
<< " -na CLASSNAME, -name CLASSNAME\n"
|
||||
<< " Set the window class to CLASSNAME\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -i, -iconic"
|
||||
<< "Start " << PACKAGE_NAME << " in iconified state\n"
|
||||
<< " -s SCHEME, -scheme SCHEME\n"
|
||||
<< " Set the widget scheme\n"
|
||||
<< " SCHEME can be one of: " << schemes << "\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -k, -kbd or -nok, -nokbd"
|
||||
<< "Enable or disable visible keyboard focus\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "in non-text widgets\n"
|
||||
<< " -ti WINDOWTITLE, -title WINDOWTITLE\n"
|
||||
<< " Set the window title\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -na CLASSNAME, -name CLASSNAME"
|
||||
<< "Set the window class to CLASSNAME\n"
|
||||
<< " -to, -tooltips or -not, -notooltips\n"
|
||||
<< " Enable or disable tooltips\n\n";
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -s SCHEME, -scheme SCHEME"
|
||||
<< "Set the widget scheme\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "SCHEME can be one of: " << schemes << '\n'
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -ti WINDOWTITLE, -title WINDOWTITLE"
|
||||
<< "Set the window title\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " -to, -tooltips or -not, -notooltips"
|
||||
<< "Enable or disable tooltips\n";
|
||||
|
||||
help << "\nAdditional UI options:\n"
|
||||
help << "Additional UI options:\n\n"
|
||||
|
||||
// << setw(width) << setiosflags(ios::left)
|
||||
// << " --fast-text" << "Use fast text widgets\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --font FONT[:SIZE]"
|
||||
<< "Set the widget font and (optional) size\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "The default is: " << Fl::get_font(FL_HELVETICA)
|
||||
<< ':' << FL_NORMAL_SIZE << '\n'
|
||||
<< " --font FONT[:SIZE]\n"
|
||||
<< " Set the widget font and (optionally) size\n"
|
||||
<< " The default is: " << Fl::get_font(FL_HELVETICA)
|
||||
<< ':' << FL_NORMAL_SIZE << "\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --profile PROFILE"
|
||||
<< "If PROFILE is ``emc'', ``emcomm'', or\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "``minimal'', widget sizes will be adjusted\n"
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< "" << "for a minimal screen footprint.\n"
|
||||
<< " --profile PROFILE\n"
|
||||
<< " If PROFILE is ``emc'', ``emcomm'', or ``minimal'',\n"
|
||||
<< " widget sizes will be adjusted for a minimal screen footprint\n\n"
|
||||
|
||||
<< setw(width) << setiosflags(ios::left)
|
||||
<< " --usechkbtns"
|
||||
<< "Use check buttons for AFC / SQL\n";
|
||||
<< " --usechkbtns\n"
|
||||
<< " Use check buttons for AFC / SQL.\n";
|
||||
|
||||
|
||||
option_help = help.str();
|
||||
|
@ -558,7 +527,7 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
exit(EXIT_SUCCESS);
|
||||
|
||||
case OPT_VERSION:
|
||||
print_versions(cerr);
|
||||
cerr << version_text;
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
case '?':
|
||||
|
@ -572,8 +541,9 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void print_versions(std::ostream& s)
|
||||
void generate_version_text(void)
|
||||
{
|
||||
ostringstream s;
|
||||
s << PACKAGE_NAME << ' ' << PACKAGE_VERSION << "\n\nSystem: ";
|
||||
struct utsname u;
|
||||
if (uname(&u) != -1) {
|
||||
|
@ -587,32 +557,34 @@ void print_versions(std::ostream& s)
|
|||
s /*<< "\nConfigured with: " << COMPILE_CFG*/ << '\n'
|
||||
<< "Built on " << COMPILE_DATE << " by " << COMPILE_USER
|
||||
<< '@' << COMPILE_HOST << " with:\n"
|
||||
<< ' ' << COMPILER << '\n'
|
||||
<< " CFLAGS=" << CFLAGS << '\n'
|
||||
<< " LDFLAGS=" << LDFLAGS << '\n';
|
||||
<< COMPILER << '\n'
|
||||
<< "CFLAGS=" << CFLAGS << '\n'
|
||||
<< "LDFLAGS=" << LDFLAGS << '\n';
|
||||
#endif // HAVE_VERSIONS_H
|
||||
|
||||
s << "Libraries:\n"
|
||||
<< " FLTK " << FL_MAJOR_VERSION << '.' << FL_MINOR_VERSION << '.'
|
||||
<< "FLTK " << FL_MAJOR_VERSION << '.' << FL_MINOR_VERSION << '.'
|
||||
<< FL_PATCH_VERSION << '\n';
|
||||
|
||||
#if USE_HAMLIB
|
||||
s << ' ' << hamlib_version << '\n';
|
||||
s << hamlib_version << '\n';
|
||||
#endif
|
||||
|
||||
#if USE_PORTAUDIO
|
||||
s << ' ' << Pa_GetVersionText() << ' ' << Pa_GetVersion() << '\n';
|
||||
s << Pa_GetVersionText() << ' ' << Pa_GetVersion() << '\n';
|
||||
#endif
|
||||
|
||||
#if USE_SNDFILE
|
||||
char sndfile_version[32];
|
||||
sf_command(NULL, SFC_GET_LIB_VERSION, sndfile_version, sizeof(sndfile_version));
|
||||
s << ' ' << sndfile_version << '\n';
|
||||
s << sndfile_version << '\n';
|
||||
#endif
|
||||
|
||||
#ifdef src_get_version
|
||||
s << ' ' << src_get_version() << '\n';
|
||||
#endif
|
||||
|
||||
version_text = s.str();
|
||||
}
|
||||
|
||||
// When debugging is enabled, reexec with malloc debugging hooks enabled, unless
|
||||
|
@ -641,3 +613,20 @@ void debug_exec(char** argv)
|
|||
perror("execvp");
|
||||
#endif
|
||||
}
|
||||
|
||||
void string_wrap(std::string& s, unsigned c)
|
||||
{
|
||||
string::size_type spos = s.find(' '), prev = spos, line = 0;
|
||||
|
||||
while ((spos = s.find_first_of(" \n", spos+1)) != string::npos) {
|
||||
if (spos - line > c) {
|
||||
s[prev] = '\n';
|
||||
line = prev + 1;
|
||||
}
|
||||
if (s[spos] == '\n')
|
||||
line = spos + 1;
|
||||
prev = spos;
|
||||
}
|
||||
if (s.length() - line > c)
|
||||
s[prev] = '\n';
|
||||
}
|
||||
|
|
|
@ -40,11 +40,6 @@
|
|||
|
||||
#include "qrunner.h"
|
||||
|
||||
#undef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#undef CLAMP
|
||||
#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
|
||||
|
||||
#define AFC_COUNT 32
|
||||
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ void diediedie(void)
|
|||
" due to a fatal error.\nPlease report this to "
|
||||
PACKAGE_BUGREPORT << "\n\n";
|
||||
pstack(STDERR_FILENO);
|
||||
extern void print_versions(std::ostream&);
|
||||
print_versions(std::cerr << "\nVersion information:\n");
|
||||
extern std::string version_text;
|
||||
std::cerr << "\nVersion information:\n" << version_text;
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include <config.h>
|
||||
|
||||
// Return the smallest power of 2 not less than n
|
||||
#include "util.h"
|
||||
|
||||
/* Return the smallest power of 2 not less than n */
|
||||
uint32_t ceil2(uint32_t n)
|
||||
{
|
||||
--n;
|
||||
|
@ -13,7 +15,7 @@ uint32_t ceil2(uint32_t n)
|
|||
return n + 1;
|
||||
}
|
||||
|
||||
// Return the largest power of 2 not greater than n
|
||||
/* Return the largest power of 2 not greater than n */
|
||||
uint32_t floor2(uint32_t n)
|
||||
{
|
||||
n |= n >> 1;
|
||||
|
|
|
@ -9,8 +9,20 @@ cFreqControl *FreqDisp=(cFreqControl *)0;
|
|||
Fl_Browser *FreqSelect=(Fl_Browser *)0;
|
||||
|
||||
static void cb_FreqSelect(Fl_Browser*, void*) {
|
||||
if (FreqSelect->value())
|
||||
(Fl::event_state() & FL_SHIFT) ? delFreq() : selectFreq();
|
||||
if (FreqSelect->value()) {
|
||||
switch (Fl::event_button()) {
|
||||
case FL_MIDDLE_MOUSE:
|
||||
delFreq();
|
||||
addFreq();
|
||||
break;
|
||||
case FL_LEFT_MOUSE: default:
|
||||
if (Fl::event_state() & FL_SHIFT)
|
||||
delFreq();
|
||||
else
|
||||
selectFreq();
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Fl_ComboBox *opMODE=(Fl_ComboBox *)0;
|
||||
|
@ -68,7 +80,8 @@ Fl_Double_Window* rig_dialog() {
|
|||
o->SetONOFFCOLOR( FL_RED, FL_BLACK);
|
||||
}
|
||||
{ Fl_Browser* o = FreqSelect = new Fl_Browser(278, 5, 280, 70);
|
||||
o->tooltip("Select operating mode and frequency");
|
||||
o->tooltip("Select operating mode and frequency\nMiddle click to replace, Shift-left clic\
|
||||
k to delete");
|
||||
o->type(2);
|
||||
o->box(FL_DOWN_BOX);
|
||||
o->labelfont(4);
|
||||
|
@ -124,12 +137,16 @@ Fl_Double_Window* rig_dialog() {
|
|||
}
|
||||
// Resizable kludge
|
||||
// Move FreqSelect one pixel down so that we can define a box
|
||||
// that will be used resize this widget only. There has to be
|
||||
// that will be used to resize this widget only. There has to be
|
||||
// a better way of doing this...
|
||||
{
|
||||
FreqSelect->resize(FreqSelect->x(), FreqSelect->y() + 1, FreqSelect->w(), FreqSelect->h());
|
||||
Fl_Box* b_ = new Fl_Box(FreqSelect->x() + FreqSelect->w() - 1, FreqSelect->y() + FreqSelect->h() - 1, 1, 1);
|
||||
w->add_resizable(*b_);
|
||||
// make the minimum width equal to that of the frequency display
|
||||
w->size_range(FreqDisp->x() + FreqDisp->w(), w->h());
|
||||
// get rid of the horizontal scrollbar, we will resize the window instead
|
||||
FreqSelect->has_scrollbar(Fl_Browser_::VERTICAL);
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
|
|
@ -23,9 +23,22 @@ Function {rig_dialog()} {open
|
|||
class cFreqControl
|
||||
}
|
||||
Fl_Browser FreqSelect {
|
||||
callback {if (FreqSelect->value())
|
||||
(Fl::event_state() & FL_SHIFT) ? delFreq() : selectFreq();}
|
||||
tooltip {Select operating mode and frequency} xywh {278 5 280 70} type Hold box DOWN_BOX labelfont 4 labelsize 12 textfont 4
|
||||
callback {if (FreqSelect->value()) {
|
||||
switch (Fl::event_button()) {
|
||||
case FL_MIDDLE_MOUSE:
|
||||
delFreq();
|
||||
addFreq();
|
||||
break;
|
||||
case FL_LEFT_MOUSE: default:
|
||||
if (Fl::event_state() & FL_SHIFT)
|
||||
delFreq();
|
||||
else
|
||||
selectFreq();
|
||||
break;
|
||||
}
|
||||
}}
|
||||
tooltip {Select operating mode and frequency
|
||||
Middle click to replace, Shift-left click to delete} xywh {278 5 280 70} type Hold box DOWN_BOX labelfont 4 labelsize 12 textfont 4
|
||||
}
|
||||
Fl_Group opMODE {
|
||||
callback {setMode();} open
|
||||
|
@ -63,11 +76,15 @@ Function {rig_dialog()} {open
|
|||
}
|
||||
code {// Resizable kludge
|
||||
// Move FreqSelect one pixel down so that we can define a box
|
||||
// that will be used resize this widget only. There has to be
|
||||
// that will be used to resize this widget only. There has to be
|
||||
// a better way of doing this...
|
||||
{
|
||||
FreqSelect->resize(FreqSelect->x(), FreqSelect->y() + 1, FreqSelect->w(), FreqSelect->h());
|
||||
Fl_Box* b_ = new Fl_Box(FreqSelect->x() + FreqSelect->w() - 1, FreqSelect->y() + FreqSelect->h() - 1, 1, 1);
|
||||
w->add_resizable(*b_);
|
||||
// make the minimum width equal to that of the frequency display
|
||||
w->size_range(FreqDisp->x() + FreqDisp->w(), w->h());
|
||||
// get rid of the horizontal scrollbar, we will resize the window instead
|
||||
FreqSelect->has_scrollbar(Fl_Browser_::VERTICAL);
|
||||
}} {}
|
||||
}
|
||||
|
|
|
@ -32,20 +32,6 @@
|
|||
#include <FL/Fl.H>
|
||||
#include "File_Selector.h"
|
||||
|
||||
#ifdef MIN
|
||||
# undef MIN
|
||||
#endif
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#ifdef MAX
|
||||
# undef MAX
|
||||
#endif
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
#ifdef powerof2
|
||||
# undef powerof2
|
||||
#endif
|
||||
#define powerof2(n) ((((n) - 1) & (n)) == 0)
|
||||
|
||||
|
||||
cSound::cSound()
|
||||
: sample_frequency(0), txppm(progdefaults.TX_corr), rxppm(progdefaults.RX_corr),
|
||||
|
|
|
@ -36,26 +36,6 @@
|
|||
|
||||
#include "qrunner.h"
|
||||
|
||||
inline double MAX(double m1, double m2) {
|
||||
if (m1 > m2) return m1;
|
||||
return m2;
|
||||
}
|
||||
|
||||
inline int MAX(int m1, int m2) {
|
||||
if (m1 > m2) return m1;
|
||||
return m2;
|
||||
}
|
||||
|
||||
inline double MIN(double m1, double m2) {
|
||||
if (m1 < m2) return m1;
|
||||
return m2;
|
||||
}
|
||||
|
||||
inline int MIN (int m1, int m2) {
|
||||
if (m1 < m2) return m1;
|
||||
return m2;
|
||||
}
|
||||
|
||||
|
||||
Digiscope::Digiscope (int X, int Y, int W, int H) :
|
||||
Fl_Widget (X, Y, W, H) {
|
||||
|
|
|
@ -66,9 +66,6 @@ static RGB RGBred = {254,0,0};
|
|||
RGBI mag2RGBI[256];
|
||||
RGB palette[9];
|
||||
|
||||
#define max(a,b) (a)>(b)?(a):(b)
|
||||
#define min(a,b) (a)<(b)?(a):(b)
|
||||
|
||||
short int *tmp_fft_db;
|
||||
|
||||
WFdisp::WFdisp (int x0, int y0, int w0, int h0, char *lbl) :
|
||||
|
@ -633,9 +630,9 @@ void WFdisp::update_waterfall() {
|
|||
p4 = p3;
|
||||
for (int col = 0; col < disp_width; col++) {
|
||||
if (step == 4)
|
||||
sig = max( max ( max ( *p2, *(p2+1) ), *(p2+2) ), *(p2+3) );
|
||||
sig = MAX( MAX ( MAX ( *p2, *(p2+1) ), *(p2+2) ), *(p2+3) );
|
||||
else if (step == 2)
|
||||
sig = max( *p2, *(p2 + 1) );
|
||||
sig = MAX( *p2, *(p2 + 1) );
|
||||
else
|
||||
sig = *p2;
|
||||
*p4 = mag2RGBI[ sig ];
|
||||
|
@ -734,9 +731,9 @@ void WFdisp::drawspectrum() {
|
|||
if (step == 1)
|
||||
sig = tmp_fft_db[c];
|
||||
else if (step == 2)
|
||||
sig = max(tmp_fft_db[c], tmp_fft_db[c+1]);
|
||||
sig = MAX(tmp_fft_db[c], tmp_fft_db[c+1]);
|
||||
else
|
||||
sig = max( max ( max ( tmp_fft_db[c], tmp_fft_db[c+1] ), tmp_fft_db[c+2] ), tmp_fft_db[c+3]);
|
||||
sig = MAX( MAX ( MAX ( tmp_fft_db[c], tmp_fft_db[c+1] ), tmp_fft_db[c+2] ), tmp_fft_db[c+3]);
|
||||
ynext = h1 * sig / 256;
|
||||
while (ffty < ynext) { fft_sig_img[fftpixel -= IMAGE_WIDTH/step] = graylevel; ffty++;}
|
||||
while (ffty > ynext) { fft_sig_img[fftpixel += IMAGE_WIDTH/step] = graylevel; ffty--;}
|
||||
|
|
Ładowanie…
Reference in New Issue