kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Upstream version 2.10N
rodzic
b4bd00695e
commit
2b68f1100a
16
ChangeLog
16
ChangeLog
|
@ -16,10 +16,11 @@ Change Log:
|
|||
12) Fixes to mfsk picture mode decoding
|
||||
13) Changed frequency2 data file format, downward compatible
|
||||
14) Added FELD_SLOWHELL, FELD_HELLX5 and FELD_HELLX9 modems
|
||||
15) Added support to the PortAudio backend for separate capture and playback
|
||||
devices and sample rates
|
||||
15) Added support to the PortAudio backend for separate capture and
|
||||
playback devices and sample rates
|
||||
16) Added mt63 500/1000/2000 modes
|
||||
17) Added psk acquisition level control
|
||||
18) Added script to create .app bundles on OS X
|
||||
|
||||
2.09 1) Modified src/Makefile.am for FreeBSD name space clash
|
||||
2) Added psk multi-channel viewer with regex search capability
|
||||
|
@ -142,8 +143,8 @@ Change Log:
|
|||
SKIP : FL_BLUE - used in Rx/Tx for skipped chars (eg: Tx ON/OFF)
|
||||
ALTR : FL_DARK_GREEN - used in Rx widget for quick view of signal
|
||||
when right-clicking on a waterfall signal
|
||||
26) Added additional control/mode commands to the pskmail/ARQ SYSV message
|
||||
queue processor. Mode command strings are now:
|
||||
26) Added additional control/mode commands to the pskmail/ARQ SYSV
|
||||
message queue processor. Mode command strings are now:
|
||||
CW : <cmd><mode>CW</mode></cmd>
|
||||
DOMINO EX4 : <cmd><mode>DOMINOEX4</mode></cmd>
|
||||
DOMINO EX5 : <cmd><mode>DOMINOEX5</mode></cmd>
|
||||
|
@ -162,12 +163,13 @@ Change Log:
|
|||
this will cause fldigi to enter the TUNE mode for a very brief
|
||||
100 milliseconds.
|
||||
27) Abandoned the original fldigi.def configuration file and changed to
|
||||
an xml based configuration file. New file is $HOME/.fldigi/fldigi_def.xml
|
||||
an xml based configuration file. New file is
|
||||
$HOME/.fldigi/fldigi_def.xml
|
||||
You may delete all occurances of
|
||||
$HOME/.fldigi/fldigi.def, and
|
||||
$HOME/.fldigi/FLDIGI_XML.DEF
|
||||
Future changes to the configuration should never require deleting the old
|
||||
configuration file.
|
||||
Future changes to the configuration should never require deleting the
|
||||
old configuration file.
|
||||
You will need to reconfigure and save the program configuration the
|
||||
first time the new version of fldigi is executed.
|
||||
28) Added numerous command line switches which control the look and feel.
|
||||
|
|
53
INSTALL
53
INSTALL
|
@ -3,17 +3,16 @@ Installation Instructions for fldigi
|
|||
|
||||
To compile fldigi you will need:
|
||||
|
||||
* A recent C++ compiler. The GNU C++ compilers in the 4.x series are
|
||||
* A recent C++ compiler. The GNU C++ compilers in the 4.x series are
|
||||
known to work. Building with g++ 3.x requires the development files
|
||||
for the Boost C++ library.
|
||||
|
||||
* Version 1.1.x of the Fast Light Tool Kit (FLTK), with its
|
||||
development libraries and headers. Version 1.1.7 and pre-releases of
|
||||
1.1.8 are known to work. FLTK's multi-threading support is required.
|
||||
development library and headers. Version 1.1.7 and pre-releases of
|
||||
1.1.8 are known to work. FLTK's multi-threading support is required.
|
||||
|
||||
You should also install the libraries and headers for PortAudio, the
|
||||
Portable audio I/O library. It is possible, but not recommended, to
|
||||
compile fldigi without PortAudio; see below.
|
||||
Portable audio I/O library.
|
||||
|
||||
Additional features are enabled if the corresponding libraries are
|
||||
present on your system:
|
||||
|
@ -24,6 +23,18 @@ present on your system:
|
|||
* Audio file generation, capture and playback support is enabled if
|
||||
`configure' can find the sndfile library.
|
||||
|
||||
* The PulseAudio sound backend is compiled if the development files
|
||||
for libpulse-simple, the PulseAudio simple API library, are present.
|
||||
|
||||
Finally, fldigi requires the samplerate library but has its own copy to
|
||||
fall back on should it not be detected on your system. The following
|
||||
message will be printed in that case:
|
||||
|
||||
configure: WARNING: using bundled libsamplerate
|
||||
|
||||
If you are building packages for other users you should link fldigi
|
||||
with the libsamplerate that comes with your distribution.
|
||||
|
||||
|
||||
Once you have installed the required packages, the following commands
|
||||
should be sufficient to compile fldigi and install it under /usr/local:
|
||||
|
@ -32,19 +43,33 @@ should be sufficient to compile fldigi and install it under /usr/local:
|
|||
make
|
||||
make install (you may need superuser privileges for installation)
|
||||
|
||||
To disable PortAudio support you will need to pass an additional option
|
||||
to `configure':
|
||||
The `install' target installs the executable, an icon, and a .desktop
|
||||
file. After installation, an fldigi launcher should appear somewhere in
|
||||
your applications menu.
|
||||
|
||||
./configure --without-portaudio
|
||||
|
||||
Fldigi also requires the samplerate library, but has its own copy to
|
||||
fall back on should it not be detected on your system. The following
|
||||
message will be printed in that case:
|
||||
To run fldigi on Mac OS X you will need to create an app bundle. The
|
||||
Makefile has an `appbundle' target for this purpose that can be used
|
||||
instead of `install':
|
||||
|
||||
configure: using bundled libsamplerate
|
||||
make appbundle
|
||||
|
||||
If you are building packages for other users you should link fldigi
|
||||
with the libsamplerate that comes with your distribution.
|
||||
This target will generate two bundles inside the build directory (by
|
||||
default src/):
|
||||
|
||||
* mac-bundle/fldigi.app, which only contains the bare minimum that is
|
||||
required to run fldigi on the build system
|
||||
|
||||
* mac-libs-bundle/fldigi.app, which also includes copies of non-system
|
||||
libraries (such as PortAudio and FLTK) that the binary links to
|
||||
|
||||
The configure script has some support for building universal x86/ppc
|
||||
binaries. Pass the following additional arguments to enable it:
|
||||
|
||||
--enable-mac-universal --disable-dependency-tracking
|
||||
|
||||
OS X support is not yet well tested and any feedback/suggestions/patches
|
||||
will be very welcomed.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,3 +5,6 @@ SUBDIRS = src
|
|||
|
||||
flgen:
|
||||
(cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
|
||||
|
||||
appbundle:
|
||||
(cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
|
||||
|
|
29
configure.ac
29
configure.ac
|
@ -4,7 +4,24 @@
|
|||
AC_COPYRIGHT([Copyright (C) 2007, 2008 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)])
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([fldigi], [2.10M], [w1hkj AT w1hkj DOT com])
|
||||
|
||||
dnl major and minor must be integers; patch may
|
||||
dnl contain other characters or be empty
|
||||
m4_define(FLDIGI_MAJOR, [2])
|
||||
m4_define(FLDIGI_MINOR, [10])
|
||||
m4_define(FLDIGI_PATCH, [N])
|
||||
|
||||
AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com])
|
||||
|
||||
# substitute in Makefiles
|
||||
AC_SUBST([FLDIGI_VERSION_MAJOR], [FLDIGI_MAJOR])
|
||||
AC_SUBST([FLDIGI_VERSION_MINOR], [FLDIGI_MINOR])
|
||||
AC_SUBST([FLDIGI_VERSION_PATCH], [FLDIGI_PATCH])
|
||||
# define in config.h
|
||||
AC_DEFINE([FLDIGI_VERSION_MAJOR], [FLDIGI_MAJOR], [Major version number])
|
||||
AC_DEFINE([FLDIGI_VERSION_MINOR], [FLDIGI_MINOR], [Minor version number])
|
||||
AC_DEFINE([FLDIGI_VERSION_PATCH], ["FLDIGI_PATCH"], [Patch/alpha version string])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
# define build, build_cpu, build_vendor, build_os
|
||||
|
@ -21,8 +38,8 @@ AC_CONFIG_HEADER([src/config.h])
|
|||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
|
||||
AC_DEFINE(PACKAGE_HOME, ["http://www.w1hkj.com/Fldigi-2.x.html"], [Home page])
|
||||
AC_DEFINE(PACKAGE_DOCS, ["http://www.w1hkj.com/FldigiHelp-2.0/index.html"], [Docs index])
|
||||
AC_DEFINE([PACKAGE_HOME], ["http://www.w1hkj.com/Fldigi-2.x.html"], [Home page])
|
||||
AC_DEFINE([PACKAGE_DOCS], ["http://www.w1hkj.com/FldigiHelp-2.0/index.html"], [Docs index])
|
||||
|
||||
|
||||
# Checks for programs.
|
||||
|
@ -146,6 +163,12 @@ AC_FLDIGI_PKG_CHECK([hamlib], [hamlib >= 1.2.4], [with], [HAMLIB],
|
|||
[use hamradio control libraries @<:@autodetect@:>@],
|
||||
[ENABLE_HAMLIB])
|
||||
|
||||
### OSX
|
||||
# Set ac_cv_mac_universal to yes/no
|
||||
# Set DARWIN Makefile conditional
|
||||
# Substitute MAC_UNIVERSAL_CFLAGS and MAC_UNIVERSAL_LDFLAGS in Makefile
|
||||
AC_FLDIGI_MACOSX
|
||||
|
||||
|
||||
### output
|
||||
AH_TOP([
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>%%IDENTIFIER%%</string>
|
||||
|
||||
<key>CFBundleName</key>
|
||||
<string>%%NAME%%</string>
|
||||
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
|
||||
<key>CFBundleSignature</key>
|
||||
<string>%%SIGNATURE%%</string>
|
||||
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>%%BINARY%%</string>
|
||||
|
||||
<key>CFBundleVersion</key>
|
||||
<string>%%VERSION%%</string>
|
||||
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>%%VERSION%%</string>
|
||||
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>%%VERSION%%</string>
|
||||
|
||||
<!--
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>%%ICON%%</string>
|
||||
-->
|
||||
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
<string>No</string>
|
||||
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright (c) 2006-2008 Dave Freese W1HKJ and others</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,42 @@
|
|||
AC_DEFUN([AC_FLDIGI_MACOSX], [
|
||||
case "$target_os" in
|
||||
darwin*)
|
||||
target_darwin="yes"
|
||||
;;
|
||||
*)
|
||||
target_darwin="no"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_ENABLE([mac-universal], AC_HELP_STRING([--enable-mac-universal],
|
||||
[build a universal binary on Mac OS X @<:@no@:>@]),
|
||||
[case "${enableval}" in
|
||||
yes|no) ac_cv_mac_universal="${enableval}" ;;
|
||||
*) AC_MSG_ERROR([bad value "${enableval}" for --enable-mac-universal]) ;;
|
||||
esac],
|
||||
[ac_cv_mac_universal=no])
|
||||
|
||||
if test "x$target_darwin" = "xyes" && test "x$ac_cv_mac_universal" = "xyes"; then
|
||||
mac_minversion="-mmacosx-version-min=10.4"
|
||||
case "$target_os" in
|
||||
darwin8*)
|
||||
mac_arches="-arch i386 -arch ppc"
|
||||
mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
|
||||
;;
|
||||
darwin9*)
|
||||
mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
|
||||
mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
|
||||
;;
|
||||
*)
|
||||
mac_arches=""
|
||||
mac_sysroot=""
|
||||
;;
|
||||
esac
|
||||
MAC_UNIVERSAL_CFLAGS="$mac_arches $mac_sysroot $mac_minversion"
|
||||
MAC_UNIVERSAL_LDFLAGS="-dynamiclib"
|
||||
fi
|
||||
AC_SUBST([MAC_UNIVERSAL_CFLAGS])
|
||||
AC_SUBST([MAC_UNIVERSAL_LDFLAGS])
|
||||
|
||||
AM_CONDITIONAL([DARWIN], [test "x$target_darwin" = "xyes"])
|
||||
])
|
|
@ -28,8 +28,8 @@ else
|
|||
PKG_CHECK_MODULES([$4], [$2]) # for the error message
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([$3][_CFLAGS])
|
||||
AC_SUBST([$3][_LIBS])
|
||||
AC_SUBST([$4][_CFLAGS])
|
||||
AC_SUBST([$4][_LIBS])
|
||||
|
||||
m4_ifval([$6], [ AM_CONDITIONAL([$6], [test "x$ac_cv_[]$1" = "xyes"]) ], [:])
|
||||
])
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
#!/bin/sh
|
||||
|
||||
### Script to create the .app structure for osx
|
||||
### 20080227 Stelios Bounanos M0GLD
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Syntax: $0 data-dir build-dir" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PWD=`pwd`
|
||||
data="${PWD}/$1"
|
||||
build="${PWD}/$2"
|
||||
# more sanity checks
|
||||
for d in "$data" "$build"; do
|
||||
test -d "$d" && continue
|
||||
echo "%{d}: not a directory" >&2
|
||||
exit 1
|
||||
done
|
||||
if ! test -w "$build"; then
|
||||
echo "%{build} is not writeable" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
plist="${data}/mac/Info.plist.in"
|
||||
icons="${data}/mac/fldigi.icns"
|
||||
for f in "$plist" "$icons"; do
|
||||
test -r "$f" && continue
|
||||
echo "%{f}: not readable" >&2
|
||||
exit 1
|
||||
done
|
||||
|
||||
|
||||
identifier="com.w1hkj.fldigi"
|
||||
name="Fldigi"
|
||||
signature="fldg"
|
||||
binary="fldigi"
|
||||
version="${FLDIGI_VERSION_MAJOR}.${FLDIGI_VERSION_MINOR}"
|
||||
icon="`basename $icons`"
|
||||
|
||||
set -e
|
||||
|
||||
cd "$build"
|
||||
|
||||
# bundle the binary
|
||||
echo "Creating ${build}/mac-bundle/"$PACKAGE".app"
|
||||
$mkinstalldirs mac-bundle/"$PACKAGE".app/Contents/MacOS mac-bundle/"$PACKAGE".app/Contents/Resources
|
||||
cd mac-bundle
|
||||
$INSTALL_STRIP_PROGRAM "${build}/$binary" "$PACKAGE".app/Contents/MacOS
|
||||
# $INSTALL_DATA "$icons" "$PACKAGE".app/Contents/Resources
|
||||
echo "APPL${signature}" > "$PACKAGE".app/Contents/PkgInfo
|
||||
sed -e "s!%%IDENTIFIER%%!${identifier}!g; s!%%NAME%%!${name}!g;\
|
||||
s!%%SIGNATURE%%!${signature}!g; s!%%BINARY%%!${binary}!g;\
|
||||
s!%%VERSION%%!${version}!g; s!%%ICON%%!${icon}!g;" < "$plist" > "$PACKAGE".app/Contents/Info.plist
|
||||
if grep '%%[A-Z]*%%' "$PACKAGE".app/Contents/Info.plist; then
|
||||
echo "Unsubstituted variables in Info.plist!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# bundle the binary and its non-standard dependencies
|
||||
echo "Creating ${build}/mac-libs-bundle/"$PACKAGE".app"
|
||||
cd ..
|
||||
$mkinstalldirs mac-libs-bundle
|
||||
cp -pR mac-bundle/"$PACKAGE".app mac-libs-bundle
|
||||
$mkinstalldirs mac-libs-bundle/"$PACKAGE".app/Contents/Frameworks
|
||||
cd mac-libs-bundle/"$PACKAGE".app/Contents
|
||||
|
||||
list="MacOS/$binary"
|
||||
while test "x$list" != "x"; do
|
||||
change="$list"
|
||||
list=""
|
||||
|
||||
for obj in $change; do
|
||||
for lib in `otool -L $obj | \
|
||||
sed -n 's!^.*[[:space:]]\([^[:space:]]*\.dylib\).*$!\1!p' | \
|
||||
grep -Ev '^/(usr/lib|System)'`; do
|
||||
libfn="`basename $lib`"
|
||||
if ! test -f "Frameworks/$libfn"; then
|
||||
cp "$lib" "Frameworks/$libfn"
|
||||
install_name_tool -id "@executable_path/../Frameworks/$libfn" "Frameworks/$libfn"
|
||||
list="$list Frameworks/$libfn"
|
||||
fi
|
||||
install_name_tool -change "$lib" "@executable_path/../Frameworks/$libfn" "$obj"
|
||||
done
|
||||
done
|
||||
done
|
|
@ -8,9 +8,12 @@ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/irrxml @BOOST_CPPFLAGS
|
|||
|
||||
AM_CXXFLAGS = @PORTAUDIO_CFLAGS@ @FLTK_CFLAGS@ @SNDFILE_CFLAGS@ \
|
||||
@SAMPLERATE_CFLAGS@ @PULSEAUDIO_CFLAGS@ @HAMLIB_CFLAGS@ \
|
||||
@MAC_UNIVERSAL_CFLAGS@ \
|
||||
-pipe -Wall -O2 -ffast-math -fexceptions -finline-functions
|
||||
AM_CFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
AM_LDFLAGS = @MAC_UNIVERSAL_LDFLAGS@
|
||||
|
||||
LDADD = @PORTAUDIO_LIBS@ @BOOST_LDFLAGS@ @FLTK_LIBS@ @SNDFILE_LIBS@ \
|
||||
@SAMPLERATE_LIBS@ @PULSEAUDIO_LIBS@ @HAMLIB_LIBS@ @RTLIB@
|
||||
|
||||
|
@ -28,7 +31,7 @@ fldigi_SOURCES =
|
|||
|
||||
if ENABLE_DEBUG
|
||||
AM_CPPFLAGS += -UNDEBUG
|
||||
LDFLAGS += @RDYNAMIC@
|
||||
AM_LDFLAGS += @RDYNAMIC@
|
||||
else
|
||||
AM_CPPFLAGS += -DNDEBUG
|
||||
endif
|
||||
|
@ -42,8 +45,12 @@ if ENABLE_HAMLIB
|
|||
fldigi_SOURCES += $(HAMLIB_SRC)
|
||||
endif
|
||||
|
||||
FLDIGI_VERSION_MAJOR = @FLDIGI_VERSION_MAJOR@
|
||||
FLDIGI_VERSION_MINOR = @FLDIGI_VERSION_MINOR@
|
||||
FLDIGI_VERSION_PATCH = @FLDIGI_VERSION_PATCH@
|
||||
|
||||
.EXPORT_ALL_VARIABLES: versions.h appbundle
|
||||
|
||||
.EXPORT_ALL_VARIABLES: versions.h
|
||||
versions.h: $(srcdir)/include/versions.h.in
|
||||
sh $(srcdir)/../scripts/mkversions.sh $^ $@ || echo > $@
|
||||
|
||||
|
@ -76,10 +83,23 @@ flgen: $(srcdir)/dialogs/confdialog.fl $(srcdir)/rigcontrol/rigdialog.fl
|
|||
$(FLUID) -c -o ../rigcontrol/rigdialog.cxx -h rigdialog.h ../rigcontrol/rigdialog.fl)
|
||||
else
|
||||
flgen:
|
||||
@echo
|
||||
@echo >&2
|
||||
@echo "*** The code and headers cannot be generated from the .fl source" >&2
|
||||
@echo "*** files because the fluid utility was not found on your system" >&2
|
||||
@echo
|
||||
@echo >&2
|
||||
@false
|
||||
endif
|
||||
|
||||
if DARWIN
|
||||
appbundle:
|
||||
sh $(srcdir)/../scripts/mkappbundle.sh "$(srcdir)/../data" .
|
||||
clean-local:
|
||||
@rm -rf mac-bundle mac-libs-bundle
|
||||
else
|
||||
appbundle:
|
||||
@echo >&2
|
||||
@echo "*** This target only works on OSX ***" >&2
|
||||
@echo >&2
|
||||
@false
|
||||
endif
|
||||
|
||||
|
@ -120,6 +140,7 @@ fldigi_SOURCES += \
|
|||
include/analysis.h \
|
||||
include/ascii.h \
|
||||
include/colorbox.h \
|
||||
include/colorsfonts.h \
|
||||
include/combo.h \
|
||||
include/complex.h \
|
||||
include/configuration.h \
|
||||
|
@ -216,6 +237,7 @@ fldigi_SOURCES += \
|
|||
mfsk/mfskvaricode.cxx \
|
||||
misc/ascii.cxx \
|
||||
misc/configuration.cxx \
|
||||
misc/colorsfonts.cxx \
|
||||
misc/flstring.c \
|
||||
misc/log.cxx \
|
||||
misc/macroedit.cxx \
|
||||
|
@ -296,10 +318,12 @@ EXTRA_fldigi_SOURCES += \
|
|||
# Additional non-source files that we distribute
|
||||
EXTRA_DIST = \
|
||||
$(srcdir)/../scripts/mkversions.sh \
|
||||
$(srcdir)/../scripts/mkappbundle.sh \
|
||||
$(srcdir)/../data/fldigi-psk.png \
|
||||
$(srcdir)/../data/fldigi-rtty.png \
|
||||
$(srcdir)/../data/fldigi.xpm \
|
||||
$(srcdir)/../data/fldigi.desktop \
|
||||
$(srcdir)/../data/mac/Info.plist.in \
|
||||
fileselector/allfiles.xbm \
|
||||
fileselector/d1.xbm \
|
||||
fileselector/d1_mask.xbm \
|
||||
|
|
|
@ -35,7 +35,7 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
|
|||
code {} {}
|
||||
Fl_Window {} {
|
||||
label {fldigi - config} open
|
||||
xywh {396 414 400 250} type Double color 45 selection_color 51 align 80 visible
|
||||
xywh {562 95 400 250} type Double color 45 selection_color 51 align 80 visible
|
||||
} {
|
||||
Fl_Tabs tabsConfigure {open
|
||||
xywh {0 0 405 220} color 47 selection_color 9
|
||||
|
@ -1118,20 +1118,20 @@ progdefaults.changed = true;}
|
|||
}
|
||||
}
|
||||
Fl_Group tabOlivia {
|
||||
label Olivia open
|
||||
xywh {0 50 400 170} color 51 selection_color 51 hide
|
||||
label Olivia open selected
|
||||
xywh {0 50 400 170} color 51 selection_color 51
|
||||
} {
|
||||
Fl_Choice mnuOlivia_Tones {
|
||||
label Tones
|
||||
callback {progdefaults.changed = true;} open
|
||||
xywh {90 72 85 20} down_box BORDER_BOX
|
||||
xywh {105 72 70 22} down_box BORDER_BOX
|
||||
code0 {o->add(szOliviaTones);}
|
||||
code1 {o->value(2);}
|
||||
} {}
|
||||
Fl_Choice mnuOlivia_Bandwidth {
|
||||
label Bandwidth
|
||||
callback {progdefaults.changed = true;} open
|
||||
xywh {270 72 85 20} down_box BORDER_BOX
|
||||
xywh {270 72 85 22} down_box BORDER_BOX
|
||||
code0 {o->add(szOliviaBandwidth);}
|
||||
code1 {o->value(2);}
|
||||
} {}
|
||||
|
@ -1145,17 +1145,17 @@ progdefaults.changed = true;}
|
|||
Fl_Counter cntOlivia_smargin {
|
||||
label {RX sync tune margin}
|
||||
callback {progdefaults.changed = true;}
|
||||
xywh {90 105 85 20} type Simple align 8 minimum 2 maximum 128 step 1 value 2
|
||||
xywh {90 105 85 22} type Simple align 8 minimum 2 maximum 128 step 1 value 8
|
||||
}
|
||||
Fl_Counter cntOlivia_sinteg {
|
||||
label {RX sync integration period}
|
||||
callback {progdefaults.changed = true;}
|
||||
xywh {90 135 85 20} type Simple align 8 minimum 2 maximum 128 step 1 value 2
|
||||
xywh {90 135 85 22} type Simple align 8 minimum 2 maximum 128 step 1 value 4
|
||||
}
|
||||
}
|
||||
Fl_Group tabPSK {
|
||||
label Psk open
|
||||
xywh {0 50 400 170}
|
||||
xywh {0 50 400 170} hide
|
||||
} {
|
||||
Fl_Counter cntSearchRange {
|
||||
label {Acq Srch Range}
|
||||
|
@ -1240,7 +1240,7 @@ progdefaults.changed = true;}
|
|||
Fl_Counter cntACQsn {
|
||||
label {Acq s/n (db)}
|
||||
callback {progdefaults.ACQsn = (int)o->value();
|
||||
progdefaults.changed = true;} selected
|
||||
progdefaults.changed = true;}
|
||||
xywh {220 60 80 21} type Simple align 8 minimum 3 maximum 20 step 1 value 6
|
||||
code0 {o->value(progdefaults.ACQsn);}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@
|
|||
|
||||
#include "confdialog.h"
|
||||
#include "configuration.h"
|
||||
#include "colorsfonts.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "macroedit.h"
|
||||
#include "logger.h"
|
||||
|
@ -465,6 +467,43 @@ void macro_cb(Fl_Widget *w, void *v)
|
|||
restoreFocus();
|
||||
}
|
||||
|
||||
void colorize_macro(int i)
|
||||
{
|
||||
if (i < 4){
|
||||
btnMacro[i]->color(fl_rgb_color(
|
||||
progdefaults.btnGroup1.R,
|
||||
progdefaults.btnGroup1.G,
|
||||
progdefaults.btnGroup1.B));
|
||||
} else if (i < 8) {
|
||||
btnMacro[i]->color(fl_rgb_color(
|
||||
progdefaults.btnGroup2.R,
|
||||
progdefaults.btnGroup2.G,
|
||||
progdefaults.btnGroup2.B));
|
||||
btnMacro[i]->labelcolor(FL_WHITE);
|
||||
} else {
|
||||
btnMacro[i]->color(fl_rgb_color(
|
||||
progdefaults.btnGroup3.R,
|
||||
progdefaults.btnGroup3.G,
|
||||
progdefaults.btnGroup3.B));
|
||||
btnMacro[i]->labelcolor(FL_WHITE);
|
||||
}
|
||||
btnMacro[i]->labelcolor(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnFkeyTextColor.R,
|
||||
progdefaults.btnFkeyTextColor.G,
|
||||
progdefaults.btnFkeyTextColor.B ));
|
||||
}
|
||||
|
||||
void colorize_macros()
|
||||
{
|
||||
FL_LOCK_D();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
colorize_macro(i);
|
||||
btnMacro[i]->redraw_label();
|
||||
}
|
||||
FL_UNLOCK_D();
|
||||
}
|
||||
|
||||
void altmacro_cb(Fl_Widget *w, void *v)
|
||||
{
|
||||
altMacros = !altMacros;
|
||||
|
@ -573,35 +612,8 @@ void cb_mnuPlayback(Fl_Widget *w, void *d)
|
|||
}
|
||||
#endif // USE_SNDFILE
|
||||
|
||||
void cb_FontBrowser(Font_Browser*, void* v)
|
||||
{
|
||||
Font_Browser *ft= (Font_Browser*)v;
|
||||
|
||||
Fl_Font fnt = ft->fontNumber();
|
||||
int size = ft->fontSize();
|
||||
|
||||
ReceiveText->setFont(fnt);
|
||||
ReceiveText->setFontSize(size);
|
||||
|
||||
TransmitText->setFont(fnt);
|
||||
TransmitText->setFontSize(size);
|
||||
|
||||
progdefaults.Fontnbr = (int)(fnt);
|
||||
progdefaults.FontSize = size;
|
||||
|
||||
ft->hide();
|
||||
}
|
||||
|
||||
void cb_mnuConfigFonts(Fl_Menu_*, void *) {
|
||||
static Font_Browser *b = (Font_Browser *)0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.Fontnbr);
|
||||
b->fontSize(progdefaults.FontSize);
|
||||
// b->fontColor(progdefaults.FontColor);
|
||||
}
|
||||
b->callback((Fl_Callback*)cb_FontBrowser, (void*)(b));
|
||||
b->show();
|
||||
selectColorsFonts();
|
||||
}
|
||||
|
||||
void cb_mnuSaveConfig(Fl_Menu_ *, void *) {
|
||||
|
@ -609,11 +621,6 @@ void cb_mnuSaveConfig(Fl_Menu_ *, void *) {
|
|||
restoreFocus();
|
||||
}
|
||||
|
||||
//void cb_mnuHelp(Fl_Menu_*,void*) {
|
||||
// show_help();
|
||||
// restoreFocus();
|
||||
//}
|
||||
|
||||
void cb_mnuAbout(Fl_Widget*, void*)
|
||||
{
|
||||
fl_message ("%s @@W1HKJ\n\n%s\n\n%s\n\nVersion %s", PACKAGE_NAME,
|
||||
|
@ -827,7 +834,6 @@ void afconoff_cb(Fl_Widget *w, void *vi)
|
|||
{
|
||||
FL_LOCK_D();
|
||||
Fl_Button *b = (Fl_Button *)w;
|
||||
// Fl_Light_Button *b = (Fl_Light_Button *)w;
|
||||
int v = b->value();
|
||||
FL_UNLOCK_D();
|
||||
active_modem->set_afcOnOff(v);
|
||||
|
@ -838,7 +844,6 @@ void sqlonoff_cb(Fl_Widget *w, void *vi)
|
|||
{
|
||||
FL_LOCK_D();
|
||||
Fl_Button *b = (Fl_Button *)w;
|
||||
// Fl_Light_Button *b = (Fl_Light_Button *)w;
|
||||
int v = b->value();
|
||||
FL_UNLOCK_D();
|
||||
active_modem->set_sqlchOnOff( v ? true : false );
|
||||
|
@ -991,7 +996,7 @@ Fl_Menu_Item menu_[] = {
|
|||
|
||||
{"Configure", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Defaults", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Fonts", 0, (Fl_Callback*)cb_mnuConfigFonts, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Fonts-Colors", 0, (Fl_Callback*)cb_mnuConfigFonts, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Operator", 0, (Fl_Callback*)cb_mnuConfigOperator, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Waterfall", 0, (Fl_Callback*)cb_mnuConfigWaterfall, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{"Video", 0, (Fl_Callback*)cb_mnuConfigVideo, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
|
@ -1275,7 +1280,11 @@ void create_fl_digi_main() {
|
|||
ReceiveText = new FTextView(sw, Y, WNOM-sw, minRxHeight, "");
|
||||
else
|
||||
ReceiveText = new TextView(sw, Y, WNOM-sw, minRxHeight, "");
|
||||
|
||||
ReceiveText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.RxColor.R,
|
||||
progdefaults.RxColor.G,
|
||||
progdefaults.RxColor.B));
|
||||
FHdisp = new Raster(sw, Y, WNOM-sw, minRxHeight);
|
||||
FHdisp->hide();
|
||||
Y += minRxHeight;
|
||||
|
@ -1284,6 +1293,12 @@ void create_fl_digi_main() {
|
|||
TransmitText = new FTextEdit(sw, Y, WNOM-sw, minTxHeight);
|
||||
else
|
||||
TransmitText = new TextEdit(sw, Y, WNOM-sw, minTxHeight);
|
||||
TransmitText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.TxColor.R,
|
||||
progdefaults.TxColor.G,
|
||||
progdefaults.TxColor.B));
|
||||
|
||||
Y += minTxHeight;
|
||||
|
||||
TiledGroup->resizable(minbox);
|
||||
|
@ -1305,6 +1320,7 @@ void create_fl_digi_main() {
|
|||
btnMacro[i] = new Fl_Button(xpos, Y+2, Wbtn, Hmacros - 4);
|
||||
btnMacro[i]->callback(macro_cb, (void *)i);
|
||||
btnMacro[i]->label( (macros.name[i]).c_str());
|
||||
colorize_macro(i);
|
||||
xpos += Wbtn;
|
||||
}
|
||||
bx = new Fl_Box(xpos, Y+2, WNOM - 32 - xpos, Hmacros - 4);
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// colorsfonts.cxx
|
||||
//
|
||||
// Copyright (C) 2006
|
||||
// Dave Freese, W1HKJ
|
||||
//
|
||||
// This file is part of fldigi.
|
||||
//
|
||||
// fldigi is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// fldigi is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with fldigi; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef colorsfonts_h
|
||||
#define colorsfonts_h
|
||||
|
||||
#include "fl_digi.h"
|
||||
#include "configuration.h"
|
||||
#include "font_browser.h"
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Color_Chooser.H>
|
||||
#include <FL/Fl_Double_Window.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Check_Button.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Multiline_Output.H>
|
||||
|
||||
void selectColorsFonts();
|
||||
|
||||
extern void cbRxFontBrowser(Font_Browser*, void* v);
|
||||
extern void cbTxFontBrowser(Font_Browser*, void* v);
|
||||
extern void cb_ColorFontOK();
|
||||
extern void make_colorsfonts();
|
||||
|
||||
extern Fl_Check_Button *btnUseColoredFkeys;
|
||||
extern Fl_Button *btnGroup1;
|
||||
extern Fl_Button *btnGroup2;
|
||||
extern Fl_Button *btnGroup3;
|
||||
extern Fl_Button *btnFkeyTextColor;
|
||||
extern Fl_Button *btnFkeyDefaults;
|
||||
extern Fl_Multiline_Output *RxText;
|
||||
extern Fl_Multiline_Output *TxText;
|
||||
extern Fl_Button *btnRxColor;
|
||||
extern Fl_Button *btnRxFont;
|
||||
extern Fl_Button *btnTxColor;
|
||||
extern Fl_Button *btnTxFont;
|
||||
extern Fl_Button *btnTextDefaults;
|
||||
extern Fl_Button *btnClrFntOK;
|
||||
|
||||
#endif
|
|
@ -166,6 +166,20 @@ struct configuration {
|
|||
|
||||
// waterfall palette
|
||||
RGBint cfgpal[9];
|
||||
|
||||
// Button key color palette
|
||||
RGBint btnGroup1;
|
||||
RGBint btnGroup2;
|
||||
RGBint btnGroup3;
|
||||
RGBint btnFkeyTextColor;
|
||||
|
||||
// Rx / Tx fonts & palettes
|
||||
int RxFontnbr;
|
||||
int RxFontsize;
|
||||
int TxFontnbr;
|
||||
int TxFontsize;
|
||||
RGBint RxColor;
|
||||
RGBint TxColor;
|
||||
|
||||
bool alt_text_widgets;
|
||||
|
||||
|
@ -206,4 +220,6 @@ extern configuration progdefaults;
|
|||
extern void mixerInputs();
|
||||
extern void enableMixer(bool);
|
||||
|
||||
enum { SAMPLE_RATE_UNSET = -1, SAMPLE_RATE_AUTO, SAMPLE_RATE_NATIVE, SAMPLE_RATE_OTHER };
|
||||
|
||||
#endif
|
||||
|
|
|
@ -145,4 +145,7 @@ extern void init_modem_sync(trx_mode mode);
|
|||
|
||||
extern void change_modem_param(int state);
|
||||
|
||||
extern void colorize_macro(int i);
|
||||
extern void colorize_macros();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -143,7 +143,6 @@ public:
|
|||
virtual size_t Write(double *, size_t) = 0;
|
||||
virtual size_t Write_stereo(double *, double *, size_t) = 0;
|
||||
virtual size_t Read(double *, size_t) = 0;
|
||||
virtual bool full_duplex(void) { return false; }
|
||||
#if USE_SNDFILE
|
||||
void get_file_params(const char* def_fname, char** fname, int* format);
|
||||
int Capture(bool val);
|
||||
|
@ -221,13 +220,13 @@ public:
|
|||
size_t Write(double *buf, size_t count);
|
||||
size_t Write_stereo(double *bufleft, double *bufright, size_t count);
|
||||
size_t Read(double *buf, size_t count);
|
||||
bool full_duplex(void);
|
||||
|
||||
private:
|
||||
void src_data_reset(int mode);
|
||||
void resample(int mode, float *buf, size_t count, size_t max = 0);
|
||||
void init_stream(unsigned dir);
|
||||
void start_stream(unsigned dir);
|
||||
void close_stream(unsigned dir);
|
||||
bool stream_active(unsigned dir);
|
||||
bool full_duplex_device(const PaDeviceInfo* dev);
|
||||
double find_srate(unsigned dir);
|
||||
|
@ -265,7 +264,6 @@ public:
|
|||
size_t Write(double* buf, size_t count);
|
||||
size_t Write_stereo(double* bufleft, double* bufright, size_t count);
|
||||
size_t Read(double *buf, size_t count);
|
||||
bool full_duplex(void) { return true; }
|
||||
|
||||
private:
|
||||
void src_data_reset(int mode);
|
||||
|
@ -290,7 +288,6 @@ public:
|
|||
size_t Write(double* buf, size_t count);
|
||||
size_t Write_stereo(double* bufleft, double* bufright, size_t count);
|
||||
size_t Read(double *buf, size_t count);
|
||||
bool full_duplex(void) { return true; }
|
||||
};
|
||||
|
||||
#endif // SOUND_H
|
||||
|
|
|
@ -37,6 +37,10 @@ extern "C" {
|
|||
# define read_memory_barrier() asm volatile ("lfence":::"memory")
|
||||
# define write_memory_barrier() asm volatile ("sfence":::"memory")
|
||||
*/
|
||||
# elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__)
|
||||
# define full_memory_barrier() asm volatile("sync":::"memory")
|
||||
# define read_memory_barrier() full_memory_barrier()
|
||||
# define write_memory_barrier() full_memory_barrier()
|
||||
# else
|
||||
# warning Memory barriers not defined on this system
|
||||
# define full_memory_barrier() ((void)0)
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
using namespace std;
|
||||
|
||||
string scDevice[2];
|
||||
bool pa_allow_full_duplex = false;
|
||||
int pa_frames_per_buffer = 0;
|
||||
|
||||
char szHomedir[120] = "";
|
||||
|
@ -431,7 +430,7 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
OPT_WINDOW_WIDTH, OPT_WINDOW_HEIGHT, OPT_PROFILE, OPT_USE_CHECK,
|
||||
OPT_RESAMPLE,
|
||||
#if USE_PORTAUDIO
|
||||
OPT_ALLOW_FULL_DUPLEX, OPT_FRAMES_PER_BUFFER,
|
||||
OPT_FRAMES_PER_BUFFER,
|
||||
#endif
|
||||
OPT_EXIT_AFTER,
|
||||
OPT_HELP, OPT_VERSION };
|
||||
|
@ -454,7 +453,6 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
{ "resample", 1, 0, OPT_RESAMPLE },
|
||||
|
||||
#if USE_PORTAUDIO
|
||||
{ "full-duplex", 0, 0, OPT_ALLOW_FULL_DUPLEX },
|
||||
{ "frames-per-buf",1, 0, OPT_FRAMES_PER_BUFFER },
|
||||
#endif
|
||||
{ "exit-after", 1, 0, OPT_EXIT_AFTER },
|
||||
|
@ -549,9 +547,6 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
break;
|
||||
|
||||
#if USE_PORTAUDIO
|
||||
case OPT_ALLOW_FULL_DUPLEX:
|
||||
pa_allow_full_duplex = true;
|
||||
break;
|
||||
case OPT_FRAMES_PER_BUFFER:
|
||||
pa_frames_per_buffer = strtol(optarg, 0, 10);
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,438 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// colorsfonts.cxx
|
||||
//
|
||||
// Copyright (C) 2006
|
||||
// Dave Freese, W1HKJ
|
||||
//
|
||||
// This file is part of fldigi.
|
||||
//
|
||||
// fldigi is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// fldigi is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with fldigi; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "colorsfonts.h"
|
||||
|
||||
Fl_Double_Window *dlgColorFont = (Fl_Double_Window *)0;
|
||||
Fl_Check_Button *btnUseColoredFkeys=(Fl_Check_Button *)0;
|
||||
Fl_Button *btnGroup1=(Fl_Button *)0;
|
||||
Fl_Button *btnGroup2=(Fl_Button *)0;
|
||||
Fl_Button *btnGroup3=(Fl_Button *)0;
|
||||
Fl_Button *btnFkeyTextColor=(Fl_Button *)0;
|
||||
Fl_Button *btnFkeyDefaults=(Fl_Button *)0;
|
||||
Fl_Multiline_Output *RxText=(Fl_Multiline_Output *)0;
|
||||
Fl_Multiline_Output *TxText=(Fl_Multiline_Output *)0;
|
||||
Fl_Button *btnRxColor=(Fl_Button *)0;
|
||||
Fl_Button *btnRxFont=(Fl_Button *)0;
|
||||
Fl_Button *btnTxColor=(Fl_Button *)0;
|
||||
Fl_Button *btnTxFont=(Fl_Button *)0;
|
||||
Fl_Button *btnTextDefaults=(Fl_Button *)0;
|
||||
Fl_Button *btnClrFntOK=(Fl_Button *)0;
|
||||
|
||||
void selectColorsFonts()
|
||||
{
|
||||
if (!dlgColorFont)
|
||||
make_colorsfonts();
|
||||
dlgColorFont->show();
|
||||
}
|
||||
|
||||
void cb_ColorFontOK()
|
||||
{
|
||||
dlgColorFont->hide();
|
||||
}
|
||||
|
||||
static void cb_btnUseColoredFkeys(Fl_Check_Button* o, void*)
|
||||
{
|
||||
// progdefaults.UseColoredFkeys = o->value();
|
||||
// progdefaults.changed = true;
|
||||
}
|
||||
|
||||
static void cb_btnGroup1(Fl_Button* o, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.btnGroup1.R;
|
||||
g = progdefaults.btnGroup1.G;
|
||||
b = progdefaults.btnGroup1.B;
|
||||
int res = fl_color_chooser("Group 1", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.btnGroup1.R = r;
|
||||
progdefaults.btnGroup1.G = g;
|
||||
progdefaults.btnGroup1.B = b;
|
||||
o->color(fl_rgb_color(r,g,b));
|
||||
progdefaults.changed = true;
|
||||
colorize_macros();
|
||||
}
|
||||
}
|
||||
|
||||
static void cb_btnGroup2(Fl_Button* o, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.btnGroup2.R;
|
||||
g = progdefaults.btnGroup2.G;
|
||||
b = progdefaults.btnGroup2.B;
|
||||
int res = fl_color_chooser("Group 1", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.btnGroup2.R = r;
|
||||
progdefaults.btnGroup2.G = g;
|
||||
progdefaults.btnGroup2.B = b;
|
||||
o->color(fl_rgb_color(r,g,b));
|
||||
progdefaults.changed = true;
|
||||
colorize_macros();
|
||||
}
|
||||
}
|
||||
|
||||
static void cb_btnGroup3(Fl_Button* o, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.btnGroup3.R;
|
||||
g = progdefaults.btnGroup3.G;
|
||||
b = progdefaults.btnGroup3.B;
|
||||
int res = fl_color_chooser("Group 1", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.btnGroup3.R = r;
|
||||
progdefaults.btnGroup3.G = g;
|
||||
progdefaults.btnGroup3.B = b;
|
||||
o->color(fl_rgb_color(r,g,b));
|
||||
progdefaults.changed = true;
|
||||
colorize_macros();
|
||||
}
|
||||
}
|
||||
|
||||
static void cb_btnFkeyTextColor(Fl_Button* o, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.btnFkeyTextColor.R;
|
||||
g = progdefaults.btnFkeyTextColor.G;
|
||||
b = progdefaults.btnFkeyTextColor.B;
|
||||
int res = fl_color_chooser("Fkey Text", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.btnFkeyTextColor.R = r;
|
||||
progdefaults.btnFkeyTextColor.G = g;
|
||||
progdefaults.btnFkeyTextColor.B = b;
|
||||
o->color(fl_rgb_color(r,g,b));
|
||||
btnGroup1->labelcolor(fl_rgb_color(r,g,b));
|
||||
btnGroup2->labelcolor(fl_rgb_color(r,g,b));
|
||||
btnGroup3->labelcolor(fl_rgb_color(r,g,b));
|
||||
btnGroup1->redraw_label();
|
||||
btnGroup2->redraw_label();
|
||||
btnGroup3->redraw_label();
|
||||
progdefaults.changed = true;
|
||||
colorize_macros();
|
||||
}
|
||||
}
|
||||
|
||||
static void cb_btnFkeyDefaults(Fl_Button*, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
Fl_Color clr;
|
||||
|
||||
r = 80; g = 144; b = 144;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
btnGroup1->color(clr);
|
||||
progdefaults.btnGroup1.R = r;
|
||||
progdefaults.btnGroup1.G = g;
|
||||
progdefaults.btnGroup1.B = b;
|
||||
|
||||
r = 144; g = 80; b = 80;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
btnGroup2->color(clr);
|
||||
progdefaults.btnGroup2.R = r;
|
||||
progdefaults.btnGroup2.G = g;
|
||||
progdefaults.btnGroup2.B = b;
|
||||
|
||||
r = 80; g = 80; b = 144;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
btnGroup3->color(clr);
|
||||
progdefaults.btnGroup3.R = r;
|
||||
progdefaults.btnGroup3.G = g;
|
||||
progdefaults.btnGroup3.B = b;
|
||||
|
||||
r = 255; g = 255; b = 255;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
btnFkeyTextColor->color(clr);
|
||||
btnFkeyTextColor->redraw_label();
|
||||
progdefaults.btnFkeyTextColor.R = r;
|
||||
progdefaults.btnFkeyTextColor.G = g;
|
||||
progdefaults.btnFkeyTextColor.B = b;
|
||||
|
||||
btnGroup1->labelcolor(clr);
|
||||
btnGroup1->redraw_label();
|
||||
|
||||
btnGroup2->labelcolor(clr);
|
||||
btnGroup2->redraw_label();
|
||||
|
||||
btnGroup3->labelcolor(clr);
|
||||
btnGroup3->redraw_label();
|
||||
progdefaults.changed = true;
|
||||
colorize_macros();
|
||||
}
|
||||
|
||||
static void cb_btnRxColor(Fl_Button*, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.RxColor.R;
|
||||
g = progdefaults.RxColor.G;
|
||||
b = progdefaults.RxColor.B;
|
||||
int res = fl_color_chooser("Rx Color", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.RxColor.R = r;
|
||||
progdefaults.RxColor.G = g;
|
||||
progdefaults.RxColor.B = b;
|
||||
ReceiveText->color(fl_rgb_color(r,g,b));
|
||||
ReceiveText->damage();
|
||||
RxText->color(fl_rgb_color(r,g,b));
|
||||
RxText->redraw();
|
||||
progdefaults.changed = true;
|
||||
ReceiveText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.RxColor.R,
|
||||
progdefaults.RxColor.G,
|
||||
progdefaults.RxColor.B));
|
||||
ReceiveText->redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void cbRxFontBrowser(Font_Browser*, void* v)
|
||||
{
|
||||
Font_Browser *ft= (Font_Browser*)v;
|
||||
Fl_Font fnt = ft->fontNumber();
|
||||
int size = ft->fontSize();
|
||||
|
||||
RxText->textfont(fnt);
|
||||
RxText->textsize(size);
|
||||
RxText->redraw();
|
||||
|
||||
progdefaults.RxFontnbr = (int)(fnt);
|
||||
progdefaults.RxFontsize = size;
|
||||
progdefaults.changed = true;
|
||||
|
||||
ReceiveText->textfont(fnt);
|
||||
ReceiveText->textsize(size);
|
||||
ReceiveText->redraw();
|
||||
|
||||
ft->hide();
|
||||
}
|
||||
|
||||
static void cb_btnRxFont(Fl_Button*, void*)
|
||||
{
|
||||
static Font_Browser *b = (Font_Browser *)0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.Fontnbr);
|
||||
b->fontSize(progdefaults.FontSize);
|
||||
}
|
||||
b->callback((Fl_Callback*)cbRxFontBrowser, (void*)(b));
|
||||
b->show();
|
||||
}
|
||||
|
||||
static void cb_btnTxColor(Fl_Button*, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
r = progdefaults.TxColor.R;
|
||||
g = progdefaults.TxColor.G;
|
||||
b = progdefaults.TxColor.B;
|
||||
int res = fl_color_chooser("Rx Color", r, g, b);
|
||||
if (res) {
|
||||
progdefaults.TxColor.R = r;
|
||||
progdefaults.TxColor.G = g;
|
||||
progdefaults.TxColor.B = b;
|
||||
TransmitText->color(fl_rgb_color(r,g,b));
|
||||
TransmitText->damage();
|
||||
TxText->color(fl_rgb_color(r,g,b));
|
||||
TxText->redraw();
|
||||
progdefaults.changed = true;
|
||||
TransmitText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.TxColor.R,
|
||||
progdefaults.TxColor.G,
|
||||
progdefaults.TxColor.B));
|
||||
TransmitText->redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void cbTxFontBrowser(Font_Browser*, void* v)
|
||||
{
|
||||
Font_Browser *ft= (Font_Browser*)v;
|
||||
Fl_Font fnt = ft->fontNumber();
|
||||
int size = ft->fontSize();
|
||||
|
||||
TxText->textfont(fnt);
|
||||
TxText->textsize(size);
|
||||
TxText->redraw();
|
||||
|
||||
progdefaults.TxFontnbr = (int)(fnt);
|
||||
progdefaults.TxFontsize = size;
|
||||
progdefaults.changed = true;
|
||||
|
||||
TransmitText->textfont(fnt);
|
||||
TransmitText->textsize(size);
|
||||
TransmitText->redraw();
|
||||
|
||||
ft->hide();
|
||||
}
|
||||
|
||||
static void cb_btnTxFont(Fl_Button*, void*)
|
||||
{
|
||||
static Font_Browser *b = (Font_Browser *)0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.Fontnbr);
|
||||
b->fontSize(progdefaults.FontSize);
|
||||
}
|
||||
b->callback((Fl_Callback*)cbTxFontBrowser, (void*)(b));
|
||||
b->show();
|
||||
}
|
||||
|
||||
static void cb_btnTextDefaults(Fl_Button*, void*)
|
||||
{
|
||||
uchar r, g, b;
|
||||
Fl_Color clr;
|
||||
|
||||
r = 255; g = 242; b = 190;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
RxText->color(clr);
|
||||
RxText->redraw();
|
||||
ReceiveText->color(clr);
|
||||
ReceiveText->redraw();
|
||||
|
||||
r = 200; g = 235; b = 255;
|
||||
clr = fl_rgb_color(r,g,b);
|
||||
TxText->color(clr);
|
||||
TxText->redraw();
|
||||
TransmitText->color(clr);
|
||||
TransmitText->redraw();
|
||||
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
static void cb_btnClrFntOK(Fl_Button*, void*)
|
||||
{
|
||||
cb_ColorFontOK();
|
||||
}
|
||||
|
||||
void make_colorsfonts()
|
||||
{
|
||||
Fl_Double_Window* w;
|
||||
{ Fl_Double_Window* o = new Fl_Double_Window(370, 235, "Fldigi - Colors / Fonts");
|
||||
w = o;
|
||||
{ Fl_Group* o = new Fl_Group(0, 5, 185, 200, "Function Keys");
|
||||
o->box(FL_ENGRAVED_FRAME);
|
||||
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
|
||||
|
||||
btnUseColoredFkeys = new Fl_Check_Button(10, 30, 70, 15, "use colored buttons");
|
||||
btnUseColoredFkeys->down_box(FL_DOWN_BOX);
|
||||
btnUseColoredFkeys->callback((Fl_Callback*)cb_btnUseColoredFkeys);
|
||||
// btnUseColoredFkeys->value(progdefaults.UseColoredFkeys);
|
||||
|
||||
btnGroup1 = new Fl_Button(95, 55, 70, 20, "Text");
|
||||
btnGroup1->callback((Fl_Callback*)cb_btnGroup1);
|
||||
btnGroup1->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnGroup1.R,
|
||||
progdefaults.btnGroup1.G,
|
||||
progdefaults.btnGroup1.B));
|
||||
btnGroup1->labelcolor(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnFkeyTextColor.R,
|
||||
progdefaults.btnFkeyTextColor.G,
|
||||
progdefaults.btnFkeyTextColor.B));
|
||||
|
||||
new Fl_Box(15, 56, 75, 20, "Group 1");
|
||||
btnGroup2 = new Fl_Button(95, 84, 70, 20, "Text");
|
||||
btnGroup2->callback((Fl_Callback*)cb_btnGroup2);
|
||||
btnGroup2->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnGroup2.R,
|
||||
progdefaults.btnGroup2.G,
|
||||
progdefaults.btnGroup2.B));
|
||||
btnGroup2->labelcolor(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnFkeyTextColor.R,
|
||||
progdefaults.btnFkeyTextColor.G,
|
||||
progdefaults.btnFkeyTextColor.B));
|
||||
|
||||
new Fl_Box(15, 85, 75, 20, "Group 2");
|
||||
btnGroup3 = new Fl_Button(95, 114, 70, 20, "Text");
|
||||
btnGroup3->callback((Fl_Callback*)cb_btnGroup3);
|
||||
btnGroup3->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnGroup3.R,
|
||||
progdefaults.btnGroup3.G,
|
||||
progdefaults.btnGroup3.B));
|
||||
btnGroup3->labelcolor(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnFkeyTextColor.R,
|
||||
progdefaults.btnFkeyTextColor.G,
|
||||
progdefaults.btnFkeyTextColor.B));
|
||||
|
||||
new Fl_Box(15, 115, 75, 20, "Group 3");
|
||||
btnFkeyTextColor = new Fl_Button(95, 145, 70, 20);
|
||||
btnFkeyTextColor->callback((Fl_Callback*)cb_btnFkeyTextColor);
|
||||
btnFkeyTextColor->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.btnFkeyTextColor.R,
|
||||
progdefaults.btnFkeyTextColor.G,
|
||||
progdefaults.btnFkeyTextColor.B));
|
||||
|
||||
new Fl_Box(15, 145, 75, 20, "Text Color");
|
||||
btnFkeyDefaults = new Fl_Button(95, 175, 70, 20, "Defaults");
|
||||
btnFkeyDefaults->callback((Fl_Callback*)cb_btnFkeyDefaults);
|
||||
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(185, 5, 185, 200, "Text Controls");
|
||||
o->box(FL_ENGRAVED_FRAME);
|
||||
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
|
||||
|
||||
RxText = new Fl_Multiline_Output(195, 30, 165, 37, "");
|
||||
RxText->value("Receive Text");
|
||||
RxText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.RxColor.R,
|
||||
progdefaults.RxColor.G,
|
||||
progdefaults.RxColor.B));
|
||||
|
||||
TxText = new Fl_Multiline_Output(195, 103, 165, 37, "");
|
||||
TxText->value("Transmit Text");
|
||||
TxText->color(
|
||||
fl_rgb_color(
|
||||
progdefaults.TxColor.R,
|
||||
progdefaults.TxColor.G,
|
||||
progdefaults.TxColor.B));
|
||||
|
||||
btnRxColor = new Fl_Button(205, 75, 70, 20, "Rx Color");
|
||||
btnRxColor->callback((Fl_Callback*)cb_btnRxColor);
|
||||
|
||||
btnRxFont = new Fl_Button(291, 75, 72, 20, "Rx Font");
|
||||
btnRxFont->callback((Fl_Callback*)cb_btnRxFont);
|
||||
|
||||
btnTxColor = new Fl_Button(210, 145, 70, 20, "Tx Color");
|
||||
btnTxColor->callback((Fl_Callback*)cb_btnTxColor);
|
||||
|
||||
btnTxFont = new Fl_Button(291, 145, 72, 20, "Tx Font");
|
||||
btnTxFont->callback((Fl_Callback*)cb_btnTxFont);
|
||||
|
||||
btnTextDefaults = new Fl_Button(295, 175, 70, 20, "Defaults");
|
||||
btnTextDefaults->callback((Fl_Callback*)cb_btnTextDefaults);
|
||||
|
||||
o->end();
|
||||
}
|
||||
|
||||
btnClrFntOK = new Fl_Button(295, 209, 72, 20, "OK");
|
||||
btnClrFntOK->callback((Fl_Callback*)cb_btnClrFntOK);
|
||||
|
||||
o->end();
|
||||
}
|
||||
dlgColorFont = w;
|
||||
}
|
|
@ -143,9 +143,9 @@ configuration progdefaults = {
|
|||
"", // string PortIndevice;
|
||||
"", // string PortOutDevice;
|
||||
"", // string PulseServer
|
||||
0, // int sample_rate;
|
||||
-1, // int in_sample_rate;
|
||||
-1, // int out_sample_rate;
|
||||
SAMPLE_RATE_UNSET, // int sample_rate;
|
||||
SAMPLE_RATE_UNSET, // int in_sample_rate;
|
||||
SAMPLE_RATE_UNSET, // int out_sample_rate;
|
||||
"src-sinc-fastest", // string sample_converter;
|
||||
0, // int RX_corr;
|
||||
0, // int TX_corr;
|
||||
|
@ -170,6 +170,21 @@ configuration progdefaults = {
|
|||
{{ 0, 0, 0},{ 0, 0, 62},{ 0, 0,126}, // default palette
|
||||
{ 0, 0,214},{145,142, 96},{181,184, 48},
|
||||
{223,226,105},{254,254, 4},{255, 58, 0} },
|
||||
|
||||
// Button key color palette
|
||||
{ 80, 144, 144}, // RGBint btnGroup1;
|
||||
{ 144, 80, 80}, // RGBint btnGroup2;
|
||||
{ 80, 80, 144}, // RGBint btnGroup3;
|
||||
{ 255, 255, 255}, // RGBint btnFkeyTextColor;
|
||||
|
||||
// Rx / Tx Text Widgets
|
||||
|
||||
0, // int RxFontnbr
|
||||
16, // int RxFontsize
|
||||
0, // int TxFontnbr
|
||||
16, // int TxFontsize
|
||||
{ 255, 242, 190}, // RGBint RxColor;
|
||||
{ 200, 235, 255}, // RGBint TxColor;
|
||||
|
||||
true, // bool alt_text_widgets;
|
||||
|
||||
|
@ -244,7 +259,11 @@ enum TAG { \
|
|||
PALETTE0, PALETTE1, PALETTE2, PALETTE3, PALETTE4,
|
||||
PALETTE5, PALETTE6, PALETTE7, PALETTE8,
|
||||
VIEWERMARQUEE, VIEWERSHOWFREQ, VIEWERSTART,
|
||||
VIEWERCHANNELS, VIEWERSQUELCH, VIEWERTIMEOUT, WFAVERAGING
|
||||
VIEWERCHANNELS, VIEWERSQUELCH, VIEWERTIMEOUT, WFAVERAGING,
|
||||
FKEYGROUP1, FKEYGROUP2, FKEYGROUP3,
|
||||
FKEYTEXTCOLOR,
|
||||
RXFONTNBR, RXFONTSIZE, TXFONTNBR, TXFONTSIZE,
|
||||
RXFONTCOLOR, TXFONTCOLOR
|
||||
};
|
||||
// , ALT_TEXT_WIDGETS };
|
||||
|
||||
|
@ -439,6 +458,19 @@ void configuration::writeDefaultsXML()
|
|||
writeXMLdbl(f, "VIEWERSQUELCH", VIEWERsquelch);
|
||||
writeXMLint(f, "VIEWERTIMEOUT", VIEWERtimeout);
|
||||
writeXMLbool(f,"WFAVERAGEING", WFaveraging);
|
||||
|
||||
writeXMLrgb(f, "FKEYGROUP1", btnGroup1.R, btnGroup1.G, btnGroup1.B);
|
||||
writeXMLrgb(f, "FKEYGROUP2", btnGroup2.R, btnGroup2.G, btnGroup2.B);
|
||||
writeXMLrgb(f, "FKEYGROUP3", btnGroup3.R, btnGroup3.G, btnGroup3.B);
|
||||
writeXMLrgb(f, "FKEYTEXTCOLOR",
|
||||
btnFkeyTextColor.R, btnFkeyTextColor.G, btnFkeyTextColor.B);
|
||||
|
||||
writeXMLint(f, "RXFONTNBR", RxFontnbr);
|
||||
writeXMLint(f, "RXFONTSIZE", RxFontsize);
|
||||
writeXMLint(f, "TXFONTNBR", TxFontnbr);
|
||||
writeXMLint(f, "TXFONTSIZE", RxFontsize);
|
||||
writeXMLrgb(f, "RXFONTCOLOR", RxColor.R, RxColor.G, RxColor.B);
|
||||
writeXMLrgb(f, "TXFONTCOLOR", TxColor.R, TxColor.G, TxColor.B);
|
||||
|
||||
f << "</FLDIGI_DEFS>\n";
|
||||
f.close();
|
||||
|
@ -654,21 +686,18 @@ bool configuration::readDefaultsXML()
|
|||
UseBWTracks = atoi(xml->getNodeData());
|
||||
break;
|
||||
case CLCOLORS :
|
||||
// sscanf( xml->getNodeData(), "%d %d %d %d",
|
||||
sscanf( xml->getNodeData(), "%hhu %hhu %hhu",
|
||||
&cursorLineRGBI.R,
|
||||
&cursorLineRGBI.G,
|
||||
&cursorLineRGBI.B );
|
||||
break;
|
||||
case CCCOLORS :
|
||||
// sscanf( xml->getNodeData(), "%d %d %d %d",
|
||||
sscanf( xml->getNodeData(), "%hhu %hhu %hhu",
|
||||
&cursorCenterRGBI.R,
|
||||
&cursorCenterRGBI.G,
|
||||
&cursorCenterRGBI.B );
|
||||
break;
|
||||
case BWTCOLORS :
|
||||
// sscanf( xml->getNodeData(), "%d %d %d %d",
|
||||
sscanf( xml->getNodeData(), "%hhu %hhu %hhu",
|
||||
&bwTrackRGBI.R,
|
||||
&bwTrackRGBI.G,
|
||||
|
@ -885,9 +914,44 @@ bool configuration::readDefaultsXML()
|
|||
case WFAVERAGING :
|
||||
WFaveraging = atoi(xml->getNodeData());
|
||||
break;
|
||||
// case ALT_TEXT_WIDGETS :
|
||||
// alt_text_widgets = atoi(xml->getNodeData());
|
||||
// break;
|
||||
case FKEYGROUP1 :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&btnGroup1.R, &btnGroup1.G, &btnGroup1.B);
|
||||
break;
|
||||
case FKEYGROUP2 :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&btnGroup2.R, &btnGroup2.G, &btnGroup2.B);
|
||||
break;
|
||||
case FKEYGROUP3 :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&btnGroup3.R, &btnGroup3.G, &btnGroup3.B);
|
||||
break;
|
||||
case FKEYTEXTCOLOR :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&btnFkeyTextColor.R,
|
||||
&btnFkeyTextColor.G,
|
||||
&btnFkeyTextColor.B);
|
||||
break;
|
||||
case RXFONTNBR :
|
||||
RxFontnbr = atoi(xml->getNodeData());
|
||||
break;
|
||||
case RXFONTSIZE :
|
||||
RxFontsize = atoi(xml->getNodeData());
|
||||
break;
|
||||
case TXFONTNBR :
|
||||
TxFontnbr = atoi(xml->getNodeData());
|
||||
break;
|
||||
case TXFONTSIZE :
|
||||
RxFontsize = atoi(xml->getNodeData());
|
||||
break;
|
||||
case RXFONTCOLOR :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&RxColor.R, &RxColor.G, &RxColor.B);
|
||||
break;
|
||||
case TXFONTCOLOR :
|
||||
sscanf( xml->getNodeData(), "%d %d %d",
|
||||
&TxColor.R, &TxColor.G, &TxColor.B);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1028,7 +1092,16 @@ bool configuration::readDefaultsXML()
|
|||
else if (!strcmp("VIEWERSQUELCH", nodeName)) tag = VIEWERSQUELCH;
|
||||
else if (!strcmp("VIEWERTIMEOUT", nodeName)) tag = VIEWERTIMEOUT;
|
||||
else if (!strcmp("WFAVERAGING", nodeName)) tag = WFAVERAGING;
|
||||
// else if (!strcmp("ALT_TEXT_WIDGETS", nodeName)) tag = ALT_TEXT_WIDGETS;
|
||||
else if (!strcmp("FKEYGROUP1", nodeName)) tag = FKEYGROUP1;
|
||||
else if (!strcmp("FKEYGROUP2", nodeName)) tag = FKEYGROUP2;
|
||||
else if (!strcmp("FKEYGROUP3", nodeName)) tag = FKEYGROUP3;
|
||||
else if (!strcmp("FKEYTEXTCOLOR", nodeName)) tag = FKEYTEXTCOLOR;
|
||||
else if (!strcmp("RXFONTNBR", nodeName)) tag = RXFONTNBR;
|
||||
else if (!strcmp("RXFONTSIZE", nodeName)) tag = RXFONTSIZE;
|
||||
else if (!strcmp("TXFONTNBR", nodeName)) tag = TXFONTNBR;
|
||||
else if (!strcmp("TXFONTSIZE", nodeName)) tag = TXFONTSIZE;
|
||||
else if (!strcmp("RXFONTCOLOR", nodeName)) tag = RXFONTCOLOR;
|
||||
else if (!strcmp("TXFONTCOLOR", nodeName)) tag = TXFONTCOLOR;
|
||||
else tag = IGNORE;
|
||||
}
|
||||
break;
|
||||
|
@ -1321,23 +1394,28 @@ int configuration::openDefaults() {
|
|||
resetMixerControls();
|
||||
menuMix->value(MXdevice.c_str());
|
||||
|
||||
|
||||
char sr[6+1];
|
||||
if (in_sample_rate == -1)
|
||||
in_sample_rate = sample_rate;
|
||||
if (in_sample_rate > 1) {
|
||||
if (in_sample_rate == SAMPLE_RATE_UNSET &&
|
||||
(in_sample_rate = sample_rate) == SAMPLE_RATE_UNSET)
|
||||
in_sample_rate = SAMPLE_RATE_AUTO;
|
||||
else if (in_sample_rate > SAMPLE_RATE_OTHER)
|
||||
snprintf(sr, sizeof(sr), "%d", in_sample_rate);
|
||||
menuInSampleRate->value(menuInSampleRate->find_item(sr));
|
||||
}
|
||||
else
|
||||
if (in_sample_rate <= SAMPLE_RATE_NATIVE)
|
||||
menuInSampleRate->value(in_sample_rate);
|
||||
if (out_sample_rate == -1)
|
||||
out_sample_rate = sample_rate;
|
||||
if (out_sample_rate > 1) {
|
||||
snprintf(sr, sizeof(sr), "%d", out_sample_rate);
|
||||
menuOutSampleRate->value(menuOutSampleRate->find_item(sr));
|
||||
}
|
||||
else
|
||||
menuInSampleRate->value(menuInSampleRate->find_item(sr));
|
||||
|
||||
if (out_sample_rate == SAMPLE_RATE_UNSET &&
|
||||
(out_sample_rate = sample_rate) == SAMPLE_RATE_UNSET)
|
||||
out_sample_rate = SAMPLE_RATE_AUTO;
|
||||
else if (out_sample_rate > SAMPLE_RATE_OTHER)
|
||||
snprintf(sr, sizeof(sr), "%d", out_sample_rate);
|
||||
if (out_sample_rate <= SAMPLE_RATE_NATIVE)
|
||||
menuOutSampleRate->value(out_sample_rate);
|
||||
else
|
||||
menuOutSampleRate->value(menuOutSampleRate->find_item(sr));
|
||||
|
||||
|
||||
cntRxRateCorr->value(RX_corr);
|
||||
cntTxRateCorr->value(TX_corr);
|
||||
|
|
|
@ -355,6 +355,8 @@ void SoundOSS::setfragsize()
|
|||
|
||||
int SoundOSS::Open(int md, int freq)
|
||||
{
|
||||
Close();
|
||||
|
||||
mode = md;
|
||||
try {
|
||||
device_fd = open(device.c_str(), mode, 0);
|
||||
|
@ -744,63 +746,43 @@ int SoundPort::Open(int mode, int freq)
|
|||
int old_sample_rate = (int)req_sample_rate;
|
||||
req_sample_rate = sample_frequency = freq;
|
||||
|
||||
// Try to keep the stream open if we are using jack, or if we
|
||||
// are in full duplex mode and the sample rate has not changed.
|
||||
if (stream_active(STREAM_IN) && stream_active(STREAM_OUT)) {
|
||||
if (Pa_GetHostApiInfo((*idev[STREAM_IN])->hostApi)->type == paJACK ||
|
||||
Pa_GetHostApiInfo((*idev[STREAM_OUT])->hostApi)->type == paJACK) {
|
||||
// If we have a new sample rate, we must reset the src data.
|
||||
if (old_sample_rate != freq)
|
||||
src_data_reset(1 << O_RDONLY | 1 << O_WRONLY);
|
||||
return 0;
|
||||
}
|
||||
else if ( (idev[STREAM_IN] != idev[STREAM_OUT] ||
|
||||
full_duplex_device(*idev[STREAM_IN])) &&
|
||||
old_sample_rate == freq)
|
||||
return 0;
|
||||
}
|
||||
// do we need to (re)initialise the streams?
|
||||
int sr[2] = { progdefaults.in_sample_rate, progdefaults.out_sample_rate };
|
||||
int m[2] = { 1 << O_RDONLY, 1 << O_WRONLY };
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
if ( !(stream_active(i) && (Pa_GetHostApiInfo((*idev[i])->hostApi)->type == paJACK ||
|
||||
old_sample_rate == freq ||
|
||||
sr[i] != SAMPLE_RATE_AUTO)) ) {
|
||||
close_stream(i);
|
||||
init_stream(i);
|
||||
src_data_reset(m[i]);
|
||||
start_stream(i);
|
||||
}
|
||||
else if (old_sample_rate != freq)
|
||||
src_data_reset(m[i]);
|
||||
}
|
||||
|
||||
Close();
|
||||
|
||||
init_stream(STREAM_IN);
|
||||
#ifndef NDEBUG
|
||||
if (dev_sample_rate[STREAM_IN] != req_sample_rate)
|
||||
cerr << "PA_debug: input: resampling " << dev_sample_rate[STREAM_IN]
|
||||
<< " <-> " << req_sample_rate << endl;
|
||||
#endif
|
||||
|
||||
init_stream(STREAM_OUT);
|
||||
#ifndef NDEBUG
|
||||
if (dev_sample_rate[STREAM_OUT] != req_sample_rate)
|
||||
cerr << "PA_debug: output: resampling " << dev_sample_rate[STREAM_OUT]
|
||||
<< " <-> " << req_sample_rate << endl;
|
||||
#endif
|
||||
|
||||
mode = full_duplex() ? 1 << O_RDONLY | 1 << O_WRONLY : 1 << mode;
|
||||
src_data_reset(mode);
|
||||
|
||||
if (mode & 1 << O_RDONLY)
|
||||
start_stream(STREAM_IN);
|
||||
if (mode & 1 << O_WRONLY)
|
||||
start_stream(STREAM_OUT);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SoundPort::Close(void)
|
||||
void SoundPort::Close()
|
||||
{
|
||||
close_stream(STREAM_IN);
|
||||
close_stream(STREAM_OUT);
|
||||
}
|
||||
|
||||
void SoundPort::close_stream(unsigned dir)
|
||||
{
|
||||
int err;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (!stream_active(i))
|
||||
return;
|
||||
if (!stream_active(dir))
|
||||
return;
|
||||
|
||||
if ((err = Pa_StopStream(stream[i])) != paNoError)
|
||||
pa_perror(err, "Pa_StopStream");
|
||||
if ((err = Pa_CloseStream(stream[i])) != paNoError)
|
||||
pa_perror(err, "Pa_CloseStream");
|
||||
if ((err = Pa_StopStream(stream[dir])) != paNoError)
|
||||
pa_perror(err, "Pa_StopStream");
|
||||
if ((err = Pa_CloseStream(stream[dir])) != paNoError)
|
||||
pa_perror(err, "Pa_CloseStream");
|
||||
|
||||
stream[i] = 0;
|
||||
}
|
||||
stream[dir] = 0;
|
||||
}
|
||||
|
||||
size_t SoundPort::Read(double *buf, size_t count)
|
||||
|
@ -937,15 +919,6 @@ size_t SoundPort::Write_stereo(double *bufleft, double *bufright, size_t count)
|
|||
return count;
|
||||
}
|
||||
|
||||
bool SoundPort::full_duplex(void)
|
||||
{
|
||||
extern bool pa_allow_full_duplex;
|
||||
return (pa_allow_full_duplex && full_duplex_device(*idev[STREAM_IN])) ||
|
||||
idev[STREAM_IN] != idev[STREAM_OUT] ||
|
||||
(Pa_GetHostApiInfo((*idev[STREAM_IN])->hostApi)->type == paJACK ||
|
||||
Pa_GetHostApiInfo((*idev[STREAM_OUT])->hostApi)->type == paJACK);
|
||||
}
|
||||
|
||||
void SoundPort::src_data_reset(int mode)
|
||||
{
|
||||
int err;
|
||||
|
@ -1011,6 +984,8 @@ void SoundPort::resample(int mode, float *buf, size_t count, size_t max)
|
|||
|
||||
void SoundPort::init_stream(unsigned dir)
|
||||
{
|
||||
const char* dir_str[2] = { "input", "output" };
|
||||
|
||||
#ifndef NDEBUG
|
||||
cerr << "PA_debug: looking for \"" << device[dir] << "\"\n";
|
||||
#endif
|
||||
|
@ -1018,13 +993,14 @@ void SoundPort::init_stream(unsigned dir)
|
|||
if (device[dir] == (*idev[dir])->name)
|
||||
break;
|
||||
if (idev[dir] == devs.end()) {
|
||||
cerr << "PA_debug: could not find device \"" << device[dir] << "\"\n";
|
||||
cerr << "PA_debug: could not find \"" << device[dir]
|
||||
<< "\", using default " << dir_str[dir] << " device\n";
|
||||
idev[dir] = devs.begin() + (dir == STREAM_IN ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice());
|
||||
}
|
||||
PaDeviceIndex idx = idev[dir] - devs.begin();
|
||||
|
||||
#ifndef NDEBUG
|
||||
cerr << "PA_debug: using " << (dir == STREAM_IN ? "input" : "output") << " device:"
|
||||
cerr << "PA_debug: using " << dir_str[dir] << " device:"
|
||||
<< "\n index: " << idx
|
||||
<< "\n name: " << (*idev[dir])->name
|
||||
<< "\n hostAPI: " << Pa_GetHostApiInfo((*idev[dir])->hostApi)->name
|
||||
|
@ -1043,7 +1019,7 @@ void SoundPort::init_stream(unsigned dir)
|
|||
<< "\n isSystemDefaultOutputDevice: " << (idx == Pa_GetDefaultOutputDevice())
|
||||
<< "\n isHostApiDefaultInputDevice: " << (idx == Pa_GetHostApiInfo((*idev[dir])->hostApi)->defaultInputDevice)
|
||||
<< "\n isHostApiDefaultOutputDevice: " << (idx == Pa_GetHostApiInfo((*idev[dir])->hostApi)->defaultOutputDevice)
|
||||
<< "\n\n";
|
||||
<< "\n";
|
||||
#endif
|
||||
|
||||
if ((dir == STREAM_IN && (*idev[dir])->maxInputChannels == 0) ||
|
||||
|
@ -1066,6 +1042,11 @@ void SoundPort::init_stream(unsigned dir)
|
|||
}
|
||||
|
||||
dev_sample_rate[dir] = find_srate(dir);
|
||||
#ifndef NDEBUG
|
||||
if (dev_sample_rate[dir] != req_sample_rate)
|
||||
cerr << "PA_debug: " << dir_str[dir] << ": resampling "
|
||||
<< dev_sample_rate[dir] << " <-> " << req_sample_rate << "\n\n";
|
||||
#endif
|
||||
|
||||
extern int pa_frames_per_buffer;
|
||||
if (pa_frames_per_buffer)
|
||||
|
@ -1116,9 +1097,9 @@ double SoundPort::find_srate(unsigned dir)
|
|||
{
|
||||
int sr = (dir == STREAM_IN ? progdefaults.in_sample_rate : progdefaults.out_sample_rate);
|
||||
switch (sr) {
|
||||
case -1: case 0:
|
||||
case SAMPLE_RATE_UNSET: case SAMPLE_RATE_AUTO:
|
||||
break;
|
||||
case 1:
|
||||
case SAMPLE_RATE_NATIVE:
|
||||
return (*idev[dir])->defaultSampleRate;
|
||||
default:
|
||||
return sr;
|
||||
|
|
|
@ -147,8 +147,6 @@ void trx_trx_receive_loop()
|
|||
active_modem->HistoryON(false);
|
||||
}
|
||||
}
|
||||
if (!scard->full_duplex())
|
||||
scard->Close();
|
||||
} else
|
||||
MilliSleep(10);
|
||||
}
|
||||
|
@ -185,8 +183,6 @@ void trx_trx_transmit_loop()
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (!scard->full_duplex())
|
||||
scard->Close();
|
||||
} else
|
||||
MilliSleep(10);
|
||||
|
||||
|
@ -234,8 +230,6 @@ void trx_tune_loop()
|
|||
MilliSleep(10);
|
||||
return;
|
||||
}
|
||||
if (!scard->full_duplex())
|
||||
scard->Close();
|
||||
_trx_tune = 0;
|
||||
} else
|
||||
MilliSleep(10);
|
||||
|
|
Ładowanie…
Reference in New Issue