Compare commits

...

483 Commits

Author SHA1 Message Date
Charles J. Cliffe 033330367c
Merge pull request #1026 from cjcliffe/cjcliffe-readme-update-1
Update README.md
2024-03-05 20:50:29 -05:00
Charles J. Cliffe 2a2d626af9
Update README.md 2024-03-05 20:37:46 -05:00
Charles J. Cliffe b959ff3f06
Merge pull request #1014 from cjcliffe/cjcliffe-macos-bundlemod-soapy-root-to-cmake-install-prefiox
Update CMakeLists.txt
2023-10-27 01:06:03 -04:00
Charles J. Cliffe b3d25f62c7
Update CMakeLists.txt
Replace flaky SOAPY_SDR_ROOT with CMAKE_INSTALL_PREFIX; SOAPY_SDR_ROOT is now coming up blank randomly
2023-10-27 01:02:14 -04:00
Charles J. Cliffe e5149c28ad
Update CMakeLists.txt
Set default vendor to avoid CPack 'Humanity' default from prefixing itself to component
2023-10-17 21:53:26 -04:00
Charles J. Cliffe f96c1ec6bf
Merge pull request #1012 from cjcliffe/macos-code-signing-missed-files-1
Update code_sign.sh.in
2023-10-16 23:48:52 -04:00
Charles J. Cliffe 77627b6013
Update code_sign.sh.in
Update script to sign dylib in all app subfolders
2023-10-16 23:36:37 -04:00
Charles J. Cliffe 2c6716907e Actual fix was in build repo; revert ABI version reference 2023-08-17 00:51:36 -04:00
Charles J. Cliffe fcb646f385 Use prefix lib path if provided so we can override system libs for bundles 2023-08-17 00:15:32 -04:00
Charles J. Cliffe 74b52f7b97 Fix app bundle soapy module path mismatch (folder doesn't have suffix) 2023-08-16 21:47:02 -04:00
Charles J. Cliffe 1d1532e1f5
Update CubicSDR.desktop.in 2023-04-26 20:13:59 -04:00
Charles J. Cliffe 87f5d8835a
Merge pull request #999 from cjcliffe/fix-janky-bandwidth-ui
Fix modem bandwidth interaction lag; favor visual responsiveness
2023-04-17 23:38:53 -04:00
Charles J. Cliffe 5edd7ba845 Fix modem bandwidth interaction lag; favor visual responsiveness
- Trying to always show the active bandwidth state when liquid-dsp is being slow to generate resamplers makes interaction janky.  Let the audio state lag behind the visuals for a better experience.
- Minor out-of-order fixes for variable set/notify.
- Side thought; why is liquid-dsp slow at generating resamplers now?
2023-04-17 23:25:02 -04:00
Charles J. Cliffe 3426a0188e Donation/contribution list updates 2023-04-13 23:05:53 -04:00
Charles J. Cliffe 6afebe585b
Merge pull request #997 from cjcliffe/winbuild-updates
Winbuild updates
2023-04-13 21:26:15 -04:00
Charles J. Cliffe 674bfa1246
Merge branch 'master' into winbuild-updates 2023-04-13 21:22:08 -04:00
Charles J. Cliffe a93b698284 CMake v3.0 minimum breaks windows builds; go with 2.8.12 2023-04-11 21:28:09 -04:00
Charles J. Cliffe 40046b1655 Restore deleted pthread lib needed for user builds
Remove old vc redist used by installer
2023-04-11 20:41:52 -04:00
Charles J. Cliffe f9766ceaf0
Merge pull request #950 from classabbyamp/fix-build
fix build errors caused by commented parameters in function declarations
2023-03-29 01:57:08 -04:00
Charles J. Cliffe b12084d2e5
Merge branch 'master' into fix-build 2023-03-29 01:50:22 -04:00
Charles J. Cliffe 6c1cfcad65
Merge pull request #564 from f4grx/fix-liquid-libs
Avoid build failure when liquid-dsp is not in a default libdir
2023-03-29 01:45:11 -04:00
Charles J. Cliffe 9fe4841cde Merge branch 'master' into winbuild-updates 2023-03-29 00:54:21 -04:00
Charles J. Cliffe 6d65a1ca7c
Update README.md 2023-03-29 00:43:12 -04:00
Charles J. Cliffe 69a7b0b97a
Merge pull request #995 from cjcliffe/circleci-project-setup
Upgrade from Travis -> CircleCI
2023-03-29 00:34:43 -04:00
Charles J. Cliffe e1e30ed890 Delete .travis.yml 2023-03-29 00:29:59 -04:00
Charles J. Cliffe 165ace2c37 Don't use nproc on CI; it returns host threads 2023-03-29 00:10:20 -04:00
Charles J. Cliffe b3428c3ba8 Update config.yml
boost resource_class once more
2023-03-28 23:55:46 -04:00
Charles J. Cliffe b4fee0dff7 Update config.yml
needs a bit more memory to build I think; boost resource_class
2023-03-28 23:52:33 -04:00
Charles J. Cliffe c0e71c70d6 Update config.yml
wx cached; try remaining build steps
2023-03-28 23:40:45 -04:00
Charles J. Cliffe 1fd2f431cb Update config.yml
Try newer base image
2023-03-28 23:23:36 -04:00
Charles J. Cliffe 61797c2ac6 Build wx verbose (output timeout)
Disable other build steps for the moment; see if we can get a working wxwidgets cache first
2023-03-28 23:04:03 -04:00
Charles J. Cliffe 8ad45faec5 Just check build env using uname 2023-03-28 22:30:57 -04:00
Charles J. Cliffe 437a66b3bd job name not configurable? 2023-03-28 22:27:45 -04:00
Charles J. Cliffe 0b899dbdb3 Move scripts to circle-ci
Minor updates to build scripts
2023-03-28 22:24:29 -04:00
Charles J. Cliffe 2dff8948e3
Update config.yml 2023-03-28 21:46:34 -04:00
Charles J. Cliffe f4aacd11e2
Update config.yml 2023-03-28 21:43:56 -04:00
Charles J. Cliffe be641f1946
Update config.yml 2023-03-28 21:42:00 -04:00
Charles J. Cliffe eba9a18182
Update config.yml 2023-03-28 21:39:55 -04:00
Charles J. Cliffe f59e25a4bf
Update config.yml 2023-03-28 21:38:22 -04:00
Charles J. Cliffe 41d27ad357
Trying GPT-4 auto conversion from travis-ci yml 2023-03-28 21:31:34 -04:00
Charles J. Cliffe 50370cc74b Add .circleci/config.yml 2023-03-28 12:41:11 -04:00
vsonnier 071204f392 Updated Travis and Wiki to reference wxWidgets v3.2.1 at last a stable version 2023-01-14 11:11:01 +01:00
vsonnier e09e7e8381 Set maximum compatibility OpenGL profile for wxWidgets 2023-01-11 21:27:40 +01:00
vsonnier 0e3a785bd2 Fix for liquid-dsp v1.50 where msresamp_crcf_create() with mad As parameter somewhat creates crashes 2023-01-11 21:27:40 +01:00
vsonnier 8c23e370da Updates Windows liquid-dsp binaries to v1.5.0:
- Win32/64 bins liquid-dsp ref: c3e0de7e89cdcc0ec5da9ccaeb5738496263d4c0 (tag: v1.5.0)
    - Win32/64 bins using GCC 12.2 (MSYS2)
	- Arch : SSE4.1 for maximum compatibility
2023-01-11 21:27:40 +01:00
vsonnier 03ba4ff2ee Continue with version 0.28a (alpha) 2023-01-11 21:27:40 +01:00
Charles J. Cliffe 4fb3088936 Remove installer binaries; moving externals to winbuild project 2022-06-14 23:00:37 -04:00
classabbyamp 521f62900a
fix build errors caused by commented parameters in function declarations 2022-05-08 16:15:28 -04:00
vsonnier ba7a35c336 Tag version '0.2.7'
- Do not use 'a' suffix to be consistent with other releases
2022-02-05 11:36:59 +01:00
vsonnier 83617cbdc9 Merge branch 'v027' of https://github.com/SDRplay/CubicSDR into SDRplay-v027 2022-02-05 11:34:37 +01:00
vsonnier 1518364684 Updates Windows Hamlib binaries to v4.4 2022-02-03 19:36:56 +01:00
vsonnier bbc2e974de Updates Windows liquid-dsp binaries to v1.4.0:
- Win32/64 bins liquid-dsp ref: 3b8a6f07ba6780b7a3d4be148461257515d183ad (tag: v1.4.0)
- Win32/64 bins using GCC 11.2 (MSYS2)
2022-02-03 19:20:59 +01:00
SDRplay 9961e67441 Uprev to 0.2.7a 2022-01-02 20:40:25 +00:00
dforsi f461fcb94c
Fix typing errors (#935)
Found with:
codespell --skip=external --ignore-words-list=axix,bord,parm,soley,ue --write-changes --interactive 2

Co-authored-by: Daniele Forsi <iu5hkx@gmail.com>
2021-12-29 19:54:03 +01:00
vsonnier b826d58cd0 Updates Windows liquid-dsp binaries to master
- Win32/64 bins liquid-dsp ref: e77c20bbc26af260d61133ee42ff101c48e4f389
- Win32/64 bins using GCC 11.2 (MSYS2)
2021-12-11 16:43:50 +01:00
Vincent Sonnier cab1227acd
Update RtAudio to v5.20 (#927) 2021-11-21 11:39:27 +01:00
vsonnier 0831aa262c Fix #926: liquid-dsp master 'modem' changed to 'modemcf' for Digital modems, updates Windows liquid-dsp binaries to master
- Updated Windows bins dependencies to latest MSYS2
- Win32/64 bins liquid-dsp ref: 471f46660ddfab7e6713341324f473b7785da101
- Win32/64 bins using GCC 11.2 (MSYS2)
2021-11-12 11:07:17 +01:00
vsonnier 0248e5aeac Updated Windows bins dependencies to latest MSYS2 2021-08-14 10:13:59 +02:00
vsonnier b7ee0fb8ca Updated Windows liquid-dsp binaries to master
- liquid-dsp ref: 373d440d38201bb8950f65c73b322b981355f2c9
- using GCC 10.3 (MSYS2)
2021-08-14 10:06:54 +02:00
vsonnier 29e9144aa5 Hamlib : Restore usage of FILPATHLEN which valid for both v2 and v4 thanks to commit 'HAMLIB patch for updated define' 2021-08-14 09:06:27 +02:00
Aleksey Makarenko 5c78738d33 Proper OpenGL HiDPI handling. Fixes problems with size of OpenGL widgets on HiDPI screens. (PR #769) 2021-08-02 14:57:45 +02:00
Vincent Sonnier 3a08df72ad
Updated Hamlib to v4.2 (#867)
OK, looks like it should work. Let's go !
2021-08-02 14:29:29 +02:00
Charles J. Cliffe 29db1bde99
Merge pull request #885 from cjcliffe/compiler-warning-cleanup-fixes
Cleanup: C++11 updates, clean-up, warning fixes
2021-07-05 20:58:00 -04:00
Charles J. Cliffe 703ec4ac6d init sequence warning 2021-06-03 01:16:47 -04:00
Charles J. Cliffe ed193f0ec1
Update README.md 2021-06-02 22:50:03 -04:00
Charles J. Cliffe 7826006c14 HAMLIB patch for updated define 2021-06-02 22:41:50 -04:00
Charles J. Cliffe d0b4bf694b Missed updates for digital modems 2021-04-29 21:25:24 -04:00
Charles J. Cliffe dcaa5cda38 Merge remote-tracking branch 'origin/master' into compiler-warning-cleanup-fixes 2021-04-22 00:37:41 -04:00
Charles J. Cliffe a409822429 Enumerator class and warnings cleanup 2021-04-22 00:34:45 -04:00
Vincent Sonnier bd7574a3d5
Updated build script with wxWidgets 3.1.5 version, disabling EGL 2021-04-17 18:05:57 +02:00
Charles J. Cliffe f97f368a6a Cleanup: appframe, bookmarks, sessions, core app 2021-04-04 22:22:16 -04:00
Charles J. Cliffe 7aa7daa55f Cleanup: utility classes 2021-04-04 22:21:05 -04:00
Charles J. Cliffe a0f1ccf68d Cleanup: visual ui / interface panels 2021-04-04 22:20:33 -04:00
Charles J. Cliffe 690896f65d Cleanup: SDR threads, enumerator, device info 2021-04-04 22:19:24 -04:00
Charles J. Cliffe 8420f5fb4b Cleanup: rig thread 2021-04-04 22:18:50 -04:00
Charles J. Cliffe e9a6fc089c Cleanup: data, visual processor threads 2021-04-04 22:18:19 -04:00
Charles J. Cliffe 0b9bcc5a46 Cleanup: scope, meter, spectrum and waterfall panels 2021-04-04 22:17:30 -04:00
Charles J. Cliffe 9e22a1314c Cleanup: digital modems 2021-04-04 22:16:57 -04:00
Charles J. Cliffe 74f63d0e84 Cleanup: analog modems 2021-04-04 22:16:44 -04:00
Charles J. Cliffe 02fdcb2aa3 Cleanup: modem digital/analog base 2021-04-04 22:16:30 -04:00
Charles J. Cliffe 592ffa2050 Cleanup: about, digital console and device dialogs 2021-04-04 22:15:44 -04:00
Charles J. Cliffe 296f7790f1 Cleanup: bookmark mgr 2021-04-04 22:15:10 -04:00
Charles J. Cliffe 4605eaccf0 Cleanup: demodulator mgr, instances, threads 2021-04-04 22:14:31 -04:00
Charles J. Cliffe 0b97bd360a Cleanup: audio file, audio threads 2021-04-04 22:13:31 -04:00
vsonnier 19b1ecd7c2 Fixed CMake Win32/64 external binaries deployment 2021-03-21 10:56:31 +01:00
vsonnier 606a7345a0 Fix missing Win32 external dependency for liquid-dsp, updated others 2021-03-20 11:25:36 +01:00
Charles J. Cliffe a174db1725 Minor warning/formatting clean-up 2021-03-19 22:42:42 -04:00
Charles J. Cliffe 95b7a86ed9 Merge branch 'master' of https://github.com/colbyAtCRI/CubicSDR into colbyAtCRI-master 2021-03-19 22:01:33 -04:00
Charles J. Cliffe bdf31ebf76
Merge pull request #877 from cjcliffe/travis_ci_updates_feb2021
Update CI OSX/Xcode version
2021-02-22 20:28:19 -05:00
Charles J. Cliffe f571f27efc
Update CI OSX/Xcode version 2021-02-22 19:55:24 -05:00
colbyAtCRI 260b391c5e Really added the files this time 2021-01-15 07:12:54 -08:00
colbyAtCRI 4eefcd2465 Added ModemCW 2021-01-15 07:11:49 -08:00
vsonnier 0b2b90848d Updated Windows liquid-dsp binaries to master, now some functions have return values for error management.
- liquid-dsp ref: c68f5e39434433c88bd4fe19784bf4c8a32aa8e4
- using GCC 10.2 (MSYS2)
2021-01-02 12:13:17 +01:00
Paul Colby 6a709fe24b
Modified ModemAM (#865)
Works perfectly :)
2021-01-02 12:11:02 +01:00
vsonnier 7b1956f7cd Cleaner management of the device not accepting the requested sample rate 2020-11-21 11:52:34 +01:00
Vincent Sonnier 155862f703
Apparently for wxWidgets 3.1.4 some options are no longer needed for MacOS 2020-11-11 11:33:04 +01:00
Vincent Sonnier 366c0088c8
Update script for wxWidgets v3.1.4 2020-11-11 10:12:01 +01:00
Charles J. Cliffe 4f1db5544d
Merge pull request #840 from cjcliffe/feature/zeroing_and_universal_offset
Update to standard SoapySDR frequency correction, allow zero-to-right by SHIFT+Right Click freq. digits
2020-08-24 22:47:42 -04:00
vsonnier d08b0be9bd Updated Windows liquid-dsp binaries (master: 3be93e37e2556b7152e176046dd899a6d2599a58) using GCC 10.2 (MSYS2) 2020-08-14 12:41:29 +02:00
Charles J. Cliffe 850e646c6d Fix source of bandwidth display visual glitch 2020-08-10 23:16:37 -04:00
Charles J. Cliffe 2f0bbef234 Frequency dialog bw limit check 2020-08-10 23:05:28 -04:00
Charles J. Cliffe 63631cd255 Use shift-right click for zero-right instead, additional cleanup 2020-07-28 23:24:00 -04:00
Charles J. Cliffe 94ca0bbe54 Update to use SoapySDR frequency correction instead of RTL-SDR specific 2020-07-20 01:01:28 -04:00
Charles J. Cliffe 8b61aaa62f
Merge pull request #839 from cjcliffe/feature/hamlib_error_feedback
Error dialog feedback when rig thread exits unexpectedly.
2020-07-13 20:52:00 -04:00
Charles J. Cliffe 7742646794 Error dialog feedback when rig thread exits unexpectedly. 2020-07-12 23:58:24 -04:00
Charles J. Cliffe 4cc0958f7b
Merge pull request #835 from cjcliffe/bugfix/bookmark-issues-jun2020
Bugfix/bookmark issues jun2020
2020-06-22 23:46:03 -04:00
Charles J. Cliffe b4f2b611eb Update recording notification message 2020-06-22 23:36:39 -04:00
Charles J. Cliffe 50f2bb18eb Fix enter handling on mac 2020-06-22 23:26:04 -04:00
Charles J. Cliffe c5652be141 Possible workaround for label entry to keep it from breaking global key handler (Linux tested) 2020-06-17 22:05:57 -04:00
vsonnier b564a0ddde Fix #806: fix scale of Frequency and Edit Label dialogs by @jawatson
Co-Authored-By: James Watson <jimwatson@mac.com>
2020-04-19 12:13:49 +02:00
James Watson 2f4e9a9e74 Adds a fix to scale the Frequency dialog.
The dialog layout uses a sizer to scale the content automatically.  The layout wasn't very good using sizers alone as width of the dialog was being set too narrow for the title string.  The width is set manually to either the [title string width + 35%] or the [content string width +10%], whichever's the greater.
2020-04-19 10:25:05 +02:00
vsonnier 853484ff82 BookmarkMgr: Add more upper and lower amateur bands to the default ranges, also display frequency 2020-04-17 16:30:36 +02:00
vsonnier 60fa038549 Updated Windows liquid-dsp binaries to master using GCC 9.30 2020-04-17 13:09:06 +02:00
Vincent Sonnier d2f9333523
Misc. enhancements (driven by RSPDuo support needs) (#786)
* Add Device name in main window title bar

* Cleaner stopping of device in case of device loss
2020-02-26 07:11:19 +01:00
vsonnier 9c32b97910 Make Gradient constructor using doubles instead of floats, to prevent narrowing-conversion warnings down the road 2020-01-04 21:20:36 +01:00
Charles J. Cliffe 45fe1a9f3b
Merge pull request #779 from cjcliffe/2019-donation-updates
Updated donation dialog contents and fixed layout issues
2019-12-30 22:16:55 -05:00
Charles J. Cliffe 8a629b1438 Updated donation dialog contents and fixed layout issues 2019-12-30 22:07:23 -05:00
Benoît Allard f00efe7e58 Fix missing import for GLX on linux. (#767)
Haha, this looks indeed useful, so let's take it to master.
2019-12-29 17:32:53 +01:00
Vincent Sonnier 57454e4b32
Changed wxWidgets version to 3.1.3 2019-12-27 11:42:57 +01:00
antihax cd6df01166 Winsock.h was included multiple times through windows.h causing compile errors (#772)
* Prevent redefinition of winsock.

* Remove redundant windows.h import
2019-12-11 06:50:06 +01:00
antihax 58d3a02855 Stop spamming hundreds of `No SoapySDR Module` dialogs. (#773) 2019-12-09 07:19:45 +01:00
rainbow 31323fe3c2 fix build with wxWidgets 3.1.3 (#765)
AppFrame.cpp use wxToolTip() without including the library
2019-10-29 08:38:31 +01:00
Vincent Sonnier 4f7dcd4d89
Use Google Turbo Color for Default Theme WF colors (#748)
* Use Google Turbo Color for Default Theme WF colors

* Added Default Jet Waterfall as the old WF color theme

* Oups duplicate IDs for widgets is wrong
2019-09-23 07:24:04 +02:00
vsonnier e0d1e2b6ff Update Windows libraries to liquid-dsp v1.32 / Gcc 9.2.0 2019-08-17 17:17:55 +02:00
Charles J. Cliffe 21fc2d605a
Merge pull request #745 from cjcliffe/general_ux_fixes_May2019
General ux fixes
2019-07-23 22:57:17 -04:00
Charles J. Cliffe 117c1de3fb Merge remote-tracking branch 'origin/master' into general_ux_fixes_May2019 2019-07-02 20:15:10 -04:00
Charles J. Cliffe 14c546ef9e BookmarkView refresh handling cleanup; reduce flicker and layout errors 2019-06-28 00:24:39 -04:00
Charles J. Cliffe 59687d7a0b Alpha version bump; update to VS2019 redist files 2019-06-26 00:07:02 -04:00
vsonnier 9bf25b8feb Fix #739: removed usage of std::binary_function deprecated after C++11 2019-06-02 18:56:00 +02:00
Charles J. Cliffe e379cceeb2 Bookmarks: Add delete key handler, fix refresh issues, ensure active selection stays in view on refresh 2019-05-29 00:25:02 -04:00
Charles J. Cliffe 99ecbef373 Fix nudging out of view, fix keypad triggering and tuner freq entry target 2019-05-24 00:30:22 -04:00
Charles J. Cliffe 0fa818c2fb
Merge pull request #730 from cjcliffe/appimage_configload
Move config load out of commandline parse to prevent wrong path in AppImage
2019-05-13 22:59:04 -04:00
Charles J. Cliffe 1f188a3c4b Move config load out of commandline parse to prevent wrong path in AppImage 2019-05-13 22:41:22 -04:00
Charles J. Cliffe 0131c4d128
Merge pull request #729 from cjcliffe/linux_ui_fixes
Bookmark refreshing, port selection and device selector UI fixes
2019-05-13 21:44:48 -04:00
Charles J. Cliffe dcdacb0cf7 Bookmark refreshing, port selection and device selector UI fixes 2019-05-13 20:52:36 -04:00
Charles J. Cliffe 19b922a863
Merge pull request #728 from cjcliffe/rigmenu_serial
Fix port selector dialog; simplify rig model selection with manufacturer sub-menus
2019-05-08 19:01:07 -04:00
Charles J. Cliffe 8b862037da Fix port selector dialog size/layout; make rig model selection easier with submenus 2019-05-07 23:35:06 -04:00
vsonnier a000446610 Upgrade to RtAudio v5.1.0 2019-04-18 06:58:04 +02:00
Charles J. Cliffe d43f30f0c7
Merge pull request #724 from cjcliffe/liquid_dsp_ampmodem_update
Liquid dsp ampmodem/firhilbf update-related changes
2019-04-17 22:04:38 -04:00
vsonnier c6855cd099 Updated Windows liquid-dsp aligned on ampmodem API changes 2019-04-17 06:51:12 +02:00
Charles J. Cliffe 1a362152ee USB modem fix re: firhilbf c2r update 2019-04-17 00:12:54 -04:00
Charles J. Cliffe 35ae486d20 Patch for updated liquid-dsp firhilbf complex->real adding usb 2019-04-16 19:05:05 -04:00
Charles J. Cliffe 58086c17fb ampmodem parameters have changed 2019-04-16 18:53:10 -04:00
Charles J. Cliffe 8edd8a77dc
Merge pull request #723 from cjcliffe/code_quality
AppFrame refactoring
2019-04-16 18:32:47 -04:00
Charles J. Cliffe 44fd77ec50 Merge remote-tracking branch 'origin/master' into code_quality 2019-04-10 22:24:11 -04:00
vsonnier 61f6eac8cf Updated Windows liquid-dsp binaries again-again, from latest master 2019-04-02 06:49:31 +02:00
vsonnier cf8ea45fa9 Updated Updated Windows liquid-dsp binaries again, from latest master 2019-03-30 15:50:51 +01:00
Charles J. Cliffe c67330e985 menu action cleanup/refactoring 2019-03-19 00:06:01 -04:00
Charles J. Cliffe 58d4f484e4 Appframe header cleanup, sorting, move init vars 2019-03-16 18:37:52 -04:00
Charles J. Cliffe 5f3de57bd8 AppFrame Cleanup: Move config, menubar inits 2019-03-16 17:44:41 -04:00
Charles J. Cliffe 8d09d9c329 Merge remote-tracking branch 'origin/master' into code_quality 2019-03-16 16:57:10 -04:00
Vincent Sonnier c27e1e6514
Make stream deactivated before a sample-rate change and reactivated afterwards (#718)
* Make stream deactivated before a sample-rate chnage and reactivated afterwards

* Re-read sample rate and MTU AFTER stream activation to recompute CubicSDR buffers
2019-03-15 06:30:55 +01:00
Charles J. Cliffe 86c2817ba6 Merge branch 'master' into code_quality 2019-03-14 23:10:27 -04:00
Charles J. Cliffe 0f098e3cbb Compiler warnings: comment unused params 2019-03-14 23:07:51 -04:00
Charles J. Cliffe 3009da6194 Merge remote-tracking branch 'origin/master' into code_quality 2019-03-14 21:15:07 -04:00
Charles J. Cliffe ea016e6638 Merge branch 'drahosj-master' 2019-03-14 21:02:52 -04:00
Charles J. Cliffe 2a75c2776e tabs->spaces 2019-03-14 21:01:19 -04:00
vsonnier b18b609d61 Updated Windows liquid-dsp binaries again, from latest master 2019-03-12 22:04:05 +01:00
Diane Bruce f449a65457 Add __FreeBSD__ where needed to properly compile on FreeBSD + fix for Windows 2019-03-11 20:14:19 +01:00
vsonnier 9e43beec1a Updated Windows liquid-dsp binaries part II: use exact same config.h as Linux goes, removed not-relevant files 2019-03-10 18:56:01 +01:00
Dantali0n ed5993748f Fix for above 3Mhz sample rate on LimeSDR-USB
This problem could  also be present on other devices using the FX3 driver and is perhaps part of a larger general problem  in the LMS7 Soapy  module.
2019-03-09 20:33:17 +01:00
vsonnier 94e252db51 Fix wrong type for timeoutUs parameter of readStream 2019-03-09 18:23:06 +01:00
vsonnier a2bd569e5a Fix wrong type for timeoutUs parameter of readStream 2019-03-09 18:22:49 +01:00
vsonnier 6d8c9f60d2 Maybe fixing #716: Nullify readStream timeout parameter effect which some modules effectively use (LimeSDR...) but we don't care 2019-03-09 17:59:22 +01:00
vsonnier b6c81fe726 Add traces about MTU used size 2019-03-09 14:19:42 +01:00
vsonnier f13af7f357 Updated Windows liquid-dsp binaries to latest version
- Take liquid-dsp master
- Align config.h MingW and Linux one.
- Make 64bit build target SSE4.2 while 32bit stays SSE3.
- Use latest MSYS2 version, i.e. GCC 8.3 for 64bit, GCC 7.4 for 32bit.
- Updated libwinpthread-1.dll from latest MSYS2
- Removed libliquid.a from msvsc libs since Visual Studio can't possibly static link MINGW lib.
==> 1.5x perf boost in CubicSDR :)
==> Maybe the config.h was wrong all this time, for instance HAVE_MMX wasn't defined. Well well.
2019-03-09 10:41:23 +01:00
Vincent Sonnier c561292a27
Merge pull request #715 from cjcliffe/vso_spin_lock_adjustments2
More Spin locks experiments
2019-03-05 06:49:28 +01:00
vsonnier 1d2e35cbac More Spin locks experiments 2019-03-05 06:44:58 +01:00
Vincent Sonnier fd30710d14
Merge pull request #714 from cjcliffe/vso_spin_lock_adjustments
No Spin-lock for xxxProcessor, unclear what the gain was
2019-03-04 18:46:14 +01:00
vsonnier 8dbd5de53d No Spin-lock for xxxProcessor, unclear what the gain was 2019-03-04 18:44:48 +01:00
vsonnier 8dfc7503f2 Fix wrong condition in DataTree 2019-03-03 13:22:29 +01:00
Vincent Sonnier 8b0d4c2449
Merge pull request #713 from cjcliffe/vso_use_spin_locks
Let's go to production and ask for forgiveness later.
2019-03-03 13:08:44 +01:00
vsonnier 6afa3a6d6a Reduced SpinMutex scope in VisualProcessor::distribute() 2019-03-03 11:42:34 +01:00
vsonnier 5ab44e3104 Use spin-locks for short-lived, non-recursive locking sequences 2019-03-03 10:36:10 +01:00
Vincent Sonnier 792bf20a9c
Merge pull request #711 from cjcliffe/vso_dataelement_rework
Tentative fix for #760
2019-03-02 16:27:49 +01:00
vsonnier 44a9274cb1 More fake partial template specialization 2019-03-01 22:18:43 +01:00
vsonnier dd92e75cda Try to workaround explicit specialization in class scope error for GCC and friends 2019-02-28 22:05:27 +01:00
vsonnier 3b47045d28 Rework of DataElement to use more templates and much less memcpy... 2019-02-22 20:19:30 +01:00
Charles J. Cliffe 9ed085123a More AppFrame cleanup, active/current modem verbage adjustments 2019-02-11 22:59:43 -05:00
Charles J. Cliffe abaf458ea1 Merge remote-tracking branch 'origin/master' into code_quality 2019-02-11 22:57:54 -05:00
Charles J. Cliffe a958912da6 Move Session stuff to SessionMgr 2019-01-30 23:24:33 -05:00
Charles J. Cliffe 1f70f9189e AppFrame clean-up, first pass 2019-01-22 00:01:31 -05:00
Jake Drahos 4ca6e8dba9 Safer calls to setGainMode
Will call hasGainMode first - this will prevent crashes when the underlying
device situationally doesn't support setGainMode calls.
2019-01-13 21:53:37 -06:00
Charles J. Cliffe b0505b0659
Merge pull request #700 from cjcliffe/travis-ci
Add hamlib, digital lab to CI, fix several build warnings
2019-01-10 21:48:40 -05:00
Charles J. Cliffe c57a123130 Additional warning fixes; run brew update before brew install for hamlib 2019-01-10 21:23:26 -05:00
Charles J. Cliffe e75387c25d Warning cleanup, fix travis config 2019-01-10 20:49:24 -05:00
Charles J. Cliffe 3a594de37f Enable hamlib + digital lab 2019-01-10 20:04:18 -05:00
Charles J. Cliffe 29702505da
Merge pull request #699 from cjcliffe/travis-ci
Travis-CI add MacOS build
2019-01-08 22:40:16 -05:00
Charles J. Cliffe 10ff7a5453 Fix wx cache logic 2019-01-08 21:57:15 -05:00
Charles J. Cliffe 45118b44e5 Script copypasta err, unify wx cache dirs 2019-01-08 21:50:47 -05:00
Charles J. Cliffe dd49fbae4d separate build scripts and add platform logic 2019-01-08 21:44:04 -05:00
Charles J. Cliffe 5f829b2767 Rearranging scripts 2019-01-08 21:30:34 -05:00
Charles J. Cliffe d561ed6b79 common build test 2019-01-08 21:24:49 -05:00
Charles J. Cliffe 4deaaaba5d Add some more steps for MacOS 2019-01-08 21:12:00 -05:00
Charles J. Cliffe b234a51ef7 MacOS build test 2019-01-08 21:05:19 -05:00
Charles J. Cliffe 9961531620
Merge pull request #698 from cjcliffe/travis-ci
Travis-CI Build Script
2019-01-08 01:04:53 -05:00
Charles J. Cliffe c133f1294f
Update build.sh
travis-ci timeout due to lack of output; AKA don't redirect wxWidgets build output to null :)
2019-01-08 00:44:06 -05:00
Charles J. Cliffe ee4862f595
Update README.md 2019-01-08 00:05:36 -05:00
Charles J. Cliffe 9758b5670d
Update build.sh 2019-01-07 23:40:08 -05:00
Charles J. Cliffe 73aed6c9cc
Update build.sh 2019-01-07 23:32:36 -05:00
Charles J. Cliffe 849b7ca112
Update .travis.yml 2019-01-07 23:05:12 -05:00
Charles J. Cliffe 9f0d0bed71
Update build.sh 2019-01-07 23:05:10 -05:00
Charles J. Cliffe 268c7c747d
Update build.sh 2019-01-07 22:30:14 -05:00
Charles J. Cliffe 45ac3d383b
Update build.sh 2019-01-07 22:27:55 -05:00
Charles J. Cliffe 8e9d5a240a
Update build.sh 2019-01-07 22:26:13 -05:00
Charles J. Cliffe 7ff208f64d
Update .travis.yml 2019-01-07 22:22:49 -05:00
Charles J. Cliffe 3f0763ea6f
Update build.sh 2019-01-07 22:17:01 -05:00
Charles J. Cliffe 02794adb59
Update build.sh 2019-01-07 22:07:44 -05:00
Charles J. Cliffe ea294384ec
Update build.sh 2019-01-07 22:00:39 -05:00
Charles J. Cliffe 4d941de46a
Update build.sh 2019-01-07 21:56:40 -05:00
Charles J. Cliffe 1cd78bdfe2
Update .travis.yml 2019-01-07 21:54:17 -05:00
Charles J. Cliffe b539b8f50a
Update build.sh 2019-01-07 21:54:14 -05:00
Charles J. Cliffe 03e1284aaa
Update .travis.yml 2019-01-07 21:49:59 -05:00
Charles J. Cliffe 32cfb5b382
Create build.sh 2019-01-07 21:49:50 -05:00
Charles J. Cliffe 3448f4030b
Update .travis.yml 2019-01-07 21:36:30 -05:00
Charles J. Cliffe ae6fb3515f
Update .travis.yml 2019-01-07 21:17:11 -05:00
Charles J. Cliffe f1bcfe6474
Create .travis.yml 2019-01-07 21:14:36 -05:00
vsonnier b27a8890d6 Fix #689: Wrong setAudioSampleRate code, thanks @GkvJeep 2018-11-14 20:16:11 +01:00
vsonnier f03925d27f Fix #677: SDRPostThread : Do not push twice the samples in single-channel mode, refactorings and simplifications. 2018-09-15 08:33:22 +02:00
vsonnier 5db28da361 Fix #678: be clean when leaving SDRPostThread 2018-09-15 07:12:50 +02:00
vsonnier 00c0693574 Fix #675 cut-n-paste giving wrong demod data queue (thanks @GkvJeep) plus boost of AudioThread queue size to prevent stuttering at very high CPU loads 2018-08-31 20:21:45 +02:00
vsonnier 1fed3b7480 Updated Windows Hamlib binaries to latest v3.3 2018-08-20 18:53:40 +02:00
vsonnier f7ef0daa8d Update LodePNG to 2018.08.19 version 2018-08-20 18:50:14 +02:00
Charles J. Cliffe 298d9bec82 Version bump 2018-08-17 23:28:39 -04:00
Charles J. Cliffe 43f4f3d75e Donation list update 2018-08-17 22:44:13 -04:00
vsonnier f9346fc616 Regenerated forms with wxFormsBuilder v3.81 which includes small fixes for wxWidgets 3.11, fdp projects format auto-migration to this version 2018-08-12 07:54:42 +02:00
vsonnier 727af1238f Updated LodePNG to 2018.08.09 version 2018-08-12 07:54:32 +02:00
vsonnier 5e8e608a9c Updated LodePNG to 2018.06.11 version 2018-08-09 20:49:59 +02:00
vsonnier a7e4d911e9 Updated Windows64 binaries:
- liquid-dsp v1.31 compiled to latest GCC 8.2.0
- libwinpthread latest from MSYS2
2018-08-06 17:33:47 +02:00
vsonnier 2f84df3c47 Make DataTree throw exception objects, instead of dynamically allocated ones for simplicity 2018-06-08 05:58:55 +02:00
vsonnier cf06709cb4 Fix memory leak of the previous commit 2018-06-07 21:44:17 +02:00
vsonnier 3e4aadfaef Fix #659 : Allow manual editing of user_labels in normal ASCII 2018-06-06 20:49:37 +02:00
vsonnier 35482a0ede Improved CPU usage menu wording a bit 2018-05-19 16:16:36 +02:00
vsonnier f8317a6438 Fix wrong variable declaration placement preventing build w/o Hamlib 2018-05-18 17:04:39 +02:00
vsonnier 6faa2f87b3 Changed Low-perf mode into a CPU usage submenu (low, Normal, High) where High means PFBCH2 usage 2018-05-17 17:54:31 +02:00
Charles J. Cliffe 462da6cdf7
Merge pull request #651 from cjcliffe/firpbch2_mode
Firpbch2 support and SDRPostThread clean-up
2018-05-07 22:20:46 -04:00
Charles J. Cliffe 89f56284c8 Default to PFBCH until toggle for PFBCH2 preference is available 2018-05-07 22:14:50 -04:00
Charles J. Cliffe 94b0b04b59 Merge branch 'master' into firpbch2_mode 2018-05-07 20:30:19 -04:00
Charles J. Cliffe 5731a93354 Version bump, donation updates 2018-04-26 22:15:31 -04:00
Charles J. Cliffe 4240b0efc2 Merge remote-tracking branch 'origin/master' into firpbch2_mode 2018-04-26 20:09:42 -04:00
vsonnier 2239bfd3da Updated Hamlib libs to v3.2 on Windows, changed Hamlib site location to Github in README.md 2018-04-06 07:23:14 +02:00
vsonnier 1cc60bfc8d Fixes #635 round 5, Bookmarkview : let the buttons be of default color 2018-03-24 17:32:54 +01:00
vsonnier c9d38ab363 Fixes #635, round 4, Bookmarkview : always have Start/Stop Recording button irrespective of the actual demod active state 2018-03-24 09:48:18 +01:00
vsonnier a25253e745 Fix #635 round 3, BookmarkView: clear the buttons when 'Remove active' 2018-03-24 09:36:06 +01:00
vsonnier 00a864f741 Fix #635 Round 2 for Bookmarkview on Windows, should be OK now 2018-03-24 08:45:50 +01:00
vsonnier 120d394f01 Simpler #634, always use the first choice when out of bounds 2018-03-24 07:06:39 +01:00
vsonnier 4cd8735014 Fix #634 plus #534: bound checking in SDRDevices dialog selection 2018-03-21 06:35:59 +01:00
Charles J. Cliffe cdaae140fd
Merge pull request #637 from cjcliffe/master
Updates from master
2018-03-20 16:55:05 -04:00
vsonnier 225a795f31 Fixes for #635, round 1: BookmarkView 2018-03-20 20:00:59 +01:00
Vincent Sonnier 876b477ae8
Merge pull request #633 from cjcliffe/vso_wxwidgets_v311_integration 2018-03-17 09:02:36 +01:00
vsonnier e46d7f9735 Migration to wxWidgets v3.11:
- Seen on Windows: Bookmarkview slow update because the controls are self-reacting to the rebuild control events, so fix nullify them during control rebuilding.
- Update OpenGL initialization using v3.1 level context and canvas attributes instead of the deprecated calls.
2018-03-11 11:47:14 +01:00
vsonnier 8e52f232cf Visual scale is called Visual Gain in manual, so use the same naming in tooltips 2018-03-11 10:37:21 +01:00
vsonnier 10a4e391d7 Fix #630 improvement on Zoom(s) functions:
- Right-drag now does the same thing on both Spectrum and Waterfall, i.e change and hold vertical scale,
- So Right-drag on Waterfall no longer zoom bandwidth, there are already much more practical ways to do it (up/down, wheel)
- Right-click to reset vertical scale stays only enabled on Spectrum.
- Adapted mouse cursors to reflect the possible moves on Spectrum and Waterfall.
- Updated both Waterfall and Spectrum tooltips to match those features.
2018-03-11 10:04:57 +01:00
Charles J. Cliffe b193456ccb Merge branch 'master' into firpbch2_mode 2018-02-20 00:17:37 -05:00
Charles J. Cliffe 8cb5e9e244 SDRPostThread clean-up and re-factoring 2018-02-20 00:16:54 -05:00
vsonnier 7f732735ce Fix #616 wrong WAV size reported in header (thanks @nsmith-) 2018-02-18 19:49:47 +01:00
vsonnier c1e60f31f5 Fix #615 Be smarter when looking for font resources 2018-02-15 19:02:56 +01:00
Charles J. Cliffe afc29303c9 2x channel bandwidth firpfbch2_crcf optional path 2018-02-14 21:24:22 -05:00
vsonnier 490f72ceeb Fix #614: Wrong Freq offset applied if set from SDR Devices 2018-02-07 13:13:52 +01:00
vsonnier 70371890a2 Updated Windows liquid-dsp v1.31 binaries using newest MSYS2 gcc 7.3.0 2018-01-27 08:06:00 +01:00
vsonnier f2de1dd987 Fix #601 ?: Removed deadlock that prevent Audio controller threads to die. 2018-01-22 20:11:13 +01:00
vsonnier b55609c802 AudioThread: rollback some guard code because of previously wrong understanding 2018-01-22 07:26:13 +01:00
vsonnier 033bbd07df AudioThread: re-apply consistent formating 2018-01-22 07:10:45 +01:00
vsonnier fc1c1c3b4d AudioThread: rollback deviceCleanup() to only doing terminate + TEST: apply to all platforms 2018-01-22 07:04:45 +01:00
vsonnier 36224defd7 AudioThread: Rework mutex usage (again) + added proper cleanups (hopefully) 2018-01-21 18:08:46 +01:00
vsonnier d8ac9559fe BoolmarkMgr: rationalize a bit the usage of recursive_mutexes 2018-01-16 20:43:00 +01:00
Charles J. Cliffe 7fb66b6998
Merge pull request #594 from cjcliffe/audio_recording
Audio recording
2018-01-14 19:57:48 -05:00
Charles J. Cliffe 7588e77d94 Donation list update 2018-01-14 19:41:41 -05:00
Charles J. Cliffe 7baaca1216 OSX crash-on-exit fix, File menu tidying, Confirm bookmark reset 2018-01-14 18:56:30 -05:00
vsonnier 4c6d7ab4d7 Fix wrong multi-part WAV sequence management with time-limit files 2018-01-14 15:30:40 +01:00
vsonnier 3334538e64 Fix boolean usage instead of bool (we are not Java, are we ?) 2018-01-13 12:17:02 +01:00
vsonnier 4e6197c579 Fix minor cut-n-paste error in AudioSinkFileThread 2018-01-13 12:13:41 +01:00
vsonnier 26deefd606 Added #583: add periodic file generation, plus other options:
- Added a Recording menu,
git commit -m Added
2018-01-13 11:50:31 +01:00
vsonnier 4d0f3a794d Merge remote-tracking branch 'origin/master' into audio_recording 2018-01-12 19:31:33 +01:00
vsonnier 7b904bf803 Add a Reset Bookmarks menu (empty the bookmarks), similar to Reset Session 2018-01-12 19:26:22 +01:00
vsonnier 64e44d6172 Merge remote-tracking branch 'origin/master' into audio_recording 2018-01-10 19:00:04 +01:00
vsonnier 0f72a0f683 Fix #593 : Make the middle of the range always the central frequency 2018-01-09 20:22:56 +01:00
vsonnier 978cf492f8 Merge remote-tracking branch 'origin/master' into audio_recording 2018-01-09 07:07:11 +01:00
Vincent Sonnier 505ed18066
Merge pull request #596 from cjcliffe/vso_saving_bookmarks
Well, I think it works really well now, lets merge to master.
2018-01-09 07:01:40 +01:00
vsonnier f1208c7f5c When saving bookmarks, use active information when available
+ Fixed std::string <=> std::wstring conversions using wxString
+ cleanups.
2018-01-08 19:26:34 +01:00
vsonnier fc0f20f07d Removed recording duration limitation:
- Limit WAV size to 2GB for maximum compatibility,
- Continue recording on another file when size gets too big (XXX_001.wav, then XXX_002.wav and so on)
- The sequence assure up to 2000GB worth of recording which should be enough
- Changed file pattern to international Year.Month.Day so its recognizable whether you are English of French or whatever :)
2018-01-07 08:59:39 +01:00
vsonnier 8f45451df2 Choose a valid audio output if the modem-saved one is not recognized. 2018-01-06 16:15:40 +01:00
vsonnier 8daadc3603 Missing trace in AudioSink queue saturation 2018-01-06 15:10:25 +01:00
vsonnier 1dbfcedcd2 Fix to record below-squelch levels as audio silence 2018-01-06 14:19:32 +01:00
vsonnier d4251b41fb Feature #486 : Save/Load bookmarks into files 2018-01-06 10:22:14 +01:00
Charles J. Cliffe be75c62778 Menu and demod display tweaks 2018-01-02 23:51:32 -05:00
Charles J. Cliffe 8609667f33 About Dialog code update, passive vcredist install 2018-01-02 00:13:09 -05:00
Charles J. Cliffe f625cb6eea Donation list update 2018-01-01 22:12:04 -05:00
Charles J. Cliffe c3257536cf Version bump 2017-12-31 21:14:47 -05:00
Charles J. Cliffe e6cd2ae774 AppImage fix - put_time req. GCC 5+ 2017-12-31 20:59:06 -05:00
Charles J. Cliffe 9b1f7b828c Merge branch 'master' into audio_recording 2017-12-31 14:54:41 -05:00
Charles J. Cliffe 5c45c1cf6b Record muted, toggle-all recording /w shift-R, status texts 2017-12-29 22:46:39 -05:00
Charles J. Cliffe b9e4f6aeba Recording path notify, bookmark panel record buttons, tweaks and adjustments 2017-12-04 22:44:47 -05:00
vsonnier ada56440fc Fix reloading of gains at startup. 2017-11-25 09:47:43 +01:00
vsonnier 4b077af873 Fix for gain sliders not perfectly following integer gain steps from the menu (i.e RSPx RF gains) 2017-11-20 18:53:38 +01:00
vsonnier e44af72b00 Assure Gain control <==> Settings menu synchronization in case of mutually depdendent updates 2017-11-19 17:06:11 +01:00
Charles J. Cliffe 326a993a29 Sequence recording on format change; user label as filename when available 2017-11-16 23:53:30 -05:00
Charles J. Cliffe 8f31fd9f5b Recording is now writing playable .WAV files 2017-11-02 00:01:22 -04:00
Charles J. Cliffe 6af64752be Merge branch 'master' into audio_recording 2017-11-01 22:34:28 -04:00
Vincent Sonnier 6dc9b86855
Merge pull request #585 from cjcliffe/vso_squash_warnings
Halloween compiler Warnings cleanup
2017-10-31 11:29:17 +01:00
vsonnier d55d7e9b75 Halloween Warning cleanup:
- wxFont SetFont() deprecated warnings, suppressed by re-generating forms with latest wxFormBuilder,
- double-to-float implicit conversion in CubicVR2
2017-10-31 11:08:15 +01:00
vsonnier d8ff4ea1de Squash some warnings with std::shared_ptr init seen on Ubuntu 16.04 2017-10-29 15:06:24 +01:00
vsonnier 89d12ef4e3 #513 Workaround in case the number of samples rates is too much to be handled by the menu, decimate to 25 max. 2017-10-28 13:12:27 +02:00
vsonnier 230a87d8df AudioThread: Revised mutex usage for devices vs. AudioThread* due to erroneous implem., creating crashes in some cases
(damn those things are hard...)
2017-10-28 11:57:01 +02:00
vsonnier 950a4622b7 Updated Windows liquid-dsp binaries to v1.31 (gcc 7.2.0) 2017-10-26 07:04:36 +02:00
vsonnier 3cc49bdb15 Fixes #581 ?: Do not set std::shared_ptr to nullptr in constructors (useless anyway) since they could be wrongly interpreted 2017-10-16 18:50:55 +02:00
vsonnier 6019207bd4 VisualProcessor : protect against null input queue 2017-10-15 08:51:01 +02:00
vsonnier f4107c1541 Optimized VisualProcessor by using a non-recursive mutex and making some ops non-blocking, small AudioThread opt as well 2017-10-14 11:34:25 +02:00
Charles J. Cliffe 1c415afa92 Merge branch 'master' into audio_recording 2017-10-12 00:15:00 -04:00
Charles J. Cliffe 38fab6ac51 Add 'R' toggle key + fixes from initial testing 2017-10-12 00:08:22 -04:00
Charles J. Cliffe f8e51df8cd Demod instance start/stop recording setup 2017-10-09 20:07:40 -04:00
vsonnier 2c1be22c51 Well, looks like WASAPI audio create crashes on Windows, so revert to good old DirectSound for audio 2017-09-27 21:45:08 +02:00
Charles J. Cliffe c202d99a2a initial audio sink file and thread handling rough-in 2017-09-26 23:25:55 -04:00
Charles J. Cliffe 21dd062da0 Merge branch 'master' into audio_recording 2017-09-24 23:56:37 -04:00
Charles J. Cliffe a398bc57f1 Initial AudioSink thread base and recoring preference 2017-09-24 23:50:08 -04:00
vsonnier 1a73f627a2 Frequency entry dialog font is slightly too big to fit, use the same as Label dialog instead 2017-09-24 12:46:33 +02:00
vsonnier 927d727a16 Try not to use atomics in performance code 2017-09-22 22:53:59 +02:00
vsonnier aec0100f78 ThreadBlockingQueue : remove useless/dangerous operations, forbid both copy and assignment. 2017-09-10 19:35:12 +02:00
vsonnier afedca05c6 Updated liquid-dsp v1.30 Windows binaries to GCC 7.2.0 (MSYS2) 2017-09-02 21:49:20 +02:00
vsonnier 030628c5ed SDRPostThread is better using try_push, restore previous audio-related code in DemodulatorInstance 2017-09-02 16:24:25 +02:00
vsonnier 87077a89c1 Fix #574: cannot enter frequency offsets > 2GHz 2017-09-01 18:39:35 +02:00
vsonnier 252b6bf9f8 AudioThread polishing 2017-09-01 06:18:35 +02:00
vsonnier 5460863608 Upgraded RtAudio to v5.0.0, WASAPI is now the default audio backend on Windows 2017-08-31 21:30:32 +02:00
vsonnier 3a5b30dda8 Fix AudioThread nullptr check 2017-08-31 21:29:53 +02:00
vsonnier 9bbcb582e3 Fix hang when the active demodulator goes out-of-bandwwidth by changing sample rate 2017-08-31 20:51:37 +02:00
vsonnier 3842cf087f More terminate()-and-flush calls missed before 2017-08-29 18:48:59 +02:00
vsonnier dc9c67bec1 Fix a DemodulatorInstance dangling reference 2017-08-29 06:40:07 +02:00
vsonnier 03bf38fea8 Squashing an actual memory leak in SDRPostThread by simplifying the code 2017-08-28 21:22:07 +02:00
vsonnier 3f90cbb858 Flush queues on terminate() calls to unblock push()s and so ease threads termination 2017-08-28 20:53:21 +02:00
Vincent Sonnier 2d01a279e9 Merge pull request #572 from cjcliffe/vso_shared_ptr_DemodulatorInstances
Let's see if I've broken something :)
2017-08-27 14:47:10 +02:00
vsonnier b52c4ac8a6 This lock is actually needed, restore it. 2017-08-27 13:35:11 +02:00
vsonnier 3c3939e0b7 Use nullptr instead of NULL when shared_ptr is used 2017-08-27 13:00:32 +02:00
vsonnier 37712c7a81 Simplify SDRPostThread: no longer binding methods, directly use the true list of demodulators 2017-08-27 12:39:28 +02:00
vsonnier a8f8f4a7e2 Initial commit: working... 2017-08-27 11:11:30 +02:00
vsonnier c112026a2c Make processing queues timed-push, to be able to escape deadlocks. Rollback 'restart device when blocked' that is ineffective in practice. 2017-08-26 23:34:48 +02:00
vsonnier ebca762ea8 Fix crash introduced with #559, fix hanging thread at application termination 2017-08-25 18:52:33 +02:00
vsonnier a018a36100 Add a read-only TX antenna menu entry showing the active one, closing #559 2017-08-25 07:28:14 +02:00
Vincent Sonnier 8993121fc6 Merge pull request #571 from cjcliffe/vso_SoapySDR_antenna_support
Add  Antenna support (RX only), plus improved Settings menu.
2017-08-25 06:23:22 +02:00
vsonnier 2c20f728d5 Settings UI even better, fix device config not right w.r.t real antenna presence 2017-08-24 21:26:28 +02:00
vsonnier f5f4a80f23 Rollback addition of AGC,PPM in the SDRdevices menu, because not all devices support it. Keep Antenna selection, though 2017-08-23 23:49:52 +02:00
vsonnier 1042c62c3b Initial commit: Antenna support, Enhanced Settings menu, Enhanced SDR device dialog 2017-08-23 23:27:49 +02:00
vsonnier e32e687fe8 Make IOThreads terminate() fully non-blocking and misc.
- Thanks to timed-pop() usage, it is no longer needed to nudge queues with dummy to wake them
- Less bad luck to be stuck there
- Misc: leave the trace about the audio thread staturation, useful despite it raises some alarm among users...
2017-08-14 09:46:53 +02:00
vsonnier acc6d2a31d Restart the device automatically if stuck with read stream errors 2017-08-13 22:14:12 +02:00
vsonnier c64baab99d Threads vs. Queues lifetimes, cleanups.
- Ideally Queues must outlive the threads using them, but wasn't done so. Yes, std::shared_ptr them!
- Now queues are always valid in the context of the threads using them.
- No longer need tedious queues deallocation by the original owner.
- Misc cleanups.
2017-08-13 19:19:25 +02:00
vsonnier 98c7c30aee Yet another Thread termination problem found, and try killing the app if the closing turns bad 2017-08-13 12:11:14 +02:00
vsonnier 33107bfa9e Fix #565, Solo mode is now saved into session files 2017-08-12 18:09:36 +02:00
vsonnier ae74023864 Updated Windows liquid-dsp v1.30 binaries, compiled with latest MSYS2 GCC 7.1.0
- Apparently the 32bit build no longer need any dependency, so remove libgcc_s_dw2-1.dll
- Updated libwinpthread-1.dll from MSYS2 too.
2017-08-12 14:29:49 +02:00
vsonnier e67a29f5b6 Don't get stuck when closing application just because some Demodulators refuse to die 2017-08-12 11:30:32 +02:00
vsonnier 33aa0cade6 Fix bad re-loading, setting and UI glitches for Device Runtime settings, and misc.
- Quite obvious on the SDRPlay RSP2 for ex.
- Random cleanups by using the for-each construct at some places for clarity.
2017-08-12 08:17:40 +02:00
Sebastien F4GRX aa29aa41c6 Avoid build failure when liquid-dsp is not in a default libdir 2017-08-03 15:38:01 +02:00
Vincent Sonnier 695d00d966 Merge pull request #555 from lospheris/master
Change boolean to bool
2017-06-02 06:21:15 +02:00
Dell-Ray Sackett ab6cb059b9 boolean not a valid keyword
changed boolean to bool in garbageCollect
2017-06-01 21:12:06 -07:00
Dell-Ray Sackett b315bac97f Change boolean to bool
void DemodulatorMgr::garbageCollect(boolean forcedGC)
should be 
void DemodulatorMgr::garbageCollect(bool forcedGC)
2017-06-01 21:05:49 -07:00
vsonnier 3604b7f1ff Even better thread and application termination:
- Now that timed-pop()/try_pop() prevent indefinite blocking it is best to flush() on thread stopping to unblock push()
- Reworked a bit the CubicSDR::OnExit() sequence, see comments.
2017-06-01 19:57:58 +02:00
vsonnier 8f608bbf5c Cleanup: remove some unused params and variables, conversion warnings seen with #550. 2017-05-29 20:22:10 +02:00
vsonnier be3c0c9778 Pedantic change for mat4::to_ptr() 2017-05-28 17:33:44 +02:00
Vincent Sonnier 83b3bb1cb2 Merge pull request #551 from cjcliffe/vso_CubicVR2_cleaner_array_access
CubicVR2  removal of convert to pointer operators (fixes #550)
2017-05-28 17:15:38 +02:00
vsonnier dd2fa12d57 There is no need for operator bool conversion:
- it was there for != NULL checks when convert-to-pointer existed, which is no longer the case.
2017-05-28 15:20:43 +02:00
vsonnier 3095f8205a CubicVR2: more restricted operators on structures by removing convert-to-pointer. (Fix #550 ?) 2017-05-28 12:59:08 +02:00
vsonnier 56b56685e0 Yet Another Semicolon After Endif left... (#549) 2017-05-27 15:28:42 +02:00
vsonnier 3de3d3eee8 Tentative fix #549 prt 3 2017-05-27 12:36:47 +02:00
vsonnier b3dd0b0d6e Tentative fix #548 part 2 2017-05-27 09:49:19 +02:00
vsonnier d170f731c5 Fix #549, plus more usual syntax for #548 2017-05-27 07:46:28 +02:00
vsonnier fcf9f0bb82 Potential fix for #548, to be tested in Nix-like environnements 2017-05-26 23:22:43 +02:00
vsonnier a0526f757e ReBuffer somewhat cleaner, safer code 2017-05-26 10:29:47 +02:00
vsonnier 44cdfa8521 Make ReBuffer also GC its own memory + cleanups:
- Use deque in ReBuffer instead of vector (as before) because it allows freeing its memory
- Random cleanup: remove mutable when not needed.
2017-05-25 16:39:01 +02:00
Vincent Sonnier 3192ee0e71 Merge pull request #547 from cjcliffe/vso_ReBuffer_with_shared_ptr
Rebuffer automatic refcount management
2017-05-25 12:32:11 +02:00
vsonnier 9b0ce69e8f Use the nuclear option to solve the hung problem:
Besides deadlocks, a thread can in theory get stuck in a blocking pop(),
not seeing the stopping flag in particular. So assure liveness by making all
pop() timed pop.
2017-05-25 09:32:27 +02:00
vsonnier 77a82e1617 Another fix for the neverending hung application bugs:
- Clear up DemodulatorInstance garbage collection, only do it in a single thread (AppFrame::OnIdle)
- Add a specific mutex lock for the list of deleted demodulators,
- Add a specific lock to control DemodulatorInstance thread lifetimes, protecting IsTerminated() of concurrent join and delete
2017-05-25 08:03:08 +02:00
vsonnier 4b323e9863 Make ReBuffer refcount management automatic, using std::shared_ptr:
- No longer need to call setRefCount() / decRefCount()
- Restore old ThreadBlockingQueue using std::deque, for std::shared_ptr correct behaviour.
2017-05-24 12:28:37 +02:00
vsonnier 8776908340 Fixes #546, when MTU > nb samples per-frame, overflow management was wrong. 2017-05-23 11:09:29 +02:00
vsonnier 5797548739 SoapySDRThread tweak: directly resize to the final size when building SDRThreadIQData 2017-05-23 11:09:28 +02:00
vsonnier af20f680a4 Clearer ThreadBlockingQueue impl by using a field to hold size... 2017-05-21 21:04:12 +02:00
Vincent Sonnier 313d66e1d6 Merge pull request #545 from cjcliffe/vso_circular_buffer_for_queue
TheadBlockingQueue implemented with circular buffer (zero runtime mem allocs)
==> Well, looks like it works.
2017-05-21 10:31:22 +02:00
vsonnier 41c7dd231b Fix tabs introduced in latest commits... 2017-05-21 10:03:21 +02:00
vsonnier e0af609224 Use a circular buffer for ThreadBlockingQueue (allocation-free) 2017-05-21 09:39:29 +02:00
vsonnier fc2716518d SoapySDRThread: more comments about the relation between MTU and sample rate 2017-05-21 09:20:41 +02:00
vsonnier c1fef72103 Use more a reliable time source in Windows for the Timer class 2017-05-20 13:31:55 +02:00
vsonnier a541e55ff6 SaopySDRThread simplified, (small) perf improvement: No longer use inpBuffer,
write to SDRThreadIQData->data directly.
2017-05-20 13:31:46 +02:00
Charles J. Cliffe 21a6d2b5f6 Module bundling fix for OSX BUNDLE_APP 2017-05-12 22:19:19 -04:00
Charles J. Cliffe 1bf7c22f00 Donation list update 2017-05-11 22:51:39 -04:00
Charles J. Cliffe 994c67dd93 version bump 2017-05-11 21:43:50 -04:00
Charles J. Cliffe 15d8715234 Merge pull request #542 from Dantali0n/master
Fix portselectordialog being added to sources and headers while USE_HAMLIB disabled
2017-04-22 14:35:38 -04:00
Dantali0n 0e838327fe Fix portselectordialog sources only in win32 2017-04-22 20:25:35 +02:00
Dantali0n 0cf09d1f5d Fix portselectordialog added with USE_HAMLIB disabled 2017-04-22 14:24:07 +02:00
Charles J. Cliffe 91fd255c86 Remove temporary windows SSB filtering solution 2017-04-20 21:19:55 -04:00
Charles J. Cliffe 43ed37b23c Merge pull request #541 from cjcliffe/serial_detect
Fix rig control menu, add serial port detection and selection dialog
2017-04-20 20:52:44 -04:00
Charles J. Cliffe 21b2b3d191 MSVC serial fix-up 2017-04-20 20:41:03 -04:00
Charles J. Cliffe f9dc1aeb32 Use the right function.. 2017-04-20 19:53:08 -04:00
Charles J. Cliffe 43a9150107 Fix rig control menu, add serial port detection and selection dialog 2017-04-20 19:40:09 -04:00
vsonnier 0a19686b51 Remove 'threadlocal' pedantic and very limited usage that is not supported on all platforms 2017-04-05 19:28:18 +02:00
vsonnier c8cca67fc7 Bookmarks: fix for #525 item 2, other cleanups. 2017-04-01 19:38:08 +02:00
Charles J. Cliffe 53c7daa521 Merge pull request #533 from cjcliffe/bookmark_issues
Tweaks for bookmark selection, activation and group renaming
2017-03-30 22:45:38 -04:00
Charles J. Cliffe f4d090e65b Tweaks for bookmark selection, activation and group renaming 2017-03-30 22:26:11 -04:00
Charles J. Cliffe 8df7feda60 Merge pull request #528 from cjcliffe/feature/build_opts2
Fix flip-flopping config path conflict when using alternate build name.
2017-03-22 21:12:34 -04:00
Charles J. Cliffe 1529fe3306 Fix flip-flopping config path conflict when using alternate build name. 2017-03-21 19:30:36 -04:00
Charles J. Cliffe ba24322fdf Merge pull request #527 from cjcliffe/feature/build_opts2
Build opts / fixes
2017-03-20 22:18:36 -04:00
Charles J. Cliffe ec10f2523e Some additional custom build opts; fix compile order issue on OSX; patch tuning label font glitch. 2017-03-20 20:20:17 -04:00
vsonnier b0ec698012 Windows: no need to add libusb-1.0.dll binaries:
- libusb current master compiled with Visual C++ seems finally OK despite being a commmon deps between hamlib and SoapySDR.
2017-03-19 09:44:20 +01:00
Charles J. Cliffe cadee60c15 Merge pull request #524 from cjcliffe/bookmark_label_edit_consistency
Groups now renamed like everything else via label control
2017-03-16 23:27:03 -04:00
Charles J. Cliffe 38e41eb85e Groups now renamed like everything else; remove onRenameGroup dc 2017-03-16 23:23:21 -04:00
Charles J. Cliffe e45de44dbd Merge pull request #523 from cjcliffe/remove_treelabeledit
Fix the label editing issue :)
2017-03-15 21:32:04 -04:00
Charles J. Cliffe 243c744c0a Fix the label editing issue :) 2017-03-15 21:23:13 -04:00
vsonnier 772e24fdb3 Better comments on CF32 format coming out of SoapySDR 2017-03-10 19:12:54 +01:00
vsonnier 97639d1d09 BIG FIX: Truncated stream of incoming samples on 32 bit targets !
This one is a veryy old long standing bug I was look for. All 32 bit Windows builds
suffered indeed of corrupted sound defects in all circumstances (reported even on rtl-sdr.com coments)
that had no identifiable origin... Until now.
Given the fix, all 32 bit adress targets should be affected as well...
2017-03-08 22:52:20 +01:00
vsonnier 294713945a Bookmarks: a BookmarkEntry owns its DataNode, so free it in destructor 2017-03-07 18:30:33 +01:00
vsonnier 9726f0eec6 Bookmarks: no need to Delete a tree element when the next steps will take care of it 2017-03-06 19:51:27 +01:00
vsonnier 925203b4a5 Bookmarks (cont...) : more understanding, more comments, more fixes. NOW memory management should be clean... 2017-03-04 11:22:44 +01:00
vsonnier 7bab9588e1 Bookmarks: rollback delete item data procedures: reading wxWidgets labyrinthine code more carefully
item data is properly deleted by Delete or DeleteChildren. On the other hand, SetItemData simply overwrites the pointer,
so take care or releasing ressources there
2017-03-04 09:02:15 +01:00
vsonnier b30f9e9bbb Bookmarks: assure proper recursive cleanup of ItemData for all levels of a tree item 2017-03-03 22:49:58 +01:00
vsonnier aab899d63c Bookmarks fixes: try to cleanup Recent entries in order 2017-03-03 20:33:14 +01:00
vsonnier b5a658bb4c Updated Hamlib v3.1 binaries for Windows using the official pre-build binaries:
- Gather all *.dll deps in external/msvc to preserve consistency
- This Hamlib distribution provides a pre-built libusb-1.0.dll, so add it to the common dependencies :
  this libusb-1.0.dll have only MSVCRT.dll as dependency itself, contrary to the one provided
  in CubicSDR binary releases, which turns out is not compatible with this Hamlib distribution.
  The libusb one from the Hamlib on the other hand works for both Hamlib and SoapySDR.
2017-03-03 19:37:32 +01:00
vsonnier c1184d24db Bookmarks: cleanup item data properly 2017-03-02 22:10:17 +01:00
Vincent Sonnier 5fe844b8af Should fix #520 2017-03-02 11:25:39 +01:00
vsonnier bd65377162 BookmarkPanel was missing the Disconect matching the new Connect... 2017-03-01 22:25:27 +01:00
vsonnier 2760d3d12e Status/tootips additions: Gain, Bookmarks. Fix Bookmark mousewheel handling (for Windows <= 7) for the tree view 2017-03-01 22:13:41 +01:00
vsonnier b149da864a Bookmark fixes and cleanups:
- Fix Search field not working on Windows 7 (at least), hope I didn't break all the other platforms
- Memory management is tedious there, with lots of BookmarkEntry* / BookmarkRangeEntry* shared and dangling around
  we cannot reasonably know when to clean up safely. So go nuclear and std::shared_ptr those things.
2017-02-28 19:05:36 +01:00
vsonnier 469fc41805 AppFrrame::OnMenu() tidy, correct wrong ColorTheme name (harmless) 2017-02-26 11:18:09 +01:00
vsonnier 1e14eece65 Updated LodePNG to 2016.11.27 version (indeed current master) 2017-02-26 09:02:31 +01:00
vsonnier 946a9801dc FIX: Inactive demod bendwiths are restored to 0 from sessions, because they were erroneously saved as such.
The problem lies in DemodulatorPreThread:
- settings were actually get/set unprotected from concurrent access (bendwiths, frequencies, sample rates...etc) so make them atomic.
- If bandwith has changed, return the new value instead of the current one, just like frequencies.
2017-02-20 21:39:12 +01:00
Charles J. Cliffe 4b48113936 Merge pull request #515 from cjcliffe/vso_blocking_queue
Replace ThreadQueue by a full blocking queue.
2017-02-20 15:34:40 -05:00
vsonnier 051ebec49f BLOCKING_QUEUE: let audio-out try_push() too, else it often blocks evrything while in debugger... 2017-02-18 10:15:47 +01:00
Charles J. Cliffe 8dfb8ea3f1 minor fixes 2017-02-16 21:54:18 -05:00
vsonnier 9e32141a5f MISC4: Fix ref count of VisualDataDistributor (harmless, currently unused) 2017-02-15 20:45:46 +01:00
vsonnier 3ed65eff8e BLOCKING_QUEUE: don't forget to cleanup if we try_push() 2017-02-15 20:27:57 +01:00
vsonnier 65c1722bca FIX: VisualProcessor compilation on Linux targets (#514), ThreadBlockingQueue version... 2017-02-14 18:42:12 +01:00
vsonnier 7d412eccb6 BLOCKING_QUEUE: display current Thread id in both hex and decimal so both worlds are happy (GDB and Visual Studio) 2017-02-14 18:42:12 +01:00
vsonnier 25f7ba386d BLOCKING_QUEUE: remove ThreadBlockingQueue dependency to ThreadQueue, remove ThreadQueue.h from CMakeLists 2017-02-14 18:42:11 +01:00
vsonnier c7467a88bc BLOCKING_QUEUE: prepare by raising up max queue lenghts
BLOCKING_QUEUE: Replaced ThreadQueue usage by ThreadBlockingQueue usage
BLOCKING_QUEUE: instrument all push() with timeouts, showed some call have to be non-blocking...
BLOCKING_QUEUE: tuned push()/try_push()
2017-02-14 18:42:05 +01:00
vsonnier e173eec3ef MISC3: Fed up with warning 4996 spam on MSVC, silence it for good in CMake 2017-02-14 18:36:20 +01:00
vsonnier c0dafb3197 FIX: VisualProcessor compilation on Linux targets (#514), suggested by @abousselmi, also works on MSVC 2017-02-14 18:34:25 +01:00
vsonnier 977ffa3e3d MISC2: Position labels better according to font scale (working this time) 2017-02-13 18:38:16 +01:00
vsonnier 2b0a2822a7 MISC: Position labels better according to font scale 2017-02-12 22:27:46 +01:00
vsonnier d3db510643 pre-BLOCKING_QUEUE: Simplified, fixed ThreadQueue, VisualProcessor (use std:deque, cleaner templates, max_size fixes) 2017-02-12 12:53:50 +01:00
Charles J. Cliffe 8c1d785ff6 About Dialog panel padding tweak 2017-02-08 21:22:56 -05:00
Charles J. Cliffe a4ae7fefb9 About dialog size adjustment 2017-02-08 19:48:28 -05:00
Charles J. Cliffe 54117fb99a Merge pull request #511 from cjcliffe/contributors_update
Contributors update
2017-02-07 21:52:52 -05:00
Charles J. Cliffe 6ce061280a New 'About' dialog and minor cleanup 2017-02-07 21:48:22 -05:00
Charles J. Cliffe febaf63d22 Merge cmakelists with master changes 2017-02-07 18:52:00 -05:00
Charles J. Cliffe 536ca64f7b Merge branch 'stefantalpalaru-rtaudio' 2017-02-07 18:30:09 -05:00
Charles J. Cliffe ca4092cc33 Minor cmake rtaudio else-case tweak 2017-02-07 18:29:34 -05:00
Stefan Talpalaru d1686f9699
add USE_SYSTEM_RTAUDIO flag, off by default 2017-02-07 17:07:44 +01:00
Stefan Talpalaru f4a60e6765
Merge branch 'master' into rtaudio 2017-02-06 17:52:15 +01:00
Charles J. Cliffe e181849a1d Merge branch 'vsonnier-vso_waterfall_fixes_and_improvements' 2017-02-05 20:48:24 -05:00
Charles J. Cliffe a05741fa9e Minor re-tweak of main waterfall default lines, version bump 2017-02-05 20:47:47 -05:00
vsonnier a161cf51f9 OPTION1: Boost line numbers of main and demod waterfall from 512/128 to 1024/256 2017-02-05 18:54:17 +01:00
vsonnier 4609386648 COMMENTS,POLISHING: comments fenzy around VisualProcessor machinery,
make process() a true interface as strong hint for derived classes,
plus misc define added for understanding.

BUGFIX: FFTDataDistributor loses incoming samples when compacting internal buffers.

BUGFIX2: FFTDistributor: Frozen Waterfall if internal buffer is no bigger than fftSize
2017-02-05 12:41:43 +01:00
Vincent Sonnier 0815b6a684 Merge pull request #509 from vsonnier/vso_liquid_dsp_Windows_gcc63
Update Windows liquid-dsp v1.3 libs using latest MySys2(GCC 6.3) using -ffast-math
2017-02-03 20:37:28 +01:00
vsonnier f90f36a653 Update liquid-dsp v1.3 build using MySys2(GCC 6.3) using -ffast-math 2017-02-03 19:28:06 +01:00
Vincent Sonnier 5b1383ab64 Merge pull request #504 from cjcliffe/vso_fix_#503
FIX: size_t definition not visible in some cases causing failed compilation.
2017-01-29 17:15:27 +01:00
vsonnier c00060a7d9 FIX: size_t definition not visible on some systems, so include stddef.h explicitly 2017-01-29 17:10:44 +01:00
Vincent Sonnier cce1faa1ad Merge pull request #502 from cjcliffe/vso_compiler_and_static_analysis_fixes
CLEANUP: some compiler and static analysis warnings
2017-01-29 09:06:02 +01:00
vsonnier 115b0ffa58 CLEANUP: some compiler and static analysis warnings 2017-01-28 14:57:27 +01:00
Charles J. Cliffe af6a32902f Merge pull request #501 from vsonnier/theme_ui_fixes
UI fixes: Theme set/change, B shortcut, add icon to SDR Devices dialog.
2017-01-27 19:22:12 -05:00
vsonnier 2d97353365 Add a proper icon to the SDR Devices dialog 2017-01-27 23:34:48 +01:00
vsonnier 848d1bf0e3 Manage B key correctly activated for spectrum, not waterfall. Add another independent B (dB) key for audio scope 2017-01-27 23:23:25 +01:00
vsonnier 532f34c608 Theme set/change now consistent over the UI 2017-01-27 23:23:25 +01:00
Charles J. Cliffe 0b23a14678 Merge pull request #500 from cjcliffe/update_range
Allow updating of an existing range
2017-01-24 23:18:00 -05:00
Charles J. Cliffe 0b10ea5fb7 Allow updating of an existing range 2017-01-24 23:14:39 -05:00
Charles J. Cliffe 6bcf0eb56a Merge pull request #499 from vsonnier/sample_rate_gui_improvements
Device Sample Rate improvements: UI, rates handled as long, misc...
2017-01-24 18:31:49 -05:00
vsonnier 196c664cf4 Device Sample Rate improvements: UI, changed device sample rates to be expressed as long instead of int at some places for safety/consistency. Also pedantic harmless traces changes. 2017-01-21 12:56:16 +01:00
Charles J. Cliffe 5e4f5d7d96 IsMaximized() return is ambiguous for OSX full-screen vs. filled-screen; use Y position instead.. 2017-01-18 21:24:50 -05:00
Charles J. Cliffe 066d634d24 Don't save maximized window state/position on OSX 2017-01-18 20:13:25 -05:00
Charles J. Cliffe 9ecf29d3b4 Merge pull request #497 from vsonnier/liquid_dsp_v130_upgrade
Liquid dsp v1.30 upgrade (for Windows)
2017-01-16 17:58:04 -05:00
vsonnier 7ab2b08e7d UPGRADE_cleanup: removal of ENABLE_LIQUID_EXPERIMENTAL conditionals because the features are now in mainline liquid v1.30 2017-01-14 18:16:41 +01:00
vsonnier 02cf6fbe4b UPGRADE: Recompiled Windows libraries in v1.30 version, added MinGW makefiles, updated runtime libs
wip
2017-01-14 18:16:32 +01:00
Charles J. Cliffe c02e7afccb Merge pull request #490 from vsonnier/fix_missing_demod_spectrum_and_wf
FIX: missing demod displays due to wrong input/queue setups order
2017-01-10 20:29:03 -05:00
vsonnier 1a53e454ab FIX: missing demod displays due to wrong input/queue setups order 2017-01-08 12:46:31 +01:00
Charles J. Cliffe 4919988c7c Merge pull request #484 from vsonnier/fixes_on_021alpha_bookmark1
FIX: wrong directive placement prevent building without HAMLIB
2017-01-03 17:36:00 -05:00
vsonnier 89cac5db88 FIX: wrong directive placement prevent building witout HAMLIB 2017-01-03 18:41:38 +01:00
Charles J. Cliffe 2cb540e44b Update README.md 2017-01-02 21:33:29 -05:00
Charles J. Cliffe d8430ddde3 Merge pull request #482 from cjcliffe/develop
Develop
2017-01-02 21:29:45 -05:00
Charles J. Cliffe c3106613a2 Additional license headers, cleanup unused code defs/refs 2017-01-02 21:27:08 -05:00
Charles J. Cliffe 143c297485 Merge pull request #481 from cjcliffe/master
Master -> Develop
2017-01-02 21:22:34 -05:00
Charles J. Cliffe 5c72b97309 Merge branch 'develop' into master 2017-01-02 21:22:13 -05:00
Charles J. Cliffe a21440c290 Merge pull request #480 from cjcliffe/license-cleanup
Licence fix, add SPDX-License-Identifier, remove unused code files
2017-01-02 21:20:59 -05:00
Charles J. Cliffe 3ec14fbe38 Licence fix, add SPDX-License-Identifier, remove unused code files 2017-01-02 21:07:43 -05:00
Charles J. Cliffe 299d57d2ff Merge pull request #449 from cjcliffe/feature/bookmark
Feature/bookmark
2017-01-02 02:01:08 -05:00
Charles J. Cliffe 591610062a Bundle mod folder update 2017-01-02 01:37:22 -05:00
Charles J. Cliffe 3cfb0154af Fix some header orders to make MSVC happy 2017-01-02 01:29:27 -05:00
Charles J. Cliffe e971f551ad Set default bookmark sash pos 2017-01-02 00:00:31 -05:00
Charles J. Cliffe 5c89a0783d Flip recent list; bundle mod path update; version bump 2017-01-01 23:51:37 -05:00
Stefan Talpalaru 03eb22a5c7
use the system RtAudio on Linux 2016-09-02 17:54:23 +02:00
292 changed files with 51909 additions and 23605 deletions

34
.circleci/config.yml Normal file
View File

@ -0,0 +1,34 @@
version: 2.1
jobs:
build:
docker:
- image: cimg/base:current-22.04
resource_class: medium
environment:
- CACHE_DIR: ~/build/wxWidgets/staticlib
steps:
- checkout
- restore_cache:
keys:
- cache-{{ checksum ".circleci/scripts/build_wxwidgets.sh" }}
- run:
name: Install Dependencies
command: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libpulse-dev libgtk-3-dev freeglut3 freeglut3-dev libhamlib-dev
- run:
name: Build wxWidgets
command: bash .circleci/scripts/build_wxwidgets.sh
- run:
name: Build LiquidDSP
command: bash .circleci/scripts/build_liquiddsp.sh
- run:
name: Build SoapySDR
command: bash .circleci/scripts/build_soapysdr.sh
- run:
name: Build CubicSDR
command: bash .circleci/scripts/build_cubicsdr.sh
- save_cache:
key: cache-{{ checksum ".circleci/scripts/build_wxwidgets.sh" }}
paths:
- ~/build/wxWidgets/staticlib

View File

@ -0,0 +1,5 @@
# CubicSDR
mkdir -p $HOME/build/cjcliffe/CubicSDR-build
cd $HOME/build/cjcliffe/CubicSDR-build
cmake ~/project -DCMAKE_BUILD_TYPE=Release -DwxWidgets_CONFIG_EXECUTABLE=$HOME/build/wxWidgets/staticlib/bin/wx-config -DUSE_HAMLIB=1 -DENABLE_DIGITAL_LAB=1
make -j2

View File

@ -0,0 +1,14 @@
# Liquid-DSP
mkdir -p $HOME/build/jgaeddert
cd $HOME/build/jgaeddert
git clone https://github.com/jgaeddert/liquid-dsp.git
cd $HOME/build/jgaeddert/liquid-dsp
./bootstrap.sh
echo "Configuring liquid-dsp.."
./configure > /dev/null
echo "Building liquid-dsp.."
make -j2 > /dev/null
sudo make install

View File

@ -0,0 +1,13 @@
# Soapy SDR
mkdir -p $HOME/build/pothosware/SoapySDR-build
cd $HOME/build/pothosware
git clone https://github.com/pothosware/SoapySDR.git
cd $HOME/build/pothosware/SoapySDR-build
cmake $HOME/build/pothosware/SoapySDR -DCMAKE_BUILD_TYPE=Release
echo "Building SoapySDR.."
make -j2 > /dev/null
sudo make install

View File

@ -0,0 +1,29 @@
# wxWidgets
if [ -f "$HOME/build/wxWidgets/staticlib/bin/wx-config" ]; then
echo "wxWidgets cache found; skipping.."
exit 0
else
echo "wxWidgets cache not found; building.."
fi
echo "Fetch wxWidgets.."
mkdir -p $HOME/build/wxWidgets/staticlib
cd $HOME/build/wxWidgets
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.1/wxWidgets-3.2.1.tar.bz2 > /dev/null
echo "Unpacking wxWidgets.."
tar -xvjf wxWidgets-3.2.1.tar.bz2 > /dev/null
cd wxWidgets-3.2.1/
./autogen.sh
if [ "$(uname)" == "Linux" ]; then
./configure --with-opengl --disable-glcanvasegl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webview --disable-webviewwebkit --prefix=`echo $HOME/build/wxWidgets/staticlib` CXXFLAGS="-std=c++0x"
elif [ "$(uname)" == "Darwin" ]; then
./configure --with-opengl --disable-glcanvasegl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --with-mac --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --prefix=`echo $HOME/build/wxWidgets/staticlib` CXXFLAGS="-std=c++0x" --with-libiconv=/usr
fi
echo "Building wxWidgets.."
make V=1 -j2
make install

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 2.8.12)
project (CubicSDR)
@ -6,7 +6,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "2")
SET(CUBICSDR_VERSION_PATCH "0")
SET(CUBICSDR_VERSION_PATCH "8")
SET(CUBICSDR_VERSION_SUFFIX "")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}${CUBICSDR_VERSION_SUFFIX}")
@ -14,6 +14,7 @@ SET(CPACK_PACKAGE_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.$
SET(CPACK_PACKAGE_VERSION_MAJOR ${CUBICSDR_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${CUBICSDR_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${CUBICSDR_VERSION_PATCH})
set(CPACK_PACKAGE_VENDOR "cubicproductions")
SET (CUSTOM_BUILD OFF CACHE BOOL "Enable custom build options")
# Build options for custom deploys, optimization and debugging
@ -27,6 +28,8 @@ IF(CUSTOM_BUILD)
# feature flags
SET (CUBICSDR_ENABLE_VIEW_DEMOD ON CACHE BOOL "Enable Second Demodulator Spectrum/Waterfall view.")
SET (CUBICSDR_ENABLE_VIEW_SCOPE ON CACHE BOOL "Enable Demodulator Scope/Spectrum view.")
SET (CUBICSDR_ENABLE_ABOUT_DIALOG ON CACHE BOOL "Enable About Dialog.")
SET (CUBICSDR_DEFAULT_HIDE_BOOKMARKS OFF CACHE BOOL "Hide Bookmarks by Default.")
SET (CUBICSDR_MODEM_EXCLUDE CACHE "" "Comma-separated list of modems to exclude.")
IF (NOT CUBICSDR_HEADER_IMAGE STREQUAL "")
@ -45,15 +48,17 @@ IF(CUSTOM_BUILD)
)
ENDIF()
ELSE()
SET (CUBICSDR_BUILD_TITLE "CubicSDR v${CUBICSDR_VERSION} by Charles J. Cliffe (@ccliffe) :: www.cubicsdr.com")
SET (CUBICSDR_BUILD_TITLE "CubicSDR v${CUBICSDR_VERSION} :: www.cubicsdr.com")
# bundle flags
SET (CUBICSDR_INSTALL_NAME "CubicSDR")
SET (CUBICSDR_INSTALL_TITLE "CubicSDR ${CUBICSDR_VERSION} Installer")
SET (CUBICSDR_HEADER_IMAGE "")
SET (CUBICSDR_HEADER_BG "")
# feature flags
SET (CUBICSDR_ENABLE_VIEW_DEMOD TRUE)
SET (CUBICSDR_ENABLE_VIEW_SCOPE TRUE)
SET (CUBICSDR_ENABLE_VIEW_DEMOD ON)
SET (CUBICSDR_ENABLE_VIEW_SCOPE ON)
SET (CUBICSDR_DEFAULT_HIDE_BOOKMARKS OFF)
SET (CUBICSDR_ENABLE_ABOUT_DIALOG ON)
SET (CUBICSDR_EXCLUDE_MODEM "")
ENDIF()
@ -65,6 +70,14 @@ IF(CUBICSDR_ENABLE_VIEW_SCOPE)
ADD_DEFINITIONS( -DCUBICSDR_ENABLE_VIEW_SCOPE=1 )
ENDIF()
IF(CUBICSDR_DEFAULT_HIDE_BOOKMARKS)
ADD_DEFINITIONS( -DCUBICSDR_DEFAULT_HIDE_BOOKMARKS=1 )
ENDIF()
IF(CUBICSDR_ENABLE_ABOUT_DIALOG)
ADD_DEFINITIONS( -DCUBICSDR_ENABLE_ABOUT_DIALOG=1 )
ENDIF()
ADD_DEFINITIONS(
-DCUBICSDR_INSTALL_NAME="${CUBICSDR_INSTALL_NAME}"
-DCUBICSDR_VERSION="${CUBICSDR_VERSION}"
@ -76,16 +89,6 @@ IF(ENABLE_DIGITAL_LAB)
ADD_DEFINITIONS(
-DENABLE_DIGITAL_LAB=1
)
IF(MSVC)
SET (ENABLE_LIQUID_EXPERIMENTAL OFF CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
ELSE()
SET (ENABLE_LIQUID_EXPERIMENTAL ON CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
ENDIF()
IF(ENABLE_LIQUID_EXPERIMENTAL)
ADD_DEFINITIONS(
-DENABLE_LIQUID_EXPERIMENTAL=1
)
ENDIF()
ENDIF()
set(USE_HAMLIB OFF CACHE BOOL "Support hamlib for radio control functions.")
@ -157,7 +160,7 @@ IF (MSVC)
SET(LIQUID_INCLUDES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/include/" CACHE STRING "Liquid-DSP include directory")
SET(LIQUID_LIBRARIES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.lib" CACHE STRING "Liquid-DSP Library")
SET(LIQUID_DLL "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll" CACHE STRING "Liquid-DSP DLL")
SET(HAMLIB_DLLS "${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libhamlib-2.dll;${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libwinpthread-1.dll" CACHE STRING "HAMLIB DLLS")
SET(HAMLIB_DLLS "${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libhamlib-4.dll" CACHE STRING "HAMLIB DLLS")
ELSE (MSVC)
ADD_DEFINITIONS(
-std=c++0x
@ -224,57 +227,85 @@ IF (WIN32)
ENDIF()
ENDIF (WIN32)
MACRO(use_included_rtaudio)
SET (cubicsdr_sources
${cubicsdr_sources}
external/rtaudio/RtAudio.cpp
)
SET (cubicsdr_headers
${cubicsdr_headers}
external/rtaudio/RtAudio.h
)
SOURCE_GROUP("_ext-RTAudio" REGULAR_EXPRESSION "external/rtaudio/.*${REG_EXT}")
include_directories(${PROJECT_SOURCE_DIR}/external/rtaudio)
ENDMACRO(use_included_rtaudio)
IF (UNIX AND NOT APPLE)
set(BUILD_DEB OFF CACHE BOOL "Build DEB")
SET(USE_AUDIO_PULSE ON CACHE BOOL "Use Pulse Audio")
SET(USE_AUDIO_JACK OFF CACHE BOOL "Use Jack Audio")
SET(USE_AUDIO_ALSA OFF CACHE BOOL "Use ALSA Audio")
SET(USE_AUDIO_OSS OFF CACHE BOOL "Use OSS Audio")
SET(USE_SYSTEM_RTAUDIO OFF CACHE BOOL "Use the system RtAudio which in turn provides OSS, ALSA, JACK, PulseAudio support depending on how it was compiled")
SET(LIQUID_LIB liquid)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
IF(USE_AUDIO_PULSE)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} pulse-simple pulse)
ADD_DEFINITIONS(
-D__LINUX_PULSE__
)
ENDIF(USE_AUDIO_PULSE)
IF(USE_SYSTEM_RTAUDIO)
find_package(RtAudio)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} ${RTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${RTAUDIO_DEFINITIONS})
include_directories(${RTAUDIO_INCLUDE_DIR})
ELSE(USE_SYSTEM_RTAUDIO)
use_included_rtaudio()
IF(USE_AUDIO_JACK)
find_package(Jack)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} ${JACK_LIBRARIES})
ADD_DEFINITIONS(
-D__UNIX_JACK__
)
include_directories(${JACK_INCLUDE_DIRS})
ENDIF(USE_AUDIO_JACK)
SET(USE_AUDIO_PULSE ON CACHE BOOL "Use Pulse Audio")
SET(USE_AUDIO_JACK OFF CACHE BOOL "Use Jack Audio")
SET(USE_AUDIO_ALSA OFF CACHE BOOL "Use ALSA Audio")
SET(USE_AUDIO_OSS OFF CACHE BOOL "Use OSS Audio")
IF(USE_AUDIO_PULSE)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} pulse-simple pulse)
ADD_DEFINITIONS(
-D__LINUX_PULSE__
)
ENDIF(USE_AUDIO_PULSE)
IF(USE_AUDIO_ALSA)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} asound)
set(ALSA_INCLUDE_DIR "/usr/include" CACHE FILEPATH "ALSA include path")
include_directories(${ALSA_INCLUDE_DIR})
set(ALSA_LIB_DIR "/usr/lib" CACHE FILEPATH "ALSA lib path")
link_directories(${ALSA_LIB_DIR})
ADD_DEFINITIONS(
-D__LINUX_ALSA__
)
ENDIF(USE_AUDIO_ALSA)
IF(USE_AUDIO_JACK)
find_package(Jack)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} ${JACK_LIBRARIES})
ADD_DEFINITIONS(
-D__UNIX_JACK__
)
include_directories(${JACK_INCLUDE_DIRS})
ENDIF(USE_AUDIO_JACK)
IF(USE_AUDIO_OSS)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} oss)
ADD_DEFINITIONS(
-D__LINUX_OSS__
)
ENDIF(USE_AUDIO_OSS)
IF(USE_AUDIO_ALSA)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} asound)
set(ALSA_INCLUDE_DIR "/usr/include" CACHE FILEPATH "ALSA include path")
include_directories(${ALSA_INCLUDE_DIR})
set(ALSA_LIB_DIR "/usr/lib" CACHE FILEPATH "ALSA lib path")
link_directories(${ALSA_LIB_DIR})
ADD_DEFINITIONS(
-D__LINUX_ALSA__
)
ENDIF(USE_AUDIO_ALSA)
IF(USE_AUDIO_OSS)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} oss)
ADD_DEFINITIONS(
-D__LINUX_OSS__
)
ENDIF(USE_AUDIO_OSS)
ENDIF(USE_SYSTEM_RTAUDIO)
ELSE(UNIX AND NOT APPLE)
use_included_rtaudio()
ENDIF(UNIX AND NOT APPLE)
IF (APPLE)
SET(CMAKE_OSX_DEPLOYMENT_TARGET, "10.9")
SET(LIQUID_LIB liquid)
IF(CMAKE_INSTALL_PREFIX)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
ENDIF(CMAKE_INSTALL_PREFIX)
link_directories(/usr/local/lib)
link_directories(/opt/local/lib)
@ -290,6 +321,7 @@ ENDIF (APPLE)
SET (cubicsdr_sources
${cubicsdr_sources}
src/CubicSDR.cpp
src/AppFrame.cpp
src/AppConfig.cpp
@ -298,6 +330,7 @@ SET (cubicsdr_sources
src/IOThread.cpp
src/ModemProperties.cpp
src/BookmarkMgr.cpp
src/SessionMgr.cpp
src/sdr/SDRDeviceInfo.cpp
src/sdr/SDRPostThread.cpp
src/sdr/SDREnumerator.cpp
@ -311,6 +344,7 @@ SET (cubicsdr_sources
src/modules/modem/ModemAnalog.cpp
src/modules/modem/ModemDigital.cpp
src/modules/modem/analog/ModemAM.cpp
src/modules/modem/analog/ModemCW.cpp
src/modules/modem/analog/ModemDSB.cpp
src/modules/modem/analog/ModemFM.cpp
src/modules/modem/analog/ModemNBFM.cpp
@ -319,6 +353,10 @@ SET (cubicsdr_sources
src/modules/modem/analog/ModemLSB.cpp
src/modules/modem/analog/ModemUSB.cpp
src/audio/AudioThread.cpp
src/audio/AudioSinkThread.cpp
src/audio/AudioSinkFileThread.cpp
src/audio/AudioFile.cpp
src/audio/AudioFileWAV.cpp
src/util/Gradient.cpp
src/util/Timer.cpp
src/util/MouseTracker.cpp
@ -360,7 +398,8 @@ SET (cubicsdr_sources
src/forms/Bookmark/BookmarkView.cpp
src/forms/Dialog/ActionDialogBase.cpp
src/forms/Dialog/ActionDialog.cpp
external/rtaudio/RtAudio.cpp
src/forms/Dialog/AboutDialogBase.cpp
src/forms/Dialog/AboutDialog.cpp
external/lodepng/lodepng.cpp
external/tinyxml/tinyxml.cpp
external/tinyxml/tinystr.cpp
@ -385,16 +424,12 @@ IF(ENABLE_DIGITAL_LAB)
src/modules/modem/digital/ModemSQAM.cpp
src/modules/modem/digital/ModemQAM.cpp
src/modules/modem/digital/ModemQPSK.cpp
)
IF(ENABLE_LIQUID_EXPERIMENTAL)
SET (cubicsdr_sources
${cubicsdr_sources}
src/modules/modem/digital/ModemFSK.cpp
)
ENDIF()
ENDIF()
SET (cubicsdr_headers
${cubicsdr_headers}
src/CubicSDRDefs.h
src/CubicSDR.h
src/AppFrame.h
@ -404,6 +439,7 @@ SET (cubicsdr_headers
src/IOThread.h
src/ModemProperties.h
src/BookmarkMgr.h
src/SessionMgr.h
src/sdr/SDRDeviceInfo.h
src/sdr/SDRPostThread.h
src/sdr/SDREnumerator.h
@ -418,6 +454,7 @@ SET (cubicsdr_headers
src/modules/modem/ModemAnalog.h
src/modules/modem/ModemDigital.h
src/modules/modem/analog/ModemAM.h
src/modules/modem/analog/ModemCW.h
src/modules/modem/analog/ModemDSB.h
src/modules/modem/analog/ModemFM.h
src/modules/modem/analog/ModemNBFM.h
@ -426,13 +463,18 @@ SET (cubicsdr_headers
src/modules/modem/analog/ModemLSB.h
src/modules/modem/analog/ModemUSB.h
src/audio/AudioThread.h
src/audio/AudioSinkThread.h
src/audio/AudioSinkFileThread.h
src/audio/AudioFile.h
src/audio/AudioFileWAV.h
src/util/Gradient.h
src/util/Timer.h
src/util/ThreadQueue.h
src/util/ThreadBlockingQueue.h
src/util/MouseTracker.h
src/util/GLExt.h
src/util/GLFont.h
src/util/DataTree.h
src/util/SpinMutex.h
src/panel/ScopePanel.h
src/panel/SpectrumPanel.h
src/panel/WaterfallPanel.h
@ -470,7 +512,8 @@ SET (cubicsdr_headers
src/forms/Bookmark/BookmarkView.h
src/forms/Dialog/ActionDialogBase.h
src/forms/Dialog/ActionDialog.h
external/rtaudio/RtAudio.h
src/forms/Dialog/AboutDialogBase.h
src/forms/Dialog/AboutDialog.h
external/lodepng/lodepng.h
external/tinyxml/tinyxml.h
external/tinyxml/tinystr.h
@ -506,25 +549,41 @@ SET (cubicsdr_headers
src/modules/modem/digital/ModemSQAM.h
src/modules/modem/digital/ModemQAM.h
src/modules/modem/digital/ModemQPSK.h
src/modules/modem/digital/ModemFSK.h
)
IF(ENABLE_LIQUID_EXPERIMENTAL)
SET (cubicsdr_sources
${cubicsdr_sources}
src/modules/modem/digital/ModemFSK.h
)
ENDIF()
ENDIF()
IF (USE_HAMLIB)
SET (cubicsdr_headers
${cubicsdr_headers}
src/forms/Dialog/PortSelectorDialogBase.h
src/forms/Dialog/PortSelectorDialog.h
src/rig/RigThread.h
external/rs232/rs232.h
)
SET (cubicsdr_sources
${cubicsdr_sources}
src/forms/Dialog/PortSelectorDialogBase.cpp
src/forms/Dialog/PortSelectorDialog.cpp
src/rig/RigThread.cpp
)
IF(WIN32)
SET (cubicsdr_sources
${cubicsdr_sources}
external/rs232/rs232-win.cpp
)
ELSE()
SET (cubicsdr_sources
${cubicsdr_sources}
external/rs232/rs232-linux.cpp
)
ENDIF()
include_directories (
external/rs232/
)
ENDIF()
@ -562,6 +621,7 @@ SOURCE_GROUP("Forms\\Dialog" REGULAR_EXPRESSION "src/forms/Dialog/${REG_EXT}")
SOURCE_GROUP("SDR" REGULAR_EXPRESSION "src/sdr/${REG_EXT}")
IF(USE_HAMLIB)
SOURCE_GROUP("Rig" REGULAR_EXPRESSION "src/rig/${REG_EXT}")
SOURCE_GROUP("_ext-RS-232" REGULAR_EXPRESSION "external/rs232/${REG_EXT}")
ENDIF()
SOURCE_GROUP("Demodulator" REGULAR_EXPRESSION "src/demod/${REG_EXT}")
SOURCE_GROUP("Modem" REGULAR_EXPRESSION "src/modules/modem/${REG_EXT}")
@ -576,7 +636,6 @@ SOURCE_GROUP("Visual" REGULAR_EXPRESSION "src/visual/${REG_EXT}")
SOURCE_GROUP("Panel" REGULAR_EXPRESSION "src/panel/${REG_EXT}")
SOURCE_GROUP("Process" REGULAR_EXPRESSION "src/process/${REG_EXT}")
SOURCE_GROUP("UI" REGULAR_EXPRESSION "src/ui/${REG_EXT}")
SOURCE_GROUP("_ext-RTAudio" REGULAR_EXPRESSION "external/rtaudio/.*${REG_EXT}")
SOURCE_GROUP("_ext-LodePNG" REGULAR_EXPRESSION "external/lodepng/.*${REG_EXT}")
SOURCE_GROUP("_ext-TinyXML" REGULAR_EXPRESSION "external/tinyxml/.*${REG_EXT}")
SOURCE_GROUP("_ext-CubicVR2" REGULAR_EXPRESSION "external/cubicvr2/.*${REG_EXT}")
@ -600,7 +659,6 @@ include_directories (
${PROJECT_SOURCE_DIR}/src/ui
${PROJECT_SOURCE_DIR}/src/rig
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/external/rtaudio
${PROJECT_SOURCE_DIR}/external/lodepng
${PROJECT_SOURCE_DIR}/external/tinyxml
${PROJECT_SOURCE_DIR}/external/cubicvr2/math
@ -626,26 +684,33 @@ IF (NOT BUNDLE_APP)
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
IF(MSVC)
configure_files(${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
configure_files(${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
IF(USE_HAMLIB)
configure_files(${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
ENDIF(USE_HAMLIB)
ENDIF()
IF (CUBICSDR_HAS_HEADER_IMAGE)
configure_files(${CUBICSDR_HEADER_IMAGE_DIR} ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} ${CUBICSDR_HEADER_IMAGE_FILE})
ENDIF()
add_executable(CubicSDR ${cubicsdr_sources} ${cubicsdr_headers} ${RES_FILES})
target_link_libraries(CubicSDR ${LIQUID_LIB} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${OTHER_LIBRARIES})
target_link_libraries(CubicSDR ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${OTHER_LIBRARIES})
ENDIF (NOT BUNDLE_APP)
IF (MSVC)
set_target_properties(CubicSDR PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_DEBUG "_WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_DEBUG "_WINDOWS;WIN32_LEAN_AND_MEAN")
set_target_properties(CubicSDR PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO "_WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO "_WINDOWS;WIN32_LEAN_AND_MEAN")
set_target_properties(CubicSDR PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_RELEASE "_WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_RELEASE "_WINDOWS;WIN32_LEAN_AND_MEAN")
set_target_properties(CubicSDR PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_MINSIZEREL "_WINDOWS")
set_target_properties(CubicSDR PROPERTIES COMPILE_DEFINITIONS_MINSIZEREL "_WINDOWS;WIN32_LEAN_AND_MEAN")
set(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWS /ENTRY:\"mainCRTStartup\"")
set_target_properties (CubicSDR PROPERTIES OUTPUT_NAME "${CUBICSDR_INSTALL_NAME}")
ADD_DEFINITIONS(
/wd\"4996\"
)
ENDIF(MSVC)
IF (APPLE)
@ -722,9 +787,11 @@ IF (APPLE AND BUNDLE_APP)
# SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
IF (BUNDLE_SOAPY_MODS)
message(STATUS "SOAPY_ROOT: ${SOAPY_SDR_ROOT}")
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/*.so)
message(STATUS "SOAPY_ROOT: ${CMAKE_INSTALL_PREFIX}")
SET(SOAPY_SDR_MOD_PATH "${CMAKE_INSTALL_PREFIX}/lib/SoapySDR/modules${SOAPY_SDR_ABI_VERSION}")
message(STATUS "SOAPY_SDR_MOD_PATH: ${SOAPY_SDR_MOD_PATH}")
file(GLOB SOAPY_MODS ${SOAPY_SDR_MOD_PATH}/*.so)
FOREACH(SOAPY_MOD_FILE ${SOAPY_MODS})
INSTALL( FILES "${SOAPY_MOD_FILE}"
@ -849,7 +916,7 @@ IF (WIN32 AND NOT BUILD_INSTALLER)
IF(USE_HAMLIB)
FOREACH(HAMLIB_DLL ${HAMLIB_DLLS})
message(STATUS "Copying Hamlib DLL: ${HAMLIB_DLL}")
INSTALL( FILES "${HAMLIB_DLL}"
INSTALL( FILES ${HAMLIB_DLL}
DESTINATION bin
)
ENDFOREACH()
@ -893,7 +960,8 @@ IF (WIN32 AND BUILD_INSTALLER)
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CUBICSDR_INSTALL_NAME} ${CPACK_PACKAGE_VERSION} (x86)")
set(CMAKE_CL_64 FALSE)
ENDIF(EX_PLATFORM EQUAL 64)
SET(BUNDLE_MSVC_REDIST "" CACHE STRING "Visual C++ Redistributable")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
install(TARGETS CubicSDR RUNTIME DESTINATION .)
@ -933,24 +1001,28 @@ IF (WIN32 AND BUILD_INSTALLER)
ENDIF()
file(GLOB SOAPY_BINS ${SOAPY_SDR_ROOT}/bin/*.dll)
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/*.dll)
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules${SOAPY_SDR_ABI_VERSION}/*.dll)
message(STATUS "SOAPY_BINS: ${SOAPY_BINS}")
message(STATUS "SOAPY_MODS: ${SOAPY_MODS}")
install(FILES ${SOAPY_BINS} DESTINATION .)
install(FILES ${SOAPY_MODS} DESTINATION modules)
ENDIF(BUNDLE_SOAPY_MODS)
IF(MSVC AND EX_PLATFORM EQUAL 32)
install(FILES
${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/libgcc_s_dw2-1.dll
DESTINATION .)
ENDIF(MSVC AND EX_PLATFORM EQUAL 32)
IF(MSVC)
file(GLOB MSVC_DEPS ${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/*.dll)
install(FILES ${MSVC_DEPS} DESTINATION .)
ENDIF(MSVC)
set(CPACK_PACKAGE_EXECUTABLES CubicSDR "CubicSDR")
IF (MSVC)
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/vc_redist.${EX_PLATFORM_NAME}.exe DESTINATION vc_redist)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\vc_redist\\\\vc_redist.${EX_PLATFORM_NAME}.exe\\\" /q:a'")
IF (BUNDLE_MSVC_REDIST)
message(STATUS "BUNDLE_MSVC_REDIST: ${BUNDLE_MSVC_REDIST}")
cmake_path(GET BUNDLE_MSVC_REDIST FILENAME BUNDLE_MSVC_REDIST_FN)
message(STATUS "BUNDLE_MSVC_REDIST_FN: ${BUNDLE_MSVC_REDIST_FN}")
install(PROGRAMS ${BUNDLE_MSVC_REDIST} DESTINATION vc_redist)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\vc_redist\\\\${BUNDLE_MSVC_REDIST_FN}\\\" /passive /norestart'")
ENDIF()
ENDIF (MSVC)

11
LICENSE
View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
CubicSDR
Copyright (C) 2014 Charles J. Cliffe
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
@ -337,4 +337,3 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,11 +1,12 @@
CubicSDR
CubicSDR [![CircleCI](https://dl.circleci.com/status-badge/img/gh/cjcliffe/CubicSDR/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/cjcliffe/CubicSDR/tree/master)
========
Cross-Platform Software-Defined Radio Application
- Please see the [CubicSDR GitHub Wiki](https://github.com/cjcliffe/CubicSDR/wiki) for build instructions.
- Manual is available (work-in-progress) at [cubicsdr.readthedocs.io](http://cubicsdr.readthedocs.io).
- See also the current [CubicSDR Releases](https://github.com/cjcliffe/CubicSDR/releases) page for available binaries.
- The latest releases are available on the [CubicSDR Releases](https://github.com/cjcliffe/CubicSDR/releases) page.
- Build instructions can be found at the [CubicSDR Wiki](https://github.com/cjcliffe/CubicSDR/wiki) page.
- Manual is available at [cubicsdr.readthedocs.io](http://cubicsdr.readthedocs.io).
- Manual contributions can be submitted to the [CubicSDR-Manual](https://github.com/cjcliffe/CubicSDR-Manual) repository.
Utilizes:
--------
@ -22,12 +23,7 @@ Utilizes:
Optional Libs:
--------
- FFTW3 (can be compiled into liquid-dsp if desired) (http://www.fftw.org/ -- https://github.com/FFTW/fftw3)
- hamlib (https://sourceforge.net/p/hamlib/wiki/Hamlib/ -- https://sourceforge.net/p/hamlib/code/ci/master/tree/)
Features and Status:
--------------------
- Please see the issues on GitHub or visit https://github.com/cjcliffe/CubicSDR/wiki/CubicSDR-Roadmap-and-Ideas for more information.
- A manual is in development at https://github.com/cjcliffe/CubicSDR/issues/248 if you would like to contribute.
- hamlib (https://github.com/Hamlib/Hamlib)
Recommended minimum requirements:
--------------------
@ -36,16 +32,14 @@ Recommended minimum requirements:
- OSX 10.9+ for Mac binary releases.
- Windows 7+ for 64 or 32-bit Windows binary releases.
- Linux and other embedded distribution support yet to be indexed, known to at least work on Debian 8+ and Ubuntu 14+.
- Raspberry Pi2 support is being experimented with; earlier versions of CubicSDR known to work with Banana Pi.
Target Platforms:
----------------
- [x] OSX
- [x] Windows
- [x] Linux
- [ ] HTML5
Platform build scripts and test builds:
--------------------------------------
- MacOS (https://github.com/cjcliffe/CubicSDR-macOSBuild)
- Windows (https://github.com/cjcliffe/CubicSDR-WinBuild)
- Linux (AppImage) (https://github.com/cjcliffe/CubicSDR-AppImageKit)
License:
-------
- GPL
- GPL-2.0+

View File

@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Exec=CubicSDR %u
Icon=@CMAKE_INSTALL_PREFIX@/share/cubicsdr/CubicSDR.png
Icon=@CMAKE_INSTALL_PREFIX@/share/cubicsdr/CubicSDR
Terminal=false
Name=CubicSDR
GenericName=CubicSDR

View File

@ -0,0 +1,48 @@
# https://github.com/idiap/juicer/blob/master/cmake/FindRtAudio.cmake
#
# Copyright 2015 by Idiap Research Institute
#
# Licensed under 3-clause BSD.
#
# Author(s):
# Phil Garner, November 2015
#
# ...but basically copied from FindSndFile in libube, in turn from the examples
# on the web.
#
#
# Try to find RtAudio
# Once done this will define
# RTAUDIO_FOUND - System has RtAudio
# RTAUDIO_INCLUDE_DIR - The RtAudio include directories
# RTAUDIO_LIBRARIES - The libraries needed to use RtAudio
# RTAUDIO_DEFINITIONS - Compiler switches required for using RtAudio
# RTAUDIO_VERSION_STRING - the version of RtAudio found
#
find_package(PkgConfig)
pkg_check_modules(PC_RTAUDIO rtaudio)
set(RTAUDIO_DEFINITIONS ${PC_RTAUDIO_CFLAGS_OTHER})
set(RTAUDIO_VERSION_STRING ${PC_RTAUDIO_VERSION})
find_path(
RTAUDIO_INCLUDE_DIR RtAudio.h
HINTS ${PC_RTAUDIO_INCLUDEDIR} ${PC_RTAUDIO_INCLUDE_DIRS}
)
find_library(
RTAUDIO_LIBRARIES NAMES rtaudio
HINTS ${PC_RTAUDIO_LIBDIR} ${PC_RTAUDIO_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
RtAudio
REQUIRED_VARS RTAUDIO_LIBRARIES RTAUDIO_INCLUDE_DIR
VERSION_VAR RTAUDIO_VERSION_STRING
)
#mark_as_advanced(RTAUDIO_INCLUDE_DIR RTAUDIO_LIBRARIES)

View File

@ -1,5 +1,5 @@
#!/bin/bash
for f in ${APPS}/Contents/MacOS/*.dylib
for f in ${APPS}/Contents/**/*.dylib
do
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" $f
done

View File

@ -14,7 +14,7 @@
namespace CubicVR {
enum aabb_enum { AABB_DISJOINT, AABB_A_INSIDE_B, AABB_B_INSIDE_A, AABB_INTERSECT };
enum class aabb_intersect { AABB_DISJOINT, AABB_A_INSIDE_B, AABB_B_INSIDE_A, AABB_INTERSECT };
struct aabb {
vec3 min, max;
@ -76,33 +76,33 @@ namespace CubicVR {
CubicVR.enums.aabb.B_INSIDE_A if boxB is inside boxA
CubicVR.enums.aabb.DISJOINT if AABBs are disjoint (do not intersect)
*/
aabb_enum intersects(aabb boxA, aabb boxB) {
aabb_intersect intersects(aabb boxA, aabb boxB) {
// Disjoint
if( boxA.min[0] > boxB.max[0] || boxA.max[0] < boxB.min[0] ){
return AABB_DISJOINT;
return aabb_intersect::AABB_DISJOINT;
}
if( boxA.min[1] > boxB.max[1] || boxA.max[1] < boxB.min[1] ){
return AABB_DISJOINT;
return aabb_intersect::AABB_DISJOINT;
}
if( boxA.min[2] > boxB.max[2] || boxA.max[2] < boxB.min[2] ){
return AABB_DISJOINT;
return aabb_intersect::AABB_DISJOINT;
}
// boxA is inside boxB.
if( boxA.min[0] >= boxB.min[0] && boxA.max[0] <= boxB.max[0] &&
boxA.min[1] >= boxB.min[1] && boxA.max[1] <= boxB.max[1] &&
boxA.min[2] >= boxB.min[2] && boxA.max[2] <= boxB.max[2]) {
return AABB_A_INSIDE_B;
return aabb_intersect::AABB_A_INSIDE_B;
}
// boxB is inside boxA.
if( boxB.min[0] >= boxA.min[0] && boxB.max[0] <= boxA.max[0] &&
boxB.min[1] >= boxA.min[1] && boxB.max[1] <= boxA.max[1] &&
boxB.min[2] >= boxA.min[2] && boxB.max[2] <= boxA.max[2]) {
return AABB_B_INSIDE_A;
return aabb_intersect::AABB_B_INSIDE_A;
}
// Otherwise AABB's intersect.
return AABB_INTERSECT;
return aabb_intersect::AABB_INTERSECT;
}
};
};

View File

@ -12,7 +12,7 @@
#include <iostream>
#include "vec3.h"
#include <cstring>
#include <stddef.h>
namespace CubicVR {
#define mat3SG(c,x,y) \
@ -20,14 +20,20 @@ namespace CubicVR {
c & COMBINE(set,x)(mat3 value) { y = value; return *this; }
struct mat3 {
__float a,b,c,d,e,f,g,h,i;
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
#ifndef _WIN32
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
#endif
operator __float*() const { return (__float *)this; }
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
mat3(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii) {
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii;
};

View File

@ -15,21 +15,35 @@
#include "vec4.h"
#include "mat3.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
using namespace std;
#define mat4SG(c,x,y) \
mat4 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(mat4 value) { y = value; return *this; }
struct mat4 {
__float a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
//16 elements
__float a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
#ifndef _WIN32
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
#endif
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
//To be accessed by GL API directly, accessed by pointer.
//operator* overloading is way too dangerous, especially in ptr != NULL
//tests.
inline __float* to_ptr() const { return (__float *)this; }
operator __float*() const { return (__float *)this; }
mat4(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii,__float ji,__float ki,__float li,__float mi,__float ni,__float oi,__float pi) {
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii; j = ji; k = ki; l = li; m = mi; n = ni; o = oi; p = pi;
}
@ -263,22 +277,19 @@ namespace CubicVR {
static mat4 transform(vec3 position, vec3 rotation, vec3 scale) {
mat4 m = mat4::identity();
if (position!=NULL) {
m *= mat4::translate(position[0],position[1],position[2]);
m *= mat4::translate(position[0],position[1],position[2]);
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
m *= mat4::rotate(rotation[0], rotation[1], rotation[2]);
}
if (rotation!=NULL) {
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
m *= mat4::rotate(rotation[0],rotation[1],rotation[2]);
}
}
if (scale!=NULL) {
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
m *= mat4::scale(scale[0],scale[1],scale[2]);
}
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
m *= mat4::scale(scale[0],scale[1],scale[2]);
}
return m;
};
static vec4 vec4_multiply(vec4 m1, mat4 m2) {
vec4 mOut;
@ -313,7 +324,7 @@ namespace CubicVR {
};
static vec3 unProject(mat4 pMatrix, mat4 mvMatrix, float width, float height, float winx, float winy, float /* winz */) {
vec4 p(((winx / width) * 2.0f) - 1.0, -(((winy / height) * 2.0f) - 1.0), 1.0, 1.0);
vec4 p(((winx / width) * 2.0f) - 1.0f, -(((winy / height) * 2.0f) - 1.0f), 1.0f, 1.0f);
vec4 invp = mat4::vec4_multiply(mat4::vec4_multiply(p, mat4::inverse(pMatrix)), mat4::inverse(mvMatrix));

View File

@ -73,7 +73,7 @@ namespace CubicVR {
void pushMatrix(mat4 m) {
c_stack++;
m_stack[c_stack] = (m ? m : getIdentity());
m_stack[c_stack] = m;
}
void popMatrix() {
@ -88,14 +88,10 @@ namespace CubicVR {
m_cache.clear();
c_stack = 0;
valid = 0;
delete result;
result = mat4::identity();
if (init_mat != NULL) {
m_stack[0] = init_mat;
} else {
setIdentity();
}
m_stack[0] = init_mat;
}
void translate(__float x, __float y, __float z) {

View File

@ -12,6 +12,7 @@
#include <iostream>
#include <cmath>
#include "cubic_types.h"
#include <stddef.h>
namespace CubicVR {
#define vec2SG(c,x,y) \
@ -20,20 +21,27 @@ namespace CubicVR {
struct vec2 {
__float x, y;
public:
__float& u() { return x; }
__float& v() { return y; }
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
#ifndef _WIN32
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
#endif
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec2 (__float xi,__float yi) { x = xi; y = yi; }
vec2 () { x = y = 0.0f; }
operator __float*() const { return (__float *)this; }
vec2 operator*(__float v) { return vec2( x*v, y*v ); }
// vec2 operator*(vec2 v) { return vec2::cross(*this,v); }
vec2 operator+(vec2 v) { return vec2::add(*this,v); }
vec2 operator-(vec2 v) { return vec2::subtract(*this,v); }

View File

@ -12,6 +12,7 @@
#include <iostream>
#include "cubic_types.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
@ -23,19 +24,24 @@ namespace CubicVR {
struct vec3 {
__float x,y,z;
operator __float*() const { return (__float *)this; }
__float& r() { return x; }
__float& g() { return y; }
__float& b() { return z; }
#ifndef _WIN32
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
#endif
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec3 (__float xi,__float yi,__float zi) { x = xi; y = yi; z = zi; }
vec3 () { x = y = z = 0.0f; }
vec3 operator*(__float v) { return vec3(x*v, y*v, z*v); }
vec3 operator*(vec3 v) { return vec3::cross(*this,v); }
vec3 operator+(vec3 v) { return vec3::add(*this,v); }

View File

@ -12,6 +12,7 @@
#include <iostream>
#include "cubic_types.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
@ -20,23 +21,29 @@ namespace CubicVR {
c & COMBINE(set,x)(vec3 value) { y = value; return *this; }
struct vec4 {
__float x,y,z,w;
__float x, y, z, w;
public:
__float& r() { return x; }
__float& g() { return y; }
__float& b() { return z; }
__float& a() { return w; }
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
#ifndef _WIN32
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
#endif
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec4 (__float xi,__float yi,__float zi,__float wi) { x = xi; y = yi; z = zi; w = wi; }
vec4 () { x = y = z = w = 0.0f; }
operator __float*() const { return (__float *)this; }
vec4 operator*(__float v) { return vec4(x*v, y*v, z*v, w*v); }
// vec4 operator*(vec4 v) { return vec4::cross(*this,v); }
// vec4 operator+(vec4 v) { return vec4::add(*this,v); }

View File

@ -1,261 +0,0 @@
EXPORTS
azimuth_long_path
dec2dmmm
dec2dms
distance_long_path
dmmm2dec
dms2dec
from_bcd
from_bcd_be
hamlib_copyright
hamlib_version
initrigs3_adat
initrigs3_alinco
initrigs3_aor
initrigs3_drake
initrigs3_dummy
initrigs3_flexradio
initrigs3_icmarine
initrigs3_icom
initrigs3_jrc
initrigs3_kachina
initrigs3_kenwood
initrigs3_kit
initrigs3_lowe
initrigs3_pcr
initrigs3_prm80
initrigs3_racal
initrigs3_rft
initrigs3_rs
initrigs3_skanti
initrigs3_tapr
initrigs3_tentec
initrigs3_tuner
initrigs3_uniden
initrigs3_winradio
initrigs3_wj
initrigs3_yaesu
initrots3_amsat
initrots3_ars
initrots3_celestron
initrots3_cnctrk
initrots3_dummy = _netrigctl_set_freq
initrots3_easycomm
initrots3_ether6
initrots3_fodtrack = _initrots3_heathkit
initrots3_gs232a
initrots3_heathkit
initrots3_kit
initrots3_m2
initrots3_prosistel
initrots3_rotorez
initrots3_sartek
initrots3_spid
initrots3_ts7400
locator2longlat
longlat2locator
par_lock
par_read_control
par_read_data
par_read_status
par_unlock
par_write_control
par_write_data
port_close
port_open
probeallrigs3_adat
probeallrigs3_drake
probeallrigs3_icom
probeallrigs3_kenwood
probeallrigs3_lowe
probeallrigs3_uniden
probeallrigs3_yaesu
qrb
read_block
read_string
rig_check_backend
rig_check_cache_timeout
rig_cleanup
rig_close
rig_confparam_lookup
rig_debug
rig_ext_level_foreach
rig_ext_lookup
rig_ext_lookup_tok
rig_ext_parm_foreach
rig_ext_token_lookup
rig_force_cache_timeout
rig_get_ant
rig_get_caps
rig_get_chan_all
rig_get_chan_all_cb
rig_get_channel
rig_get_conf
rig_get_ctcss_sql
rig_get_ctcss_tone
rig_get_dcd
rig_get_dcs_code
rig_get_dcs_sql
rig_get_ext_level
rig_get_ext_parm
rig_get_freq
rig_get_func
rig_get_info
rig_get_level
rig_get_mem
rig_get_mem_all = _rig_debug
rig_get_mem_all_cb
rig_get_mode
rig_get_parm
rig_get_powerstat
rig_get_ptt
rig_get_range
rig_get_resolution
rig_get_rit
rig_get_rptr_offs
rig_get_rptr_shift
rig_get_split_freq
rig_get_split_freq_mode
rig_get_split_mode
rig_get_split_vfo
rig_get_trn
rig_get_ts
rig_get_vfo
rig_get_xit
rig_has_get_func
rig_has_get_level
rig_has_get_parm
rig_has_scan
rig_has_set_func
rig_has_set_level
rig_has_set_parm
rig_has_vfo_op
rig_init
rig_list_foreach
rig_load_all_backends
rig_load_backend
rig_lookup_mem_caps
rig_mW2power
rig_mem_count
rig_need_debug
rig_no_restore_ai
rig_open
rig_parse_func
rig_parse_level
rig_parse_mode
rig_parse_mtype
rig_parse_parm
rig_parse_rptr_shift
rig_parse_scan
rig_parse_vfo
rig_parse_vfo_op
rig_passband_narrow
rig_passband_normal
rig_passband_wide
rig_power2mW
rig_probe
rig_probe_all
rig_raw2val = _rig_get_ctcss_tone
rig_recv_dtmf
rig_register
rig_reset
rig_scan
rig_send_dtmf
rig_send_morse
rig_set_ant
rig_set_bank
rig_set_chan_all
rig_set_chan_all_cb
rig_set_channel
rig_set_conf
rig_set_ctcss_sql
rig_set_ctcss_tone
rig_set_dcd_callback
rig_set_dcs_code
rig_set_dcs_sql
rig_set_debug
rig_set_debug_callback
rig_set_debug_file
rig_set_ext_level
rig_set_ext_parm
rig_set_freq
rig_set_freq_callback
rig_set_func
rig_set_level
rig_set_mem
rig_set_mem_all = _rig_set_func
rig_set_mem_all_cb = _rig_has_set_level
rig_set_mode
rig_set_mode_callback
rig_set_parm
rig_set_pltune_callback
rig_set_powerstat
rig_set_ptt
rig_set_ptt_callback
rig_set_rit
rig_set_rptr_offs
rig_set_rptr_shift
rig_set_split_freq
rig_set_split_freq_mode
rig_set_split_mode = _rig_reset
rig_set_split_vfo
rig_set_trn
rig_set_ts
rig_set_vfo
rig_set_vfo_callback
rig_set_xit
rig_setting2idx
rig_strfunc
rig_strlevel
rig_strmtype
rig_strparm
rig_strptrshift
rig_strrmode
rig_strscan
rig_strstatus
rig_strvfo
rig_strvfop
rig_token_foreach
rig_token_lookup
rig_unregister
rig_vfo_op
rigerror
rot_check_backend
rot_cleanup
rot_close
rot_confparam_lookup
rot_get_caps
rot_get_conf
rot_get_info
rot_get_position
rot_init
rot_list_foreach
rot_load_all_backends
rot_load_backend
rot_move
rot_open
rot_park
rot_probe_all
rot_register
rot_reset
rot_set_conf
rot_set_position
rot_stop
rot_token_foreach
rot_token_lookup
rot_unregister
ser_get_car
ser_get_cts
ser_get_dsr
ser_get_dtr
ser_get_rts = _rig_check_backend
ser_set_brk
ser_set_dtr
ser_set_rts
serial_flush
serial_open
serial_setup
sprintf_freq
to_bcd
to_bcd_be
write_block

Binary file not shown.

Binary file not shown.

Binary file not shown.

408
external/hamlib/32/libhamlib-4.def vendored Normal file
View File

@ -0,0 +1,408 @@
EXPORTS
CRC32_function @1
amp_check_backend @2
amp_cleanup @3
amp_close @4
amp_confparam_lookup @5
amp_ext_lookup @6
amp_get_caps @7
amp_get_conf @8
amp_get_ext_level @9
amp_get_freq @10
amp_get_info @11
amp_get_level @12
amp_get_powerstat @13
amp_has_get_level @14
amp_init @15
amp_list_foreach @16
amp_load_all_backends @17
amp_load_backend @18
amp_open @19
amp_parse_level @20
amp_probe_all @21
amp_register @22
amp_reset @23
amp_set_conf @24
amp_set_freq @25
amp_set_powerstat @26
amp_sprintf_level @27
amp_strlevel @28
amp_token_lookup @29
amp_unregister @30
azimuth_long_path @31
cookie_use @32 DATA
debugmsgsave @33 DATA
debugmsgsave2 @34 DATA
debugmsgsave3 @35 DATA
dec2dmmm @36
dec2dms @37
distance_long_path @38
dmmm2dec @39
dms2dec @40
dot10ths_to_millis @41
dump_hex @42
elapsed_ms @43
from_bcd @44
from_bcd_be @45
get_rig_conf_type @46
hamlib_copyright @47 DATA
hamlib_copyright2 @48 DATA
hamlib_version @49 DATA
hamlib_version2 @50 DATA
hl_usleep @51
initamps4_dummy @52
initamps4_kpa1500 @53
initrigs4_adat @54
initrigs4_alinco @55
initrigs4_aor @56
initrigs4_barrett @57
initrigs4_dorji @58
initrigs4_drake @59
initrigs4_dummy @60
initrigs4_elad @61
initrigs4_flexradio @62
initrigs4_icm710 @63
initrigs4_icmarine @64
initrigs4_icom @65
initrigs4_jrc @66
initrigs4_kachina @67
initrigs4_kenwood @68
initrigs4_kit @69
initrigs4_lowe @70
initrigs4_pcr @71
initrigs4_prm80 @72
initrigs4_racal @73
initrigs4_rft @74
initrigs4_rs @75
initrigs4_skanti @76
initrigs4_tapr @77
initrigs4_tentec @78
initrigs4_tuner @79
initrigs4_uniden @80
initrigs4_winradio @81
initrigs4_wj @82
initrigs4_yaesu @83
initrots4_amsat @84
initrots4_ars @85
initrots4_celestron @86
initrots4_cnctrk @87
initrots4_dummy @88
initrots4_easycomm @89
initrots4_ether6 @90
initrots4_fodtrack @91
initrots4_gs232a @92
initrots4_heathkit @93
initrots4_ioptron @94
initrots4_kit @95
initrots4_m2 @96
initrots4_meade @97
initrots4_prosistel @98
initrots4_radant @99
initrots4_rotorez @100
initrots4_sartek @101
initrots4_satel @102
initrots4_spid @103
initrots4_ts7400 @104
locator2longlat @105
longlat2locator @106
millis_to_dot10ths @107
morse_code_dot_to_millis @108
netrigctl_get_vfo_mode @109
network_multicast_server @110
par_lock @111
par_read_control @112
par_read_data @113
par_read_status @114
par_unlock @115
par_write_control @116
par_write_data @117
parse_hoststr @118
port_close @119
port_open @120
print_ext_param @121
probeallrigs4_adat @122
probeallrigs4_drake @123
probeallrigs4_elad @124
probeallrigs4_icom @125
probeallrigs4_kenwood @126
probeallrigs4_lowe @127
probeallrigs4_uniden @128
probeallrigs4_yaesu @129
qrb @130
read_block @131
read_string @132
rig_check_backend @133
rig_check_cache_timeout @134
rig_cleanup @135
rig_close @136
rig_confparam_lookup @137
rig_cookie @138
rig_copyright @139
rig_debug @140
rig_ext_func_foreach @141
rig_ext_level_foreach @142
rig_ext_lookup @143
rig_ext_lookup_tok @144
rig_ext_parm_foreach @145
rig_ext_token_lookup @146
rig_flush @147
rig_force_cache_timeout @148
rig_get_ant @149
rig_get_cache @150
rig_get_cache_timeout_ms @151
rig_get_caps @152
rig_get_caps_cptr @153
rig_get_caps_int @154
rig_get_chan_all @155
rig_get_chan_all_cb @156
rig_get_channel @157
rig_get_clock @158
rig_get_conf @159
rig_get_ctcss_sql @160
rig_get_ctcss_tone @161
rig_get_dcd @162
rig_get_dcs_code @163
rig_get_dcs_sql @164
rig_get_ext_func @165
rig_get_ext_level @166
rig_get_ext_parm @167
rig_get_freq @168
rig_get_func @169
rig_get_function_ptr @170
rig_get_info @171
rig_get_level @172
rig_get_mem @173
rig_get_mem_all @174
rig_get_mem_all_cb @175
rig_get_mode @176
rig_get_parm @177
rig_get_powerstat @178
rig_get_ptt @179
rig_get_range @180
rig_get_resolution @181
rig_get_rig_info @182
rig_get_rit @183
rig_get_rptr_offs @184
rig_get_rptr_shift @185
rig_get_split_freq @186
rig_get_split_freq_mode @187
rig_get_split_mode @188
rig_get_split_vfo @189
rig_get_trn @190
rig_get_ts @191
rig_get_twiddle @192
rig_get_vfo @193
rig_get_vfo_info @194
rig_get_vfo_list @195
rig_get_xit @196
rig_has_get_func @197
rig_has_get_level @198
rig_has_get_parm @199
rig_has_scan @200
rig_has_set_func @201
rig_has_set_level @202
rig_has_set_parm @203
rig_has_vfo_op @204
rig_idx2setting @205
rig_init @206
rig_license @207
rig_list_foreach @208
rig_list_foreach_model @209
rig_load_all_backends @210
rig_load_backend @211
rig_lookup_mem_caps @212
rig_mW2power @213
rig_mem_count @214
rig_need_debug @215
rig_no_restore_ai @216
rig_open @217
rig_parse_func @218
rig_parse_level @219
rig_parse_mode @220
rig_parse_mtype @221
rig_parse_parm @222
rig_parse_rptr_shift @223
rig_parse_scan @224
rig_parse_vfo @225
rig_parse_vfo_op @226
rig_passband_narrow @227
rig_passband_normal @228
rig_passband_wide @229
rig_power2mW @230
rig_probe @231
rig_probe_all @232
rig_raw2val @233
rig_raw2val_float @234
rig_recv_dtmf @235
rig_register @236
rig_reset @237
rig_scan @238
rig_send_dtmf @239
rig_send_morse @240
rig_send_voice_mem @241
rig_set_ant @242
rig_set_bank @243
rig_set_cache_timeout_ms @244
rig_set_chan_all @245
rig_set_chan_all_cb @246
rig_set_channel @247
rig_set_clock @248
rig_set_conf @249
rig_set_ctcss_sql @250
rig_set_ctcss_tone @251
rig_set_dcd_callback @252
rig_set_dcs_code @253
rig_set_dcs_sql @254
rig_set_debug @255
rig_set_debug_callback @256
rig_set_debug_file @257
rig_set_debug_time_stamp @258
rig_set_ext_func @259
rig_set_ext_level @260
rig_set_ext_parm @261
rig_set_freq @262
rig_set_freq_callback @263
rig_set_func @264
rig_set_level @265
rig_set_mem @266
rig_set_mem_all @267
rig_set_mem_all_cb @268
rig_set_mode @269
rig_set_mode_callback @270
rig_set_parm @271
rig_set_pltune_callback @272
rig_set_powerstat @273
rig_set_ptt @274
rig_set_ptt_callback @275
rig_set_rit @276
rig_set_rptr_offs @277
rig_set_rptr_shift @278
rig_set_spectrum_callback @279
rig_set_split_freq @280
rig_set_split_freq_mode @281
rig_set_split_mode @282
rig_set_split_vfo @283
rig_set_trn @284
rig_set_ts @285
rig_set_twiddle @286
rig_set_uplink @287
rig_set_vfo @288
rig_set_vfo_callback @289
rig_set_vfo_opt @290
rig_set_xit @291
rig_setting2idx @292
rig_sprintf_ant @293
rig_sprintf_func @294
rig_sprintf_level @295
rig_sprintf_level_gran @296
rig_sprintf_mode @297
rig_sprintf_parm @298
rig_sprintf_parm_gran @299
rig_sprintf_scan @300
rig_sprintf_spectrum_avg_modes @301
rig_sprintf_spectrum_modes @302
rig_sprintf_spectrum_spans @303
rig_sprintf_vfo @304
rig_sprintf_vfop @305
rig_stop_morse @306
rig_stragclevel @307
rig_strfunc @308
rig_strlevel @309
rig_strmtype @310
rig_strparm @311
rig_strptrshift @312
rig_strrmode @313
rig_strrmodes @314
rig_strscan @315
rig_strspectrummode @316
rig_strstatus @317
rig_strvfo @318
rig_strvfop @319
rig_token_foreach @320
rig_token_lookup @321
rig_unregister @322
rig_version @323
rig_vfo_op @324
rig_wait_morse @325
rigerror @326
rot_check_backend @327
rot_cleanup @328
rot_close @329
rot_confparam_lookup @330
rot_ext_func_foreach @331
rot_ext_level_foreach @332
rot_ext_lookup @333
rot_ext_lookup_tok @334
rot_ext_parm_foreach @335
rot_ext_token_lookup @336
rot_get_caps @337
rot_get_conf @338
rot_get_ext_func @339
rot_get_ext_level @340
rot_get_ext_parm @341
rot_get_func @342
rot_get_info @343
rot_get_level @344
rot_get_parm @345
rot_get_position @346
rot_get_status @347
rot_has_get_func @348
rot_has_get_level @349
rot_has_get_parm @350
rot_has_set_func @351
rot_has_set_level @352
rot_has_set_parm @353
rot_init @354
rot_list_foreach @355
rot_load_all_backends @356
rot_load_backend @357
rot_move @358
rot_open @359
rot_park @360
rot_parse_func @361
rot_parse_level @362
rot_parse_parm @363
rot_probe_all @364
rot_register @365
rot_reset @366
rot_set_conf @367
rot_set_ext_func @368
rot_set_ext_level @369
rot_set_ext_parm @370
rot_set_func @371
rot_set_level @372
rot_set_parm @373
rot_set_position @374
rot_sprintf_func @375
rot_sprintf_level @376
rot_sprintf_level_gran @377
rot_sprintf_parm @378
rot_sprintf_parm_gran @379
rot_sprintf_status @380
rot_stop @381
rot_strfunc @382
rot_strlevel @383
rot_strparm @384
rot_strstatus @385
rot_token_foreach @386
rot_token_lookup @387
rot_unregister @388
ser_get_car @389
ser_get_cts @390
ser_get_dsr @391
ser_get_dtr @392
ser_get_rts @393
ser_set_brk @394
ser_set_dtr @395
ser_set_rts @396
serial_flush @397
serial_open @398
serial_setup @399
sprintf_freq @400
sprintf_level_ext @401
sync_callback @402
to_bcd @403
to_bcd_be @404
vfo_fixup @405
vfo_fixup2a @406
write_block @407

BIN
external/hamlib/32/libhamlib-4.dll vendored Normal file

Binary file not shown.

BIN
external/hamlib/32/libhamlib-4.exp vendored Normal file

Binary file not shown.

BIN
external/hamlib/32/libhamlib-4.lib vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,261 +0,0 @@
EXPORTS
azimuth_long_path
dec2dmmm
dec2dms
distance_long_path
dmmm2dec
dms2dec
from_bcd
from_bcd_be = rig_get_trn
hamlib_copyright
hamlib_version
initrigs3_adat
initrigs3_alinco
initrigs3_aor
initrigs3_drake
initrigs3_dummy
initrigs3_flexradio
initrigs3_icmarine
initrigs3_icom = optoscan_get_info
initrigs3_jrc
initrigs3_kachina
initrigs3_kenwood
initrigs3_kit
initrigs3_lowe
initrigs3_pcr
initrigs3_prm80
initrigs3_racal
initrigs3_rft
initrigs3_rs
initrigs3_skanti
initrigs3_tapr
initrigs3_tentec
initrigs3_tuner
initrigs3_uniden
initrigs3_winradio
initrigs3_wj
initrigs3_yaesu
initrots3_amsat
initrots3_ars = ether_rot_park
initrots3_celestron
initrots3_cnctrk
initrots3_dummy
initrots3_easycomm
initrots3_ether6
initrots3_fodtrack
initrots3_gs232a
initrots3_heathkit
initrots3_kit
initrots3_m2
initrots3_prosistel
initrots3_rotorez
initrots3_sartek
initrots3_spid
initrots3_ts7400
locator2longlat
longlat2locator
par_lock
par_read_control
par_read_data
par_read_status
par_unlock
par_write_control
par_write_data
port_close
port_open
probeallrigs3_adat
probeallrigs3_drake
probeallrigs3_icom
probeallrigs3_kenwood
probeallrigs3_lowe = pcr_get_freq
probeallrigs3_uniden = ft100_set_ptt
probeallrigs3_yaesu
qrb
read_block
read_string
rig_check_backend
rig_check_cache_timeout
rig_cleanup
rig_close
rig_confparam_lookup
rig_debug
rig_ext_level_foreach
rig_ext_lookup
rig_ext_lookup_tok
rig_ext_parm_foreach
rig_ext_token_lookup
rig_force_cache_timeout
rig_get_ant = ser_get_cts
rig_get_caps
rig_get_chan_all
rig_get_chan_all_cb
rig_get_channel
rig_get_conf
rig_get_ctcss_sql
rig_get_ctcss_tone
rig_get_dcd
rig_get_dcs_code = longlat2locator
rig_get_dcs_sql
rig_get_ext_level
rig_get_ext_parm
rig_get_freq
rig_get_func
rig_get_info
rig_get_level
rig_get_mem
rig_get_mem_all = rig_set_debug_file
rig_get_mem_all_cb
rig_get_mode
rig_get_parm = cm108_open
rig_get_powerstat = from_bcd
rig_get_ptt
rig_get_range
rig_get_resolution
rig_get_rit
rig_get_rptr_offs
rig_get_rptr_shift
rig_get_split_freq
rig_get_split_freq_mode = rig_mW2power
rig_get_split_mode
rig_get_split_vfo
rig_get_trn
rig_get_ts
rig_get_vfo
rig_get_xit
rig_has_get_func
rig_has_get_level
rig_has_get_parm
rig_has_scan
rig_has_set_func
rig_has_set_level = cm108_close
rig_has_set_parm
rig_has_vfo_op
rig_init
rig_list_foreach
rig_load_all_backends
rig_load_backend
rig_lookup_mem_caps
rig_mW2power
rig_mem_count
rig_need_debug
rig_no_restore_ai
rig_open
rig_parse_func
rig_parse_level
rig_parse_mode
rig_parse_mtype
rig_parse_parm
rig_parse_rptr_shift
rig_parse_scan
rig_parse_vfo
rig_parse_vfo_op
rig_passband_narrow
rig_passband_normal
rig_passband_wide
rig_power2mW
rig_probe
rig_probe_all = to_bcd_be
rig_raw2val
rig_recv_dtmf
rig_register
rig_reset
rig_scan
rig_send_dtmf
rig_send_morse
rig_set_ant
rig_set_bank
rig_set_chan_all
rig_set_chan_all_cb
rig_set_channel
rig_set_conf
rig_set_ctcss_sql
rig_set_ctcss_tone
rig_set_dcd_callback
rig_set_dcs_code
rig_set_dcs_sql
rig_set_debug
rig_set_debug_callback
rig_set_debug_file
rig_set_ext_level
rig_set_ext_parm
rig_set_freq
rig_set_freq_callback
rig_set_func
rig_set_level
rig_set_mem
rig_set_mem_all
rig_set_mem_all_cb
rig_set_mode = rig_get_rptr_shift
rig_set_mode_callback
rig_set_parm
rig_set_pltune_callback
rig_set_powerstat
rig_set_ptt
rig_set_ptt_callback
rig_set_rit
rig_set_rptr_offs
rig_set_rptr_shift
rig_set_split_freq
rig_set_split_freq_mode
rig_set_split_mode
rig_set_split_vfo
rig_set_trn
rig_set_ts
rig_set_vfo = rig_get_split_freq
rig_set_vfo_callback
rig_set_xit
rig_setting2idx
rig_strfunc
rig_strlevel
rig_strmtype
rig_strparm
rig_strptrshift
rig_strrmode
rig_strscan
rig_strstatus
rig_strvfo
rig_strvfop
rig_token_foreach
rig_token_lookup
rig_unregister
rig_vfo_op
rigerror = rig_open
rot_check_backend
rot_cleanup
rot_close
rot_confparam_lookup
rot_get_caps
rot_get_conf
rot_get_info
rot_get_position
rot_init
rot_list_foreach
rot_load_all_backends
rot_load_backend
rot_move
rot_open
rot_park
rot_probe_all = read_block
rot_register
rot_reset
rot_set_conf
rot_set_position
rot_stop
rot_token_foreach = map_parm
rot_token_lookup
rot_unregister
ser_get_car
ser_get_cts
ser_get_dsr
ser_get_dtr
ser_get_rts = rig_probe_all_backends
ser_set_brk
ser_set_dtr
ser_set_rts
serial_flush
serial_open
serial_setup
sprintf_freq
to_bcd = remove_trn_rig
to_bcd_be
write_block

Binary file not shown.

Binary file not shown.

Binary file not shown.

408
external/hamlib/64/libhamlib-4.def vendored Normal file
View File

@ -0,0 +1,408 @@
EXPORTS
CRC32_function @1
amp_check_backend @2
amp_cleanup @3
amp_close @4
amp_confparam_lookup @5
amp_ext_lookup @6
amp_get_caps @7
amp_get_conf @8
amp_get_ext_level @9
amp_get_freq @10
amp_get_info @11
amp_get_level @12
amp_get_powerstat @13
amp_has_get_level @14
amp_init @15
amp_list_foreach @16
amp_load_all_backends @17
amp_load_backend @18
amp_open @19
amp_parse_level @20
amp_probe_all @21
amp_register @22
amp_reset @23
amp_set_conf @24
amp_set_freq @25
amp_set_powerstat @26
amp_sprintf_level @27
amp_strlevel @28
amp_token_lookup @29
amp_unregister @30
azimuth_long_path @31
cookie_use @32 DATA
debugmsgsave @33 DATA
debugmsgsave2 @34 DATA
debugmsgsave3 @35 DATA
dec2dmmm @36
dec2dms @37
distance_long_path @38
dmmm2dec @39
dms2dec @40
dot10ths_to_millis @41
dump_hex @42
elapsed_ms @43
from_bcd @44
from_bcd_be @45
get_rig_conf_type @46
hamlib_copyright @47 DATA
hamlib_copyright2 @48 DATA
hamlib_version @49 DATA
hamlib_version2 @50 DATA
hl_usleep @51
initamps4_dummy @52
initamps4_kpa1500 @53
initrigs4_adat @54
initrigs4_alinco @55
initrigs4_aor @56
initrigs4_barrett @57
initrigs4_dorji @58
initrigs4_drake @59
initrigs4_dummy @60
initrigs4_elad @61
initrigs4_flexradio @62
initrigs4_icm710 @63
initrigs4_icmarine @64
initrigs4_icom @65
initrigs4_jrc @66
initrigs4_kachina @67
initrigs4_kenwood @68
initrigs4_kit @69
initrigs4_lowe @70
initrigs4_pcr @71
initrigs4_prm80 @72
initrigs4_racal @73
initrigs4_rft @74
initrigs4_rs @75
initrigs4_skanti @76
initrigs4_tapr @77
initrigs4_tentec @78
initrigs4_tuner @79
initrigs4_uniden @80
initrigs4_winradio @81
initrigs4_wj @82
initrigs4_yaesu @83
initrots4_amsat @84
initrots4_ars @85
initrots4_celestron @86
initrots4_cnctrk @87
initrots4_dummy @88
initrots4_easycomm @89
initrots4_ether6 @90
initrots4_fodtrack @91
initrots4_gs232a @92
initrots4_heathkit @93
initrots4_ioptron @94
initrots4_kit @95
initrots4_m2 @96
initrots4_meade @97
initrots4_prosistel @98
initrots4_radant @99
initrots4_rotorez @100
initrots4_sartek @101
initrots4_satel @102
initrots4_spid @103
initrots4_ts7400 @104
locator2longlat @105
longlat2locator @106
millis_to_dot10ths @107
morse_code_dot_to_millis @108
netrigctl_get_vfo_mode @109
network_multicast_server @110
par_lock @111
par_read_control @112
par_read_data @113
par_read_status @114
par_unlock @115
par_write_control @116
par_write_data @117
parse_hoststr @118
port_close @119
port_open @120
print_ext_param @121
probeallrigs4_adat @122
probeallrigs4_drake @123
probeallrigs4_elad @124
probeallrigs4_icom @125
probeallrigs4_kenwood @126
probeallrigs4_lowe @127
probeallrigs4_uniden @128
probeallrigs4_yaesu @129
qrb @130
read_block @131
read_string @132
rig_check_backend @133
rig_check_cache_timeout @134
rig_cleanup @135
rig_close @136
rig_confparam_lookup @137
rig_cookie @138
rig_copyright @139
rig_debug @140
rig_ext_func_foreach @141
rig_ext_level_foreach @142
rig_ext_lookup @143
rig_ext_lookup_tok @144
rig_ext_parm_foreach @145
rig_ext_token_lookup @146
rig_flush @147
rig_force_cache_timeout @148
rig_get_ant @149
rig_get_cache @150
rig_get_cache_timeout_ms @151
rig_get_caps @152
rig_get_caps_cptr @153
rig_get_caps_int @154
rig_get_chan_all @155
rig_get_chan_all_cb @156
rig_get_channel @157
rig_get_clock @158
rig_get_conf @159
rig_get_ctcss_sql @160
rig_get_ctcss_tone @161
rig_get_dcd @162
rig_get_dcs_code @163
rig_get_dcs_sql @164
rig_get_ext_func @165
rig_get_ext_level @166
rig_get_ext_parm @167
rig_get_freq @168
rig_get_func @169
rig_get_function_ptr @170
rig_get_info @171
rig_get_level @172
rig_get_mem @173
rig_get_mem_all @174
rig_get_mem_all_cb @175
rig_get_mode @176
rig_get_parm @177
rig_get_powerstat @178
rig_get_ptt @179
rig_get_range @180
rig_get_resolution @181
rig_get_rig_info @182
rig_get_rit @183
rig_get_rptr_offs @184
rig_get_rptr_shift @185
rig_get_split_freq @186
rig_get_split_freq_mode @187
rig_get_split_mode @188
rig_get_split_vfo @189
rig_get_trn @190
rig_get_ts @191
rig_get_twiddle @192
rig_get_vfo @193
rig_get_vfo_info @194
rig_get_vfo_list @195
rig_get_xit @196
rig_has_get_func @197
rig_has_get_level @198
rig_has_get_parm @199
rig_has_scan @200
rig_has_set_func @201
rig_has_set_level @202
rig_has_set_parm @203
rig_has_vfo_op @204
rig_idx2setting @205
rig_init @206
rig_license @207
rig_list_foreach @208
rig_list_foreach_model @209
rig_load_all_backends @210
rig_load_backend @211
rig_lookup_mem_caps @212
rig_mW2power @213
rig_mem_count @214
rig_need_debug @215
rig_no_restore_ai @216
rig_open @217
rig_parse_func @218
rig_parse_level @219
rig_parse_mode @220
rig_parse_mtype @221
rig_parse_parm @222
rig_parse_rptr_shift @223
rig_parse_scan @224
rig_parse_vfo @225
rig_parse_vfo_op @226
rig_passband_narrow @227
rig_passband_normal @228
rig_passband_wide @229
rig_power2mW @230
rig_probe @231
rig_probe_all @232
rig_raw2val @233
rig_raw2val_float @234
rig_recv_dtmf @235
rig_register @236
rig_reset @237
rig_scan @238
rig_send_dtmf @239
rig_send_morse @240
rig_send_voice_mem @241
rig_set_ant @242
rig_set_bank @243
rig_set_cache_timeout_ms @244
rig_set_chan_all @245
rig_set_chan_all_cb @246
rig_set_channel @247
rig_set_clock @248
rig_set_conf @249
rig_set_ctcss_sql @250
rig_set_ctcss_tone @251
rig_set_dcd_callback @252
rig_set_dcs_code @253
rig_set_dcs_sql @254
rig_set_debug @255
rig_set_debug_callback @256
rig_set_debug_file @257
rig_set_debug_time_stamp @258
rig_set_ext_func @259
rig_set_ext_level @260
rig_set_ext_parm @261
rig_set_freq @262
rig_set_freq_callback @263
rig_set_func @264
rig_set_level @265
rig_set_mem @266
rig_set_mem_all @267
rig_set_mem_all_cb @268
rig_set_mode @269
rig_set_mode_callback @270
rig_set_parm @271
rig_set_pltune_callback @272
rig_set_powerstat @273
rig_set_ptt @274
rig_set_ptt_callback @275
rig_set_rit @276
rig_set_rptr_offs @277
rig_set_rptr_shift @278
rig_set_spectrum_callback @279
rig_set_split_freq @280
rig_set_split_freq_mode @281
rig_set_split_mode @282
rig_set_split_vfo @283
rig_set_trn @284
rig_set_ts @285
rig_set_twiddle @286
rig_set_uplink @287
rig_set_vfo @288
rig_set_vfo_callback @289
rig_set_vfo_opt @290
rig_set_xit @291
rig_setting2idx @292
rig_sprintf_ant @293
rig_sprintf_func @294
rig_sprintf_level @295
rig_sprintf_level_gran @296
rig_sprintf_mode @297
rig_sprintf_parm @298
rig_sprintf_parm_gran @299
rig_sprintf_scan @300
rig_sprintf_spectrum_avg_modes @301
rig_sprintf_spectrum_modes @302
rig_sprintf_spectrum_spans @303
rig_sprintf_vfo @304
rig_sprintf_vfop @305
rig_stop_morse @306
rig_stragclevel @307
rig_strfunc @308
rig_strlevel @309
rig_strmtype @310
rig_strparm @311
rig_strptrshift @312
rig_strrmode @313
rig_strrmodes @314
rig_strscan @315
rig_strspectrummode @316
rig_strstatus @317
rig_strvfo @318
rig_strvfop @319
rig_token_foreach @320
rig_token_lookup @321
rig_unregister @322
rig_version @323
rig_vfo_op @324
rig_wait_morse @325
rigerror @326
rot_check_backend @327
rot_cleanup @328
rot_close @329
rot_confparam_lookup @330
rot_ext_func_foreach @331
rot_ext_level_foreach @332
rot_ext_lookup @333
rot_ext_lookup_tok @334
rot_ext_parm_foreach @335
rot_ext_token_lookup @336
rot_get_caps @337
rot_get_conf @338
rot_get_ext_func @339
rot_get_ext_level @340
rot_get_ext_parm @341
rot_get_func @342
rot_get_info @343
rot_get_level @344
rot_get_parm @345
rot_get_position @346
rot_get_status @347
rot_has_get_func @348
rot_has_get_level @349
rot_has_get_parm @350
rot_has_set_func @351
rot_has_set_level @352
rot_has_set_parm @353
rot_init @354
rot_list_foreach @355
rot_load_all_backends @356
rot_load_backend @357
rot_move @358
rot_open @359
rot_park @360
rot_parse_func @361
rot_parse_level @362
rot_parse_parm @363
rot_probe_all @364
rot_register @365
rot_reset @366
rot_set_conf @367
rot_set_ext_func @368
rot_set_ext_level @369
rot_set_ext_parm @370
rot_set_func @371
rot_set_level @372
rot_set_parm @373
rot_set_position @374
rot_sprintf_func @375
rot_sprintf_level @376
rot_sprintf_level_gran @377
rot_sprintf_parm @378
rot_sprintf_parm_gran @379
rot_sprintf_status @380
rot_stop @381
rot_strfunc @382
rot_strlevel @383
rot_strparm @384
rot_strstatus @385
rot_token_foreach @386
rot_token_lookup @387
rot_unregister @388
ser_get_car @389
ser_get_cts @390
ser_get_dsr @391
ser_get_dtr @392
ser_get_rts @393
ser_set_brk @394
ser_set_dtr @395
ser_set_rts @396
serial_flush @397
serial_open @398
serial_setup @399
sprintf_freq @400
sprintf_level_ext @401
sync_callback @402
to_bcd @403
to_bcd_be @404
vfo_fixup @405
vfo_fixup2a @406
write_block @407

BIN
external/hamlib/64/libhamlib-4.dll vendored Normal file

Binary file not shown.

BIN
external/hamlib/64/libhamlib-4.exp vendored Normal file

Binary file not shown.

BIN
external/hamlib/64/libhamlib-4.lib vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,15 @@
The Hamlib specific dependencies on Windows platforms are:
- libwinpthread-1.dll
for both x86 and x64,
and also
- libgcc_s_sjlj-1.dll for x86 targets only.
Those dependencies are installed from external/msvc/[x86|x64] dirs.
In addition, Hamlib also uses libusb but since it is a common
dependency with SoapySDR, it is not included in the external dirs.
For Hamlib v4.x releases, only the export file 'libhamlib-4.def' is provided, so we need to re-generate .lib to work on Visual Studio projects:
- Open the 'Developper Command Prompt for VS 2022'
- For Win32, go to hamlib/32 directory and run 'LIB /DEF:libhamlib-4.def /MACHINE:X86'
- For Win64, go to hamlib/64 directory and run 'LIB /DEF:libhamlib-4.def /MACHINE:X64'

446
external/hamlib/hamlib/amplifier.h vendored Normal file
View File

@ -0,0 +1,446 @@
/*
* Hamlib Interface - Amplifier API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _AMPLIFIER_H
#define _AMPLIFIER_H 1
#include <hamlib/rig.h>
#include <hamlib/amplist.h>
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier data structures.
*
* \file amplifier.h
*
* This file contains the data structures and declarations for the Hamlib
* amplifier Application Programming Interface (API).
*
* See the amplifier.c file for details on the amplifier API functions.
*/
__BEGIN_DECLS
/* Forward struct references */
struct amp;
struct amp_state;
/**
* \brief Main amplifier handle type definition.
*
* \typedef typedef struct amp AMP
*
* The #AMP handle is returned by amp_init() and is passed as a parameter to
* every amplifier specific API call.
*
* amp_cleanup() must be called when this handle is no longer needed.
*/
typedef struct amp AMP;
/**
* \brief Type definition for
* <a href="https://en.wikipedia.org/wiki/Standing_wave_ratio" >SWR (Standing Wave Ratio)</a>.
*
* \typedef typedef float swr_t
*
* The \a swr_t type is used as a parameter for the amp_get_swr() function.
*
* The unit of \a swr_t is 1.0 to the maximum value reported by the amplifier's
* internal antenna system tuner, i.e.
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>,
* representing the ratio of 1.0:1 to Maximum:1.
*/
typedef float swr_t;
/**
* \brief Type definition for the
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>
* tuning values of
* <a href="https://en.wikipedia.org/wiki/Capacitance" >capacitance</a>
* and
* <a href="https://en.wikipedia.org/wiki/Inductance" >inductance</a>.
*
* \typedef typedef float tune_value_t
*
* The \a tune_value_t type is used as a parameter for amp_get_level().
*
* The unit of \a tune_value_t is
* <a href="https://en.wikipedia.org/wiki/Farad" >picoFarads (pF)</a>
* or
* <a href="https://en.wikipedia.org/wiki/Henry_(unit)" >nanoHenrys (nH)</a>.
*/
typedef int tune_value_t;
/**
* \brief The token in the netampctl protocol for returning an error condition code.
*/
#define NETAMPCTL_RET "RPRT "
//! @cond Doxygen_Suppress
typedef enum
{
AMP_RESET_MEM, // erase tuner memory
AMP_RESET_FAULT, // reset any fault
AMP_RESET_AMP // for kpa1500
} amp_reset_t;
//! @endcond
/**
* \brief Amplifier type flags
*/
typedef enum
{
AMP_FLAG_1 = (1 << 1), /*!< TBD */
AMP_FLAG_2 = (1 << 2) /*!< TBD */
} amp_type_t;
//! @cond Doxygen_Suppress
// TBD AMP_TYPE
#define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2)
#define AMP_TYPE_OTHER 0
#define AMP_TYPE_1 AMP_FLAG_1
#define AMP_TYPE_2 AMP_FLAG_2
#define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2)
//! @endcond
//! @cond Doxygen_Suppress
enum amp_level_e
{
AMP_LEVEL_NONE = 0, /*!< '' -- No Level. */
AMP_LEVEL_SWR = (1 << 0), /*!< \c SWR 1.0 or greater. */
AMP_LEVEL_NH = (1 << 1), /*!< \c Tune setting in nanohenries. */
AMP_LEVEL_PF = (1 << 2), /*!< \c Tune setting in picofarads. */
AMP_LEVEL_PWR_INPUT = (1 << 3), /*!< \c Power reading from amplifier. */
AMP_LEVEL_PWR_FWD = (1 << 4), /*!< \c Power reading forward. */
AMP_LEVEL_PWR_REFLECTED = (1 << 5), /*!< \c Power reading reverse. */
AMP_LEVEL_PWR_PEAK = (1 << 6), /*!< \c Power reading peak. */
AMP_LEVEL_FAULT = (1 << 7) /*!< \c Fault code. */
};
//! @endcond
//! @cond Doxygen_Suppress
#define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR)
#define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT)
#define AMP_LEVEL_IS_FLOAT(l) ((l)&AMP_LEVEL_FLOAT_LIST)
#define AMP_LEVEL_IS_STRING(l) ((l)&AMP_LEVEL_STRING_LIST)
//! @endcond
/* Basic amp type, can store some useful info about different amplifiers. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
//! @cond Doxygen_Suppress
#define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg
//! @endcond
/**
* \brief Amplifier capabilities.
*
* \struct amp_caps
*
* The main idea of this struct is that it will be defined by the backend
* amplifier driver and will remain read-only for the application. Fields
* that need to be modifiable by the application are copied into the
* amp_state structure, which is the private memory area of the #AMP instance.
*
* This way you can have several amplifiers running within the same
* application, sharing the amp_caps structure of the backend, while keeping
* their own customized data.
*
* \b Note: Don't move fields around and only add new fields at the end of the
* amp_caps structure. Shared libraries and DLLs depend on a constant
* structure to maintain compatibility.
*/
struct amp_caps
{
amp_model_t amp_model; /*!< Amplifier model as defined in amplist.h. */
const char *model_name; /*!< Model name, e.g. MM-5k. */
const char *mfg_name; /*!< Manufacturer, e.g. Moonbeam. */
const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */
const char *copyright; /*!< Copyright info (should be LGPL). */
enum rig_status_e status; /*!< Driver status. */
int amp_type; /*!< Amplifier type. */
enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */
int serial_rate_min; /*!< Minimal serial speed. */
int serial_rate_max; /*!< Maximal serial speed. */
int serial_data_bits; /*!< Number of data bits. */
int serial_stop_bits; /*!< Number of stop bits. */
enum serial_parity_e serial_parity; /*!< Parity. */
enum serial_handshake_e serial_handshake; /*!< Handshake. */
int write_delay; /*!< Write delay. */
int post_write_delay; /*!< Post-write delay. */
int timeout; /*!< Timeout. */
int retry; /*!< Number of retries if a command fails. */
const struct confparams *cfgparams; /*!< Configuration parameters. */
const rig_ptr_t priv; /*!< Private data. */
const char *amp_model_macro_name; /*!< Model macro name. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
/*
* Amp Admin API
*
*/
int (*amp_init)(AMP *amp); /*!< Pointer to backend implementation of ::amp_init(). */
int (*amp_cleanup)(AMP *amp); /*!< Pointer to backend implementation of ::amp_cleanup(). */
int (*amp_open)(AMP *amp); /*!< Pointer to backend implementation of ::amp_open(). */
int (*amp_close)(AMP *amp); /*!< Pointer to backend implementation of ::amp_close(). */
int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */
int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */
int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */
int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */
/* get firmware info, etc. */
const char *(*get_info)(AMP *amp); /*!< Pointer to backend implementation of ::amp_get_info(). */
//! @cond Doxygen_Suppress
setting_t levels;
unsigned ext_levels;
//! @endcond
const struct confparams *extlevels; /*!< Extension levels list. \sa extamp.c */
const struct confparams *extparms; /*!< Extension parameters list. \sa extamp.c */
const char *macro_name; /*!< Amplifier model macro name. */
};
/**
* \brief Amplifier state structure.
*
* \struct amp_state
*
* This structure contains live data, as well as a copy of capability fields
* that may be updated, i.e. customized while the #AMP handle is instantiated.
*
* It is fine to move fields around, as this kind of struct should not be
* initialized like amp_caps are.
*/
struct amp_state
{
/*
* overridable fields
*/
/*
* non overridable fields, internal use
*/
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
int comm_state; /*!< Comm port state, opened/closed. */
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
setting_t has_get_level; /*!< List of get levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
};
/**
* \brief Master amplifier structure.
*
* \struct amp
*
* Master amplifier data structure acting as the #AMP handle for the
* controlled amplifier. A pointer to this structure is returned by the
* amp_init() API function and is passed as a parameter to every amplifier
* specific API call.
*
* \sa amp_init(), amp_caps, amp_state
*/
struct amp
{
struct amp_caps *caps; /*!< Amplifier caps. */
struct amp_state state; /*!< Amplifier state. */
};
//! @cond Doxygen_Suppress
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(AMP *)
amp_init HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_open HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_close HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_cleanup HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t status));
extern HAMLIB_EXPORT(int)
amp_get_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t *status));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
amp_get_freq HAMLIB_PARAMS((AMP *amp,
freq_t *freq));
extern HAMLIB_EXPORT(int)
amp_set_freq HAMLIB_PARAMS((AMP *amp,
freq_t freq));
extern HAMLIB_EXPORT(int)
amp_reset HAMLIB_PARAMS((AMP *amp,
amp_reset_t reset));
extern HAMLIB_EXPORT(const char *)
amp_get_info HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_get_level HAMLIB_PARAMS((AMP *amp, setting_t level, value_t *val));
extern HAMLIB_EXPORT(int)
amp_register HAMLIB_PARAMS((const struct amp_caps *caps));
extern HAMLIB_EXPORT(int)
amp_unregister HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct amp_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
amp_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
amp_check_backend HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(amp_model_t)
amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
amp_token_foreach HAMLIB_PARAMS((AMP *amp,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
amp_confparam_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(token_t)
amp_token_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(const struct amp_caps *)
amp_get_caps HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(setting_t)
amp_has_get_level HAMLIB_PARAMS((AMP *amp,
setting_t level));
extern HAMLIB_EXPORT(const struct confparams *)
amp_ext_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(int)
amp_get_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
extern HAMLIB_EXPORT(const struct confparams *)
rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s);
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
//! @endcond
/**
* \brief Convenience macro for generating debugging messages.
*
* \def amp_debug
*
* This is an alias of the rig_debug() function call and is used in the same
* manner.
*/
#define amp_debug rig_debug
__END_DECLS
#endif /* _AMPLIFIER_H */
/** @} */

120
external/hamlib/hamlib/amplist.h vendored Normal file
View File

@ -0,0 +1,120 @@
/*
* Hamlib Interface - list of known amplifiers
* Copyright (c) 2000-2011 by Stephane Fillod
* Copyright (c) 2000-2002 by Frank Singleton
* Copyright (C) 2019 by Michael Black W9MDB. Derived from rotlist.h
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _AMPLIST_H
#define _AMPLIST_H 1
//! @cond Doxygen_Suppress
#define AMP_MAKE_MODEL(a,b) ((a)*100+(b))
#define AMP_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier model definitions.
*
* \file amplist.h
*
* This file contains amplifier model definitions for the Hamlib amplifier
* Application Programming Interface (API). Each distinct amplifier type has
* a unique model number (ID) and is used by Hamlib to identify and
* distinguish between the different hardware drivers. The exact model
* numbers can be acquired using the macros in this file. To obtain a list of
* supported amplifier branches, one can use the statically defined
* AMP_BACKEND_LIST macro (defined in configure.ac). To obtain a full list of
* supported amplifiers (including each model in every branch), the
* foreach_opened_amp() API function can be used.
*
* The model number, or ID, is used to tell Hamlib which amplifier the client
* wishes to use which is done with the amp_init() API call.
*/
/**
* \brief A macro that returns the model number for an unknown model.
*
* \def AMP_MODEL_NONE
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define AMP_MODEL_NONE 0
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* \def AMP_MODEL_DUMMY
*
* The DUMMY backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*/
/**
* \brief A macro that returns the model number for the NETAMPCTL backend.
*
* \def AMP_MODEL_NETAMPCTL
*
* The NETAMPCTL backend allows use of the `ampctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define AMP_DUMMY 0
#define AMP_BACKEND_DUMMY "dummy"
//! @endcond
#define AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1)
#define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2)
/**
* \brief A macro that returns the model number of the KPA1500 backend.
*
* \def AMP_MODEL_ELECRAFT_KPA1500
*
* The KPA1500 backend can be used with amplifiers that support the Elecraft
* KPA-1500 protocol.
*/
//! @cond Doxygen_Suppress
#define AMP_ELECRAFT 2
#define AMP_BACKEND_ELECRAFT "elecraft"
//! @endcond
#define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1)
//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2)
/**
* \brief Convenience type definition for an amplifier model.
*
* \typedef typedef int amp_model_t
*/
typedef int amp_model_t;
#endif /* _AMPLIST_H */
/** @} */

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@
#if defined(_WIN32) && !defined(__CYGWIN__)
# undef HAMLIB_IMPEXP
# undef BACKEND_IMPEXP
# undef HAMLIB_CPP_IMPEXP
# undef HAMLIB_API
# undef HAMLIB_EXPORT
# undef HAMLIB_EXPORT_VAR
@ -42,26 +42,26 @@
# undef HAMLIB_DLL_EXPORT
# if defined (__BORLANDC__)
# define HAMLIB_DLL_IMPORT __import
# define HAMLIB_DLL_EXPORT __export
# define HAMLIB_DLL_IMPORT __import
# define HAMLIB_DLL_EXPORT __export
# else
# define HAMLIB_DLL_IMPORT __declspec(dllimport)
# define HAMLIB_DLL_EXPORT __declspec(dllexport)
# define HAMLIB_DLL_IMPORT __declspec(dllimport)
# define HAMLIB_DLL_EXPORT __declspec(dllexport)
# endif
# ifdef DLL_EXPORT
/* HAMLIB_API may be set to __stdcall for VB, .. */
/* HAMLIB_API may be set to __stdcall for VB, .. */
# define HAMLIB_API __cdecl
# ifdef IN_HAMLIB
# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT
# else
# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_IMPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT
# endif
# else
/* static build, only export the backend entry points for lt_dlsym */
# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT
/* static build, only export the backend entry points for lt_dlsym */
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# endif
#endif
@ -70,8 +70,8 @@
#if !defined(HAMLIB_IMPEXP)
# define HAMLIB_IMPEXP
#endif
#if !defined(BACKEND_IMPEXP)
# define BACKEND_IMPEXP
#if !defined(HAMLIB_CPP_IMPEXP)
# define HAMLIB_CPP_IMPEXP
#endif
#if !defined(HAMLIB_API)
# define HAMLIB_API
@ -83,10 +83,8 @@
# define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type
#endif
#if !defined(BACKEND_EXPORT)
# define BACKEND_EXPORT(type) BACKEND_IMPEXP type HAMLIB_API
# define BACKEND_EXPORT(type) HAMLIB_CPP_IMPEXP type HAMLIB_API
#endif
#if !defined(BACKEND_EXPORT_VAR)
# define BACKEND_EXPORT_VAR(type) BACKEND_IMPEXP type
# define BACKEND_EXPORT_VAR(type) HAMLIB_CPP_IMPEXP type
#endif

View File

@ -1,279 +0,0 @@
/*
* Hamlib C++ bindings - API header
* Copyright (c) 2001-2002 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _RIGCLASS_H
#define _RIGCLASS_H 1
#include <hamlib/rig.h>
#include <iostream>
class BACKEND_IMPEXP Rig {
private:
RIG* theRig; // Global ref. to the rig
protected:
public:
Rig(rig_model_t rig_model);
virtual ~Rig();
const struct rig_caps *caps;
// This method open the communication port to the rig
void open(void);
// This method close the communication port to the rig
void close(void);
void setConf(token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
void setFreq(freq_t freq, vfo_t vfo = RIG_VFO_CURR);
freq_t getFreq(vfo_t vfo = RIG_VFO_CURR);
void setMode(rmode_t, pbwidth_t width = RIG_PASSBAND_NORMAL, vfo_t vfo = RIG_VFO_CURR);
rmode_t getMode(pbwidth_t&, vfo_t vfo = RIG_VFO_CURR);
void setVFO(vfo_t);
vfo_t getVFO();
void setPTT (ptt_t ptt, vfo_t vfo = RIG_VFO_CURR);
ptt_t getPTT (vfo_t vfo = RIG_VFO_CURR);
dcd_t getDCD (vfo_t vfo = RIG_VFO_CURR);
void setLevel(setting_t level, int vali, vfo_t vfo = RIG_VFO_CURR);
void setLevel(setting_t level, float valf, vfo_t vfo = RIG_VFO_CURR);
void getLevel(setting_t level, int& vali, vfo_t vfo = RIG_VFO_CURR);
void getLevel(setting_t level, float& valf, vfo_t vfo = RIG_VFO_CURR);
int getLevelI(setting_t level, vfo_t vfo = RIG_VFO_CURR);
float getLevelF(setting_t level, vfo_t vfo = RIG_VFO_CURR);
bool hasGetLevel (setting_t level);
bool hasSetLevel (setting_t level);
void setParm(setting_t parm, int vali);
void setParm(setting_t parm, float valf);
void getParm(setting_t parm, int& vali);
void getParm(setting_t parm, float& valf);
int getParmI(setting_t parm);
float getParmF(setting_t parm);
bool hasGetParm (setting_t parm);
bool hasSetParm (setting_t parm);
void setFunc (setting_t func, bool status, vfo_t vfo = RIG_VFO_CURR);
bool getFunc (setting_t func, vfo_t vfo = RIG_VFO_CURR);
bool hasGetFunc (setting_t func);
bool hasSetFunc (setting_t func);
void VFOop(vfo_op_t op, vfo_t vfo = RIG_VFO_CURR);
bool hasVFOop (vfo_op_t op);
void scan(scan_t scan, int ch, vfo_t vfo = RIG_VFO_CURR);
bool hasScan (scan_t scan);
const char *getInfo (void);
pbwidth_t passbandNormal (rmode_t);
pbwidth_t passbandNarrow (rmode_t);
pbwidth_t passbandWide (rmode_t);
void setRptrShift (rptr_shift_t rptr_shift, vfo_t vfo = RIG_VFO_CURR);
rptr_shift_t getRptrShift (vfo_t vfo = RIG_VFO_CURR);
void setRptrOffs (shortfreq_t rptr_offs, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getRptrOffs (vfo_t vfo = RIG_VFO_CURR);
void setTs (shortfreq_t ts, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getTs (vfo_t vfo = RIG_VFO_CURR);
void setCTCSS (tone_t tone, vfo_t vfo = RIG_VFO_CURR);
tone_t getCTCSS (vfo_t vfo = RIG_VFO_CURR);
void setDCS (tone_t code, vfo_t vfo = RIG_VFO_CURR);
tone_t getDCS (vfo_t vfo = RIG_VFO_CURR);
void setCTCSSsql (tone_t tone, vfo_t vfo = RIG_VFO_CURR);
tone_t getCTCSSsql (vfo_t vfo = RIG_VFO_CURR);
void setDCSsql (tone_t tone, vfo_t vfo = RIG_VFO_CURR);
tone_t getDCSsql (vfo_t vfo = RIG_VFO_CURR);
unsigned int power2mW (float power, freq_t freq, rmode_t mode);
float mW2power (unsigned int mwpower, freq_t freq, rmode_t mode);
void setTrn (int trn);
int getTrn (void);
void setBank (int bank, vfo_t vfo = RIG_VFO_CURR);
void setMem (int ch, vfo_t vfo = RIG_VFO_CURR);
int getMem (vfo_t vfo = RIG_VFO_CURR);
void setChannel (const channel_t *chan);
void getChannel (channel_t *chan);
void setPowerStat (powerstat_t status);
powerstat_t getPowerStat (void);
rmode_t RngRxModes (freq_t freq);
rmode_t RngTxModes (freq_t freq);
void setSplitFreq (freq_t tx_freq, vfo_t vfo = RIG_VFO_CURR);
freq_t getSplitFreq (vfo_t vfo = RIG_VFO_CURR);
void setSplitMode(rmode_t, pbwidth_t width = RIG_PASSBAND_NORMAL, vfo_t vfo = RIG_VFO_CURR);
rmode_t getSplitMode(pbwidth_t&, vfo_t vfo = RIG_VFO_CURR);
void setSplitFreqMode(freq_t, rmode_t, pbwidth_t width = RIG_PASSBAND_NORMAL, vfo_t vfo = RIG_VFO_CURR);
freq_t getSplitFreqMode(rmode_t&, pbwidth_t&, vfo_t vfo = RIG_VFO_CURR);
void setSplitVFO(split_t split, vfo_t vfo = RIG_VFO_CURR, vfo_t tx_vfo = RIG_VFO_CURR);
split_t getSplitVFO(vfo_t &tx_vfo, vfo_t vfo = RIG_VFO_CURR);
void setRit (shortfreq_t rit, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getRit (vfo_t vfo = RIG_VFO_CURR);
void setXit (shortfreq_t xit, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getXit (vfo_t vfo = RIG_VFO_CURR);
void setAnt (ant_t ant, vfo_t vfo = RIG_VFO_CURR);
ant_t getAnt (vfo_t vfo = RIG_VFO_CURR);
void sendDtmf (const char *digits, vfo_t vfo = RIG_VFO_CURR);
int recvDtmf (char *digits, vfo_t vfo = RIG_VFO_CURR);
void sendMorse (const char *msg, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getResolution (rmode_t mode);
void reset (reset_t reset);
// callbacks available in your derived object
virtual int FreqEvent(vfo_t, freq_t, rig_ptr_t) const {
return RIG_OK;
}
virtual int ModeEvent(vfo_t, rmode_t, pbwidth_t, rig_ptr_t) const {
return RIG_OK;
}
virtual int VFOEvent(vfo_t, rig_ptr_t) const {
return RIG_OK;
}
virtual int PTTEvent(vfo_t, ptt_t, rig_ptr_t) const {
return RIG_OK;
}
virtual int DCDEvent(vfo_t, dcd_t, rig_ptr_t) const {
return RIG_OK;
}
};
#ifdef __GNUG__
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
# if HAVE_TYPEINFO
# include <typeinfo>
# endif
# endif
#endif
#if defined(__GNUG__)
# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
# if ETIP_NEEDS_MATH_H
# if ETIP_NEEDS_MATH_EXCEPTION
# undef exception
# define exception math_exception
# endif
# include <math.h>
# endif
# undef exception
# define exception builtin_exception
# if HAVE_GPP_BUILTIN_H
# include <gpp/builtin.h>
# elif HAVE_GXX_BUILTIN_H
# include <g++/builtin.h>
# else
# include <builtin.h>
# endif
# undef exception
# endif
#elif defined (__SUNPRO_CC)
# include <generic.h>
# include <string.h>
#else
# include <string.h>
#endif
extern "C" {
#if HAVE_VALUES_H
# include <values.h>
#endif
#include <assert.h>
#include <errno.h>
}
#include <iostream>
#if !(defined(__GNUG__)||defined(__SUNPRO_CC))
extern "C" void exit(int);
#endif
// Forward Declarations
class BACKEND_IMPEXP RigException
{
public:
const char *message;
int errorno;
RigException (const char* msg, int err)
: message(msg), errorno (err)
{};
RigException (int err)
: message(rigerror(err)), errorno (err)
{};
RigException (const char* msg)
: message(msg), errorno (-RIG_EINTERNAL)
{};
virtual ~RigException()
{};
void print() const {
std::cerr << "Rig exception: " << message << std::endl;
}
virtual const char *classname() const {
return "Rig";
}
};
inline void THROW(const RigException *e) {
#if defined(__GNUG__)
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
(*lib_error_handler)(e?e->classname():"",e?e->message:"");
#else
throw *e;
#endif
#elif defined(__SUNPRO_CC)
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
#else
if (e)
std::cerr << e->message << endl;
exit(0);
#endif
}
#define THROWS(s)
#endif // _RIGCLASS_H

View File

@ -23,22 +23,30 @@
#ifndef _RIGLIST_H
#define _RIGLIST_H 1
#define RIG_MAKE_MODEL(a,b) ((a)*100+(b))
#define RIG_BACKEND_NUM(a) ((a)/100)
//! @cond Doxygen_Suppress
// The rig model number is designed to fit in a 32-bit int
// As of 2020-02-18 we have 33 backends defined
// With a max of 1000 models per backend we get total a model number range of 1001-33001
// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range
#define MAX_MODELS_PER_BACKEND 1000
#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b))
#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND)
/*! \file riglist.h
* \brief Hamlib rig(radio) model definitions.
*
* This file contains rig model definitions for the Hamlib rig API.
* Each distinct rig type has a unique model number (ID) and is used
* by hamlib to identify and distinguish between the different hardware drivers.
* The exact model numbers can be acquired using the macros in this
* file. To obtain a list of supported rig branches, one can use the statically
* defined RIG_BACKEND_LIST macro. To obtain a full list of supported rig (including
* each model in every branch), the foreach_opened_rig() API function can be used.
* This file contains rig model definitions for the Hamlib rig API. Each
* distinct rig type has a unique model number (ID) and is used by hamlib to
* identify and distinguish between the different hardware drivers. The
* exact model numbers can be acquired using the macros in this file. To
* obtain a list of supported rig branches, one can use the statically
* defined RIG_BACKEND_LIST macro. To obtain a full list of supported rig
* (including each model in every branch), the foreach_opened_rig() API
* function can be used.
*
* The model number, or ID, is used to tell hamlib, which rig the client whishes to
* use. It is done with the rig_init() API call.
* The model number, or ID, is used to tell hamlib, which rig the client
* whishes to use. It is done with the rig_init() API call.
*/
#define RIG_MODEL_NONE 0
@ -46,20 +54,28 @@
/*! \def RIG_MODEL_DUMMY
* \brief A macro that returns the model number for the dummy backend.
*
* The dummy backend, as the name suggests, is a backend which performs
* no hardware operations and always behaves as one would expect. It can
* be thought of as a hardware simulator and is very usefull for testing
* client applications.
* The dummy backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*
* It has also been expanded to provide support to "virtual" type of rigs
* such as the network rig control backend and W1HKJ's Flrig application.
*/
#define RIG_DUMMY 0
#define RIG_BACKEND_DUMMY "dummy"
#define RIG_MODEL_DUMMY RIG_MAKE_MODEL(RIG_DUMMY, 1)
#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2)
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7)
/*
* Yaesu
*/
/*
* Yaesu
*/
#define RIG_YAESU 1
#define RIG_BACKEND_YAESU "yaesu"
#define RIG_MODEL_FT847 RIG_MAKE_MODEL(RIG_YAESU, 1)
@ -95,12 +111,23 @@
#define RIG_MODEL_FT980 RIG_MAKE_MODEL(RIG_YAESU, 31)
#define RIG_MODEL_FTDX5000 RIG_MAKE_MODEL(RIG_YAESU, 32)
#define RIG_MODEL_VX1700 RIG_MAKE_MODEL(RIG_YAESU, 33)
#define RIG_MODEL_FT1200 RIG_MAKE_MODEL(RIG_YAESU, 34)
#define RIG_MODEL_FTDX1200 RIG_MAKE_MODEL(RIG_YAESU, 34)
#define RIG_MODEL_FT991 RIG_MAKE_MODEL(RIG_YAESU, 35)
#define RIG_MODEL_FT891 RIG_MAKE_MODEL(RIG_YAESU, 36)
#define RIG_MODEL_FTDX3000 RIG_MAKE_MODEL(RIG_YAESU, 37)
#define RIG_MODEL_FT847UNI RIG_MAKE_MODEL(RIG_YAESU, 38)
#define RIG_MODEL_FT600 RIG_MAKE_MODEL(RIG_YAESU, 39)
#define RIG_MODEL_FTDX101D RIG_MAKE_MODEL(RIG_YAESU, 40)
#define RIG_MODEL_FT818 RIG_MAKE_MODEL(RIG_YAESU, 41)
#define RIG_MODEL_FTDX10 RIG_MAKE_MODEL(RIG_YAESU, 42)
#define RIG_MODEL_FT897D RIG_MAKE_MODEL(RIG_YAESU, 43)
#define RIG_MODEL_FTDX101MP RIG_MAKE_MODEL(RIG_YAESU, 44)
#define RIG_MODEL_MCHFQRP RIG_MAKE_MODEL(RIG_YAESU, 45)
/*
* Kenwood
*/
/*
* Kenwood
*/
#define RIG_KENWOOD 2
#define RIG_BACKEND_KENWOOD "kenwood"
#define RIG_MODEL_TS50 RIG_MAKE_MODEL(RIG_KENWOOD, 1)
@ -114,7 +141,7 @@
#define RIG_MODEL_TS850 RIG_MAKE_MODEL(RIG_KENWOOD, 9)
#define RIG_MODEL_TS870S RIG_MAKE_MODEL(RIG_KENWOOD, 10)
#define RIG_MODEL_TS940 RIG_MAKE_MODEL(RIG_KENWOOD, 11)
#define RIG_MODEL_TS950 RIG_MAKE_MODEL(RIG_KENWOOD, 12)
#define RIG_MODEL_TS950S RIG_MAKE_MODEL(RIG_KENWOOD, 12)
#define RIG_MODEL_TS950SDX RIG_MAKE_MODEL(RIG_KENWOOD, 13)
#define RIG_MODEL_TS2000 RIG_MAKE_MODEL(RIG_KENWOOD, 14)
#define RIG_MODEL_R5000 RIG_MAKE_MODEL(RIG_KENWOOD, 15)
@ -138,14 +165,24 @@
#define RIG_MODEL_THD72A RIG_MAKE_MODEL(RIG_KENWOOD, 33)
#define RIG_MODEL_TMD710 RIG_MAKE_MODEL(RIG_KENWOOD, 34)
#define RIG_MODEL_TMV71 RIG_MAKE_MODEL(RIG_KENWOOD, 35)
#define RIG_MODEL_F6K RIG_MAKE_MODEL(RIG_KENWOOD, 36) /* Flex 6000 Series */
#define RIG_MODEL_F6K RIG_MAKE_MODEL(RIG_KENWOOD, 36) /* Flex 6000 Series */
#define RIG_MODEL_TS590SG RIG_MAKE_MODEL(RIG_KENWOOD, 37)
#define RIG_MODEL_XG3 RIG_MAKE_MODEL(RIG_KENWOOD, 38)
#define RIG_MODEL_XG3 RIG_MAKE_MODEL(RIG_KENWOOD, 38) /* Elecraft XG-3 signal generator */
#define RIG_MODEL_TS990S RIG_MAKE_MODEL(RIG_KENWOOD, 39)
#define RIG_MODEL_HPSDR RIG_MAKE_MODEL(RIG_KENWOOD, 40) /* OpenHPSDR, PiHPSDR */
#define RIG_MODEL_TS890S RIG_MAKE_MODEL(RIG_KENWOOD, 41)
#define RIG_MODEL_THD74 RIG_MAKE_MODEL(RIG_KENWOOD, 42)
#define RIG_MODEL_K3S RIG_MAKE_MODEL(RIG_KENWOOD, 43)
#define RIG_MODEL_KX2 RIG_MAKE_MODEL(RIG_KENWOOD, 44)
#define RIG_MODEL_KX3 RIG_MAKE_MODEL(RIG_KENWOOD, 45)
#define RIG_MODEL_PT8000A RIG_MAKE_MODEL(RIG_KENWOOD, 46)
#define RIG_MODEL_K4 RIG_MAKE_MODEL(RIG_KENWOOD, 47)
#define RIG_MODEL_POWERSDR RIG_MAKE_MODEL(RIG_KENWOOD, 48)
#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49)
/*
* Icom
*/
/*
* Icom
*/
#define RIG_ICOM 3
#define RIG_BACKEND_ICOM "icom"
#define RIG_MODEL_IC1271 RIG_MAKE_MODEL(RIG_ICOM, 1)
@ -180,7 +217,7 @@
#define RIG_MODEL_IC775 RIG_MAKE_MODEL(RIG_ICOM, 30)
#define RIG_MODEL_IC781 RIG_MAKE_MODEL(RIG_ICOM, 31)
#define RIG_MODEL_IC820 RIG_MAKE_MODEL(RIG_ICOM, 32)
#define RIG_MODEL_IC821 RIG_MAKE_MODEL(RIG_ICOM, 33)
//#define RIG_MODEL_IC821 RIG_MAKE_MODEL(RIG_ICOM, 33) // not implemented and can be reused
#define RIG_MODEL_IC821H RIG_MAKE_MODEL(RIG_ICOM, 34)
#define RIG_MODEL_IC970 RIG_MAKE_MODEL(RIG_ICOM, 35)
#define RIG_MODEL_ICR10 RIG_MAKE_MODEL(RIG_ICOM, 36)
@ -194,16 +231,16 @@
#define RIG_MODEL_IC910 RIG_MAKE_MODEL(RIG_ICOM, 44)
#define RIG_MODEL_IC78 RIG_MAKE_MODEL(RIG_ICOM, 45)
#define RIG_MODEL_IC746PRO RIG_MAKE_MODEL(RIG_ICOM, 46)
#define RIG_MODEL_IC756PROII RIG_MAKE_MODEL(RIG_ICOM, 47)
#define RIG_MODEL_IC756PROII RIG_MAKE_MODEL(RIG_ICOM, 47) /* 48-53 defined below */
#define RIG_MODEL_ICID1 RIG_MAKE_MODEL(RIG_ICOM, 54)
#define RIG_MODEL_IC703 RIG_MAKE_MODEL(RIG_ICOM, 55)
#define RIG_MODEL_IC7800 RIG_MAKE_MODEL(RIG_ICOM, 56)
#define RIG_MODEL_IC756PROIII RIG_MAKE_MODEL(RIG_ICOM, 57)
#define RIG_MODEL_ICR20 RIG_MAKE_MODEL(RIG_ICOM, 58)
#define RIG_MODEL_ICR20 RIG_MAKE_MODEL(RIG_ICOM, 58) /* 59 defined below */
#define RIG_MODEL_IC7000 RIG_MAKE_MODEL(RIG_ICOM, 60)
#define RIG_MODEL_IC7200 RIG_MAKE_MODEL(RIG_ICOM, 61)
#define RIG_MODEL_IC7700 RIG_MAKE_MODEL(RIG_ICOM, 62)
#define RIG_MODEL_IC7600 RIG_MAKE_MODEL(RIG_ICOM, 63)
#define RIG_MODEL_IC7600 RIG_MAKE_MODEL(RIG_ICOM, 63) /* 64 defined below */
#define RIG_MODEL_IC92D RIG_MAKE_MODEL(RIG_ICOM, 65)
#define RIG_MODEL_ICR9500 RIG_MAKE_MODEL(RIG_ICOM, 66)
#define RIG_MODEL_IC7410 RIG_MAKE_MODEL(RIG_ICOM, 67)
@ -213,27 +250,42 @@
#define RIG_MODEL_ID5100 RIG_MAKE_MODEL(RIG_ICOM, 71)
#define RIG_MODEL_IC2730 RIG_MAKE_MODEL(RIG_ICOM, 72)
#define RIG_MODEL_IC7300 RIG_MAKE_MODEL(RIG_ICOM, 73)
/* next one is 74 */
#define RIG_MODEL_PERSEUS RIG_MAKE_MODEL(RIG_ICOM, 74)
#define RIG_MODEL_IC785x RIG_MAKE_MODEL(RIG_ICOM, 75)
#define RIG_MODEL_X108G RIG_MAKE_MODEL(RIG_ICOM, 76) /* Xiegu X108 */
#define RIG_MODEL_ICR6 RIG_MAKE_MODEL(RIG_ICOM, 77)
#define RIG_MODEL_IC7610 RIG_MAKE_MODEL(RIG_ICOM, 78)
#define RIG_MODEL_ICR8600 RIG_MAKE_MODEL(RIG_ICOM, 79)
#define RIG_MODEL_ICR30 RIG_MAKE_MODEL(RIG_ICOM, 80)
#define RIG_MODEL_IC9700 RIG_MAKE_MODEL(RIG_ICOM, 81)
#define RIG_MODEL_ID4100 RIG_MAKE_MODEL(RIG_ICOM, 82)
#define RIG_MODEL_ID31 RIG_MAKE_MODEL(RIG_ICOM, 83)
#define RIG_MODEL_ID51 RIG_MAKE_MODEL(RIG_ICOM, 84)
#define RIG_MODEL_IC705 RIG_MAKE_MODEL(RIG_ICOM, 85)
/* next one is 86 */
/*
* Optoelectronics (CI-V)
*/
/*
* Optoelectronics (CI-V)
*/
#define RIG_MODEL_MINISCOUT RIG_MAKE_MODEL(RIG_ICOM, 48)
#define RIG_MODEL_XPLORER RIG_MAKE_MODEL(RIG_ICOM, 49)
#define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52)
#define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53)
/*
* TenTec (CI-V)
*/
/*
* TenTec (CI-V)
*/
#define RIG_MODEL_OMNIVI RIG_MAKE_MODEL(RIG_ICOM, 50)
#define RIG_MODEL_OMNIVIP RIG_MAKE_MODEL(RIG_ICOM, 51) /* OMNI-VI+ */
#define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59)
#define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64)
/*
* Icom PCR
*/
/*
* Icom PCR
*/
#define RIG_PCR 4
#define RIG_BACKEND_PCR "pcr"
#define RIG_MODEL_PCR1000 RIG_MAKE_MODEL(RIG_PCR, 1)
@ -241,9 +293,10 @@
#define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3)
#define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4)
/*
* AOR
*/
/*
* AOR
*/
#define RIG_AOR 5
#define RIG_BACKEND_AOR "aor"
#define RIG_MODEL_AR8200 RIG_MAKE_MODEL(RIG_AOR, 1)
@ -263,9 +316,10 @@
#define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15)
#define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16)
/*
* JRC
*/
/*
* JRC
*/
#define RIG_JRC 6
#define RIG_BACKEND_JRC "jrc"
#define RIG_MODEL_JST145 RIG_MAKE_MODEL(RIG_JRC, 1)
@ -276,28 +330,30 @@
#define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6)
#define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7)
/*
* Radio Shack
* Actualy, they might be either Icom or Uniden. TBC --SF
*/
/*
* Radio Shack
* Actually, they might be either Icom or Uniden. TBC --SF
*/
#define RIG_RADIOSHACK 7
#define RIG_BACKEND_RADIOSHACK "radioshack"
#define RIG_MODEL_RS64 RIG_MAKE_MODEL(RIG_RADIOSHACK, 1) /* PRO-64 */
#define RIG_MODEL_RS2005 RIG_MAKE_MODEL(RIG_RADIOSHACK, 2) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2006 RIG_MAKE_MODEL(RIG_RADIOSHACK, 3) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2035 RIG_MAKE_MODEL(RIG_RADIOSHACK, 4) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */
#define RIG_MODEL_RS64 RIG_MAKE_MODEL(RIG_RADIOSHACK, 1) /* PRO-64 */
#define RIG_MODEL_RS2005 RIG_MAKE_MODEL(RIG_RADIOSHACK, 2) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2006 RIG_MAKE_MODEL(RIG_RADIOSHACK, 3) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2035 RIG_MAKE_MODEL(RIG_RADIOSHACK, 4) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */
/*
* Uniden
*/
/*
* Uniden
*/
#define RIG_UNIDEN 8
#define RIG_BACKEND_UNIDEN "uniden"
#define RIG_MODEL_BC780 RIG_MAKE_MODEL(RIG_UNIDEN, 1) /* Uniden BC780 - Trunk Tracker "Desktop Radio" */
#define RIG_MODEL_BC780 RIG_MAKE_MODEL(RIG_UNIDEN, 1) /* Uniden BC780 - Trunk Tracker "Desktop Radio" */
#define RIG_MODEL_BC245 RIG_MAKE_MODEL(RIG_UNIDEN, 2)
#define RIG_MODEL_BC895 RIG_MAKE_MODEL(RIG_UNIDEN, 3)
#define RIG_MODEL_PRO2052 RIG_MAKE_MODEL(RIG_UNIDEN, 4) /* Radio Shack PRO-2052 */
#define RIG_MODEL_PRO2052 RIG_MAKE_MODEL(RIG_UNIDEN, 4) /* Radio Shack PRO-2052 */
#define RIG_MODEL_BC235 RIG_MAKE_MODEL(RIG_UNIDEN, 5)
#define RIG_MODEL_BC250 RIG_MAKE_MODEL(RIG_UNIDEN, 6)
#define RIG_MODEL_BC785 RIG_MAKE_MODEL(RIG_UNIDEN, 7)
@ -307,18 +363,20 @@
#define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11)
#define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12)
/*
* Drake
*/
/*
* Drake
*/
#define RIG_DRAKE 9
#define RIG_BACKEND_DRAKE "drake"
#define RIG_MODEL_DKR8 RIG_MAKE_MODEL(RIG_DRAKE, 1)
#define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2)
#define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3)
/*
* Lowe
*/
/*
* Lowe
*/
#define RIG_LOWE 10
#define RIG_BACKEND_LOWE "lowe"
#define RIG_MODEL_HF150 RIG_MAKE_MODEL(RIG_LOWE, 1)
@ -326,9 +384,10 @@
#define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3)
#define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4)
/*
* Racal
*/
/*
* Racal
*/
#define RIG_RACAL 11
#define RIG_BACKEND_RACAL "racal"
#define RIG_MODEL_RA3790 RIG_MAKE_MODEL(RIG_RACAL, 1)
@ -337,9 +396,10 @@
#define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4)
#define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5)
/*
* Watkins-Johnson
*/
/*
* Watkins-Johnson
*/
#define RIG_WJ 12
#define RIG_BACKEND_WJ "wj"
#define RIG_MODEL_HF1000 RIG_MAKE_MODEL(RIG_WJ, 1)
@ -347,9 +407,10 @@
#define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3)
#define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4)
/*
* Rohde & Schwarz
*/
/*
* Rohde & Schwarz--ek
*/
#define RIG_EK 13
#define RIG_BACKEND_EK "ek"
#define RIG_MODEL_ESM500 RIG_MAKE_MODEL(RIG_EK, 1)
@ -358,9 +419,10 @@
#define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4)
#define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5)
/*
* Skanti
*/
/*
* Skanti
*/
#define RIG_SKANTI 14
#define RIG_BACKEND_SKANTI "skanti"
#define RIG_MODEL_TRP7000 RIG_MAKE_MODEL(RIG_SKANTI, 1)
@ -368,9 +430,10 @@
#define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3)
#define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4)
/*
* WiNRADiO/LinRADiO
*/
/*
* WiNRADiO/LinRADiO
*/
#define RIG_WINRADIO 15
#define RIG_BACKEND_WINRADIO "winradio"
#define RIG_MODEL_WR1000 RIG_MAKE_MODEL(RIG_WINRADIO, 1)
@ -385,69 +448,76 @@
#define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10)
#define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11)
/*
* Ten Tec
*/
/*
* Ten Tec
*/
#define RIG_TENTEC 16
#define RIG_BACKEND_TENTEC "tentec"
#define RIG_MODEL_TT550 RIG_MAKE_MODEL(RIG_TENTEC, 1) /* Pegasus */
#define RIG_MODEL_TT538 RIG_MAKE_MODEL(RIG_TENTEC, 2) /* Jupiter */
#define RIG_MODEL_TT550 RIG_MAKE_MODEL(RIG_TENTEC, 1) /* Pegasus */
#define RIG_MODEL_TT538 RIG_MAKE_MODEL(RIG_TENTEC, 2) /* Jupiter */
#define RIG_MODEL_RX320 RIG_MAKE_MODEL(RIG_TENTEC, 3)
#define RIG_MODEL_RX340 RIG_MAKE_MODEL(RIG_TENTEC, 4)
#define RIG_MODEL_RX350 RIG_MAKE_MODEL(RIG_TENTEC, 5)
#define RIG_MODEL_TT526 RIG_MAKE_MODEL(RIG_TENTEC, 6) /* 6N2 */
#define RIG_MODEL_TT516 RIG_MAKE_MODEL(RIG_TENTEC, 7) /* Argonaut V */
#define RIG_MODEL_TT565 RIG_MAKE_MODEL(RIG_TENTEC, 8) /* Orion */
#define RIG_MODEL_TT585 RIG_MAKE_MODEL(RIG_TENTEC, 9) /* Paragon */
#define RIG_MODEL_TT588 RIG_MAKE_MODEL(RIG_TENTEC, 11) /* Omni-VII */
#define RIG_MODEL_TT526 RIG_MAKE_MODEL(RIG_TENTEC, 6) /* 6N2 */
#define RIG_MODEL_TT516 RIG_MAKE_MODEL(RIG_TENTEC, 7) /* Argonaut V */
#define RIG_MODEL_TT565 RIG_MAKE_MODEL(RIG_TENTEC, 8) /* Orion */
#define RIG_MODEL_TT585 RIG_MAKE_MODEL(RIG_TENTEC, 9) /* Paragon */
#define RIG_MODEL_TT588 RIG_MAKE_MODEL(RIG_TENTEC, 11) /* Omni-VII */
#define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12)
#define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */
/*
* Alinco
*/
/*
* Alinco
*/
#define RIG_ALINCO 17
#define RIG_BACKEND_ALINCO "alinco"
#define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1)
#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2)
/*
* Kachina
*/
/*
* Kachina
*/
#define RIG_KACHINA 18
#define RIG_BACKEND_KACHINA "kachina"
#define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1)
/*
* Gnuradio backend
*/
/*
* Gnuradio backend
*/
#define RIG_GNURADIO 20
#define RIG_BACKEND_GNURADIO "gnuradio"
#define RIG_MODEL_GNURADIO RIG_MAKE_MODEL(RIG_GNURADIO, 1) /* dev model, Chirp source */
#define RIG_MODEL_MC4020 RIG_MAKE_MODEL(RIG_GNURADIO, 2) /* MC4020 */
#define RIG_MODEL_GRAUDIO RIG_MAKE_MODEL(RIG_GNURADIO, 3) /* Sound card source */
#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */
#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */
#define RIG_MODEL_GNURADIO RIG_MAKE_MODEL(RIG_GNURADIO, 1) /* dev model, Chirp source */
#define RIG_MODEL_MC4020 RIG_MAKE_MODEL(RIG_GNURADIO, 2) /* MC4020 */
#define RIG_MODEL_GRAUDIO RIG_MAKE_MODEL(RIG_GNURADIO, 3) /* Sound card source */
#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */
#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */
/*
* Microtune tuners
*/
/*
* Microtune tuners
*/
#define RIG_MICROTUNE 21
#define RIG_BACKEND_MICROTUNE "microtune"
#define RIG_MODEL_MICROTUNE_4937 RIG_MAKE_MODEL(RIG_MICROTUNE, 1) /* eval board */
#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */
#define RIG_MODEL_MICROTUNE_4937 RIG_MAKE_MODEL(RIG_MICROTUNE, 1) /* eval board */
#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */
#define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3)
/*
* TAPR
*/
/*
* TAPR
*/
#define RIG_TAPR 22
#define RIG_BACKEND_TAPR "tapr"
#define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1)
/*
* Flex-radio
*/
/*
* Flex-radio
*/
#define RIG_FLEXRADIO 23
#define RIG_BACKEND_FLEXRADIO "flexradio"
#define RIG_MODEL_SDR1000 RIG_MAKE_MODEL(RIG_FLEXRADIO, 1)
@ -456,100 +526,137 @@
#define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4)
/*
* VEB Funkwerk Köpenick RFT
*/
/*
* VEB Funkwerk Köpenick RFT
*/
#define RIG_RFT 24
#define RIG_BACKEND_RFT "rft"
#define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1)
/*
* Various kits
*/
/*
* Various kits
*/
#define RIG_KIT 25
#define RIG_BACKEND_KIT "kit"
#define RIG_MODEL_ELEKTOR304 RIG_MAKE_MODEL(RIG_KIT, 1)
#define RIG_MODEL_DRT1 RIG_MAKE_MODEL(RIG_KIT, 2)
#define RIG_MODEL_DWT RIG_MAKE_MODEL(RIG_KIT, 3)
#define RIG_MODEL_USRP0 RIG_MAKE_MODEL(RIG_KIT, 4) /* prototype */
#define RIG_MODEL_USRP0 RIG_MAKE_MODEL(RIG_KIT, 4) /* prototype */
#define RIG_MODEL_USRP RIG_MAKE_MODEL(RIG_KIT, 5)
#define RIG_MODEL_DDS60 RIG_MAKE_MODEL(RIG_KIT, 6)
#define RIG_MODEL_ELEKTOR507 RIG_MAKE_MODEL(RIG_KIT, 7) /* Elektor SDR USB */
#define RIG_MODEL_ELEKTOR507 RIG_MAKE_MODEL(RIG_KIT, 7) /* Elektor SDR USB */
#define RIG_MODEL_MINIVNA RIG_MAKE_MODEL(RIG_KIT, 8)
#define RIG_MODEL_SI570AVRUSB RIG_MAKE_MODEL(RIG_KIT, 9) /* SoftRock Si570 AVR */
#define RIG_MODEL_SI570AVRUSB RIG_MAKE_MODEL(RIG_KIT, 9) /* SoftRock Si570 AVR */
#define RIG_MODEL_PMSDR RIG_MAKE_MODEL(RIG_KIT, 10)
#define RIG_MODEL_SI570PICUSB RIG_MAKE_MODEL(RIG_KIT, 11) /* SoftRock Si570 PIC */
#define RIG_MODEL_FIFISDR RIG_MAKE_MODEL(RIG_KIT, 12) /* FiFi-SDR USB */
#define RIG_MODEL_FUNCUBEDONGLE RIG_MAKE_MODEL(RIG_KIT, 13) /* FunCUBE Dongle */
#define RIG_MODEL_HIQSDR RIG_MAKE_MODEL(RIG_KIT, 14) /* HiQSDR */
#define RIG_MODEL_FASDR RIG_MAKE_MODEL(RIG_KIT,15) /* Funkamateur Sdr */
#define RIG_MODEL_SI570PEABERRY1 RIG_MAKE_MODEL(RIG_KIT, 16) /* Peaberry V1 */
#define RIG_MODEL_SI570PEABERRY2 RIG_MAKE_MODEL(RIG_KIT, 17) /* Peaberry V2 */
#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */
#define RIG_MODEL_SI570PICUSB RIG_MAKE_MODEL(RIG_KIT, 11) /* SoftRock Si570 PIC */
#define RIG_MODEL_FIFISDR RIG_MAKE_MODEL(RIG_KIT, 12) /* FiFi-SDR USB */
#define RIG_MODEL_FUNCUBEDONGLE RIG_MAKE_MODEL(RIG_KIT, 13) /* FunCUBE Dongle */
#define RIG_MODEL_HIQSDR RIG_MAKE_MODEL(RIG_KIT, 14) /* HiQSDR */
#define RIG_MODEL_FASDR RIG_MAKE_MODEL(RIG_KIT,15) /* Funkamateur Sdr */
#define RIG_MODEL_SI570PEABERRY1 RIG_MAKE_MODEL(RIG_KIT, 16) /* Peaberry V1 */
#define RIG_MODEL_SI570PEABERRY2 RIG_MAKE_MODEL(RIG_KIT, 17) /* Peaberry V2 */
#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */
#define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */
/*
* SW/FM/TV tuner cards supported by Video4Linux,*BSD, ..
*/
/*
* SW/FM/TV tuner cards supported by Video4Linux,*BSD, ..
*/
#define RIG_TUNER 26
#define RIG_BACKEND_TUNER "tuner"
#define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1)
#define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2)
/*
* Rohde&Schwarz
*/
/*
* Rohde & Schwarz--rs
*/
#define RIG_RS 27
#define RIG_BACKEND_RS "rs"
#define RIG_MODEL_ESMC RIG_MAKE_MODEL(RIG_RS, 1)
#define RIG_MODEL_EB200 RIG_MAKE_MODEL(RIG_RS, 2)
#define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3)
/*
* Phillips/Simoco PRM80
*/
/*
* Phillips/Simoco PRM80
*/
#define RIG_PRM80 28
#define RIG_BACKEND_PRM80 "prm80"
#define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1)
#define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2)
/*
* ADAT by HB9CBU
*
* ADDED: frgo (DG1SBG), 2012-01-01
*/
/*
* ADAT by HB9CBU
*
* ADDED: frgo (DG1SBG), 2012-01-01
*/
#define RIG_ADAT 29
#define RIG_BACKEND_ADAT "adat"
#define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1)
/*
* ICOM Marine
*/
/*
* ICOM Marine
*/
#define RIG_ICMARINE 30
#define RIG_BACKEND_ICMARINE "icmarine"
#define RIG_MODEL_IC_M700PRO RIG_MAKE_MODEL(RIG_ICMARINE, 1)
#define RIG_MODEL_IC_M802 RIG_MAKE_MODEL(RIG_ICMARINE, 2)
#define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3)
#define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4)
/*
* Dorji transceiver modules
*/
#define RIG_DORJI 31
#define RIG_BACKEND_DORJI "dorji"
#define RIG_MODEL_DORJI_DRA818V RIG_MAKE_MODEL(RIG_DORJI, 1)
#define RIG_MODEL_DORJI_DRA818U RIG_MAKE_MODEL(RIG_DORJI, 2)
/*
* Barrett
*/
#define RIG_BARRETT 32
#define RIG_BACKEND_BARRETT "barrett"
#define RIG_MODEL_BARRETT_2050 RIG_MAKE_MODEL(RIG_BARRETT, 1)
#define RIG_MODEL_BARRETT_950 RIG_MAKE_MODEL(RIG_BARRETT, 2)
/*
* Elad
*/
#define RIG_ELAD 33
#define RIG_BACKEND_ELAD "elad"
#define RIG_MODEL_ELAD_FDM_DUO RIG_MAKE_MODEL(RIG_ELAD, 1)
//! @endcond
/*
* TODO:
RIG_MODEL_KWZ30, KNEISNER +DOERING
RIG_MODEL_E1800, DASA-Telefunken
etc.
*/
/*
* TODO:
RIG_MODEL_KWZ30, KNEISNER +DOERING
RIG_MODEL_E1800, DASA-Telefunken
etc.
*/
/*! \typedef typedef int rig_model_t
\brief Convenience type definition for rig model.
*/
typedef int rig_model_t;
typedef uint32_t rig_model_t;
/*
* struct rig_backend_list {
* rig_model_t model;
* const char *backend;
* rig_model_t model;
* const char *backend;
* } rig_backend_list[] = RIG_LIST;
*
* TODO:
*
{ RIG_RADIOSHACK, RIG_BACKEND_RADIOSHACK }, \
{ RIG_RADIOSHACK, RIG_BACKEND_RADIOSHACK }, \
*/
#endif /* _RIGLIST_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +0,0 @@
/*
* Hamlib C++ bindings - rotator API header
* Copyright (c) 2002 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _ROTCLASS_H
#define _ROTCLASS_H 1
#include <hamlib/rotator.h>
class BACKEND_IMPEXP Rotator {
private:
ROT* theRot; // Global ref. to the rot
protected:
public:
Rotator(rot_model_t rot_model);
virtual ~Rotator();
const struct rot_caps *caps;
// This method open the communication port to the rot
void open(void);
// This method close the communication port to the rot
void close(void);
void setConf(token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
void setPosition(azimuth_t az, elevation_t el);
void getPosition(azimuth_t& az, elevation_t& el);
void stop();
void park();
void reset (rot_reset_t reset);
void move(int direction, int speed);
};
#endif // _ROTCLASS_H

View File

@ -23,288 +23,615 @@
#ifndef _ROTLIST_H
#define _ROTLIST_H 1
//! @cond Doxygen_Suppress
#define ROT_MAKE_MODEL(a,b) ((a)*100+(b))
#define ROT_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup rotator
* @{
*/
/*! \file rotlist.h
* \brief Hamlib rotator model definitions.
/**
* \file rotlist.h
* \brief Hamlib rotator model definitions.
*
* This file contains rotator model definitions for the Hamlib rotator API.
* Each distinct rotator type has a unique model number (ID) and is used
* by hamlib to identify and distinguish between the different hardware drivers.
* The exact model numbers can be acquired using the macros in this
* file. To obtain a list of supported rotator branches, one can use the statically
* defined ROT_BACKEND_LIST macro. To obtain a full list of supported rotators (including
* each model in every branch), the foreach_opened_rot() API function can be used.
* This file contains rotator model definitions for the Hamlib rotator
* Application Programming Interface (API). Each distinct rotator type has a
* unique model number (ID) and is used by Hamlib to identify and distinguish
* between the different hardware drivers. The exact model numbers can be
* acquired using the macros in this file. To obtain a list of supported
* rotator branches, one can use the statically defined ROT_BACKEND_LIST macro
* (defined in configure.ac). To obtain a full list of supported rotators
* (including each model in every branch), the foreach_opened_rot() API
* function can be used.
*
* The model number, or ID, is used to tell hamlib, which rotator the client whishes to
* use. It is done with the rot_init() API call.
* The model number, or ID, is used to tell Hamlib which rotator the client
* wishes to use which is done with the rot_init() API call.
*/
/**
* \def ROT_MODEL_NONE
* \brief A macro that returns the model number for an unknown model.
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define ROT_MODEL_NONE 0
/*! \def ROT_MODEL_DUMMY
* \brief A macro that returns the model number for the dummy backend.
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* The dummy backend, as the name suggests, is a backend which performs
* no hardware operations and always behaves as one would expect. It can
* be thought of as a hardware simulator and is very usefull for testing
* client applications.
*/
/*! \def ROT_MODEL_NETROTCTL
* \brief A macro that returns the model number for the Network backend.
* \def ROT_MODEL_DUMMY
*
* This backend allows use of the rotctld daemon through the normal
* Hamlib API.
* The DUMMY backend, as the name suggests, is a backend which performs
* no hardware operations and always behaves as one would expect. It can
* be thought of as a hardware simulator and is very useful for testing
* client applications.
*/
/**
* \brief A macro that returns the model number for the NETROTCTL backend.
*
* \def ROT_MODEL_NETROTCTL
*
* The NETROTCTL backend allows use of the `rotctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define ROT_DUMMY 0
#define ROT_BACKEND_DUMMY "dummy"
//! @endcond
#define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1)
#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2)
/*
* Easycomm
*/
/*! \def ROT_MODEL_EASYCOMM1
* \brief A macro that returns the model number of the EasyComm 1 backend.
/**
* \brief A macro that returns the model number of the EASYCOMM 1 backend.
*
* The EasyComm 1 backend can be used with rotators that support the
* EASYCOMM I Standard.
*/
/*! \def ROT_MODEL_EASYCOMM2
* \brief A macro that returns the model number of the EasyComm 2 backend.
* \def ROT_MODEL_EASYCOMM1
*
* The EasyComm 2 backend can be used with rotators that support the
* EASYCOMM II Standard.
* The EASYCOMM1 backend can be used with rotators that support the EASYCOMM
* I Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 2 backend.
*
* \def ROT_MODEL_EASYCOMM2
*
* The EASYCOMM2 backend can be used with rotators that support the EASYCOMM
* II Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 3 backend.
*
* \def ROT_MODEL_EASYCOMM3
*
* The EASYCOMM3 backend can be used with rotators that support the EASYCOMM
* III Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_EASYCOMM 2
#define ROT_BACKEND_EASYCOMM "easycomm"
//! @endcond
#define ROT_MODEL_EASYCOMM1 ROT_MAKE_MODEL(ROT_EASYCOMM, 1)
#define ROT_MODEL_EASYCOMM2 ROT_MAKE_MODEL(ROT_EASYCOMM, 2)
#define ROT_MODEL_TRAKBOX ROT_MAKE_MODEL(ROT_EASYCOMM, 3)
#define ROT_MODEL_EASYCOMM3 ROT_MAKE_MODEL(ROT_EASYCOMM, 4)
/*! \def ROT_MODEL_FODTRACK
* \brief A macro that returns the model number of the Fodtrack backend.
/**
* \brief A macro that returns the model number of the FODTRACK backend.
*
* The Fodtrack backend can be used with rotators that support the
* FODTRACK Standard.
* \def ROT_MODEL_FODTRACK
*
* The FODTRACK backend can be used with rotators that support the FODTRACK
* Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_FODTRACK 3
#define ROT_BACKEND_FODTRACK "fodtrack"
//! @endcond
#define ROT_MODEL_FODTRACK ROT_MAKE_MODEL(ROT_FODTRACK, 1)
/*! \def ROT_MODEL_ROTOREZ
* \brief A macro that returns the model number of the Rotor-EZ backend.
/**
* \brief A macro that returns the model number of the ROTOREZ backend.
*
* The Rotor-EZ backend can be used with Hy-Gain rotators that support
* the extended DCU command set by Idiom Press Rotor-EZ board.
*/
/*! \def ROT_MODEL_ROTORCARD
* \brief A macro that returns the model number of the Rotor Card backend.
* \def ROT_MODEL_ROTOREZ
*
* The Rotor-EZ backend can be used with Yaesu rotators that support the
* extended DCU command set by Idiom Press Rotor Card board.
* The ROTOREZ backend can be used with Hy-Gain rotators that support the
* extended DCU command set by the Idiom Press Rotor-EZ board.
*/
/*! \def ROT_MODEL_DCU
* \brief A macro that returns the model number of the DCU backend.
/**
* \brief A macro that returns the model number of the ROTORCARD backend.
*
* The Rotor-EZ backend can be used with rotators that support the
* DCU command set by Hy-Gain (currently the DCU-1).
*/
/*! \def ROT_MODEL_ERC
* \brief A macro that returns the model number of the ERC backend.
* \def ROT_MODEL_ROTORCARD
*
* The Rotor-EZ backend can be used with rotators that support the
* DCU command set by DF9GR (currently the ERC).
* The ROTORCARD backend can be used with Yaesu rotators that support the
* extended DCU command set by the Idiom Press Rotor Card board.
*/
/*! \def ROT_MODEL_RT21
* \brief A macro that returns the model number of the RT21 backend.
/**
* \brief A macro that returns the model number of the DCU backend.
*
* The Rotor-EZ backend can be used with rotators that support the
* DCU command set by Green Heron (currently the RT-21).
* \def ROT_MODEL_DCU
*
* The DCU backend can be used with rotators that support the DCU command set
* by Hy-Gain (currently the DCU-1).
*/
/**
* \brief A macro that returns the model number of the ERC backend.
*
* \def ROT_MODEL_ERC
*
* The ERC backend can be used with rotators that support the DCU command set
* by DF9GR (currently the ERC).
*/
/**
* \brief A macro that returns the model number of the RT21 backend.
*
* \def ROT_MODEL_RT21
*
* The RT21 backend can be used with rotators that support the DCU command set
* by Green Heron (currently the RT-21).
*/
//! @cond Doxygen_Suppress
#define ROT_ROTOREZ 4
#define ROT_BACKEND_ROTOREZ "rotorez"
//! @endcond
#define ROT_MODEL_ROTOREZ ROT_MAKE_MODEL(ROT_ROTOREZ, 1)
#define ROT_MODEL_ROTORCARD ROT_MAKE_MODEL(ROT_ROTOREZ, 2)
#define ROT_MODEL_DCU ROT_MAKE_MODEL(ROT_ROTOREZ, 3)
#define ROT_MODEL_ERC ROT_MAKE_MODEL(ROT_ROTOREZ, 4)
#define ROT_MODEL_RT21 ROT_MAKE_MODEL(ROT_ROTOREZ, 5)
/*! \def ROT_MODEL_SARTEK1
* \brief A macro that returns the model number of the SARtek-1 backend.
/**
* \brief A macro that returns the model number of the SARTEK1 backend.
*
* The sartek backend can be used with rotators that support the
* SARtek protocol.
* \def ROT_MODEL_SARTEK1
*
* The SARTEK1 backend can be used with rotators that support the SARtek
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SARTEK 5
#define ROT_BACKEND_SARTEK "sartek"
//! @endcond
#define ROT_MODEL_SARTEK1 ROT_MAKE_MODEL(ROT_SARTEK, 1)
/*! \def ROT_MODEL_GS232A
* \brief A macro that returns the model number of the GS-232A backend.
/**
* \brief A macro that returns the model number of the GS232A backend.
*
* The GS-232A backend can be used with rotators that support the
* GS-232A protocol.
*/
/*! \def ROT_MODEL_GS232
* \brief A macro that returns the model number of the GS-232 backend.
* \def ROT_MODEL_GS232A
*
* The GS-232 backend can be used with rotators that support the
* GS-232 protocol.
* The GS232A backend can be used with rotators that support the GS-232A
* protocol.
*/
/*! \def ROT_MODEL_GS232B
* \brief A macro that returns the model number of the GS-232B backend.
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* The GS-232B backend can be used with rotators that support the
* GS-232B protocol.
*/
/*! \def ROT_MODEL_F1TETRACKER
* \brief A macro that returns the model number of the F1TETRACKER backend.
* \def ROT_MODEL_GS232_GENERIC
*
* The F1TETRACKER backend can be used with rotators that support the
* F1TETRACKER protocol.
* The GS232_GENERIC backend can be used with rotators that support the
* generic (even if not coded correctly) GS-232 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B backend.
*
* \def ROT_MODEL_GS232B
*
* The GS232B backend can be used with rotators that support the GS232B
* protocol.
*/
/**
* \brief A macro that returns the model number of the F1TETRACKER backend.
*
* \def ROT_MODEL_F1TETRACKER
*
* The F1TETRACKER backend can be used with rotators that support the F1TE
* Tracker protocol.
*/
/**
* \brief A macro that returns the model number of the GS23 backend.
*
* \def ROT_MODEL_GS23
*
* The GS23 backend can be used with rotators that support the GS-23 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* \def ROT_MODEL_GS232
*
* The GS232 backend can be used with rotators that support the GS-232
* protocol.
*/
/**
* \brief A macro that returns the model number of the LVB backend.
*
* \def ROT_MODEL_LVB
*
* The LVB backend can be used with rotators that support the G6LVB AMSAT LVB
* Tracker GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the ST2 backend.
*
* \def ROT_MODEL_ST2
*
* The ST2 backend can be used with rotators that support the Fox Delta ST2
* GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232A_AZ
*
* The GS232A_AZ backend can be used with azimuth rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_EL Elevation backend.
*
* \def ROT_MODEL_GS232A_EL
*
* The GS232A_EL backend can be used with elevation rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232B_AZ
*
* The GS232B_AZ backend can be used with azimuth rotators that support the
* GS-232B protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_EL Elevation backend.
*
* \def ROT_MODEL_GS232B_EL
*
* The GS232B_EL backend can be used with elevation rotators that support the
* GS-232B protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_GS232A 6
#define ROT_BACKEND_GS232A "gs232a"
//! @endcond
#define ROT_MODEL_GS232A ROT_MAKE_MODEL(ROT_GS232A, 1)
#define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 2) /* Not A or B */
#define ROT_MODEL_GS232_GENERIC ROT_MAKE_MODEL(ROT_GS232A, 2) /* GENERIC */
#define ROT_MODEL_GS232B ROT_MAKE_MODEL(ROT_GS232A, 3)
#define ROT_MODEL_F1TETRACKER ROT_MAKE_MODEL(ROT_GS232A, 4)
#define ROT_MODEL_GS23 ROT_MAKE_MODEL(ROT_GS232A, 5)
#define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */
#define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7)
#define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8)
#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9)
#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10)
#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11)
#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12)
/*! \def ROT_MODEL_PCROTOR
* \brief A macro that returns the model number of the PcRotor/WA6UFQ backend.
/**
* \brief A macro that returns the model number of the PCROTOR backend.
*
* The kit backend can be used with home brewed rotators.
* \def ROT_MODEL_PCROTOR
*
* The PCROTOR backend is a member of the kit backend group that can be used
* with home brewed rotators.
*/
//! @cond Doxygen_Suppress
#define ROT_KIT 7
#define ROT_BACKEND_KIT "kit"
//! @endcond
#define ROT_MODEL_PCROTOR ROT_MAKE_MODEL(ROT_KIT, 1)
/*! \def ROT_MODEL_HD1780
* \brief A macro that returns the model number of the HD 1780 backend.
/**
* \brief A macro that returns the model number of the HD1780 backend.
*
* \def ROT_MODEL_HD1780
*
* The HD1780 backend can be used with rotators that support the Heathkit
* HD-1780 protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_HEATHKIT 8
#define ROT_BACKEND_HEATHKIT "heathkit"
//! @endcond
#define ROT_MODEL_HD1780 ROT_MAKE_MODEL(ROT_HEATHKIT, 1)
/*! \def ROT_MODEL_SPID_ROT2PROG
* \brief A macro that returns the model number of the ROT2PROG backend.
/**
* \brief A macro that returns the model number of the ROT2PROG backend.
*
* The SPID backend can be used with rotators that support the SPID
* protocol.
*/
/*! \def ROT_MODEL_SPID_ROT1PROG
* \brief A macro that returns the model number of the ROT1PROG backend.
* \def ROT_MODEL_SPID_ROT2PROG
*
* The SPID backend can be used with rotators that support the SPID
* protocol.
* The SPID_ROT2PROG backend can be used with rotators that support the SPID
* azimuth and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the ROT1PROG backend.
*
* \def ROT_MODEL_SPID_ROT1PROG
*
* The SPID_ROT1PROG backend can be used with rotators that support the SPID
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the SPID_MD01_ROT2PROG backend.
*
* \def ROT_MODEL_SPID_MD01_ROT2PROG
*
* The SPID_MD01_ROT2PROG backend can be used with rotators that support the
* extended SPID ROT2PROG azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SPID 9
#define ROT_BACKEND_SPID "spid"
//! @endcond
#define ROT_MODEL_SPID_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 1)
#define ROT_MODEL_SPID_ROT1PROG ROT_MAKE_MODEL(ROT_SPID, 2)
#define ROT_MODEL_SPID_MD01_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 3)
/*! \def ROT_MODEL_RC2800
* \brief A macro that returns the model number of the RC2800 backend.
/**
* \brief A macro that returns the model number of the RC2800 backend.
*
* The M2 backend can be used with rotators that support the RC2800
* protocol and alike.
* \def ROT_MODEL_RC2800
*
* The RC2800 backend can be used with rotators that support the M2 (M
* Squared) RC2800 protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZ
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZ
*
* The RC2800_EARLY_AZ backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZEL
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZEL
*
* The RC2800_EARLY_AZEL backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_M2 10
#define ROT_BACKEND_M2 "m2"
//! @endcond
#define ROT_MODEL_RC2800 ROT_MAKE_MODEL(ROT_M2, 1)
#define ROT_MODEL_RC2800_EARLY_AZ ROT_MAKE_MODEL(ROT_M2, 2)
#define ROT_MODEL_RC2800_EARLY_AZEL ROT_MAKE_MODEL(ROT_M2, 3)
/*! \def ROT_MODEL_RCI_AZEL
* \brief A macro that returns the model number of the RCI_AZEL backend.
/**
* \brief A macro that returns the model number of the RCI_AZEL backend.
*
* The ARS backend can be used with rotators that support the ARS
* protocol.
*/
/*! \def ROT_MODEL_RCI_AZ
* \brief A macro that returns the model number of the RCI_AZ backend.
* \def ROT_MODEL_RCI_AZEL
*
* The ARS backend can be used with rotators that support the ARS
* protocol.
* The RCI_AZEL backend can be used with rotators that support the ARS azimuth
* and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the RCI_AZ backend.
*
* \def ROT_MODEL_RCI_AZ
*
* The RCI_AZ backend can be used with rotators that support the ARS azimuth
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ARS 11
#define ROT_BACKEND_ARS "ars"
//! @endcond
#define ROT_MODEL_RCI_AZEL ROT_MAKE_MODEL(ROT_ARS, 1)
#define ROT_MODEL_RCI_AZ ROT_MAKE_MODEL(ROT_ARS, 2)
/*! \def ROT_MODEL_IF100
* \brief A macro that returns the model number of the IF-100 backend.
/**
* \brief A macro that returns the model number of the IF100 backend.
*
* The AMSAT backend can be used with rotators that support,
* among other, the IF-100 interface.
* \def ROT_MODEL_IF100
*
* The IF100 backend can be used with rotators that support the AMSAT IF-100
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_AMSAT 12
#define ROT_BACKEND_AMSAT "amsat"
//! @endcond
#define ROT_MODEL_IF100 ROT_MAKE_MODEL(ROT_AMSAT, 1)
/*! \def ROT_MODEL_TS7400
* \brief A macro that returns the model number of the TS7400 backend.
/**
* \brief A macro that returns the model number of the TS7400 backend.
*
* The TS-7400 backend supports and embedded ARM board using the TS-7400
* Linux board. More information is at http://www.embeddedarm.com
* \def ROT_MODEL_TS7400
*
* The TS7400 backend supports an embedded ARM board using the TS-7400 Linux
* board. More information is at https://www.embeddedarm.com
*/
//! @cond Doxygen_Suppress
#define ROT_TS7400 13
#define ROT_BACKEND_TS7400 "ts7400"
//! @endcond
#define ROT_MODEL_TS7400 ROT_MAKE_MODEL(ROT_TS7400, 1)
/*! \def ROT_MODEL_NEXSTAR
* \brief A macro that returns the model number of the NEXSTAR backend.
/**
* \brief A macro that returns the model number of the NEXSTAR backend.
*
* The CELESTRON backend can be used with rotators that support the Celestron
* protocol and alike.
* \def ROT_MODEL_NEXSTAR
*
* The NEXSTAR backend can be used with rotators that support the Celestron
* NexStar protocol and alike.
*/
//! @cond Doxygen_Suppress
#define ROT_CELESTRON 14
#define ROT_BACKEND_CELESTRON "celestron"
//! @endcond
#define ROT_MODEL_NEXSTAR ROT_MAKE_MODEL(ROT_CELESTRON, 1)
/*! \def ROT_MODEL_ETHER6
* \brief A macro that returns the model number of the Ether6 backend.
/**
* \brief A macro that returns the model number of the ETHER6 backend.
*
* The Ether6 backend can be used with rotators that support the Ether6
* protocol and alike.
* \def ROT_MODEL_ETHER6
*
* The ETHER6 backend can be used with rotators that support the Ether6
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ETHER6 15
#define ROT_BACKEND_ETHER6 "ether6"
//! @endcond
#define ROT_MODEL_ETHER6 ROT_MAKE_MODEL(ROT_ETHER6, 1)
/*! \def ROT_MODEL_CNCTRK
* \brief A macro that returns the model number of the CNCTRK backend.
/**
* \brief A macro that returns the model number of the CNCTRK backend.
*
* The CNCTRK backend can be used with rotators that support,
* the LinuxCNC running Axis GUI interface.
* \def ROT_MODEL_CNCTRK
*
* The CNCTRK backend can be used with rotators that support the LinuxCNC
* running Axis GUI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_CNCTRK 16
#define ROT_BACKEND_CNCTRK "cnctrk"
//! @endcond
#define ROT_MODEL_CNCTRK ROT_MAKE_MODEL(ROT_CNCTRK, 1)
/*! \def ROT_MODEL_PROSISTEL
* \brief A macro that returns the model number of the PROSISTEL backend.
/**
* \brief A macro that returns the model number of the PROSISTEL_D_AZ backend.
*
* \def ROT_MODEL_PROSISTEL_D_AZ
*
* The PROSISTEL_D_AZ backend can be used with rotators that support the Prosistel
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the PROSISTEL_D_EL backend.
*
* \def ROT_MODEL_PROSISTEL_D_EL
*
* The PROSISTEL_D_EL backend can be used with rotators that support the Prosistel
* elevation protocol.
*/
/**
* \brief A macro that returns the model number of the
* PROSISTEL_COMBI_TRACK_AZEL backend.
*
* \def ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL
*
* The PROSISTEL_AZEL_COMBI_TRACK_AZEL backend can be used with rotators that
* support the Prosistel combination azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_PROSISTEL 17
#define ROT_BACKEND_PROSISTEL "prosistel"
#define ROT_MODEL_PROSISTEL ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
//! @endcond
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
/*! \typedef typedef int rot_model_t
\brief Convenience type definition for rotator model.
/**
* \brief A macro that returns the model number of the MEADE backend.
*
* \def ROT_MODEL_MEADE
*
* The MEADE backend can be used with Meade telescope rotators like the
* DS-2000.
*/
//! @cond Doxygen_Suppress
#define ROT_MEADE 18
#define ROT_BACKEND_MEADE "meade"
//! @endcond
#define ROT_MODEL_MEADE ROT_MAKE_MODEL(ROT_MEADE, 1)
/**
* \brief A macro that returns the model number of the IOPTRON backend.
*
* \def ROT_MODEL_IOPTRON
*
* The IOPTRON backend can be used with IOPTRON telescope mounts.
*/
//! @cond Doxygen_Suppress
#define ROT_IOPTRON 19
#define ROT_BACKEND_IOPTRON "ioptron"
//! @endcond
#define ROT_MODEL_IOPTRON ROT_MAKE_MODEL(ROT_IOPTRON, 1)
/**
* \brief A macro that returns the model number of the INDI backend.
*
* \def ROT_MODEL_INDI
*
* The INDI backend can be used with rotators that support the INDI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_INDI 20
#define ROT_BACKEND_INDI "indi"
//! @endcond
#define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1)
/**
* \brief A macro that returns the model number of the SATEL backend.
*
* \def ROT_MODEL_SATEL
*
* The SATEL backend can be used with rotators that support the VE5FP
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_SATEL 21
#define ROT_BACKEND_SATEL "satel"
//! @endcond
#define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1)
/**
* \brief A macro that returns the model number of the RADANT backend.
*
* \def ROT_MODEL_RADANT
*
* The RADANT backend can be used with rotators that support the MS232
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_RADANT 22
#define ROT_BACKEND_RADANT "radant"
//! @endcond
#define ROT_MODEL_RADANT ROT_MAKE_MODEL(ROT_RADANT, 1)
#define ROT_ANDROIDSENSOR 23
#define ROT_BACKEND_ANDROIDSENSOR "androidsensor"
#define ROT_MODEL_ANDROIDSENSOR ROT_MAKE_MODEL(ROT_ANDROIDSENSOR, 1)
/**
* \brief Convenience type definition for a rotator model.
*
* \typedef typedef int rot_model_t
*/
typedef int rot_model_t;
#endif /* _ROTLIST_H */
/** @} */

View File

@ -0,0 +1,11 @@
- Building libliquid.dll and libliquid.a:
-----------------------------------------
- Install the Msys2 distribution as described on their site (https://msys2.github.io/)
- Add mingw32 and mingw64 compiler to the Msys2 installation.
- Copy config.h, makefile.mingw32, makefile.mingw64 in the liquid-dsp root directory.
- Run a Msys2 Win32 shell (mingw32.exe) and execute 'make -f makefile.mingw32 -j clean' then 'make -f makefile.mingw32 -j' to compile a libliquid.dll 32bit Windows Dll.
- Run a Msys2 Win64 shell (mingw64.exe) and execute 'make -f makefile.mingw64 -j clean' then 'make -f makefile.mingw64 -j' to compile a libliquid.dll 64bit Windows Dll.
This process generates a .dll, .a together with libliquid.def the listing exported functions, and libliquid.lib the import lib matching the dll.
In order to develop with Visual Studio, you need both the include/liquid.h at source level, and the libliquid.lib import library referenced in your project.

290
external/liquid-dsp/config.h vendored Normal file
View File

@ -0,0 +1,290 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
#ifndef __LIQUID_CONFIG_H__
#define __LIQUID_CONFIG_H__
/* Define to 1 to support Advanced Bit Manipulation */
#define HAVE_ABM 1
/* Define to 1 to support Multi-Precision Add-Carry Instruction Extensions */
#define HAVE_ADX 1
/* Define to 1 to support Advanced Encryption Standard New Instruction Set
(AES-NI) */
/* #define HAVE_AES 1 */
/* Support Altivec instructions */
/* #undef HAVE_ALTIVEC */
/* Define to 1 to support Advanced Vector Extensions */
/* #define HAVE_AVX 1 */
/* Define to 1 to support Advanced Vector Extensions 2 */
/* #define HAVE_AVX2 1 */
/* Define to 1 to support AVX-512 Byte and Word Instructions */
/* #undef HAVE_AVX512_BW */
/* Define to 1 to support AVX-512 Conflict Detection Instructions */
/* #undef HAVE_AVX512_CD */
/* Define to 1 to support AVX-512 Doubleword and Quadword Instructions */
/* #undef HAVE_AVX512_DQ */
/* Define to 1 to support AVX-512 Exponential & Reciprocal Instructions */
/* #undef HAVE_AVX512_ER */
/* Define to 1 to support AVX-512 Foundation Extensions */
/* #undef HAVE_AVX512_F */
/* Define to 1 to support AVX-512 Integer Fused Multiply Add Instructions */
/* #undef HAVE_AVX512_IFMA */
/* Define to 1 to support AVX-512 Conflict Prefetch Instructions */
/* #undef HAVE_AVX512_PF */
/* Define to 1 to support AVX-512 Vector Byte Manipulation Instructions */
/* #undef HAVE_AVX512_VBMI */
/* Define to 1 to support AVX-512 Vector Length Extensions */
/* #undef HAVE_AVX512_VL */
/* Define to 1 to support Bit Manipulation Instruction Set 1 */
#define HAVE_BMI1 1
/* Define to 1 to support Bit Manipulation Instruction Set 2 */
#define HAVE_BMI2 1
/* Define to 1 if you have the `cargf' function. */
#define HAVE_CARGF 1
/* Define to 1 if you have the `cexpf' function. */
#define HAVE_CEXPF 1
/* Define to 1 if you have the `cimagf' function. */
#define HAVE_CIMAGF 1
/* Define to 1 if you have the <complex.h> header file. */
#define HAVE_COMPLEX_H 1
/* Define to 1 if you have the `cosf' function. */
#define HAVE_COSF 1
/* Define to 1 if you have the `crealf' function. */
#define HAVE_CREALF 1
/* Define to 1 if you have the `expf' function. */
#define HAVE_EXPF 1
/* Define to 1 if you have the <fec.h> header file. */
/* #undef HAVE_FEC_H */
/* Define to 1 if you have the <fftw3.h> header file. */
/* #undef HAVE_FFTW3_H */
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 to support Fused Multiply-Add Extensions 3 */
#define HAVE_FMA3 1
/* Define to 1 to support Fused Multiply-Add Extensions 4 */
/* #undef HAVE_FMA4 */
/* Define to 1 if you have the `free' function. */
#define HAVE_FREE 1
/* Define to 1 if you have the <getopt.h> header file. */
#define HAVE_GETOPT_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `c' library (-lc). */
#define HAVE_LIBC 1
/* Define to 1 if you have the `fec' library (-lfec). */
/* #undef HAVE_LIBFEC */
/* Define to 1 if you have the `fftw3f' library (-lfftw3f). */
/* #undef HAVE_LIBFFTW3F */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 to support Multimedia Extensions */
#define HAVE_MMX 1
/* Define to 1 to support Memory Protection Extensions */
/* #undef HAVE_MPX */
/* Define to 1 to support Prefetch Vector Data Into Caches WT1 */
/* #undef HAVE_PREFETCHWT1 */
/* Define to 1 to support Digital Random Number Generator */
#define HAVE_RDRND 1
/* Define to 1 if you have the `realloc' function. */
#define HAVE_REALLOC 1
/* Define to 1 to support Secure Hash Algorithm Extension */
/* #undef HAVE_SHA */
/* Define to 1 if you have the `sinf' function. */
#define HAVE_SINF 1
/* Define to 1 if you have the `sqrtf' function. */
#define HAVE_SQRTF 1
/* Define to 1 to support Streaming SIMD Extensions */
#define HAVE_SSE 1
/* Define to 1 to support Streaming SIMD Extensions */
#define HAVE_SSE2 1
/* Define to 1 to support Streaming SIMD Extensions 3 */
#define HAVE_SSE3 1
/* Define to 1 to support Streaming SIMD Extensions 4.1 */
#define HAVE_SSE4_1 1
/* Define to 1 to support Streaming SIMD Extensions 4.2 */
#define HAVE_SSE4_2 1
/* Define to 1 to support AMD Streaming SIMD Extensions 4a */
/* #undef HAVE_SSE4a */
/* Define to 1 to support Supplemental Streaming SIMD Extensions 3 */
#define HAVE_SSSE3 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Support VSX instructions */
/* #undef HAVE_VSX */
/* Define to 1 to support eXtended Operations Extensions */
/* #undef HAVE_XOP */
/* Force internal FFT even if libfftw is available */
#undef LIQUID_FFTOVERRIDE
/* Force overriding of SIMD (use portable C code) */
/* #undef LIQUID_SIMDOVERRIDE */
/* Enable strict program exit on error */
/* #undef LIQUID_STRICT_EXIT */
/* Suppress printing errors to stderr */
/* #undef LIQUID_SUPPRESS_ERROR_OUTPUT */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "joseph@liquidsdr.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "liquid-dsp"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "liquid-dsp 1.5"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "liquid-dsp"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.5"
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long int', as computed by sizeof. */
#define SIZEOF_LONG_INT 8
/* The size of `long long int', as computed by sizeof. */
#define SIZEOF_LONG_LONG_INT 8
/* The size of `short int', as computed by sizeof. */
#define SIZEOF_SHORT_INT 2
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#define STDC_HEADERS 1
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT8_T */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint8_t */
#endif // __LIQUID_CONFIG_H__

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

1881
external/liquid-dsp/makefile.mingw32 vendored Normal file

File diff suppressed because it is too large Load Diff

1881
external/liquid-dsp/makefile.mingw64 vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*
LodePNG version 20160501
LodePNG version 20180819
Copyright (c) 2005-2016 Lode Vandevenne
Copyright (c) 2005-2018 Lode Vandevenne
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -255,6 +255,7 @@ const char* lodepng_error_text(unsigned code);
typedef struct LodePNGDecompressSettings LodePNGDecompressSettings;
struct LodePNGDecompressSettings
{
/* Check LodePNGDecoderSettings for more ignorable errors such as ignore_crc */
unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/
/*use custom zlib decoder instead of built in one (default: null)*/
@ -409,23 +410,35 @@ typedef struct LodePNGInfo
/*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/
unsigned compression_method;/*compression method of the original file. Always 0.*/
unsigned filter_method; /*filter method of the original file*/
unsigned interlace_method; /*interlace method of the original file*/
unsigned interlace_method; /*interlace method of the original file: 0=none, 1=Adam7*/
LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
/*
suggested background color chunk (bKGD)
This color uses the same color mode as the PNG (except alpha channel), which can be 1-bit to 16-bit.
Suggested background color chunk (bKGD)
For greyscale PNGs, r, g and b will all 3 be set to the same. When encoding
the encoder writes the red one. For palette PNGs: When decoding, the RGB value
will be stored, not a palette index. But when encoding, specify the index of
the palette in background_r, the other two are then ignored.
This uses the same color mode and bit depth as the PNG (except no alpha channel),
with values truncated to the bit depth in the unsigned integer.
The decoder does not use this background color to edit the color of pixels.
For greyscale and palette PNGs, the value is stored in background_r. The values
in background_g and background_b are then unused.
So when decoding, you may get these in a different color mode than the one you requested
for the raw pixels.
When encoding with auto_convert, you must use the color model defined in info_png.color for
these values. The encoder normally ignores info_png.color when auto_convert is on, but will
use it to interpret these values (and convert copies of them to its chosen color model).
When encoding, avoid setting this to an expensive color, such as a non-grey value
when the image is grey, or the compression will be worse since it will be forced to
write the PNG with a more expensive color mode (when auto_convert is on).
The decoder does not use this background color to edit the color of pixels. This is a
completely optional metadata feature.
*/
unsigned background_defined; /*is a suggested background color given?*/
unsigned background_r; /*red component of suggested background color*/
unsigned background_r; /*red/grey/palette component of suggested background color*/
unsigned background_g; /*green component of suggested background color*/
unsigned background_b; /*blue component of suggested background color*/
@ -436,6 +449,10 @@ typedef struct LodePNGInfo
text_strings, while text_keys are keywords that give a short description what
the actual text represents, e.g. Title, Author, Description, or anything else.
All the string fields below including keys, names and language tags are null terminated.
The PNG specification uses null characters for the keys, names and tags, and forbids null
characters to appear in the main text which is why we can use null termination everywhere here.
A keyword is minimum 1 character and maximum 79 characters long. It's
discouraged to use a single line length longer than 79 characters for texts.
@ -468,11 +485,86 @@ typedef struct LodePNGInfo
unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/
/*
unknown chunks
There are 3 buffers, one for each position in the PNG where unknown chunks can appear
each buffer contains all unknown chunks for that position consecutively
The 3 buffers are the unknown chunks between certain critical chunks:
0: IHDR-PLTE, 1: PLTE-IDAT, 2: IDAT-IEND
Color profile related chunks: gAMA, cHRM, sRGB, iCPP
LodePNG does not apply any color conversions on pixels in the encoder or decoder and does not interpret these color
profile values. It merely passes on the information. If you wish to use color profiles and convert colors, please
use these values with a color management library.
See the PNG, ICC and sRGB specifications for more information about the meaning of these values.
*/
/* gAMA chunk: optional, overridden by sRGB or iCCP if those are present. */
unsigned gama_defined; /* Whether a gAMA chunk is present (0 = not present, 1 = present). */
unsigned gama_gamma; /* Gamma exponent times 100000 */
/* cHRM chunk: optional, overridden by sRGB or iCCP if those are present. */
unsigned chrm_defined; /* Whether a cHRM chunk is present (0 = not present, 1 = present). */
unsigned chrm_white_x; /* White Point x times 100000 */
unsigned chrm_white_y; /* White Point y times 100000 */
unsigned chrm_red_x; /* Red x times 100000 */
unsigned chrm_red_y; /* Red y times 100000 */
unsigned chrm_green_x; /* Green x times 100000 */
unsigned chrm_green_y; /* Green y times 100000 */
unsigned chrm_blue_x; /* Blue x times 100000 */
unsigned chrm_blue_y; /* Blue y times 100000 */
/*
sRGB chunk: optional. May not appear at the same time as iCCP.
If gAMA is also present gAMA must contain value 45455.
If cHRM is also present cHRM must contain respectively 31270,32900,64000,33000,30000,60000,15000,6000.
*/
unsigned srgb_defined; /* Whether an sRGB chunk is present (0 = not present, 1 = present). */
unsigned srgb_intent; /* Rendering intent: 0=perceptual, 1=rel. colorimetric, 2=saturation, 3=abs. colorimetric */
/*
iCCP chunk: optional. May not appear at the same time as sRGB.
LodePNG does not parse or use the ICC profile (except its color space header field for an edge case), a
separate library to handle the ICC data (not included in LodePNG) format is needed to use it for color
management and conversions.
For encoding, if iCCP is present, gAMA and cHRM are recommended to be added as well with values that match the ICC
profile as closely as possible, if you wish to do this you should provide the correct values for gAMA and cHRM and
enable their '_defined' flags since LodePNG will not automatically compute them from the ICC profile.
For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-grey
PNG color types and a "GRAY" profile for grey PNG color types. If you disable auto_convert, you must ensure
the ICC profile type matches your requested color type, else the encoder gives an error. If auto_convert is
enabled (the default), and the ICC profile is not a good match for the pixel data, this will result in an encoder
error if the pixel data has non-grey pixels for a GRAY profile, or a silent less-optimal compression of the pixel
data if the pixels could be encoded as greyscale but the ICC profile is RGB.
To avoid this do not set an ICC profile in the image unless there is a good reason for it, and when doing so
make sure you compute it carefully to avoid the above problems.
*/
unsigned iccp_defined; /* Whether an iCCP chunk is present (0 = not present, 1 = present). */
char* iccp_name; /* Null terminated string with profile name, 1-79 bytes */
/*
The ICC profile in iccp_profile_size bytes.
Don't allocate this buffer yourself. Use the init/cleanup functions
correctly and use lodepng_set_icc and lodepng_clear_icc.
*/
unsigned char* iccp_profile;
unsigned iccp_profile_size; /* The size of iccp_profile in bytes */
/* End of color profile related chunks */
/*
unknown chunks: chunks not known by LodePNG, passed on byte for byte.
There are 3 buffers, one for each position in the PNG where unknown chunks can appear.
Each buffer contains all unknown chunks for that position consecutively.
The 3 positions are:
0: between IHDR and PLTE, 1: between PLTE and IDAT, 2: between IDAT and IEND.
For encoding, do not store critical chunks or known chunks that are enabled with a "_defined" flag
above in here, since the encoder will blindly follow this and could then encode an invalid PNG file
(such as one with two IHDR chunks or the disallowed combination of sRGB with iCCP). But do use
this if you wish to store an ancillary chunk that is not supported by LodePNG (such as sPLT or hIST),
or any non-standard PNG chunk.
Do not allocate or traverse this data yourself. Use the chunk traversing functions declared
later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct.
*/
@ -488,12 +580,16 @@ void lodepng_info_cleanup(LodePNGInfo* info);
unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
void lodepng_clear_text(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/
unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str); /*push back both texts at once*/
void lodepng_clear_text(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/
void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/
unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag,
const char* transkey, const char* str); /*push back the 4 texts of 1 chunk at once*/
void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/
/*replaces if exists*/
unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size);
void lodepng_clear_icc(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
/*
@ -520,7 +616,14 @@ typedef struct LodePNGDecoderSettings
{
LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/
/* Check LodePNGDecompressSettings for more ignorable errors such as ignore_adler32 */
unsigned ignore_crc; /*ignore CRC checksums*/
unsigned ignore_critical; /*ignore unknown critical chunks*/
unsigned ignore_end; /*ignore issues at end of file if possible (missing IEND chunk, too large chunk, ...)*/
/* TODO: make a system involving warnings with levels and a strict mode instead. Other potentially recoverable
errors: srgb rendering intent value, size of content of ancillary chunks, more than 79 characters for some
strings, placement/combination rules for ancillary chunks, crc of unknown chunks, allowed characters
in string keys, etc... */
unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/
@ -554,24 +657,30 @@ typedef enum LodePNGFilterStrategy
LFS_PREDEFINED
} LodePNGFilterStrategy;
/*Gives characteristics about the colors of the image, which helps decide which color model to use for encoding.
Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.*/
/*Gives characteristics about the integer RGBA colors of the image (count, alpha channel usage, bit depth, ...),
which helps decide which color model to use for encoding.
Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.
NOTE: This is not related to the ICC color profile, search "iccp_profile" instead to find the ICC/chromacity/...
fields in this header file.*/
typedef struct LodePNGColorProfile
{
unsigned colored; /*not greyscale*/
unsigned key; /*if true, image is not opaque. Only if true and alpha is false, color key is possible.*/
unsigned short key_r; /*these values are always in 16-bit bitdepth in the profile*/
unsigned key; /*image is not opaque and color key is possible instead of full alpha*/
unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/
unsigned short key_g;
unsigned short key_b;
unsigned alpha; /*alpha channel or alpha palette required*/
unsigned alpha; /*image is not opaque and alpha channel or alpha palette required*/
unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16.*/
unsigned char palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order*/
unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for greyscale only. 16 if 16-bit per channel required.*/
size_t numpixels;
} LodePNGColorProfile;
void lodepng_color_profile_init(LodePNGColorProfile* profile);
/*Get a LodePNGColorProfile of the image.*/
/*Get a LodePNGColorProfile of the image. The profile must already have been inited.
NOTE: This is not related to the ICC color profile, search "iccp_profile" instead to find the ICC/chromacity/...
fields in this header file.*/
unsigned lodepng_get_color_profile(LodePNGColorProfile* profile,
const unsigned char* image, unsigned w, unsigned h,
const LodePNGColorMode* mode_in);
@ -653,7 +762,7 @@ unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h,
/*
Read the PNG header, but not the actual data. This returns only the information
that is in the header chunk of the PNG, such as width, height and color type. The
that is in the IHDR chunk of the PNG, such as width, height and color type. The
information is placed in the info_png field of the LodePNGState.
*/
unsigned lodepng_inspect(unsigned* w, unsigned* h,
@ -674,11 +783,23 @@ The lodepng_chunk functions are normally not needed, except to traverse the
unknown chunks stored in the LodePNGInfo struct, or add new ones to it.
It also allows traversing the chunks of an encoded PNG file yourself.
PNG standard chunk naming conventions:
First byte: uppercase = critical, lowercase = ancillary
Second byte: uppercase = public, lowercase = private
Third byte: must be uppercase
Fourth byte: uppercase = unsafe to copy, lowercase = safe to copy
The chunk pointer always points to the beginning of the chunk itself, that is
the first byte of the 4 length bytes.
In the PNG file format, chunks have the following format:
-4 bytes length: length of the data of the chunk in bytes (chunk itself is 12 bytes longer)
-4 bytes chunk name (ASCII a-z,A-Z only, see below)
-length bytes of data (may be 0 bytes if length was 0)
-4 bytes of CRC, computed on chunk name + data
The first chunk starts at the 8th byte of the PNG file, the entire rest of the file
exists out of concatenated chunks with the above format.
PNG standard chunk ASCII naming conventions:
-First byte: uppercase = critical, lowercase = ancillary
-Second byte: uppercase = public, lowercase = private
-Third byte: must be uppercase
-Fourth byte: uppercase = unsafe to copy, lowercase = safe to copy
*/
/*
@ -713,7 +834,12 @@ unsigned lodepng_chunk_check_crc(const unsigned char* chunk);
/*generates the correct CRC from the data and puts it in the last 4 bytes of the chunk*/
void lodepng_chunk_generate_crc(unsigned char* chunk);
/*iterate to next chunks. don't use on IEND chunk, as there is no next chunk then*/
/*
Iterate to next chunks, allows iterating through all chunks of the PNG file. Expects at least 4 readable
bytes of memory in the input pointer. Will output pointer to the start of the next chunk or the end of the
file if there is no more chunk after this. Start this process at the 8th byte of the PNG file. In a non-corrupt
PNG file, the last chunk should have name "IEND".
*/
unsigned char* lodepng_chunk_next(unsigned char* chunk);
const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk);
@ -890,12 +1016,15 @@ TODO:
[.] test if there are no memory leaks or security exploits - done a lot but needs to be checked often
[.] check compatibility with various compilers - done but needs to be redone for every newer version
[X] converting color to 16-bit per channel types
[ ] read all public PNG chunk types (but never let the color profile and gamma ones touch RGB values)
[X] support color profile chunk types (but never let them touch RGB values by default)
[ ] support all public PNG chunk types
[ ] make sure encoder generates no chunks with size > (2^31)-1
[ ] partial decoding (stream processing)
[X] let the "isFullyOpaque" function check color keys and transparent palettes too
[X] better name for the variables "codes", "codesD", "codelengthcodes", "clcl" and "lldl"
[ ] don't stop decoding on errors like 69, 57, 58 (make warnings)
[ ] make warnings like: oob palette, checksum fail, data after iend, wrong/unknown crit chunk, no null terminator in text, ...
[ ] errors with line numbers (and version)
[ ] let the C++ wrapper catch exceptions coming from the standard library and return LodePNG error codes
[ ] allow user to provide custom color conversion functions, e.g. for premultiplied alpha, padding bits or not, ...
[ ] allow user to give data (void*) to custom allocator
@ -1566,6 +1695,8 @@ For decoding:
state.decoder.zlibsettings.ignore_adler32: ignore ADLER32 checksums
state.decoder.zlibsettings.custom_...: use custom inflate function
state.decoder.ignore_crc: ignore CRC checksums
state.decoder.ignore_critical: ignore unknown critical chunks
state.decoder.ignore_end: ignore missing IEND chunk. May fail if this corruption causes other errors
state.decoder.color_convert: convert internal PNG color to chosen one
state.decoder.read_text_chunks: whether to read in text metadata chunks
state.decoder.remember_unknown_chunks: whether to read in unknown chunks
@ -1607,6 +1738,14 @@ yyyymmdd.
Some changes aren't backwards compatible. Those are indicated with a (!)
symbol.
*) 19 aug 2018 (!): fixed color mode bKGD is encoded with and made it use palette
index in case of palette.
*) 10 aug 2018 (!): added support for gAMA, cHRM, sRGB and iCCP chunks. This
change is backwards compatible unless you relied on unknown_chunks for those.
*) 11 jun 2018: less restrictive check for pixel size integer overflow
*) 14 jan 2018: allow optionally ignoring a few more recoverable errors
*) 17 sep 2017: fix memory leak for some encoder input error cases
*) 27 nov 2016: grey+alpha auto color model detection bugfix
*) 18 apr 2016: Changed qsort to custom stable sort (for platforms w/o qsort).
*) 09 apr 2016: Fixed colorkey usage detection, and better file loading (within
the limits of pure C90).
@ -1755,5 +1894,5 @@ Domain: gmail dot com.
Account: lode dot vandevenne.
Copyright (c) 2005-2016 Lode Vandevenne
Copyright (c) 2005-2018 Lode Vandevenne
*/

BIN
external/msvc/x64/libwinpthread-1.dll vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
external/msvc/x86/libgcc_s_sjlj-1.dll vendored Normal file

Binary file not shown.

BIN
external/msvc/x86/libwinpthread-1.dll vendored Normal file

Binary file not shown.

Binary file not shown.

29
external/rs232/README vendored Normal file
View File

@ -0,0 +1,29 @@
Cross-platform serial / RS232 library
Version 0.21, 11/10/2015
The MIT License (MIT)
Supported platforms:
- Windows (XP / Win7, possibly 8 and 10)
- Linux
- MacOS X
Copyright (c) 2007 - 2015 Frédéric Meslin
Contact: fredericmeslin@hotmail.com, @marzacdev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

13
external/rs232/README.md vendored Normal file
View File

@ -0,0 +1,13 @@
# rs232
C / C++ RS232 cross-platform serial library
Version 0.21, 11/10/2015
Supported platforms:
- Windows (XP / Win7, possibly 8 and 10)
- Linux
- MacOS X
Copyright (c) 2013-2015 Frédéric Meslin
Email: fredericmeslin@hotmail.com
Website: www.fredslab.net
Twitter: @marzacdev

261
external/rs232/rs232-linux.cpp vendored Normal file
View File

@ -0,0 +1,261 @@
/*
Cross-platform serial / RS232 library
Version 0.21, 11/10/2015
-> LINUX and MacOS implementation
-> rs232-linux.c
The MIT License (MIT)
Copyright (c) 2013-2015 Frédéric Meslin, Florent Touchard
Email: fredericmeslin@hotmail.com
Website: www.fredslab.net
Twitter: @marzacdev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#if defined(__unix__) || defined(__unix) || \
defined(__APPLE__) && defined(__MACH__)
#define _DARWIN_C_SOURCE
#include "rs232.h"
#include <unistd.h>
#define __USE_MISC // For CRTSCTS
#include <termios.h>
#include <fcntl.h>
#include <dirent.h>
#define __USE_SVID // For strdup
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/*****************************************************************************/
/** Base name for COM devices */
#if defined(__APPLE__) && defined(__MACH__)
static const char * devBases[] = {
"tty."
};
static int noBases = 1;
#else
static const char * devBases[] = {
"ttyACM", "ttyUSB", "rfcomm", "ttyS"
};
static int noBases = 4;
#endif
/*****************************************************************************/
typedef struct {
char * port;
int handle;
} COMDevice;
#define COM_MAXDEVICES 64
static COMDevice comDevices[COM_MAXDEVICES];
static int noDevices = 0;
/*****************************************************************************/
/** Private functions */
void _AppendDevices(const char * base);
int _BaudFlag(int BaudRate);
/*****************************************************************************/
int comEnumerate()
{
for (int i = 0; i < noDevices; i++) {
if (comDevices[i].port) free(comDevices[i].port);
comDevices[i].port = NULL;
}
noDevices = 0;
for (int i = 0; i < noBases; i++)
_AppendDevices(devBases[i]);
return noDevices;
}
void comTerminate()
{
comCloseAll();
for (int i = 0; i < noDevices; i++) {
if (comDevices[i].port) free(comDevices[i].port);
comDevices[i].port = NULL;
}
}
int comGetNoPorts()
{
return noDevices;
}
/*****************************************************************************/
int comFindPort(const char * name)
{
int p;
for (p = 0; p < noDevices; p++)
if (strcmp(name, comDevices[p].port) == 0)
return p;
return -1;
}
const char * comGetInternalName(int index)
{
#define COM_MAXNAME 128
static char name[COM_MAXNAME];
if (index >= noDevices || index < 0)
return NULL;
sprintf(name, "/dev/%s", comDevices[index].port);
return name;
}
const char * comGetPortName(int index) {
if (index >= noDevices || index < 0)
return NULL;
return comDevices[index].port;
}
/*****************************************************************************/
int comOpen(int index, int baudrate)
{
if (index >= noDevices || index < 0)
return 0;
// Close if already open
COMDevice * com = &comDevices[index];
if (com->handle >= 0) comClose(index);
// Open port
printf("Try %s \n", comGetInternalName(index));
int handle = open(comGetInternalName(index), O_RDWR | O_NOCTTY | O_NDELAY);
if (handle < 0)
return 0;
printf("Open %s \n", comGetInternalName(index));
// General configuration
struct termios config;
memset(&config, 0, sizeof(config));
tcgetattr(handle, &config);
config.c_iflag &= ~(INLCR | ICRNL);
config.c_iflag |= IGNPAR | IGNBRK;
config.c_oflag &= ~(OPOST | ONLCR | OCRNL);
config.c_cflag &= ~(PARENB | PARODD | CSTOPB | CSIZE | CRTSCTS);
config.c_cflag |= CLOCAL | CREAD | CS8;
config.c_lflag &= ~(ICANON | ISIG | ECHO);
int flag = _BaudFlag(baudrate);
cfsetospeed(&config, flag);
cfsetispeed(&config, flag);
// Timeouts configuration
config.c_cc[VTIME] = 1;
config.c_cc[VMIN] = 0;
//fcntl(handle, F_SETFL, FNDELAY);
// Validate configuration
if (tcsetattr(handle, TCSANOW, &config) < 0) {
close(handle);
return 0;
}
com->handle = handle;
return 1;
}
void comClose(int index)
{
if (index >= noDevices || index < 0)
return;
COMDevice * com = &comDevices[index];
if (com->handle < 0)
return;
tcdrain(com->handle);
close(com->handle);
com->handle = -1;
}
void comCloseAll()
{
for (int i = 0; i < noDevices; i++)
comClose(i);
}
/*****************************************************************************/
int comWrite(int index, const char * buffer, size_t len)
{
if (index >= noDevices || index < 0)
return 0;
if (comDevices[index].handle <= 0)
return 0;
int res = write(comDevices[index].handle, buffer, len);
if (res < 0)
res = 0;
return res;
}
int comRead(int index, char * buffer, size_t len)
{
if (index >= noDevices || index < 0)
return 0;
if (comDevices[index].handle <= 0)
return 0;
int res = read(comDevices[index].handle, buffer, len);
if (res < 0)
res = 0;
return res;
}
/*****************************************************************************/
int _BaudFlag(int BaudRate)
{
switch(BaudRate)
{
case 50: return B50; break;
case 110: return B110; break;
case 134: return B134; break;
case 150: return B150; break;
case 200: return B200; break;
case 300: return B300; break;
case 600: return B600; break;
case 1200: return B1200; break;
case 1800: return B1800; break;
case 2400: return B2400; break;
case 4800: return B4800; break;
case 9600: return B9600; break;
case 19200: return B19200; break;
case 38400: return B38400; break;
case 57600: return B57600; break;
case 115200: return B115200; break;
case 230400: return B230400; break;
default : return B0; break;
}
}
void _AppendDevices(const char * base)
{
int baseLen = strlen(base);
struct dirent * dp;
// Enumerate devices
DIR * dirp = opendir("/dev");
while ((dp = readdir(dirp)) && noDevices < COM_MAXDEVICES) {
if (strlen(dp->d_name) >= baseLen) {
if (memcmp(base, dp->d_name, baseLen) == 0) {
COMDevice * com = &comDevices[noDevices ++];
com->port = (char *) strdup(dp->d_name);
com->handle = -1;
}
}
}
closedir(dirp);
}
#endif // unix

253
external/rs232/rs232-win.cpp vendored Normal file
View File

@ -0,0 +1,253 @@
/*
Cross-platform serial / RS232 library
Version 0.21, 11/10/2015
-> WIN32 implementation
-> rs232-win.c
The MIT License (MIT)
Copyright (c) 2013-2015 Frédéric Meslin, Florent Touchard
Email: fredericmeslin@hotmail.com
Website: www.fredslab.net
Twitter: @marzacdev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef _WIN32
#include "rs232.h"
#include <stdio.h>
#include <string.h>
#include <Windows.h>
/*****************************************************************************/
typedef struct {
int port;
void * handle;
} COMDevice;
/*****************************************************************************/
#define COM_MAXDEVICES 64
static COMDevice comDevices[COM_MAXDEVICES];
static int noDevices = 0;
#define COM_MINDEVNAME 16384
const char * comPtn = "COM???";
/*****************************************************************************/
const char * findPattern(const char * string, const char * pattern, int * value);
const char * portInternalName(int index);
/*****************************************************************************/
int comEnumerate()
{
// Get devices information text
size_t size = COM_MINDEVNAME;
char * list = (char *) malloc(size);
SetLastError(0);
QueryDosDeviceA(NULL, list, size);
while (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
size *= 2;
char * nlist = (char *) realloc(list, size);
if (!nlist) {
free(list);
return 0;
}
list = nlist;
SetLastError(0);
QueryDosDeviceA(NULL, list, size);
}
// Gather all COM ports
int port;
const char * nlist = findPattern(list, comPtn, &port);
noDevices = 0;
while(port > 0 && noDevices < COM_MAXDEVICES) {
COMDevice * com = &comDevices[noDevices ++];
com->port = port;
com->handle = 0;
nlist = findPattern(nlist, comPtn, &port);
}
free(list);
return noDevices;
}
void comTerminate()
{
comCloseAll();
}
int comGetNoPorts()
{
return noDevices;
}
/*****************************************************************************/
const char * comGetPortName(int index)
{
#define COM_MAXNAME 32
static char name[COM_MAXNAME];
if (index < 0 || index >= noDevices)
return 0;
sprintf(name, "COM%i", comDevices[index].port);
return name;
}
int comFindPort(const char * name)
{
for (int i = 0; i < noDevices; i++)
if (strcmp(name, comGetPortName(i)) == 0)
return i;
return -1;
}
const char * comGetInternalName(int index)
{
#define COM_MAXNAME 32
static char name[COM_MAXNAME];
if (index < 0 || index >= noDevices)
return 0;
sprintf(name, "//./COM%i", comDevices[index].port);
return name;
}
/*****************************************************************************/
int comOpen(int index, int baudrate)
{
DCB config;
COMMTIMEOUTS timeouts;
if (index < 0 || index >= noDevices)
return 0;
// Close if already open
COMDevice * com = &comDevices[index];
if (com->handle) comClose(index);
// Open COM port
void * handle = CreateFileA(comGetInternalName(index), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (handle == INVALID_HANDLE_VALUE)
return 0;
com->handle = handle;
// Prepare read / write timeouts
SetupComm(handle, 64, 64);
timeouts.ReadIntervalTimeout = MAXDWORD;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.WriteTotalTimeoutConstant = 0;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutMultiplier = 0;
SetCommTimeouts(handle, &timeouts);
// Prepare serial communication format
GetCommState(handle, &config);
config.BaudRate = baudrate;
config.fBinary = true;
config.fParity = 0;
config.fErrorChar = 0;
config.fNull = 0;
config.fAbortOnError = 0;
config.ByteSize = 8;
config.Parity = 0;
config.StopBits = 0;
config.EvtChar = '\n';
// Set the port state
if (SetCommState(handle, &config) == 0) {
CloseHandle(handle);
return 0;
}
return 1;
}
void comClose(int index)
{
if (index < 0 || index >= noDevices)
return;
COMDevice * com = &comDevices[index];
if (!com->handle)
return;
CloseHandle(com->handle);
com->handle = 0;
}
void comCloseAll()
{
for (int i = 0; i < noDevices; i++)
comClose(i);
}
/*****************************************************************************/
int comWrite(int index, const char * buffer, size_t len)
{
if (index < 0 || index >= noDevices)
return 0;
COMDevice * com = &comDevices[index];
uint32_t bytes = 0;
WriteFile(com->handle, buffer, len, (LPDWORD)&bytes, NULL);
return bytes;
}
int comRead(int index, char * buffer, size_t len)
{
if (index < 0 || index >= noDevices)
return 0;
COMDevice * com = &comDevices[index];
uint32_t bytes = 0;
ReadFile(com->handle, buffer, len, (LPDWORD)&bytes, NULL);
return bytes;
}
/*****************************************************************************/
const char * findPattern(const char * string, const char * pattern, int * value)
{
char c, n = 0;
const char * sp = string;
const char * pp = pattern;
// Check for the string pattern
while (1) {
c = *sp ++;
if (c == '\0') {
if (*pp == '?') break;
if (*sp == '\0') break;
n = 0;
pp = pattern;
}else{
if (*pp == '?') {
// Expect a digit
if (c >= '0' && c <= '9') {
n = n * 10 + (c - '0');
if (*pp ++ == '\0') break;
}else{
n = 0;
pp = comPtn;
}
}else{
// Expect a character
if (c == *pp) {
if (*pp ++ == '\0') break;
}else{
n = 0;
pp = comPtn;
}
}
}
}
// Return the value
* value = n;
return sp;
}
#endif // _WIN32

156
external/rs232/rs232.h vendored Normal file
View File

@ -0,0 +1,156 @@
/*
Cross-platform serial / RS232 library
Version 0.21, 11/10/2015
-> All platforms header
-> rs232.h
The MIT License (MIT)
Copyright (c) 2013-2015 Frédéric Meslin, Florent Touchard
Email: fredericmeslin@hotmail.com
Website: www.fredslab.net
Twitter: @marzacdev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef RS232_H
#define RS232_H
// TODO: convert to C++ class
//#ifdef __cplusplus
//extern "C" {
//#endif
#include <stdint.h>
#include <stdlib.h>
/*****************************************************************************/
/* Doxywizard specific */
/**
* \mainpage RS232
* \section intro_sec C / C++ RS232 cross-platform serial library
* <b>Version 0.21 - 11/10/2015</b>
*
* Supported platforms:
* - Windows (XP / Win7, possibly 8 and 10)
* - Linux
* - MacOS X
*
* Copyright (c) 2013-2015 Fr&eacute;d&eacute;ric Meslin, Florent Touchard <br>
* Email: fredericmeslin@hotmail.com <br>
* Website: www.fredslab.net <br>
* Twitter: \@marzacdev <br>
*/
/*****************************************************************************/
/**
* \fn int comEnumerate()
* \brief Enumerate available serial ports (Serial, USB serial, Bluetooth serial)
* \return number of enumerated ports
*/
int comEnumerate();
/**
* \fn int comGetNoPorts()
* \brief Return the number of enumerated ports
* \return number of enumerated ports
*/
int comGetNoPorts();
/**
* \fn int comTerminate()
* \brief Release ports and memory resources used by the library
*/
void comTerminate();
/**
* \fn const char * comGetPortName(int index)
* \brief Get port user-friendly name
* \param[in] index port index
* \return null terminated port name
*/
const char * comGetPortName(int index);
/**
* \fn const char * comGetInternalName(int index)
* \brief Get port operating-system name
* \param[in] index port index
* \return null terminated port name
*/
const char * comGetInternalName(int index);
/**
* \fn int comFindPort(const char * name)
* \brief Try to find a port given its user-friendly name
* \param[in] name port name (case sensitive)
* \return index of found port or -1 if not enumerated
*/
int comFindPort(const char * name);
/*****************************************************************************/
/**
* \fn int comOpen(int index, int baudrate)
* \brief Try to open a port at a specific baudrate
* \brief (No parity, single stop bit, no hardware flow control)
* \param[in] index port index
* \param[in] baudrate port baudrate
* \return 1 if opened, 0 if not available
*/
int comOpen(int index, int baudrate);
/**
* \fn void comClose(int index)
* \brief Close an opened port
* \param[in] index port index
*/
void comClose(int index);
/**
* \fn void comCloseAll()
* \brief Close all opened ports
*/
void comCloseAll();
/*****************************************************************************/
/**
* \fn int comWrite(int index, const char * buffer, size_t len)
* \brief Write data to the port (non-blocking)
* \param[in] index port index
* \param[in] buffer pointer to transmit buffer
* \param[in] len length of transmit buffer in bytes
* \return number of bytes transferred
*/
int comWrite(int index, const char * buffer, size_t len);
/**
* \fn int comRead(int index, const char * buffer, size_t len)
* \brief Read data from the port (non-blocking)
* \param[in] index port index
* \param[in] buffer pointer to receive buffer
* \param[in] len length of receive buffer in bytes
* \return number of bytes transferred
*/
int comRead(int index, char * buffer, size_t len);
//#ifdef __cplusplus
//}
//#endif
#endif // RS232_H

View File

@ -1,212 +0,0 @@
#pragma once
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
devpkey.h
Abstract:
Defines property keys for the Plug and Play Device Property API.
Author:
Jim Cavalaris (jamesca) 10-14-2003
Environment:
User-mode only.
Revision History:
14-October-2003 jamesca
Creation and initial implementation.
20-June-2006 dougb
Copied Jim's version replaced "DEFINE_DEVPROPKEY(DEVPKEY_" with "DEFINE_PROPERTYKEY(PKEY_"
--*/
//#include <devpropdef.h>
//
// _NAME
//
DEFINE_PROPERTYKEY(PKEY_NAME, 0xb725f130, 0x47ef, 0x101a, 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac, 10); // DEVPROP_TYPE_STRING
//
// Device properties
// These PKEYs correspond to the old setupapi SPDRP_XXX properties
//
DEFINE_PROPERTYKEY(PKEY_Device_DeviceDesc, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_HardwareIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_CompatibleIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_Service, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_Class, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_ClassGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 10); // DEVPROP_TYPE_GUID
DEFINE_PROPERTYKEY(PKEY_Device_Driver, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 11); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_ConfigFlags, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 12); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_Manufacturer, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_LocationInfo, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 15); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_PDOName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 16); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_Capabilities, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 17); // DEVPROP_TYPE_UNINT32
DEFINE_PROPERTYKEY(PKEY_Device_UINumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 18); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_UpperFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 19); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_LowerFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 20); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_BusTypeGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 21); // DEVPROP_TYPE_GUID
DEFINE_PROPERTYKEY(PKEY_Device_LegacyBusType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 22); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_BusNumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 23); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_EnumeratorName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_Security, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
DEFINE_PROPERTYKEY(PKEY_Device_SecuritySDS, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DevType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 27); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_Exclusive, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 28); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_Characteristics, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 29); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_Address, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 30); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_UINumberDescFormat, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 31); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_PowerData, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 32); // DEVPROP_TYPE_BINARY
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicy, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 33); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyDefault, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 34); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyOverride, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 35); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_InstallState, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 36); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_LocationPaths, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 37); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_BaseContainerId, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 38); // DEVPROP_TYPE_GUID
//
// Device properties
// These PKEYs correspond to a device's status and problem code
//
DEFINE_PROPERTYKEY(PKEY_Device_DevNodeStatus, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 2); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_ProblemCode, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 3); // DEVPROP_TYPE_UINT32
//
// Device properties
// These PKEYs correspond to device relations
//
DEFINE_PROPERTYKEY(PKEY_Device_EjectionRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 4); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_RemovalRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 5); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_PowerRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 6); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_BusRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 7); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_Parent, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 8); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_Children, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 9); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_Siblings, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 10); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_TransportRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 11); // DEVPROP_TYPE_STRING_LIST
//
// Other Device properties
//
DEFINE_PROPERTYKEY(PKEY_Device_Reported, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 2); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Device_Legacy, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 3); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Device_InstanceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_ContainerId, 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 2); // DEVPROP_TYPE_GUID
DEFINE_PROPERTYKEY(PKEY_Device_ModelId, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 2); // DEVPROP_TYPE_GUID
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameAttributes, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 3); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_ManufacturerAttributes, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 4); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_PresenceNotForDevice, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 5); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Numa_Proximity_Domain, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 1); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_DHP_Rebalance_Policy, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 2); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 3); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_BusReportedDeviceDesc, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 4); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_InstallInProgress, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 9); // DEVPROP_TYPE_BOOLEAN
//
// Device driver properties
//
DEFINE_PROPERTYKEY(PKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2); // DEVPROP_TYPE_FILETIME
DEFINE_PROPERTYKEY(PKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverDesc, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 4); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfPath, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 5); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSection, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 6); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSectionExt, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 7); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_MatchingDeviceId, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 8); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverPropPageProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 10); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverCoInstallers, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 11); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerTags, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 12); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerExceptions, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 13); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_Device_DriverRank, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 14); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_DriverLogoLevel, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 15); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_Device_NoConnectSound, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Device_GenericDriverInstalled, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 18); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Device_AdditionalSoftwareRequested, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 19);// DEVPROP_TYPE_BOOLEAN
//
// Device safe-removal properties
//
DEFINE_PROPERTYKEY(PKEY_Device_SafeRemovalRequired, 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 2); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_Device_SafeRemovalRequiredOverride, 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 3);// DEVPROP_TYPE_BOOLEAN
//
// Device properties that were set by the driver package that was installed
// on the device.
//
DEFINE_PROPERTYKEY(PKEY_DrvPkg_Model, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 2); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DrvPkg_VendorWebSite, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 3); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DrvPkg_DetailedDescription, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 4); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DrvPkg_DocumentationLink, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 5); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DrvPkg_Icon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 6); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_DrvPkg_BrandingIcon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 7); // DEVPROP_TYPE_STRING_LIST
//
// Device setup class properties
// These PKEYs correspond to the old setupapi SPCRP_XXX properties
//
DEFINE_PROPERTYKEY(PKEY_DeviceClass_UpperFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 19); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_DeviceClass_LowerFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 20); // DEVPROP_TYPE_STRING_LIST
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Security, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
DEFINE_PROPERTYKEY(PKEY_DeviceClass_SecuritySDS, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_DevType, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 27); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Exclusive, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 28); // DEVPROP_TYPE_UINT32
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Characteristics, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 29); // DEVPROP_TYPE_UINT32
//
// Device setup class properties
// These PKEYs correspond to registry values under the device class GUID key
//
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Name, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 2); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassName, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 3); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_Icon, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 4); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassInstaller, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 5); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_PropPageProvider, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 6); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoInstallClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 7); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoDisplayClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 8); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_DeviceClass_SilentInstall, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 9); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoUseClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 10); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_DeviceClass_DefaultService, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 11); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceClass_IconPath, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 12); // DEVPROP_TYPE_STRING_LIST
//
// Other Device setup class properties
//
DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassCoInstallers, 0x713d1703, 0xa2e2, 0x49f5, 0x92, 0x14, 0x56, 0x47, 0x2e, 0xf3, 0xda, 0x5c, 2); // DEVPROP_TYPE_STRING_LIST
//
// Device interface properties
//
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_FriendlyName, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2); // DEVPROP_TYPE_STRING
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Enabled, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 3); // DEVPROP_TYPE_BOOLEAN
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_ClassGuid, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 4); // DEVPROP_TYPE_GUID
//
// Device interface class properties
//
DEFINE_PROPERTYKEY(PKEY_DeviceInterfaceClass_DefaultInterface, 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 2); // DEVPROP_TYPE_STRING

62
external/rtaudio/README.md vendored Normal file
View File

@ -0,0 +1,62 @@
# RtAudio
![Build Status](https://github.com/thestk/rtaudio/actions/workflows/ci.yml/badge.svg)
A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO and WASAPI) operating systems.
By Gary P. Scavone, 2001-2021 (and many other developers!)
This distribution of RtAudio contains the following:
- doc: RtAudio documentation (see doc/html/index.html)
- tests: example RtAudio programs
- include: header and source files necessary for ASIO, DS & OSS compilation
- tests/Windows: Visual C++ .net test program workspace and projects
## Overview
RtAudio is a set of C++ classes that provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X and Windows (DirectSound, ASIO and WASAPI) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:
- object-oriented C++ design
- simple, common API across all supported platforms
- only one source and one header file for easy inclusion in programming projects
- allow simultaneous multi-api support
- support dynamic connection of devices
- provide extensive audio device parameter control
- allow audio device capability probing
- automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping
RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the \ref apinotes section for information specific to each of the supported audio APIs.
## Building
Several build systems are available. These are:
- autotools (`./autogen.sh; make` from git, or `./configure; make` from tarball release)
- CMake (`mkdir build; cd build; ../cmake; make`)
- meson (`meson build; cd build; ninja`)
See `install.txt` for more instructions about how to select the audio backend API. By
default all detected APIs will be enabled.
We recommend using the autotools-based build for packaging purposes. Please note that
RtAudio is designed as a single `.cpp` and `.h` file so that it is easy to copy directly
into a project. In that case you need to define the appropriate flags for the desired
backend APIs.
## FAQ
### Why does audio only come to one ear when I choose 1-channel output?
RtAudio doesn't automatically turn 1-channel output into stereo output with copied values
to each channel, it really only opens one channel. So, if this is the behaviour you want,
you have to do this copying in your audio stream callback.
## Further Reading
For complete documentation on RtAudio, see the doc directory of the distribution or surf to http://www.music.mcgill.ca/~gary/rtaudio/.
## Legal and ethical:
The RtAudio license is similar to the MIT License. Please see [LICENSE](LICENSE).

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,11 @@
and OSS), Macintosh OS X (CoreAudio and Jack), and Windows
(DirectSound, ASIO and WASAPI) operating systems.
RtAudio GitHub site: https://github.com/thestk/rtaudio
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/
RtAudio: realtime audio i/o C++ classes
Copyright (c) 2001-2016 Gary P. Scavone
Copyright (c) 2001-2021 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@ -45,11 +46,25 @@
#ifndef __RTAUDIO_H
#define __RTAUDIO_H
#define RTAUDIO_VERSION "4.1.2"
#define RTAUDIO_VERSION "5.2.0"
#if defined _WIN32 || defined __CYGWIN__
#if defined(RTAUDIO_EXPORT)
#define RTAUDIO_DLL_PUBLIC __declspec(dllexport)
#else
#define RTAUDIO_DLL_PUBLIC
#endif
#else
#if __GNUC__ >= 4
#define RTAUDIO_DLL_PUBLIC __attribute__( (visibility( "default" )) )
#else
#define RTAUDIO_DLL_PUBLIC
#endif
#endif
#include <string>
#include <vector>
#include <exception>
#include <stdexcept>
#include <iostream>
/*! \typedef typedef unsigned long RtAudioFormat;
@ -86,6 +101,7 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
- \e RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
- \e RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
- \e RTAUDIO_ALSA_USE_DEFAULT: Use the "default" PCM device (ALSA only).
- \e RTAUDIO_JACK_DONT_CONNECT: Do not automatically connect ports (JACK only).
By default, RtAudio streams pass and receive audio data from the
client in an interleaved format. By passing the
@ -101,7 +117,7 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
Certain audio APIs offer a number of parameters that influence the
I/O latency of a stream. By default, RtAudio will attempt to set
these parameters internally for robust (glitch-free) performance
(though some APIs, like Windows Direct Sound, make this difficult).
(though some APIs, like Windows DirectSound, make this difficult).
By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream()
function, internal stream settings will be influenced in an attempt
to minimize stream latency, though possibly at the expense of stream
@ -117,6 +133,9 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to
open the "default" PCM device when using the ALSA API. Note that this
will override any specified input or output device id.
If the RTAUDIO_JACK_DONT_CONNECT flag is set, RtAudio will not attempt
to automatically connect the ports of the client to the audio device.
*/
typedef unsigned int RtAudioStreamFlags;
static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1; // Use non-interleaved buffers (default = interleaved).
@ -124,6 +143,7 @@ static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2; // Attempt to s
static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4; // Attempt grab device and prevent use by others.
static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread.
static const RtAudioStreamFlags RTAUDIO_ALSA_USE_DEFAULT = 0x10; // Use the "default" PCM device (ALSA only).
static const RtAudioStreamFlags RTAUDIO_JACK_DONT_CONNECT = 0x20; // Do not automatically connect ports (JACK only).
/*! \typedef typedef unsigned long RtAudioStreamStatus;
\brief RtAudio stream status (over- or underflow) flags.
@ -174,6 +194,7 @@ static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2; // The output
\param userData A pointer to optional data provided by the client
when opening the stream (default = NULL).
\return
To continue normal stream operation, the RtAudioCallback function
should return a value of zero. To stop the stream and drain the
output buffer, the function should return a value of one. To abort
@ -195,7 +216,7 @@ typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
*/
/************************************************************************/
class RtAudioError : public std::exception
class RTAUDIO_DLL_PUBLIC RtAudioError : public std::runtime_error
{
public:
//! Defined RtAudioError types.
@ -205,34 +226,31 @@ class RtAudioError : public std::exception
UNSPECIFIED, /*!< The default, unspecified error type. */
NO_DEVICES_FOUND, /*!< No devices found on system. */
INVALID_DEVICE, /*!< An invalid device ID was specified. */
MEMORY_ERROR, /*!< An error occured during memory allocation. */
MEMORY_ERROR, /*!< An error occurred during memory allocation. */
INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
INVALID_USE, /*!< The function was called incorrectly. */
DRIVER_ERROR, /*!< A system driver error occured. */
SYSTEM_ERROR, /*!< A system error occured. */
THREAD_ERROR /*!< A thread error occured. */
DRIVER_ERROR, /*!< A system driver error occurred. */
SYSTEM_ERROR, /*!< A system error occurred. */
THREAD_ERROR /*!< A thread error occurred. */
};
//! The constructor.
RtAudioError( const std::string& message, Type type = RtAudioError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
//! The destructor.
virtual ~RtAudioError( void ) throw() {}
RtAudioError( const std::string& message,
Type type = RtAudioError::UNSPECIFIED )
: std::runtime_error(message), type_(type) {}
//! Prints thrown error message to stderr.
virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
virtual void printMessage( void ) const
{ std::cerr << '\n' << what() << "\n\n"; }
//! Returns the thrown error message type.
virtual const Type& getType(void) const throw() { return type_; }
virtual const Type& getType(void) const { return type_; }
//! Returns the thrown error message string.
virtual const std::string& getMessage(void) const throw() { return message_; }
//! Returns the thrown error message as a c-style string.
virtual const char* what( void ) const throw() { return message_.c_str(); }
virtual const std::string getMessage(void) const
{ return std::string(what()); }
protected:
std::string message_;
Type type_;
};
@ -258,7 +276,7 @@ typedef void (*RtAudioErrorCallback)( RtAudioError::Type type, const std::string
class RtApi;
class RtAudio
class RTAUDIO_DLL_PUBLIC RtAudio
{
public:
@ -272,38 +290,30 @@ class RtAudio
MACOSX_CORE, /*!< Macintosh OS-X Core Audio API. */
WINDOWS_WASAPI, /*!< The Microsoft WASAPI API. */
WINDOWS_ASIO, /*!< The Steinberg Audio Stream I/O API. */
WINDOWS_DS, /*!< The Microsoft Direct Sound API. */
RTAUDIO_DUMMY /*!< A compilable but non-functional API. */
WINDOWS_DS, /*!< The Microsoft DirectSound API. */
RTAUDIO_DUMMY, /*!< A compilable but non-functional API. */
NUM_APIS /*!< Number of values in this enum. */
};
//! The public device information structure for returning queried values.
struct DeviceInfo {
bool probed; /*!< true if the device capabilities were successfully probed. */
std::string name; /*!< Character string device identifier. */
unsigned int outputChannels; /*!< Maximum output channels supported by device. */
unsigned int inputChannels; /*!< Maximum input channels supported by device. */
unsigned int duplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */
bool isDefaultOutput; /*!< true if this is the default output device. */
bool isDefaultInput; /*!< true if this is the default input device. */
unsigned int outputChannels{}; /*!< Maximum output channels supported by device. */
unsigned int inputChannels{}; /*!< Maximum input channels supported by device. */
unsigned int duplexChannels{}; /*!< Maximum simultaneous input/output channels supported by device. */
bool isDefaultOutput{false}; /*!< true if this is the default output device. */
bool isDefaultInput{false}; /*!< true if this is the default input device. */
std::vector<unsigned int> sampleRates; /*!< Supported sample rates (queried from list of standard rates). */
unsigned int preferredSampleRate; /*!< Preferred sample rate, eg. for WASAPI the system sample rate. */
RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */
// Default constructor.
DeviceInfo()
:probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
isDefaultOutput(false), isDefaultInput(false), preferredSampleRate(0), nativeFormats(0) {}
unsigned int preferredSampleRate{}; /*!< Preferred sample rate, e.g. for WASAPI the system sample rate. */
RtAudioFormat nativeFormats{}; /*!< Bit mask of supported data formats. */
};
//! The structure for specifying input or ouput stream parameters.
//! The structure for specifying input or output stream parameters.
struct StreamParameters {
unsigned int deviceId; /*!< Device index (0 to getDeviceCount() - 1). */
unsigned int nChannels; /*!< Number of channels. */
unsigned int firstChannel; /*!< First channel index on device (default = 0). */
// Default constructor.
StreamParameters()
: deviceId(0), nChannels(0), firstChannel(0) {}
unsigned int deviceId{}; /*!< Device index (0 to getDeviceCount() - 1). */
unsigned int nChannels{}; /*!< Number of channels. */
unsigned int firstChannel{}; /*!< First channel index on device (default = 0). */
};
//! The structure for specifying stream options.
@ -331,7 +341,7 @@ class RtAudio
Certain audio APIs offer a number of parameters that influence the
I/O latency of a stream. By default, RtAudio will attempt to set
these parameters internally for robust (glitch-free) performance
(though some APIs, like Windows Direct Sound, make this difficult).
(though some APIs, like Windows DirectSound, make this difficult).
By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream()
function, internal stream settings will be influenced in an attempt
to minimize stream latency, though possibly at the expense of stream
@ -364,18 +374,14 @@ class RtAudio
RtAudio with Jack, each instance must have a unique client name.
*/
struct StreamOptions {
RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE, RTAUDIO_ALSA_USE_DEFAULT). */
unsigned int numberOfBuffers; /*!< Number of stream buffers. */
RtAudioStreamFlags flags{}; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE, RTAUDIO_ALSA_USE_DEFAULT). */
unsigned int numberOfBuffers{}; /*!< Number of stream buffers. */
std::string streamName; /*!< A stream name (currently used only in Jack). */
int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */
// Default constructor.
StreamOptions()
: flags(0), numberOfBuffers(0), priority(0) {}
int priority{}; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */
};
//! A static function to determine the current RtAudio version.
static std::string getVersion( void ) throw();
static std::string getVersion( void );
//! A static function to determine the available compiled audio APIs.
/*!
@ -383,7 +389,30 @@ class RtAudio
the enumerated list values. Note that there can be more than one
API compiled for certain operating systems.
*/
static void getCompiledApi( std::vector<RtAudio::Api> &apis ) throw();
static void getCompiledApi( std::vector<RtAudio::Api> &apis );
//! Return the name of a specified compiled audio API.
/*!
This obtains a short lower-case name used for identification purposes.
This value is guaranteed to remain identical across library versions.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiName( RtAudio::Api api );
//! Return the display name of a specified compiled audio API.
/*!
This obtains a long name used for display purposes.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiDisplayName( RtAudio::Api api );
//! Return the compiled audio API having the given name.
/*!
A case insensitive comparison will check the specified name
against the list of compiled APIs, and return the one which
matches. On failure, the function returns UNSPECIFIED.
*/
static RtAudio::Api getCompiledApiByName( const std::string &name );
//! The class constructor.
/*!
@ -401,10 +430,10 @@ class RtAudio
If a stream is running or open, it will be stopped and closed
automatically.
*/
~RtAudio() throw();
~RtAudio();
//! Returns the audio API specifier for the current instance of RtAudio.
RtAudio::Api getCurrentApi( void ) throw();
RtAudio::Api getCurrentApi( void );
//! A public function that queries for the number of audio devices available.
/*!
@ -412,7 +441,7 @@ class RtAudio
is called, thus supporting devices connected \e after instantiation. If
a system error occurs during processing, a warning will be issued.
*/
unsigned int getDeviceCount( void ) throw();
unsigned int getDeviceCount( void );
//! Return an RtAudio::DeviceInfo structure for a specified device number.
/*!
@ -435,7 +464,7 @@ class RtAudio
client's responsibility to verify that a device is available
before attempting to open a stream.
*/
unsigned int getDefaultOutputDevice( void ) throw();
unsigned int getDefaultOutputDevice( void );
//! A function that returns the index of the default input device.
/*!
@ -445,7 +474,7 @@ class RtAudio
client's responsibility to verify that a device is available
before attempting to open a stream.
*/
unsigned int getDefaultInputDevice( void ) throw();
unsigned int getDefaultInputDevice( void );
//! A public function for opening a stream with the specified parameters.
/*!
@ -485,7 +514,7 @@ class RtAudio
lowest allowable value is used. The actual value used is
returned via the structure argument. The parameter is API dependent.
\param errorCallback A client-defined function that will be invoked
when an error has occured.
when an error has occurred.
*/
void openStream( RtAudio::StreamParameters *outputParameters,
RtAudio::StreamParameters *inputParameters,
@ -498,7 +527,7 @@ class RtAudio
If a stream is not open, this function issues a warning and
returns (no exception is thrown).
*/
void closeStream( void ) throw();
void closeStream( void );
//! A function that starts a stream.
/*!
@ -528,10 +557,10 @@ class RtAudio
void abortStream( void );
//! Returns true if a stream is open and false if not.
bool isStreamOpen( void ) const throw();
bool isStreamOpen( void ) const;
//! Returns true if the stream is running and false if it is stopped or not open.
bool isStreamRunning( void ) const throw();
bool isStreamRunning( void ) const;
//! Returns the number of elapsed seconds since the stream was started.
/*!
@ -565,7 +594,7 @@ class RtAudio
unsigned int getStreamSampleRate( void );
//! Specify whether warning messages should be printed to stderr.
void showWarnings( bool value = true ) throw();
void showWarnings( bool value = true );
protected:
@ -574,29 +603,34 @@ class RtAudio
};
// Operating system dependent thread functionality.
#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_WASAPI__)
#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <process.h>
#include <stdint.h>
typedef uintptr_t ThreadHandle;
typedef CRITICAL_SECTION StreamMutex;
#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
#else
// Using pthread library for various flavors of unix.
#include <pthread.h>
typedef pthread_t ThreadHandle;
typedef pthread_mutex_t StreamMutex;
#else // Setup for "dummy" behavior
#endif
// Setup for "dummy" behavior if no apis specified.
#if !(defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_WASAPI__) \
|| defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) \
|| defined(__LINUX_OSS__) || defined(__MACOSX_CORE__))
#define __RTAUDIO_DUMMY__
typedef int ThreadHandle;
typedef int StreamMutex;
#endif
@ -604,19 +638,15 @@ class RtAudio
// between the private RtAudio stream structure and global callback
// handling functions.
struct CallbackInfo {
void *object; // Used as a "this" pointer.
ThreadHandle thread;
void *callback;
void *userData;
void *errorCallback;
void *apiInfo; // void pointer for API specific callback information
bool isRunning;
bool doRealtime;
int priority;
// Default constructor.
CallbackInfo()
:object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false) {}
void *object{}; // Used as a "this" pointer.
ThreadHandle thread{};
void *callback{};
void *userData{};
void *errorCallback{};
void *apiInfo{}; // void pointer for API specific callback information
bool isRunning{false};
bool doRealtime{false};
int priority{};
};
// **************************************************************** //
@ -643,13 +673,12 @@ class S24 {
S24() {}
S24& operator = ( const int& i ) {
c3[0] = (i & 0x000000ff);
c3[1] = (i & 0x0000ff00) >> 8;
c3[2] = (i & 0x00ff0000) >> 16;
c3[0] = (unsigned char)(i & 0x000000ff);
c3[1] = (unsigned char)((i & 0x0000ff00) >> 8);
c3[2] = (unsigned char)((i & 0x00ff0000) >> 16);
return *this;
}
S24( const S24& v ) { *this = v; }
S24( const double& d ) { *this = (int) d; }
S24( const float& f ) { *this = (int) f; }
S24( const signed short& s ) { *this = (int) s; }
@ -669,7 +698,7 @@ class S24 {
#include <sstream>
class RtApi
class RTAUDIO_DLL_PUBLIC RtApi
{
public:
@ -824,22 +853,22 @@ protected:
//
// **************************************************************** //
inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }
inline RtAudio::Api RtAudio :: getCurrentApi( void ) { return rtapi_->getCurrentApi(); }
inline unsigned int RtAudio :: getDeviceCount( void ) { return rtapi_->getDeviceCount(); }
inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }
inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }
inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }
inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }
inline unsigned int RtAudio :: getDefaultInputDevice( void ) { return rtapi_->getDefaultInputDevice(); }
inline unsigned int RtAudio :: getDefaultOutputDevice( void ) { return rtapi_->getDefaultOutputDevice(); }
inline void RtAudio :: closeStream( void ) { return rtapi_->closeStream(); }
inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }
inline void RtAudio :: stopStream( void ) { return rtapi_->stopStream(); }
inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }
inline bool RtAudio :: isStreamOpen( void ) const throw() { return rtapi_->isStreamOpen(); }
inline bool RtAudio :: isStreamRunning( void ) const throw() { return rtapi_->isStreamRunning(); }
inline bool RtAudio :: isStreamOpen( void ) const { return rtapi_->isStreamOpen(); }
inline bool RtAudio :: isStreamRunning( void ) const { return rtapi_->isStreamRunning(); }
inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }
inline unsigned int RtAudio :: getStreamSampleRate( void ) { return rtapi_->getStreamSampleRate(); }
inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }
inline void RtAudio :: setStreamTime( double time ) { return rtapi_->setStreamTime( time ); }
inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }
inline void RtAudio :: showWarnings( bool value ) { rtapi_->showWarnings( value ); }
// RtApi Subclass prototypes.
@ -853,21 +882,20 @@ public:
RtApiCore();
~RtApiCore();
RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
unsigned int getDefaultOutputDevice( void );
unsigned int getDefaultInputDevice( void );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
long getStreamLatency( void );
RtAudio::Api getCurrentApi( void ) override { return RtAudio::MACOSX_CORE; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
unsigned int getDefaultOutputDevice( void ) override;
unsigned int getDefaultInputDevice( void ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
bool callbackEvent( AudioDeviceID deviceId,
const AudioBufferList *inBufferList,
const AudioBufferList *outBufferList );
@ -877,7 +905,7 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
static const char* getErrorCode( OSStatus code );
};
@ -891,19 +919,18 @@ public:
RtApiJack();
~RtApiJack();
RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
long getStreamLatency( void );
RtAudio::Api getCurrentApi( void ) override { return RtAudio::UNIX_JACK; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
bool callbackEvent( unsigned long nframes );
private:
@ -911,7 +938,9 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
bool shouldAutoconnect_;
};
#endif
@ -924,19 +953,20 @@ public:
RtApiAsio();
~RtApiAsio();
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
long getStreamLatency( void );
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_ASIO; }
unsigned int getDeviceCount( void ) override;
unsigned int getDefaultOutputDevice( void ) override;
unsigned int getDefaultInputDevice( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
bool callbackEvent( long bufferIndex );
private:
@ -947,7 +977,7 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
};
#endif
@ -960,21 +990,20 @@ public:
RtApiDs();
~RtApiDs();
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; }
unsigned int getDeviceCount( void );
unsigned int getDefaultOutputDevice( void );
unsigned int getDefaultInputDevice( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
long getStreamLatency( void );
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_DS; }
unsigned int getDeviceCount( void ) override;
unsigned int getDefaultOutputDevice( void ) override;
unsigned int getDefaultInputDevice( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
void callbackEvent( void );
private:
@ -986,7 +1015,7 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
};
#endif
@ -999,17 +1028,15 @@ class RtApiWasapi : public RtApi
{
public:
RtApiWasapi();
~RtApiWasapi();
virtual ~RtApiWasapi();
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_WASAPI; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
unsigned int getDefaultOutputDevice( void );
unsigned int getDefaultInputDevice( void );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_WASAPI; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
private:
bool coInitialized_;
@ -1018,7 +1045,7 @@ private:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int* bufferSize,
RtAudio::StreamOptions* options );
RtAudio::StreamOptions* options ) override;
static DWORD WINAPI runWasapiThread( void* wasapiPtr );
static DWORD WINAPI stopWasapiThread( void* wasapiPtr );
@ -1036,18 +1063,18 @@ public:
RtApiAlsa();
~RtApiAlsa();
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_ALSA; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
void callbackEvent( void );
private:
@ -1057,7 +1084,7 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
};
#endif
@ -1068,28 +1095,27 @@ class RtApiPulse: public RtApi
{
public:
~RtApiPulse();
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_PULSE; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_PULSE; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
void callbackEvent( void );
private:
std::vector<RtAudio::DeviceInfo> devices_;
void saveDeviceInfo( void );
void collectDeviceInfo( void );
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
};
#endif
@ -1102,18 +1128,18 @@ public:
RtApiOss();
~RtApiOss();
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; }
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_OSS; }
unsigned int getDeviceCount( void ) override;
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
void closeStream( void ) override;
void startStream( void ) override;
void stopStream( void ) override;
void abortStream( void ) override;
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
// will most likely produce highly undesirable results!
void callbackEvent( void );
private:
@ -1121,7 +1147,7 @@ public:
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
RtAudio::StreamOptions *options ) override;
};
#endif
@ -1133,20 +1159,20 @@ class RtApiDummy: public RtApi
public:
RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtAudioError::WARNING ); }
RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; }
unsigned int getDeviceCount( void ) { return 0; }
RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) { RtAudio::DeviceInfo info; return info; }
void closeStream( void ) {}
void startStream( void ) {}
void stopStream( void ) {}
void abortStream( void ) {}
RtAudio::Api getCurrentApi( void ) override { return RtAudio::RTAUDIO_DUMMY; }
unsigned int getDeviceCount( void ) override { return 0; }
RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) override { RtAudio::DeviceInfo info; return info; }
void closeStream( void ) override {}
void startStream( void ) override {}
void stopStream( void ) override {}
void abortStream( void ) override {}
private:
bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/,
unsigned int /*firstChannel*/, unsigned int /*sampleRate*/,
RtAudioFormat /*format*/, unsigned int * /*bufferSize*/,
RtAudio::StreamOptions * /*options*/ ) { return false; }
RtAudio::StreamOptions * /*options*/ ) override { return false; }
};
#endif

View File

@ -1,61 +0,0 @@
RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO and WASAPI) operating systems.
By Gary P. Scavone, 2001-2016.
This distribution of RtAudio contains the following:
doc: RtAudio documentation (see doc/html/index.html)
tests: example RtAudio programs
include: header and source files necessary for ASIO, DS & OSS compilation
tests/Windows: Visual C++ .net test program workspace and projects
OVERVIEW:
RtAudio is a set of C++ classes that provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X and Windows (DirectSound, ASIO and WASAPI) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:
- object-oriented C++ design
- simple, common API across all supported platforms
- only one source and one header file for easy inclusion in programming projects
- allow simultaneous multi-api support
- support dynamic connection of devices
- provide extensive audio device parameter control
- allow audio device capability probing
- automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping
RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the \ref apinotes section for information specific to each of the supported audio APIs.
FURTHER READING:
For complete documentation on RtAudio, see the doc directory of the distribution or surf to http://www.music.mcgill.ca/~gary/rtaudio/.
LEGAL AND ETHICAL:
The RtAudio license is similar to the MIT License.
RtAudio: a set of realtime audio i/o C++ classes
Copyright (c) 2001-2016 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
asked to send the modifications to the original developer so that
they can be incorporated into the canonical version. This is,
however, not a binding provision of this license.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,43 +1,56 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#include "AppConfig.h"
#include "CubicSDR.h"
DeviceConfig::DeviceConfig() : deviceId("") {
#include <wx/msgdlg.h>
DeviceConfig::DeviceConfig() {
ppm.store(0);
offset.store(0);
agcMode.store(true);
sampleRate.store(0);
}
DeviceConfig::DeviceConfig(std::string deviceId) : DeviceConfig() {
this->deviceId = deviceId;
DeviceConfig::DeviceConfig(std::string deviceId_in) : DeviceConfig() {
deviceId = deviceId_in;
}
void DeviceConfig::setPPM(int ppm) {
this->ppm.store(ppm);
void DeviceConfig::setPPM(int ppm_in) {
ppm.store(ppm_in);
}
int DeviceConfig::getPPM() {
return ppm.load();
}
void DeviceConfig::setOffset(long long offset) {
this->offset.store(offset);
void DeviceConfig::setOffset(long long offset_in) {
offset.store(offset_in);
}
long long DeviceConfig::getOffset() {
return offset.load();
}
void DeviceConfig::setSampleRate(long srate) {
sampleRate.store(srate);
void DeviceConfig::setSampleRate(long sampleRate_in) {
sampleRate.store(sampleRate_in);
}
long DeviceConfig::getSampleRate() {
return sampleRate.load();
}
void DeviceConfig::setAGCMode(bool agcMode) {
this->agcMode.store(agcMode);
void DeviceConfig::setAntennaName(const std::string& name) {
antennaName = name;
}
const std::string& DeviceConfig::getAntennaName() {
return antennaName;
}
void DeviceConfig::setAGCMode(bool agcMode_in) {
agcMode.store(agcMode_in);
}
bool DeviceConfig::getAGCMode() {
@ -45,9 +58,9 @@ bool DeviceConfig::getAGCMode() {
}
void DeviceConfig::setDeviceId(std::string deviceId) {
void DeviceConfig::setDeviceId(std::string deviceId_in) {
std::lock_guard < std::mutex > lock(busy_lock);
this->deviceId = deviceId;
deviceId = deviceId_in;
}
@ -61,44 +74,48 @@ std::string DeviceConfig::getDeviceId() {
return tmp;
}
void DeviceConfig::setDeviceName(std::string deviceName) {
void DeviceConfig::setDeviceName(std::string deviceName_in) {
std::lock_guard < std::mutex > lock(busy_lock);
this->deviceName = deviceName;
deviceName = deviceName_in;
}
std::string DeviceConfig::getDeviceName() {
std::string tmp;
std::lock_guard < std::mutex > lock(busy_lock);
tmp = (deviceName=="")?deviceId:deviceName;
tmp = deviceName.empty()?deviceId:deviceName;
return tmp;
}
void DeviceConfig::save(DataNode *node) {
std::lock_guard < std::mutex > lock(busy_lock);
*node->newChild("id") = deviceId;
*node->newChild("name") = deviceName;
*node->newChild("ppm") = (int)ppm.load();
*node->newChild("ppm") = ppm.load();
*node->newChild("offset") = offset.load();
*node->newChild("sample_rate") = sampleRate.load();
*node->newChild("agc_mode") = agcMode.load()?1:0;
if (streamOpts.size()) {
if (!antennaName.empty()) {
*node->newChild("antenna") = antennaName;
}
if (!streamOpts.empty()) {
DataNode *streamOptsNode = node->newChild("streamOpts");
for (ConfigSettings::const_iterator opt_i = streamOpts.begin(); opt_i != streamOpts.end(); opt_i++) {
*streamOptsNode->newChild(opt_i->first.c_str()) = opt_i->second;
}
}
if (settings.size()) {
if (!settings.empty()) {
DataNode *settingsNode = node->newChild("settings");
for (ConfigSettings::const_iterator set_i = settings.begin(); set_i != settings.end(); set_i++) {
*settingsNode->newChild(set_i->first.c_str()) = set_i->second;
}
}
if (rigIF.size()) {
if (!rigIF.empty()) {
DataNode *rigIFs = node->newChild("rig_ifs");
for (std::map<int, long long>::const_iterator rigIF_i = rigIF.begin(); rigIF_i != rigIF.end(); rigIF_i++) {
DataNode *ifNode = rigIFs->newChild("rig_if");
@ -106,7 +123,7 @@ void DeviceConfig::save(DataNode *node) {
*ifNode->newChild("sdr_if") = rigIF_i->second;
}
}
if (gains.size()) {
if (!gains.empty()) {
DataNode *gainsNode = node->newChild("gains");
for (ConfigGains::const_iterator gain_i = gains.begin(); gain_i != gains.end(); gain_i++) {
DataNode *gainNode = gainsNode->newChild("gain");
@ -138,7 +155,7 @@ void DeviceConfig::load(DataNode *node) {
DataNode *agc_node = node->getNext("agc_mode");
int agcModeValue = 0;
agc_node->element()->get(agcModeValue);
setAGCMode(agcModeValue?true:false);
setAGCMode(agcModeValue != 0);
}
if (node->hasAnother("sample_rate")) {
DataNode *sample_rate_node = node->getNext("sample_rate");
@ -146,6 +163,12 @@ void DeviceConfig::load(DataNode *node) {
sample_rate_node->element()->get(sampleRateValue);
setSampleRate(sampleRateValue);
}
if (node->hasAnother("antenna")) {
DataNode *antenna_node = node->getNext("antenna");
std::string antennaNameValue;
antenna_node->element()->get(antennaNameValue);
setAntennaName(antennaNameValue);
}
if (node->hasAnother("streamOpts")) {
DataNode *streamOptsNode = node->getNext("streamOpts");
for (int i = 0, iMax = streamOptsNode->numChildren(); i<iMax; i++) {
@ -153,7 +176,7 @@ void DeviceConfig::load(DataNode *node) {
std::string keyName = streamOptNode->getName();
std::string strSettingValue = streamOptNode->element()->toString();
if (keyName != "") {
if (!keyName.empty()) {
setStreamOpt(keyName, strSettingValue);
}
}
@ -165,7 +188,7 @@ void DeviceConfig::load(DataNode *node) {
std::string keyName = settingNode->getName();
std::string strSettingValue = settingNode->element()->toString();
if (keyName != "") {
if (!keyName.empty()) {
setSetting(keyName, strSettingValue);
}
}
@ -176,7 +199,7 @@ void DeviceConfig::load(DataNode *node) {
DataNode *rigIFNode = rigIFNodes->getNext("rig_if");
if (rigIFNode->hasAnother("model") && rigIFNode->hasAnother("sdr_if")) {
int load_model;
long long load_freq;
long long load_freq = 0;
rigIFNode->getNext("model")->element()->get(load_model);
rigIFNode->getNext("sdr_if")->element()->get(load_freq);
@ -190,12 +213,12 @@ void DeviceConfig::load(DataNode *node) {
while (gainsNode->hasAnother("gain")) {
DataNode *gainNode = gainsNode->getNext("gain");
std::string keyName;
float fltSettingValue;
float fltSettingValue = 0;
gainNode->getNext("id")->element()->get(keyName);
gainNode->getNext("value")->element()->get(fltSettingValue);
if (keyName != "" && !(fltSettingValue!=fltSettingValue)) {
if (!keyName.empty() && !(fltSettingValue!=fltSettingValue)) {
setGain(keyName, fltSettingValue);
}
}
@ -211,11 +234,11 @@ ConfigSettings DeviceConfig::getStreamOpts() {
return streamOpts;
}
void DeviceConfig::setStreamOpt(std::string key, std::string value) {
void DeviceConfig::setStreamOpt(const std::string& key, std::string value) {
streamOpts[key] = value;
}
std::string DeviceConfig::getStreamOpt(std::string key, std::string defaultValue) {
std::string DeviceConfig::getStreamOpt(const std::string& key, std::string defaultValue) {
if (streamOpts.find(key) == streamOpts.end()) {
return defaultValue;
}
@ -223,15 +246,15 @@ std::string DeviceConfig::getStreamOpt(std::string key, std::string defaultValue
return streamOpts[key];
}
void DeviceConfig::setSettings(ConfigSettings settings) {
this->settings = settings;
void DeviceConfig::setSettings(ConfigSettings settings_in) {
settings = settings_in;
}
void DeviceConfig::setSetting(std::string key, std::string value) {
this->settings[key] = value;
void DeviceConfig::setSetting(const std::string& key, std::string value) {
settings[key] = value;
}
std::string DeviceConfig::getSetting(std::string key, std::string defaultValue) {
std::string DeviceConfig::getSetting(const std::string& key, std::string defaultValue) {
if (settings.find(key) == settings.end()) {
return defaultValue;
}
@ -243,19 +266,19 @@ ConfigSettings DeviceConfig::getSettings() {
}
void DeviceConfig::setGains(ConfigGains gains) {
this->gains = gains;
void DeviceConfig::setGains(ConfigGains gains_in) {
gains = gains_in;
}
ConfigGains DeviceConfig::getGains() {
return gains;
}
void DeviceConfig::setGain(std::string key, float value) {
void DeviceConfig::setGain(const std::string& key, float value) {
gains[key] = value;
}
float DeviceConfig::getGain(std::string key, float defaultValue) {
float DeviceConfig::getGain(const std::string& key, float defaultValue) {
if (gains.find(key) != gains.end()) {
return gains[key];
}
@ -274,14 +297,14 @@ long long DeviceConfig::getRigIF(int rigType) {
return 0;
}
AppConfig::AppConfig() : configName("") {
AppConfig::AppConfig() {
winX.store(0);
winY.store(0);
winW.store(0);
winH.store(0);
winMax.store(false);
showTips.store(true);
lowPerfMode.store(false);
perfMode.store(PERF_NORMAL);
themeId.store(0);
fontScale.store(0);
snap.store(1);
@ -292,8 +315,12 @@ AppConfig::AppConfig() : configName("") {
modemPropsCollapsed.store(false);
mainSplit = -1;
visSplit = -1;
bookmarkSplit = -1;
bookmarkSplit = 200;
#ifdef CUBICSDR_DEFAULT_HIDE_BOOKMARKS
bookmarksVisible.store(false);
#else
bookmarksVisible.store(true);
#endif
#ifdef USE_HAMLIB
rigEnabled.store(false);
@ -305,7 +332,7 @@ AppConfig::AppConfig() : configName("") {
#endif
}
DeviceConfig *AppConfig::getDevice(std::string deviceId) {
DeviceConfig *AppConfig::getDevice(const std::string& deviceId) {
if (deviceConfig.find(deviceId) == deviceConfig.end()) {
deviceConfig[deviceId] = new DeviceConfig();
}
@ -364,32 +391,32 @@ bool AppConfig::getShowTips() {
return showTips.load();
}
void AppConfig::setLowPerfMode(bool show) {
lowPerfMode.store(show);
void AppConfig::setPerfMode(PerfModeEnum show) {
perfMode.store(show);
}
bool AppConfig::getLowPerfMode() {
return lowPerfMode.load();
AppConfig::PerfModeEnum AppConfig::getPerfMode() {
return perfMode.load();
}
wxRect *AppConfig::getWindow() {
wxRect *r = NULL;
wxRect *r = nullptr;
if (winH.load() && winW.load()) {
r = new wxRect(winX.load(),winY.load(),winW.load(),winH.load());
}
return r;
}
void AppConfig::setTheme(int themeId) {
this->themeId.store(themeId);
void AppConfig::setTheme(int themeId_in) {
themeId.store(themeId_in);
}
int AppConfig::getTheme() {
return themeId.load();
}
void AppConfig::setFontScale(int fontScale) {
this->fontScale.store(fontScale);
void AppConfig::setFontScale(int fontScale_in) {
fontScale.store(fontScale_in);
}
int AppConfig::getFontScale() {
@ -478,9 +505,54 @@ bool AppConfig::getBookmarksVisible() {
return bookmarksVisible.load();
}
void AppConfig::setRecordingPath(std::string recPath) {
recordingPath = recPath;
}
void AppConfig::setConfigName(std::string configName) {
this->configName = configName;
std::string AppConfig::getRecordingPath() {
return recordingPath;
}
bool AppConfig::verifyRecordingPath() {
string recPathStr = wxGetApp().getConfig()->getRecordingPath();
if (recPathStr.empty()) {
wxMessageBox( wxT("Recording path is not set. Please use 'Set Recording Path' from the 'Recording' Menu."), wxT("Recording Path Error"), wxICON_INFORMATION);
return false;
}
wxFileName recPath(recPathStr);
if (!recPath.Exists() || !recPath.IsDirWritable()) {
wxMessageBox( wxT("Recording path does not exist or is not writable. Please use 'Set Recording Path' from the 'Recording' Menu."), wxT("Recording Path Error"), wxICON_INFORMATION);
return false;
}
return true;
}
void AppConfig::setRecordingSquelchOption(int enumChoice) {
recordingSquelchOption = enumChoice;
}
int AppConfig::getRecordingSquelchOption() const {
return recordingSquelchOption;
}
void AppConfig::setRecordingFileTimeLimit(int nbSeconds) {
recordingFileTimeLimitSeconds = nbSeconds;
}
int AppConfig::getRecordingFileTimeLimit() const {
return recordingFileTimeLimitSeconds;
}
void AppConfig::setConfigName(std::string configName_in) {
configName = configName_in;
}
std::string AppConfig::getConfigFileName(bool ignoreName) {
@ -516,14 +588,14 @@ bool AppConfig::save() {
*window_node->newChild("max") = winMax.load();
*window_node->newChild("tips") = showTips.load();
*window_node->newChild("low_perf_mode") = lowPerfMode.load();
*window_node->newChild("perf_mode") = (int)perfMode.load();
*window_node->newChild("theme") = themeId.load();
*window_node->newChild("font_scale") = fontScale.load();
*window_node->newChild("snap") = snap.load();
*window_node->newChild("center_freq") = centerFreq.load();
*window_node->newChild("waterfall_lps") = waterfallLinesPerSec.load();
*window_node->newChild("spectrum_avg") = spectrumAvgSpeed.load();
*window_node->newChild("modemprops_collapsed") = modemPropsCollapsed.load();;
*window_node->newChild("modemprops_collapsed") = modemPropsCollapsed.load();
*window_node->newChild("db_offset") = dbOffset.load();
*window_node->newChild("main_split") = mainSplit.load();
@ -532,6 +604,12 @@ bool AppConfig::save() {
*window_node->newChild("bookmark_visible") = bookmarksVisible.load();
}
//Recording settings:
DataNode *rec_node = cfg.rootNode()->newChild("recording");
*rec_node->newChild("path") = recordingPath;
*rec_node->newChild("squelch") = recordingSquelchOption;
*rec_node->newChild("file_time_limit") = recordingFileTimeLimitSeconds;
DataNode *devices_node = cfg.rootNode()->newChild("devices");
std::map<std::string, DeviceConfig *>::iterator device_config_i;
@ -540,12 +618,12 @@ bool AppConfig::save() {
device_config_i->second->save(device_node);
}
if (manualDevices.size()) {
if (!manualDevices.empty()) {
DataNode *manual_node = cfg.rootNode()->newChild("manual_devices");
for (std::vector<SDRManualDef>::const_iterator i = manualDevices.begin(); i != manualDevices.end(); i++) {
for (const auto & manualDevice : manualDevices) {
DataNode *rig_node = manual_node->newChild("device");
*rig_node->newChild("factory") = i->factory;
*rig_node->newChild("params") = i->params;
*rig_node->newChild("factory") = manualDevice.factory;
*rig_node->newChild("params") = manualDevice.params;
}
}
@ -608,12 +686,13 @@ bool AppConfig::load() {
}
if (cfg.rootNode()->hasAnother("window")) {
int x,y,w,h;
int max,tips,lpm,mpc;
int x = 0 ,y = 0 ,w = 0 ,h = 0;
int max = 0 ,tips = 0 ,perf_mode = 0 ,mpc = 0;
DataNode *win_node = cfg.rootNode()->getNext("window");
if (win_node->hasAnother("w") && win_node->hasAnother("h") && win_node->hasAnother("x") && win_node->hasAnother("y")) {
win_node->getNext("x")->element()->get(x);
win_node->getNext("y")->element()->get(y);
win_node->getNext("w")->element()->get(w);
@ -627,45 +706,53 @@ bool AppConfig::load() {
if (win_node->hasAnother("max")) {
win_node->getNext("max")->element()->get(max);
winMax.store(max?true:false);
winMax.store(max != 0);
}
if (win_node->hasAnother("tips")) {
win_node->getNext("tips")->element()->get(tips);
showTips.store(tips?true:false);
showTips.store(tips != 0);
}
if (win_node->hasAnother("low_perf_mode")) {
win_node->getNext("low_perf_mode")->element()->get(lpm);
lowPerfMode.store(lpm?true:false);
}
// default:
perfMode.store(PERF_NORMAL);
if (win_node->hasAnother("perf_mode")) {
win_node->getNext("perf_mode")->element()->get(perf_mode);
if (perf_mode == (int)PERF_LOW) {
perfMode.store(PERF_LOW);
} else if (perf_mode == (int)PERF_HIGH) {
perfMode.store(PERF_HIGH);
}
}
if (win_node->hasAnother("theme")) {
int theme;
int theme = 0;
win_node->getNext("theme")->element()->get(theme);
themeId.store(theme);
}
if (win_node->hasAnother("font_scale")) {
int fscale;
int fscale = 0;
win_node->getNext("font_scale")->element()->get(fscale);
fontScale.store(fscale);
}
if (win_node->hasAnother("snap")) {
long long snapVal;
long long snapVal = 0;
win_node->getNext("snap")->element()->get(snapVal);
snap.store(snapVal);
}
if (win_node->hasAnother("center_freq")) {
long long freqVal;
long long freqVal = 0;
win_node->getNext("center_freq")->element()->get(freqVal);
centerFreq.store(freqVal);
}
if (win_node->hasAnother("waterfall_lps")) {
int lpsVal;
int lpsVal = 30;
win_node->getNext("waterfall_lps")->element()->get(lpsVal);
waterfallLinesPerSec.store(lpsVal);
}
@ -678,7 +765,7 @@ bool AppConfig::load() {
if (win_node->hasAnother("modemprops_collapsed")) {
win_node->getNext("modemprops_collapsed")->element()->get(mpc);
modemPropsCollapsed.store(mpc?true:false);
modemPropsCollapsed.store(mpc != 0);
}
if (win_node->hasAnother("db_offset")) {
@ -713,6 +800,26 @@ bool AppConfig::load() {
}
}
//Recording settings:
if (cfg.rootNode()->hasAnother("recording")) {
DataNode *rec_node = cfg.rootNode()->getNext("recording");
if (rec_node->hasAnother("path")) {
DataNode *rec_path = rec_node->getNext("path");
recordingPath = rec_path->element()->toString();
}
if (rec_node->hasAnother("squelch")) {
DataNode *rec_squelch = rec_node->getNext("squelch");
rec_squelch->element()->get(recordingSquelchOption);
}
if (rec_node->hasAnother("file_time_limit")) {
DataNode *rec_file_time_limit = rec_node->getNext("file_time_limit");
rec_file_time_limit->element()->get(recordingFileTimeLimitSeconds);
}
}
if (cfg.rootNode()->hasAnother("devices")) {
DataNode *devices_node = cfg.rootNode()->getNext("devices");
@ -749,7 +856,7 @@ bool AppConfig::load() {
if (rig_node->hasAnother("enabled")) {
int loadEnabled;
rig_node->getNext("enabled")->element()->get(loadEnabled);
rigEnabled.store(loadEnabled?true:false);
rigEnabled.store(loadEnabled != 0);
}
if (rig_node->hasAnother("model")) {
int loadModel;
@ -767,22 +874,22 @@ bool AppConfig::load() {
if (rig_node->hasAnother("control")) {
int loadControl;
rig_node->getNext("control")->element()->get(loadControl);
rigControlMode.store(loadControl?true:false);
rigControlMode.store(loadControl != 0);
}
if (rig_node->hasAnother("follow")) {
int loadFollow;
rig_node->getNext("follow")->element()->get(loadFollow);
rigFollowMode.store(loadFollow?true:false);
rigFollowMode.store(loadFollow != 0);
}
if (rig_node->hasAnother("center_lock")) {
int loadCenterLock;
rig_node->getNext("center_lock")->element()->get(loadCenterLock);
rigCenterLock.store(loadCenterLock?true:false);
rigCenterLock.store(loadCenterLock != 0);
}
if (rig_node->hasAnother("follow_modem")) {
int loadFollow;
rig_node->getNext("follow_modem")->element()->get(loadFollow);
rigFollowModem.store(loadFollow?true:false);
rigFollowModem.store(loadFollow != 0);
}
}
#endif
@ -803,24 +910,24 @@ int AppConfig::getRigModel() {
return rigModel.load();
}
void AppConfig::setRigModel(int rigModel) {
this->rigModel.store(rigModel);
void AppConfig::setRigModel(int rigModel_in) {
rigModel.store(rigModel_in);
}
int AppConfig::getRigRate() {
return rigRate.load();
}
void AppConfig::setRigRate(int rigRate) {
this->rigRate.store(rigRate);
void AppConfig::setRigRate(int rigRate_in) {
rigRate.store(rigRate_in);
}
std::string AppConfig::getRigPort() {
return rigPort;
}
void AppConfig::setRigPort(std::string rigPort) {
this->rigPort = rigPort;
void AppConfig::setRigPort(std::string rigPort_in) {
rigPort = rigPort_in;
}
void AppConfig::setRigControlMode(bool cMode) {

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include <wx/stdpaths.h>
@ -17,40 +20,43 @@ typedef std::map<std::string, float> ConfigGains;
class DeviceConfig {
public:
DeviceConfig();
DeviceConfig(std::string deviceId);
explicit DeviceConfig(std::string deviceId_in);
void setPPM(int ppm);
void setPPM(int ppm_in);
int getPPM();
void setOffset(long long offset);
void setOffset(long long offset_in);
long long getOffset();
void setSampleRate(long srate);
void setSampleRate(long sampleRate_in);
long getSampleRate();
void setAGCMode(bool agcMode);
void setAntennaName(const std::string& name);
const std::string& getAntennaName();
void setAGCMode(bool agcMode_in);
bool getAGCMode();
void setDeviceId(std::string deviceId);
void setDeviceId(std::string deviceId_in);
std::string getDeviceId();
void setDeviceName(std::string deviceName);
void setDeviceName(std::string deviceName_in);
std::string getDeviceName();
void setStreamOpts(ConfigSettings opts);
ConfigSettings getStreamOpts();
void setStreamOpt(std::string key, std::string value);
std::string getStreamOpt(std::string key, std::string defaultValue);
void setStreamOpt(const std::string& key, std::string value);
std::string getStreamOpt(const std::string& key, std::string defaultValue);
void setSettings(ConfigSettings settings);
void setSettings(ConfigSettings settings_in);
ConfigSettings getSettings();
void setSetting(std::string key, std::string value);
std::string getSetting(std::string key, std::string defaultValue);
void setSetting(const std::string& key, std::string value);
std::string getSetting(const std::string& key, std::string defaultValue);
void setGains(ConfigGains gains);
void setGains(ConfigGains gains_in);
ConfigGains getGains();
void setGain(std::string key, float value);
float getGain(std::string key, float defaultValue);
void setGain(const std::string& key, float value);
float getGain(const std::string& key, float defaultValue);
void setRigIF(int rigType, long long freq);
long long getRigIF(int rigType);
@ -61,12 +67,14 @@ public:
private:
std::string deviceId;
std::string deviceName;
std::mutex busy_lock;
std::atomic_int ppm;
std::atomic_llong offset;
std::atomic_bool agcMode;
std::atomic_long sampleRate;
std::atomic_int ppm{};
std::atomic_llong offset{};
std::atomic_bool agcMode{};
std::atomic_long sampleRate{};
std::string antennaName;
ConfigSettings streamOpts;
ConfigGains gains;
std::map<std::string, std::string> settings;
@ -75,9 +83,17 @@ private:
class AppConfig {
public:
enum PerfModeEnum {
PERF_LOW = 0,
PERF_NORMAL = 1,
PERF_HIGH = 2
};
AppConfig();
std::string getConfigDir();
DeviceConfig *getDevice(std::string deviceId);
DeviceConfig *getDevice(const std::string& deviceId);
void setWindow(wxPoint winXY, wxSize winWH);
wxRect *getWindow();
@ -91,13 +107,13 @@ public:
void setShowTips(bool show);
bool getShowTips();
void setLowPerfMode(bool lpm);
bool getLowPerfMode();
void setPerfMode(PerfModeEnum mode);
PerfModeEnum getPerfMode();
void setTheme(int themeId);
void setTheme(int themeId_in);
int getTheme();
void setFontScale(int scaleValue);
void setFontScale(int fontScale_in);
int getFontScale();
void setSnap(long long snapVal);
@ -130,16 +146,26 @@ public:
void setBookmarksVisible(bool state);
bool getBookmarksVisible();
//Recording settings:
void setRecordingPath(std::string recPath);
std::string getRecordingPath();
bool verifyRecordingPath();
void setRecordingSquelchOption(int enumChoice);
int getRecordingSquelchOption() const;
void setRecordingFileTimeLimit(int nbSeconds);
int getRecordingFileTimeLimit() const;
#if USE_HAMLIB
int getRigModel();
void setRigModel(int rigModel);
void setRigModel(int rigModel_in);
int getRigRate();
void setRigRate(int rigRate);
void setRigRate(int rigRate_in);
std::string getRigPort();
void setRigPort(std::string rigPort);
void setRigPort(std::string rigPort_in);
void setRigControlMode(bool cMode);
bool getRigControlMode();
@ -157,7 +183,7 @@ public:
bool getRigEnabled();
#endif
void setConfigName(std::string configName);
void setConfigName(std::string configName_in);
std::string getConfigFileName(bool ignoreName=false);
bool save();
bool load();
@ -166,19 +192,26 @@ public:
private:
std::string configName;
std::map<std::string, DeviceConfig *> deviceConfig;
std::atomic_int winX,winY,winW,winH;
std::atomic_bool winMax, showTips, lowPerfMode, modemPropsCollapsed;
std::atomic_int themeId;
std::atomic_int fontScale;
std::atomic_llong snap;
std::atomic_llong centerFreq;
std::atomic_int waterfallLinesPerSec;
std::atomic<float> spectrumAvgSpeed, mainSplit, visSplit, bookmarkSplit;
std::atomic_int dbOffset;
std::atomic_int winX{},winY{},winW{},winH{};
std::atomic_bool winMax{}, showTips{}, modemPropsCollapsed{};
std::atomic_int themeId{};
std::atomic_int fontScale{};
std::atomic_llong snap{};
std::atomic_llong centerFreq{};
std::atomic_int waterfallLinesPerSec{};
std::atomic<float> spectrumAvgSpeed{}, mainSplit{}, visSplit{}, bookmarkSplit{};
std::atomic_int dbOffset{};
std::vector<SDRManualDef> manualDevices;
std::atomic_bool bookmarksVisible{};
std::atomic<PerfModeEnum> perfMode{};
std::string recordingPath;
int recordingSquelchOption = 0;
int recordingFileTimeLimitSeconds = 0;
#if USE_HAMLIB
std::atomic_int rigModel, rigRate;
std::atomic_int rigModel{}, rigRate{};
std::string rigPort;
std::atomic_bool rigEnabled, rigFollowMode, rigControlMode, rigCenterLock, rigFollowModem, bookmarksVisible;
std::atomic_bool rigEnabled{}, rigFollowMode{}, rigControlMode{}, rigCenterLock{}, rigFollowModem{};
#endif
};

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include <wx/frame.h>
@ -6,6 +9,7 @@
#include <wx/sizer.h>
#include <wx/bitmap.h>
#include <wx/statbmp.h>
#include <wx/tooltip.h>
#include "PrimaryGLContext.h"
@ -22,9 +26,297 @@
//#include "UITestCanvas.h"
#include "FrequencyDialog.h"
#include "BookmarkView.h"
#include "AboutDialog.h"
#include "DemodulatorInstance.h"
#include "DemodulatorThread.h"
#include <map>
#ifdef USE_HAMLIB
class PortSelectorDialog;
#endif
// Define a new frame type
class AppFrame: public wxFrame {
public:
AppFrame();
~AppFrame() override;
void initDeviceParams(SDRDeviceInfo *devInfo_in);
FFTVisualDataThread *getWaterfallDataThread();
WaterfallCanvas *getWaterfallCanvas();
SpectrumCanvas *getSpectrumCanvas();
void notifyUpdateModemProperties();
void setMainWaterfallFFTSize(int fftSize);
void setScopeDeviceName(std::string deviceName);
int OnGlobalKeyDown(wxKeyEvent &event);
int OnGlobalKeyUp(wxKeyEvent &event);
void setWaterfallLinesPerSecond(int lps);
void setSpectrumAvgSpeed(double avg);
FrequencyDialog::FrequencyDialogTarget getFrequencyDialogTarget();
void refreshGainUI();
void setViewState(long long center_freq, int bandwidth);
void setViewState();
long long getViewCenterFreq();
int getViewBandwidth();
bool isUserDemodBusy();
BookmarkView *getBookmarkView();
void disableSave(bool state);
//call this in case the main UI is not
//the origin of device changes / sample rate by operator,
//and must be notified back to update its UI elements
//(ex: SDR Devices dialog changing the configuration)
void notifyDeviceChanged();
#ifdef _WIN32
bool canFocus();
#endif
//set tooltip to window
void setStatusText(wxWindow* window, const std::string& statusText);
void setStatusText(const std::string& statusText, int value);
#ifdef USE_HAMLIB
void setRigControlPort(const std::string& portName);
void dismissRigControlPortDialog();
#endif
private:
/***
* UI Elements
*/
ScopeCanvas *scopeCanvas;
SpectrumCanvas *spectrumCanvas, *demodSpectrumCanvas;
WaterfallCanvas *waterfallCanvas, *demodWaterfallCanvas;
TuningCanvas *demodTuner;
MeterCanvas *demodSignalMeter, *demodGainMeter, *spectrumAvgMeter, *waterfallSpeedMeter;
ModeSelectorCanvas *demodModeSelector, *demodMuteButton, *peakHoldButton, *soloModeButton, *deltaLockButton;
GainCanvas *gainCanvas;
BookmarkView *bookmarkView;
wxSizerItem *gainSizerItem, *gainSpacerItem;
wxSplitterWindow *mainVisSplitter, *mainSplitter, *bookmarkSplitter;
wxBoxSizer *demodTray;
//Use a raw pointer here to prevent a dangling reference
DemodulatorInstance* activeDemodulator;
/***
* Menus
*/
wxMenuBar *menuBar = nullptr;
wxMenu *fileMenu = nullptr;
wxMenu *settingsMenu = nullptr;
wxMenuItem *showTipMenuItem;
wxMenuItem *iqSwapMenuItem = nullptr;
wxMenuItem *agcMenuItem = nullptr;
wxMenu *sampleRateMenu = nullptr;
wxMenu *displayMenu = nullptr;
wxMenuItem *hideBookmarksItem;
wxMenu *recordingMenu = nullptr;
//depending on context, maps the item id to wxMenuItem*,
//OR the submenu item id to its parent wxMenuItem*.
std::map<int, wxMenuItem *> sampleRateMenuItems;
std::map<int, wxMenuItem *> antennaMenuItems;
std::map<int, wxMenuItem *> settingsMenuItems;
std::map<int, wxMenuItem *> performanceMenuItems;
std::map<int, wxMenuItem *> audioSampleRateMenuItems;
std::map<int, wxMenuItem *> recordingMenuItems;
/***
* Waterfall Data Thread
*/
FFTVisualDataThread *waterfallDataThread;
std::thread *t_FFTData;
/***
* Active Settings
*/
bool saveDisabled = false;
std::string currentSessionFile;
std::string currentBookmarkFile;
SoapySDR::ArgInfoList settingArgs;
int settingsIdMax;
std::vector<long> sampleRates;
long manualSampleRate = -1;
SDRDeviceInfo *devInfo = nullptr;
std::atomic_bool deviceChanged;
ModemProperties *modemProps;
std::atomic_bool modemPropertiesUpdated;
std::vector<std::string> antennaNames;
std::string currentTXantennaName;
AboutDialog *aboutDlg = nullptr;
std::string lastToolTip;
#ifdef ENABLE_DIGITAL_LAB
ModeSelectorCanvas *demodModeSelectorAdv;
#endif
/***
* wx Events
*/
void OnMenu(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
void OnIdle(wxIdleEvent& event);
void OnDoubleClickSash(wxSplitterEvent& event);
void OnUnSplit(wxSplitterEvent& event);
void OnAboutDialogClose(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event);
/**
* Session Management
*/
void saveSession(const std::string& fileName);
bool loadSession(const std::string& fileName);
/**
* Keyboard handlers
*/
void gkNudge(const DemodulatorInstancePtr& demod, int snap);
void toggleActiveDemodRecording();
void toggleAllActiveDemodRecording();
/**
* UI init functions
*/
ModeSelectorCanvas *makeModemSelectorPanel(wxWindow *parent, const wxGLAttributes &attribList);
WaterfallCanvas *makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList);
SpectrumCanvas *makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
MeterCanvas *makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList);
ModeSelectorCanvas *makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList);
TuningCanvas *makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList);
MeterCanvas *makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList);
ModeSelectorCanvas *makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList);
ModeSelectorCanvas *makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList);
ModeSelectorCanvas *makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList);
SpectrumCanvas *makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
MeterCanvas *makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList);
WaterfallCanvas *makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList);
MeterCanvas *makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList);
ScopeCanvas *makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList);
ModeSelectorCanvas *makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList);
ModemProperties *makeModemProperties(wxPanel *parent);
void initConfigurationSettings();
void initMenuBar();
void initIcon();
wxMenu *makeFileMenu();
wxMenu *makeAudioSampleRateMenu();
wxMenu *makeDisplayMenu();
wxMenu *makeRecordingMenu();
void updateRecordingMenu();
wxString getSettingsLabel(const std::string& settingsName,
const std::string& settingsValue,
const std::string& settingsSuffix = "");
/**
* Menu Action Handlers
*/
//actionXXXX manage menu actions, return true if the event has been
//treated.
bool actionOnMenuAbout(wxCommandEvent& event);
bool actionOnMenuReset(wxCommandEvent& event);
bool actionOnMenuSettings(wxCommandEvent& event);
bool actionOnMenuAGC(wxCommandEvent& event);
bool actionOnMenuSampleRate(wxCommandEvent& event);
bool actionOnMenuAudioSampleRate(wxCommandEvent& event);
bool actionOnMenuDisplay(wxCommandEvent& event);
bool actionOnMenuLoadSave(wxCommandEvent& event);
bool actionOnMenuRecording(wxCommandEvent& event);
bool actionOnMenuRig(wxCommandEvent& event);
bool actionOnMenuSDRStartStop(wxCommandEvent &event);
bool actionOnMenuPerformance(wxCommandEvent &event);
bool actionOnMenuTips(wxCommandEvent &event);
bool actionOnMenuIQSwap(wxCommandEvent &event);
bool actionOnMenuFreqOffset(wxCommandEvent &event);
bool actionOnMenuDBOffset(wxCommandEvent &event);
bool actionOnMenuSDRDevices(wxCommandEvent &event);
bool actionOnMenuSetPPM(wxCommandEvent &event);
bool actionOnMenuClose(wxCommandEvent &event);
/**
* UI Activity Handlers
*/
void handleUpdateDeviceParams();
void handleTXAntennaChange();
void handleCurrentModem();
void handleModeSelector();
void handleGainMeter();
void handleDemodWaterfallSpectrum();
void handleSpectrumWaterfall();
void handleMuteButton();
void handleScopeProcessor();
void handleScopeSpectrumProcessors();
void handleModemProperties();
void handlePeakHold();
/**
* Hamlib/Rig specific
*/
#ifdef USE_HAMLIB
wxMenu *rigMenu;
wxMenuItem *rigEnableMenuItem;
wxMenuItem *rigPortMenuItem;
wxMenuItem *rigControlMenuItem;
wxMenuItem *rigFollowMenuItem;
wxMenuItem *rigCenterLockMenuItem;
wxMenuItem *rigFollowModemMenuItem;
std::map<int, wxMenuItem *> rigSerialMenuItems;
std::map<int, wxMenuItem *> rigModelMenuItems;
wxMenu *rigModelMenu;
int rigModel;
int rigSerialRate;
long long rigSDRIF;
std::vector<int> rigSerialRates;
std::string rigPort;
int numRigs;
PortSelectorDialog *rigPortDialog;
void enableRig();
void disableRig();
wxMenu *makeRigMenu();
void handleRigMenu();
#endif
wxDECLARE_EVENT_TABLE();
};
#define wxID_RT_AUDIO_DEVICE 1000
#define wxID_SET_FREQ_OFFSET 2001
#define wxID_RESET 2002
@ -34,32 +326,53 @@
#define wxID_SDR_DEVICES 2008
#define wxID_AGC_CONTROL 2009
#define wxID_SDR_START_STOP 2010
#define wxID_LOW_PERF 2011
#define wxID_SET_DB_OFFSET 2012
#define wxID_ABOUT_CUBICSDR 2013
#define wxID_OPEN_BOOKMARKS 2020
#define wxID_SAVE_BOOKMARKS 2021
#define wxID_SAVEAS_BOOKMARKS 2022
#define wxID_RESET_BOOKMARKS 2023
#define wxID_MAIN_SPLITTER 2050
#define wxID_VIS_SPLITTER 2051
#define wxID_BM_SPLITTER 2052
#define wxID_THEME_DEFAULT 2100
#define wxID_THEME_SHARP 2101
#define wxID_THEME_BW 2102
#define wxID_THEME_RAD 2103
#define wxID_THEME_TOUCH 2104
#define wxID_THEME_HD 2105
#define wxID_THEME_RADAR 2106
#define wxID_THEME_DEFAULT 2070
#define wxID_THEME_DEFAULT_JET 2071
#define wxID_THEME_SHARP 2072
#define wxID_THEME_BW 2073
#define wxID_THEME_RAD 2074
#define wxID_THEME_TOUCH 2075
#define wxID_THEME_HD 2076
#define wxID_THEME_RADAR 2077
#define wxID_DISPLAY_BOOKMARKS 2107
#define wxID_DISPLAY_BOOKMARKS 2100
#define wxID_BANDWIDTH_BASE 2150
#define wxID_BANDWIDTH_MANUAL_DIALOG 2199
#define wxID_BANDWIDTH_MANUAL 2200
#define wxID_DISPLAY_BASE 2250
#define wxID_SETTINGS_BASE 2300
#define wxID_ANTENNA_CURRENT 2350
#define wxID_ANTENNA_CURRENT_TX 2501
#define wxID_ANTENNAS_BASE 2352
#define wxID_PERF_CURRENT 2400
#define wxID_PERF_BASE 2401
#define wxID_DEVICE_ID 3500
#define wxID_RECORDING_PATH 8500
#define wxID_RECORDING_SQUELCH_BASE 8501
#define wxID_RECORDING_SQUELCH_SILENCE 8502
#define wxID_RECORDING_SQUELCH_SKIP 8503
#define wxID_RECORDING_SQUELCH_ALWAYS 8504
#define wxID_RECORDING_FILE_TIME_LIMIT 8505
#define wxID_AUDIO_BANDWIDTH_BASE 9000
#define wxID_AUDIO_DEVICE_MULTIPLIER 50
@ -73,143 +386,4 @@
#define wxID_RIG_FOLLOW_MODEM 11906
#define wxID_RIG_SERIAL_BASE 11950
#define wxID_RIG_MODEL_BASE 12000
#endif
// Define a new frame type
class AppFrame: public wxFrame {
public:
AppFrame();
~AppFrame();
void OnThread(wxCommandEvent& event);
void OnEventInput(wxThreadEvent& event);
void initDeviceParams(SDRDeviceInfo *devInfo);
void updateDeviceParams();
void saveSession(std::string fileName);
bool loadSession(std::string fileName);
FFTVisualDataThread *getWaterfallDataThread();
void notifyUpdateModemProperties();
void setMainWaterfallFFTSize(int fftSize);
void setScopeDeviceName(std::string deviceName);
void gkNudgeLeft(DemodulatorInstance *demod, int snap);
void gkNudgeRight(DemodulatorInstance *demod, int snap);
int OnGlobalKeyDown(wxKeyEvent &event);
int OnGlobalKeyUp(wxKeyEvent &event);
void setWaterfallLinesPerSecond(int lps);
void setSpectrumAvgSpeed(double avg);
FrequencyDialog::FrequencyDialogTarget getFrequencyDialogTarget();
void refreshGainUI();
void setViewState(long long center_freq, int bandwidth);
void setViewState(long long center_freq);
long long getViewCenterFreq();
int getViewBandwidth();
bool isUserDemodBusy();
BookmarkView *getBookmarkView();
void disableSave(bool state);
#ifdef _WIN32
bool canFocus();
#endif
private:
void OnMenu(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
void OnNewWindow(wxCommandEvent& event);
void OnIdle(wxIdleEvent& event);
void OnDoubleClickSash(wxSplitterEvent& event);
void OnUnSplit(wxSplitterEvent& event);
ScopeCanvas *scopeCanvas;
SpectrumCanvas *spectrumCanvas;
WaterfallCanvas *waterfallCanvas;
ModeSelectorCanvas *demodModeSelector;
#ifdef ENABLE_DIGITAL_LAB
ModeSelectorCanvas *demodModeSelectorAdv;
#endif
SpectrumCanvas *demodSpectrumCanvas;
WaterfallCanvas *demodWaterfallCanvas;
MeterCanvas *demodSignalMeter;
MeterCanvas *demodGainMeter;
TuningCanvas *demodTuner;
// UITestCanvas *testCanvas;
MeterCanvas *spectrumAvgMeter;
MeterCanvas *waterfallSpeedMeter;
ModeSelectorCanvas *demodMuteButton, *peakHoldButton, *soloModeButton, *deltaLockButton;
GainCanvas *gainCanvas;
wxSizerItem *gainSizerItem, *gainSpacerItem;
wxSplitterWindow *mainVisSplitter, *mainSplitter, *bookmarkSplitter;
wxBoxSizer *demodTray;
BookmarkView *bookmarkView;
DemodulatorInstance *activeDemodulator;
std::vector<RtAudio::DeviceInfo> devices;
std::map<int,RtAudio::DeviceInfo> inputDevices;
std::map<int,RtAudio::DeviceInfo> outputDevices;
std::map<int, wxMenuItem *> outputDeviceMenuItems;
std::map<int, wxMenuItem *> sampleRateMenuItems;
std::map<int, wxMenuItem *> audioSampleRateMenuItems;
std::map<int, wxMenuItem *> directSamplingMenuItems;
wxMenuBar *menuBar;
wxMenu *sampleRateMenu;
wxMenu *displayMenu;
wxMenuItem *agcMenuItem;
wxMenuItem *iqSwapMenuItem;
wxMenuItem *lowPerfMenuItem;
wxMenu *settingsMenu;
SoapySDR::ArgInfoList settingArgs;
int settingsIdMax;
std::vector<long> sampleRates;
std::string currentSessionFile;
FFTVisualDataThread *waterfallDataThread;
std::thread *t_FFTData;
SDRDeviceInfo *devInfo;
std::atomic_bool deviceChanged;
ModemProperties *modemProps;
std::atomic_bool modemPropertiesUpdated;
wxMenuItem *showTipMenuItem;
bool lowPerfMode;
#ifdef USE_HAMLIB
void enableRig();
void disableRig();
wxMenu *rigMenu;
wxMenuItem *rigEnableMenuItem;
wxMenuItem *rigPortMenuItem;
wxMenuItem *rigControlMenuItem;
wxMenuItem *rigFollowMenuItem;
wxMenuItem *rigCenterLockMenuItem;
wxMenuItem *rigFollowModemMenuItem;
wxMenuItem *sdrIFMenuItem;
wxMenuItem *hideBookmarksItem;
std::map<int, wxMenuItem *> rigSerialMenuItems;
std::map<int, wxMenuItem *> rigModelMenuItems;
int rigModel;
int rigSerialRate;
long long rigSDRIF;
std::vector<int> rigSerialRates;
std::string rigPort;
int numRigs;
bool rigInit;
bool saveDisabled;
#endif
wxDECLARE_EVENT_TABLE();
};
#endif

View File

@ -1,14 +1,24 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#include "BookmarkMgr.h"
#include "CubicSDR.h"
#include "DataTree.h"
#define BOOKMARK_RECENTS_MAX 25
BookmarkEntry::~BookmarkEntry() {
delete node;
}
BookmarkMgr::BookmarkMgr() {
rangesSorted = false;
}
//
void BookmarkMgr::saveToFile(const std::string& bookmarkFn, bool backup, bool useFullpath) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup) {
DataTree s("cubicsdr_bookmarks");
DataNode *header = s.rootNode()->newChild("header");
header->newChild("version")->element()->set(wxString(CUBICSDR_VERSION).ToStdWstring());
@ -22,7 +32,7 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup) {
DataNode *view_ranges = s.rootNode()->newChild("ranges");
for (auto re_i : ranges) {
for (const auto& re_i : ranges) {
DataNode *range = view_ranges->newChild("range");
*range->newChild("label") = re_i->label;
*range->newChild("freq") = re_i->freq;
@ -38,13 +48,27 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup) {
*group->newChild("@expanded") = (getExpandState(bmd_i.first)?std::string("true"):std::string("false"));
for (auto &bm_i : bmd_i.second ) {
group->newChildCloneFrom("modem", bm_i->node);
//if a matching demodulator exists, use its data instead to be be saved, because output_device could have been
//modified by the user. So, save that "live" version instead.
auto matchingDemod = wxGetApp().getDemodMgr().getLastDemodulatorWith(bm_i->type,
bm_i->label,
bm_i->frequency,
bm_i->bandwidth);
if (matchingDemod != nullptr) {
wxGetApp().getDemodMgr().saveInstance(group->newChild("modem"), matchingDemod);
}
else {
group->newChildCloneFrom("modem", bm_i->node);
}
}
}
DataNode *recent_modems = s.rootNode()->newChild("recent_modems");
for (auto demod : wxGetApp().getDemodMgr().getDemodulators()) {
for (const auto& demod : wxGetApp().getDemodMgr().getDemodulators()) {
wxGetApp().getDemodMgr().saveInstance(recent_modems->newChild("modem"),demod);
}
@ -52,9 +76,18 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup) {
recent_modems->newChildCloneFrom("modem", r_i->node);
}
wxFileName saveFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn);
wxFileName saveFileBackup(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
wxFileName saveFile;
wxFileName saveFileBackup;
if (useFullpath) {
saveFile.Assign(bookmarkFn);
saveFileBackup.Assign(bookmarkFn + ".backup");
}
else {
saveFile.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn);
saveFileBackup.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
}
if (saveFile.IsDirWritable()) {
// Hopefully leave at least a readable backup in case of failure..
if (backup && saveFile.FileExists() && (!saveFileBackup.FileExists() || saveFileBackup.IsFileWritable())) {
@ -64,21 +97,30 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup) {
}
}
bool BookmarkMgr::loadFromFile(const std::string& bookmarkFn, bool backup, bool useFullpath) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
wxFileName loadFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn);
wxFileName failFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".failedload");
wxFileName lastLoaded(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".lastloaded");
wxFileName backupFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
wxFileName loadFile;
wxFileName failFile;
wxFileName lastLoaded;
wxFileName backupFile;
if (useFullpath) {
loadFile.Assign(bookmarkFn);
failFile.Assign(bookmarkFn + ".failedload");
lastLoaded.Assign(bookmarkFn + ".lastloaded");
backupFile.Assign(bookmarkFn + ".backup");
}
else {
loadFile.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn);
failFile.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".failedload");
lastLoaded.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".lastloaded");
backupFile.Assign(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
}
DataTree s;
bool loadStatusOk = true;
// Clear any active data
bmData.erase(bmData.begin(),bmData.end());
recents.erase(recents.begin(),recents.end());
ranges.erase(ranges.begin(),ranges.end());
bmDataSorted.erase(bmDataSorted.begin(),bmDataSorted.end());
// File exists but is not readable
if (loadFile.FileExists() && !loadFile.IsFileReadable()) {
@ -87,7 +129,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
// New instance of bookmark savefiles
if (backup && !loadFile.FileExists() && !lastLoaded.FileExists() && !backupFile.FileExists()) {
wxGetApp().getAppFrame()->getBookmarkView()->loadDefaultRanges();
loadDefaultRanges();
return true;
}
@ -95,6 +137,17 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
if (!s.LoadFromFileXML(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString())) {
return false;
}
//Check if it is a bookmark file, read the root node.
if (s.rootNode()->getName() != "cubicsdr_bookmarks") {
return false;
}
// Clear any active data
bmData.clear();
recents.clear();
ranges.clear();
bmDataSorted.clear();
if (s.rootNode()->hasAnother("branches")) {
DataNode *branches = s.rootNode()->getNext("branches");
@ -103,10 +156,10 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
if (branches->hasAnother("range")) branches->getNext("range")->element()->get(bRange);
if (branches->hasAnother("bookmark")) branches->getNext("bookmark")->element()->get(bBookmark);
if (branches->hasAnother("recent")) branches->getNext("recent")->element()->get(bRecent);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("active", bActive?true:false);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("range", bRange?true:false);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("bookmark", bBookmark?true:false);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("recent", bRecent?true:false);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("active", bActive != 0);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("range", bRange != 0);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("bookmark", bBookmark != 0);
wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("recent", bRecent != 0);
}
if (s.rootNode()->hasAnother("ranges")) {
@ -114,7 +167,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
while (view_ranges->hasAnother("range")) {
DataNode *range = view_ranges->getNext("range");
BookmarkRangeEntry *re = new BookmarkRangeEntry;
BookmarkRangeEntryPtr re(new BookmarkRangeEntry);
if (range->hasAnother("label")) range->getNext("label")->element()->get(re->label);
if (range->hasAnother("freq")) range->getNext("freq")->element()->get(re->freq);
@ -129,20 +182,20 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
DataNode *modems = s.rootNode()->getNext("modems");
while (modems->hasAnother("group")) {
DataNode *group = modems->getNext("group");
std::string expandState = "true";
std::string groupExpandState = "true";
std::string groupName = "Unnamed";
if (group->hasAnother("@name")) {
groupName = group->getNext("@name")->element()->toString();
}
if (group->hasAnother("@expanded")) {
expandState = group->getNext("@expanded")->element()->toString();
groupExpandState = group->getNext("@expanded")->element()->toString();
}
setExpandState(groupName, (expandState == "true"));
setExpandState(groupName, (groupExpandState == "true"));
while (group->hasAnother("modem")) {
DataNode *modem = group->getNext("modem");
BookmarkEntry *be = nodeToBookmark("modem", modem);
BookmarkEntryPtr be = nodeToBookmark(modem);
if (be) {
addBookmark(groupName.c_str(), be);
addBookmark(groupName, be);
} else {
std::cout << "error loading bookmarked modem.." << std::endl;
loadStatusOk = false;
@ -156,7 +209,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
while (recent_modems->hasAnother("modem")) {
DataNode *modem = recent_modems->getNext("modem");
BookmarkEntry *be = nodeToBookmark("modem", modem);
BookmarkEntryPtr be = nodeToBookmark(modem);
if (be) {
addRecent(be);
} else {
@ -173,7 +226,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), lastLoaded.GetFullPath(wxPATH_NATIVE).ToStdString());
}
}
} else if (!loadStatusOk) {
} else {
if (loadFile.IsDirWritable()) { // Load failed; keep a copy of the failed bookmark file for analysis?
if (loadFile.FileExists() && (!failFile.FileExists() || failFile.IsFileWritable())) {
wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), failFile.GetFullPath(wxPATH_NATIVE).ToStdString());
@ -185,70 +238,105 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup) {
return loadStatusOk;
}
void BookmarkMgr::loadDefaultRanges() {
bool BookmarkMgr::hasLastLoad(std::string bookmarkFn) {
addRange(std::make_shared<BookmarkRangeEntry>(L"2200 Meters (135.7-137.8 kHz)", 136750, 135700, 137800));
addRange(std::make_shared<BookmarkRangeEntry>(L"630 Meters (472-479 kHz)", 475500, 472000, 479000));
addRange(std::make_shared<BookmarkRangeEntry>(L"160 Meters (1.8-2 MHz)", 1900000, 1800000, 2000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"80 Meters (3.5-4.0 MHz)", 3750000, 3500000, 4000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"60 Meters (5.332-5.405Mhz)", 5368500, 5332000, 5405000));
addRange(std::make_shared<BookmarkRangeEntry>(L"40 Meters (7.0-7.3 MHz)", 7150000, 7000000, 7300000));
addRange(std::make_shared<BookmarkRangeEntry>(L"30 Meters (10.1-10.15 MHz)", 10125000, 10100000, 10150000));
addRange(std::make_shared<BookmarkRangeEntry>(L"20 Meters (14.0-14.35 MHz)", 14175000, 14000000, 14350000));
addRange(std::make_shared<BookmarkRangeEntry>(L"17 Meters (17.044-19.092 MHz)", 18068180, 17044180, 19092180));
addRange(std::make_shared<BookmarkRangeEntry>(L"15 Meters (21-21.45 MHz)", 21225000, 21000000, 21450000));
addRange(std::make_shared<BookmarkRangeEntry>(L"12 Meters (24.89-24.99 MHz)", 24940000, 24890000, 24990000));
addRange(std::make_shared<BookmarkRangeEntry>(L"10 Meters (28-29.7 MHz)", 28850000, 28000000, 29700000));
addRange(std::make_shared<BookmarkRangeEntry>(L"6 Meters (50-54 MHz)", 52000000, 50000000, 54000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"4 Meters (70-70.5 MHz)", 70250000, 70000000, 70500000));
addRange(std::make_shared<BookmarkRangeEntry>(L"2 Meters (144-148 MHz)", 146000000, 144000000, 148000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"1.25 Meters (219-225 MHz)", 222000000, 219000000, 225000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"70 cm (420-450 MHz)", 435000000, 420000000, 450000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"33 cm (902-928 MHz)", 915000000, 902000000, 928000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"23 cm (1240-1300 MHz)", 1270000000, 1240000000, 1300000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"13 cm lower (2300-2310 MHz)", 2305000000, 2300000000, 2310000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"13 cm upper (2390-2450 MHz)", 2420000000, 2390000000, 2450000000));
}
void BookmarkMgr::resetBookmarks() {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
// Clear any active data
bmData.clear();
recents.clear();
ranges.clear();
bmDataSorted.clear();
loadDefaultRanges();
}
bool BookmarkMgr::hasLastLoad(const std::string& bookmarkFn) {
wxFileName lastLoaded(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".lastloaded");
return lastLoaded.FileExists() && lastLoaded.IsFileReadable();
}
bool BookmarkMgr::hasBackup(std::string bookmarkFn) {
bool BookmarkMgr::hasBackup(const std::string& bookmarkFn) {
wxFileName backupFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
return backupFile.FileExists() && backupFile.IsFileReadable();
}
void BookmarkMgr::addBookmark(std::string group, DemodulatorInstance *demod) {
std::lock_guard < std::mutex > lock(busy_lock);
BookmarkEntry *be = demodToBookmarkEntry(demod);
wxGetApp().getDemodMgr().saveInstance(be->node, demod);
void BookmarkMgr::addBookmark(const std::string& group, const DemodulatorInstancePtr& demod) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
//Create a BookmarkEntry from demod data, saving its
//characteristics in be->node.
BookmarkEntryPtr be = demodToBookmarkEntry(demod);
bmData[group].push_back(be);
bmDataSorted[group] = false;
}
void BookmarkMgr::addBookmark(std::string group, BookmarkEntry *be) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::addBookmark(const std::string& group, const BookmarkEntryPtr& be) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
bmData[group].push_back(be);
bmDataSorted[group] = false;
}
void BookmarkMgr::removeBookmark(std::string group, BookmarkEntry *be) {
std::lock_guard < std::mutex > lockData(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
void BookmarkMgr::removeBookmark(const std::string& group, const BookmarkEntryPtr& be) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (bmData.find(group) == bmData.end()) {
return;
}
BookmarkList::iterator i = std::find(bmData[group].begin(), bmData[group].end(), be);
auto i = std::find(bmData[group].begin(), bmData[group].end(), be);
if (i != bmData[group].end()) {
delete *i;
bmData[group].erase(i);
}
}
void BookmarkMgr::removeBookmark(BookmarkEntry *be) {
std::lock_guard < std::mutex > lockData(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
void BookmarkMgr::removeBookmark(const BookmarkEntryPtr& be) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (auto &bmd_i : bmData) {
BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
auto i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
if (i != bmd_i.second.end()) {
bmd_i.second.erase(i);
}
}
}
void BookmarkMgr::moveBookmark(BookmarkEntry *be, std::string group) {
std::lock_guard < std::mutex > lockData(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
void BookmarkMgr::moveBookmark(const BookmarkEntryPtr& be, const std::string& group) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (auto &bmd_i : bmData) {
BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
auto i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
if (i != bmd_i.second.end()) {
if (bmd_i.first == group) {
return;
@ -263,39 +351,37 @@ void BookmarkMgr::moveBookmark(BookmarkEntry *be, std::string group) {
}
void BookmarkMgr::addGroup(std::string group) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::addGroup(const std::string& group) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (bmData.find(group) == bmData.end()) {
BookmarkList dummy = bmData[group];
}
}
void BookmarkMgr::removeGroup(std::string group) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::removeGroup(const std::string& group) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
BookmarkMap::iterator i = bmData.find(group);
auto i = bmData.find(group);
if (i != bmData.end()) {
for (auto ii : bmData[group]) {
delete ii;
}
bmData.erase(group);
}
}
void BookmarkMgr::renameGroup(std::string group, std::string ngroup) {
void BookmarkMgr::renameGroup(const std::string& group, const std::string& ngroup) {
if (group == ngroup) {
return;
}
std::lock_guard < std::mutex > lock(busy_lock);
std::lock_guard < std::recursive_mutex > lock(busy_lock);
BookmarkMap::iterator i = bmData.find(group);
BookmarkMap::iterator it = bmData.find(ngroup);
auto i = bmData.find(group);
auto it = bmData.find(ngroup);
if (i != bmData.end() && it != bmData.end()) {
for (auto ii : bmData[group]) {
for (const auto& ii : bmData[group]) {
bmData[ngroup].push_back(ii);
}
bmData.erase(group);
@ -305,16 +391,15 @@ void BookmarkMgr::renameGroup(std::string group, std::string ngroup) {
}
}
BookmarkList BookmarkMgr::getBookmarks(std::string group) {
std::lock_guard < std::mutex > lock(busy_lock);
BookmarkList BookmarkMgr::getBookmarks(const std::string& group) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (bmData.find(group) == bmData.end()) {
BookmarkList results;
return results;
return BookmarkList();
}
if (!bmDataSorted[group]) {
std::sort(bmData[group].begin(), bmData[group].end(), BookmarkEntryCompare());
std::sort(bmData[group].begin(), bmData[group].end(), [](const BookmarkEntryPtr a, const BookmarkEntryPtr b) -> bool { return a->frequency < b->frequency;});
bmDataSorted[group] = true;
}
@ -323,24 +408,33 @@ BookmarkList BookmarkMgr::getBookmarks(std::string group) {
void BookmarkMgr::getGroups(BookmarkNames &arr) {
for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
arr.push_back(i->first);
std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (auto & i : bmData) {
arr.push_back(i.first);
}
}
void BookmarkMgr::getGroups(wxArrayString &arr) {
for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
arr.push_back(i->first);
std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (auto & i : bmData) {
arr.push_back(i.first);
}
}
void BookmarkMgr::setExpandState(std::string groupName, bool state) {
void BookmarkMgr::setExpandState(const std::string& groupName, bool state) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
expandState[groupName] = state;
}
bool BookmarkMgr::getExpandState(std::string groupName) {
bool BookmarkMgr::getExpandState(const std::string& groupName) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (expandState.find(groupName) == expandState.end()) {
return true;
}
@ -349,7 +443,12 @@ bool BookmarkMgr::getExpandState(std::string groupName) {
void BookmarkMgr::updateActiveList() {
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (wxGetApp().isShuttingDown()) {
return;
}
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (bmv) {
bmv->updateActiveList();
@ -357,6 +456,7 @@ void BookmarkMgr::updateActiveList() {
}
void BookmarkMgr::updateBookmarks() {
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (bmv) {
@ -364,7 +464,8 @@ void BookmarkMgr::updateBookmarks() {
}
}
void BookmarkMgr::updateBookmarks(std::string group) {
void BookmarkMgr::updateBookmarks(const std::string& group) {
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (bmv) {
@ -373,15 +474,16 @@ void BookmarkMgr::updateBookmarks(std::string group) {
}
void BookmarkMgr::addRecent(DemodulatorInstance *demod) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::addRecent(const DemodulatorInstancePtr& demod) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
recents.push_back(demodToBookmarkEntry(demod));
trimRecents();
}
void BookmarkMgr::addRecent(BookmarkEntry *be) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::addRecent(const BookmarkEntryPtr& be) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
recents.push_back(be);
@ -390,11 +492,11 @@ void BookmarkMgr::addRecent(BookmarkEntry *be) {
void BookmarkMgr::removeRecent(BookmarkEntry *be) {
std::lock_guard < std::mutex > lock(busy_lock);
BookmarkList::iterator bm_i = std::find(recents.begin(),recents.end(), be);
void BookmarkMgr::removeRecent(const BookmarkEntryPtr& be) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
auto bm_i = std::find(recents.begin(),recents.end(), be);
if (bm_i != recents.end()) {
recents.erase(bm_i);
}
@ -402,50 +504,51 @@ void BookmarkMgr::removeRecent(BookmarkEntry *be) {
BookmarkList BookmarkMgr::getRecents() {
return recents;
std::lock_guard < std::recursive_mutex > lock(busy_lock);
//return a copy
return recents;
}
void BookmarkMgr::clearRecents() {
std::lock_guard < std::mutex > lock(busy_lock);
recents.erase(recents.begin(),recents.end());
std::lock_guard < std::recursive_mutex > lock(busy_lock);
recents.clear();
}
void BookmarkMgr::trimRecents() {
if (recents.size() > BOOKMARK_RECENTS_MAX) {
delete *(recents.begin());
recents.erase(recents.begin(), recents.begin()+1);
}
}
void BookmarkMgr::addRange(BookmarkRangeEntry *re) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::addRange(const BookmarkRangeEntryPtr& re) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
ranges.push_back(re);
rangesSorted = false;
}
void BookmarkMgr::removeRange(BookmarkRangeEntry *re) {
std::lock_guard < std::mutex > lock(busy_lock);
void BookmarkMgr::removeRange(const BookmarkRangeEntryPtr& re) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
BookmarkRangeList::iterator re_i = std::find(ranges.begin(), ranges.end(), re);
auto re_i = std::find(ranges.begin(), ranges.end(), re);
if (re_i != ranges.end()) {
ranges.erase(re_i);
}
}
BookmarkRangeList BookmarkMgr::getRanges() {
std::lock_guard < std::mutex > lock(busy_lock);
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (!rangesSorted) {
std::sort(ranges.begin(), ranges.end(), BookmarkRangeEntryCompare());
std::sort(ranges.begin(), ranges.end(), [](const BookmarkRangeEntryPtr a, const BookmarkRangeEntryPtr b) -> bool { return a->freq < b->freq;});
rangesSorted = true;
}
@ -454,67 +557,121 @@ BookmarkRangeList BookmarkMgr::getRanges() {
void BookmarkMgr::clearRanges() {
std::lock_guard < std::mutex > lock(busy_lock);
ranges.erase(ranges.begin(),ranges.end());
std::lock_guard < std::recursive_mutex > lock(busy_lock);
ranges.clear();
}
BookmarkEntry *BookmarkMgr::demodToBookmarkEntry(DemodulatorInstance *demod) {
BookmarkEntry *be = new BookmarkEntry;
BookmarkEntryPtr BookmarkMgr::demodToBookmarkEntry(const DemodulatorInstancePtr& demod) {
BookmarkEntryPtr be(new BookmarkEntry);
be->bandwidth = demod->getBandwidth();
be->type = demod->getDemodulatorType();
be->label = demod->getDemodulatorUserLabel();
be->frequency = demod->getFrequency();
//fine to do so here, so long nobody overrides be->node, DataNode will be
//deleted at last BookmarkEntryPtr be ref.
be->node = new DataNode;
wxGetApp().getDemodMgr().saveInstance(be->node, demod);
return be;
}
BookmarkEntry *BookmarkMgr::nodeToBookmark(const char *name_in, DataNode *node) {
std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string& childNodeName) {
std::wstring decodedWString;
if (node != nullptr) {
DataNode* childNode = node->getNext(childNodeName.c_str());
//1) decode as encoded wstring:
try {
childNode->element()->get(decodedWString);
} catch (const DataTypeMismatchException &) {
//2) wstring decode fail, try simple std::string
std::string decodedStdString;
try {
childNode->element()->get(decodedStdString);
//use wxString for a clean conversion to a wstring:
decodedWString = wxString(decodedStdString).ToStdWstring();
} catch (const DataTypeMismatchException &) {
//nothing works, return an empty string.
decodedWString = L"";
}
}
}
return decodedWString;
}
BookmarkEntryPtr BookmarkMgr::nodeToBookmark(DataNode *node) {
if (!node->hasAnother("frequency") || !node->hasAnother("type") || !node->hasAnother("bandwidth")) {
return nullptr;
}
BookmarkEntry *be = new BookmarkEntry();
BookmarkEntryPtr be(new BookmarkEntry());
node->getNext("frequency")->element()->get(be->frequency);
node->getNext("type")->element()->get(be->type);
node->getNext("bandwidth")->element()->get(be->bandwidth);
if (node->hasAnother("user_label")) {
node->getNext("user_label")->element()->get(be->label);
be->label = BookmarkMgr::getSafeWstringValue( node, "user_label");
}
node->rewindAll();
//fine to do so here, so long nobody overrides be->node, DataNode will be
//deleted at last BookmarkEntryPtr be ref.
//copy data from *node.
be->node = new DataNode("node",*node);
return be;
}
std::wstring BookmarkMgr::getBookmarkEntryDisplayName(BookmarkEntry *bmEnt) {
std::wstring BookmarkMgr::getBookmarkEntryDisplayName(const BookmarkEntryPtr& bmEnt) {
std::wstring dispName = bmEnt->label;
if (dispName == "") {
if (dispName.empty()) {
std::string freqStr = frequencyToStr(bmEnt->frequency) + " " + bmEnt->type;
dispName = wstring(freqStr.begin(),freqStr.end());
dispName = wxString(freqStr).ToStdWstring();
}
return dispName;
}
std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstance *demod) {
std::wstring BookmarkMgr::getActiveDisplayName(const DemodulatorInstancePtr& demod) {
std::wstring activeName = demod->getDemodulatorUserLabel();
if (activeName == "") {
if (activeName.empty()) {
std::string wstr = frequencyToStr(demod->getFrequency()) + " " + demod->getDemodulatorType();
activeName = std::wstring(wstr.begin(),wstr.end());
activeName = wxString(wstr).ToStdWstring();
}
return activeName;
}
void BookmarkMgr::removeActive(const DemodulatorInstancePtr& demod) {
if (demod == nullptr) {
return;
}
//Delete demodulator
wxGetApp().getDemodMgr().setActiveDemodulator(nullptr, true);
wxGetApp().getDemodMgr().setActiveDemodulator(nullptr, false);
wxGetApp().removeDemodulator(demod);
wxGetApp().getDemodMgr().deleteThread(demod);
}

View File

@ -1,38 +1,43 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include <wx/arrstr.h>
#include <vector>
#include <set>
#include <wx/arrstr.h>
#include <memory>
#include "DemodulatorInstance.h"
class DataNode;
class BookmarkEntry {
public:
std::mutex busy_lock;
std::string type;
std::wstring label;
std::wstring userLabel;
//maps on the Demod user label.
std::wstring label;
long long frequency;
int bandwidth;
DataNode *node;
virtual ~BookmarkEntry();
};
class BookmarkRangeEntry {
public:
BookmarkRangeEntry() : label(L""), freq(0), startFreq(0), endFreq(0) {
BookmarkRangeEntry() : freq(0), startFreq(0), endFreq(0) {
}
BookmarkRangeEntry(std::wstring label, long long freq, long long startFreq, long long endFreq) : label(label), freq(freq), startFreq(startFreq), endFreq(endFreq) {
}
std::mutex busy_lock;
std::wstring label;
long long freq;
@ -40,26 +45,11 @@ public:
long long endFreq;
};
typedef std::shared_ptr<BookmarkEntry> BookmarkEntryPtr;
typedef std::shared_ptr<BookmarkRangeEntry> BookmarkRangeEntryPtr;
struct BookmarkEntryCompare : public std::binary_function<BookmarkEntry *,BookmarkEntry *,bool>
{
bool operator()(const BookmarkEntry *a, BookmarkEntry *b) const
{
return a->frequency < b->frequency;
}
};
struct BookmarkRangeEntryCompare : public std::binary_function<BookmarkRangeEntry *,BookmarkRangeEntry *,bool>
{
bool operator()(const BookmarkRangeEntry *a, BookmarkRangeEntry *b) const
{
return a->freq < b->freq;
}
};
typedef std::vector<BookmarkEntry *> BookmarkList;
typedef std::vector<BookmarkRangeEntry *> BookmarkRangeList;
typedef std::vector<BookmarkEntryPtr> BookmarkList;
typedef std::vector<BookmarkRangeEntryPtr> BookmarkRangeList;
typedef std::map<std::string, BookmarkList > BookmarkMap;
typedef std::map<std::string, bool > BookmarkMapSorted;
typedef std::vector<std::string> BookmarkNames;
@ -68,61 +58,80 @@ typedef std::map<std::string, bool> BookmarkExpandState;
class BookmarkMgr {
public:
BookmarkMgr();
void saveToFile(std::string bookmarkFn, bool backup = true);
bool loadFromFile(std::string bookmarkFn, bool backup = true);
//if useFullpath = false, use the application config dir.
//else assume bookmarkFn is a full path and use it for location.
void saveToFile(const std::string& bookmarkFn, bool backup = true, bool useFullpath = false);
bool loadFromFile(const std::string& bookmarkFn, bool backup = true, bool useFullpath = false);
bool hasLastLoad(std::string bookmarkFn);
bool hasBackup(std::string bookmarkFn);
void resetBookmarks();
void addBookmark(std::string group, DemodulatorInstance *demod);
void addBookmark(std::string group, BookmarkEntry *be);
void removeBookmark(std::string group, BookmarkEntry *be);
void removeBookmark(BookmarkEntry *be);
void moveBookmark(BookmarkEntry *be, std::string group);
bool hasLastLoad(const std::string& bookmarkFn);
bool hasBackup(const std::string& bookmarkFn);
void addBookmark(const std::string& group, const DemodulatorInstancePtr& demod);
void addBookmark(const std::string& group, const BookmarkEntryPtr& be);
void removeBookmark(const std::string& group, const BookmarkEntryPtr& be);
void removeBookmark(const BookmarkEntryPtr& be);
void moveBookmark(const BookmarkEntryPtr& be, const std::string& group);
void addGroup(std::string group);
void removeGroup(std::string group);
void renameGroup(std::string group, std::string ngroup);
BookmarkList getBookmarks(std::string group);
void addGroup(const std::string& group);
void removeGroup(const std::string& group);
void renameGroup(const std::string& group, const std::string& ngroup);
//return an independent copy on purpose
BookmarkList getBookmarks(const std::string& group);
void getGroups(BookmarkNames &arr);
void getGroups(wxArrayString &arr);
void setExpandState(std::string groupName, bool state);
bool getExpandState(std::string groupName);
void setExpandState(const std::string& groupName, bool state);
bool getExpandState(const std::string& groupName);
void updateActiveList();
void updateBookmarks();
void updateBookmarks(std::string group);
void updateBookmarks(const std::string& group);
void addRecent(const DemodulatorInstancePtr& demod);
void addRecent(const BookmarkEntryPtr& be);
void removeRecent(const BookmarkEntryPtr& be);
//return an independent copy on purpose
BookmarkList getRecents();
void addRecent(DemodulatorInstance *demod);
void addRecent(BookmarkEntry *be);
void removeRecent(BookmarkEntry *be);
BookmarkList getRecents();
void clearRecents();
void addRange(BookmarkRangeEntry *re);
void removeRange(BookmarkRangeEntry *re);
BookmarkRangeList getRanges();
void clearRanges();
void removeActive(const DemodulatorInstancePtr& demod);
void addRange(const BookmarkRangeEntryPtr& re);
void removeRange(const BookmarkRangeEntryPtr& re);
//return an independent copy on purpose
BookmarkRangeList getRanges();
void clearRanges();
static std::wstring getBookmarkEntryDisplayName(BookmarkEntry *bmEnt);
static std::wstring getActiveDisplayName(DemodulatorInstance *demod);
static std::wstring getBookmarkEntryDisplayName(const BookmarkEntryPtr& bmEnt);
static std::wstring getActiveDisplayName(const DemodulatorInstancePtr& demod);
protected:
void trimRecents();
void loadDefaultRanges();
//utility method that attempts to decode the childNodeName as std::wstring, else as std::string, else
//return an empty string.
static std::wstring getSafeWstringValue(DataNode* node, const std::string& childNodeName);
BookmarkEntry *demodToBookmarkEntry(DemodulatorInstance *demod);
BookmarkEntry *nodeToBookmark(const char *name_in, DataNode *node);
BookmarkEntryPtr demodToBookmarkEntry(const DemodulatorInstancePtr& demod);
BookmarkEntryPtr nodeToBookmark(DataNode *node);
BookmarkMap bmData;
BookmarkMapSorted bmDataSorted;
BookmarkList recents;
BookmarkRangeList ranges;
bool rangesSorted;
std::mutex busy_lock;
std::recursive_mutex busy_lock;
BookmarkExpandState expandState;
};

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#define OPENGL
#include "CubicSDRDefs.h"
@ -29,6 +32,8 @@ IMPLEMENT_APP(CubicSDR)
#include "ActionDialog.h"
#include <memory>
//#ifdef ENABLE_DIGITAL_LAB
//// console output buffer for windows
@ -76,7 +81,7 @@ std::string frequencyToStr(long long freq) {
long double freqTemp;
freqTemp = freq;
std::string suffix("");
std::string suffix;
std::stringstream freqStr;
if (freqTemp >= 1.0e9) {
@ -128,7 +133,7 @@ long long strToFrequency(std::string freqStr) {
} else if (suffixStr.find_first_of("Hh") != std::string::npos) {
// ...
}
} else if (numPartStr.find_first_of(".") != std::string::npos || freqTemp <= 3000) {
} else if (numPartStr.find_first_of('.') != std::string::npos || freqTemp <= 3000) {
freqTemp *= 1.0e6;
}
@ -143,7 +148,7 @@ public:
m_questionText->SetLabelText(wxT("All attempts to recover bookmarks have failed. \nWould you like to exit without touching any more save files?\nClick OK to exit without saving; or Cancel to continue anyways."));
}
void doClickOK() {
void doClickOK() override {
wxGetApp().getAppFrame()->disableSave(true);
wxGetApp().getAppFrame()->Close(false);
}
@ -157,7 +162,7 @@ public:
m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks backup file. \nWould you like to attempt to load the last succssfully loaded bookmarks file?"));
}
void doClickOK() {
void doClickOK() override {
if (wxGetApp().getBookmarkMgr().hasLastLoad("bookmarks.xml")) {
if (wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.lastloaded",false)) {
wxGetApp().getBookmarkMgr().updateBookmarks();
@ -176,7 +181,7 @@ public:
m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks file. \nWould you like to attempt to load the backup file?"));
}
void doClickOK() {
void doClickOK() override {
bool loadOk = false;
if (wxGetApp().getBookmarkMgr().hasBackup("bookmarks.xml")) {
loadOk = wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.backup",false);
@ -193,13 +198,57 @@ public:
};
class ActionDialogRigError : public ActionDialog {
public:
explicit ActionDialogRigError(const std::string& message) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Rig Control Error")) {
m_questionText->SetLabelText(message);
}
void doClickOK() override {
}
};
CubicSDR::CubicSDR() : frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFAULT_SAMPLE_RATE), agcMode(false)
{
config.load();
sampleRateInitialized.store(false);
agcMode.store(true);
soloMode.store(false);
shuttingDown.store(false);
fdlgTarget = FrequencyDialog::FDIALOG_TARGET_DEFAULT;
stoppedDev = nullptr;
//set OpenGL configuration:
m_glContextAttributes = new wxGLContextAttrs();
wxGLContextAttrs glSettings;
glSettings.CompatibilityProfile().EndList();
*m_glContextAttributes = glSettings;
}
void CubicSDR::initAudioDevices() const {
std::vector<RtAudio::DeviceInfo> devices;
std::map<int, RtAudio::DeviceInfo> inputDevices, outputDevices;
AudioThread::enumerateDevices(devices);
int i = 0;
for (auto & device : devices) {
if (device.inputChannels) {
inputDevices[i] = device;
}
if (device.outputChannels) {
outputDevices[i] = device;
}
i++;
}
wxGetApp().getDemodMgr().setOutputDevices(outputDevices);
}
bool CubicSDR::OnInit() {
@ -226,7 +275,7 @@ bool CubicSDR::OnInit() {
}
//Deactivated code to allocate an explicit Console on Windows.
//This tends to hang the apllication on heavy demod (re)creation.
//This tends to hang the application on heavy demod (re)creation.
//To continue to debug with std::cout traces, simply run CubicSDR in a MINSYS2 compatble shell on Windows:
//ex: Cygwin shell, Git For Windows Bash shell....
#if (0)
@ -244,7 +293,7 @@ bool CubicSDR::OnInit() {
#endif
wxApp::SetAppName("CubicSDR");
wxApp::SetAppName(CUBICSDR_INSTALL_NAME);
#ifdef USE_HAMLIB
t_Rig = nullptr;
@ -257,6 +306,7 @@ bool CubicSDR::OnInit() {
Modem::addModemFactory(ModemNBFM::factory, "NBFM", 12500);
Modem::addModemFactory(ModemFMStereo::factory, "FMS", 200000);
Modem::addModemFactory(ModemAM::factory, "AM", 6000);
Modem::addModemFactory(ModemCW::factory, "CW", 500);
Modem::addModemFactory(ModemLSB::factory, "LSB", 5400);
Modem::addModemFactory(ModemUSB::factory, "USB", 5400);
Modem::addModemFactory(ModemDSB::factory, "DSB", 5400);
@ -267,9 +317,7 @@ bool CubicSDR::OnInit() {
Modem::addModemFactory(ModemASK::factory, "ASK", 200000);
Modem::addModemFactory(ModemBPSK::factory, "BPSK", 200000);
Modem::addModemFactory(ModemDPSK::factory, "DPSK", 200000);
#if ENABLE_LIQUID_EXPERIMENTAL
Modem::addModemFactory(ModemFSK::factory, "FSK", 19200);
#endif
Modem::addModemFactory(ModemGMSK::factory, "GMSK", 19200);
Modem::addModemFactory(ModemOOK::factory, "OOK", 200000);
Modem::addModemFactory(ModemPSK::factory, "PSK", 200000);
@ -286,21 +334,22 @@ bool CubicSDR::OnInit() {
devicesFailed.store(false);
deviceSelectorOpen.store(false);
initAudioDevices();
// Visual Data
spectrumVisualThread = new SpectrumVisualDataThread();
pipeIQVisualData = new DemodulatorThreadInputQueue();
pipeIQVisualData = std::make_shared<DemodulatorThreadInputQueue>();
pipeIQVisualData->set_max_num_items(1);
pipeWaterfallIQVisualData = new DemodulatorThreadInputQueue();
pipeWaterfallIQVisualData = std::make_shared<DemodulatorThreadInputQueue>();
pipeWaterfallIQVisualData->set_max_num_items(128);
getSpectrumProcessor()->setInput(pipeIQVisualData);
getSpectrumProcessor()->setHideDC(true);
// I/Q Data
pipeSDRIQData = new SDRThreadIQDataQueue();
pipeSDRIQData = std::make_shared<SDRThreadIQDataQueue>();
pipeSDRIQData->set_max_num_items(100);
sdrThread = new SDRThread();
@ -311,12 +360,9 @@ bool CubicSDR::OnInit() {
sdrPostThread->setOutputQueue("IQVisualDataOutput", pipeIQVisualData);
sdrPostThread->setOutputQueue("IQDataOutput", pipeWaterfallIQVisualData);
t_PostSDR = new std::thread(&SDRPostThread::threadMain, sdrPostThread);
t_SpectrumVisual = new std::thread(&SpectrumVisualDataThread::threadMain, spectrumVisualThread);
#if CUBICSDR_ENABLE_VIEW_SCOPE
pipeAudioVisualData = new DemodulatorThreadOutputQueue();
pipeAudioVisualData = std::make_shared<DemodulatorThreadOutputQueue>();
pipeAudioVisualData->set_max_num_items(1);
scopeProcessor.setInput(pipeAudioVisualData);
@ -326,17 +372,31 @@ bool CubicSDR::OnInit() {
#if CUBICSDR_ENABLE_VIEW_DEMOD
demodVisualThread = new SpectrumVisualDataThread();
pipeDemodIQVisualData = new DemodulatorThreadInputQueue();
pipeDemodIQVisualData = std::make_shared<DemodulatorThreadInputQueue>();
pipeDemodIQVisualData->set_max_num_items(1);
if (getDemodSpectrumProcessor()) getDemodSpectrumProcessor()->setInput(pipeDemodIQVisualData);
if (getDemodSpectrumProcessor()) {
getDemodSpectrumProcessor()->setInput(pipeDemodIQVisualData);
}
sdrPostThread->setOutputQueue("IQActiveDemodVisualDataOutput", pipeDemodIQVisualData);
t_DemodVisual = new std::thread(&SpectrumVisualDataThread::threadMain, demodVisualThread);
#else
demodVisualThread = nullptr;
pipeDemodIQVisualData = nullptr;
t_DemodVisual = nullptr;
#endif
// Now that input/output queue plumbing is completely done, we can
//safely starts all the threads:
t_SpectrumVisual = new std::thread(&SpectrumVisualDataThread::threadMain, spectrumVisualThread);
if (demodVisualThread != nullptr) {
t_DemodVisual = new std::thread(&SpectrumVisualDataThread::threadMain, demodVisualThread);
}
//Start SDRPostThread last.
t_PostSDR = new std::thread(&SDRPostThread::threadMain, sdrPostThread);
sdrEnum = new SDREnumerator();
SDREnumerator::setManuals(config.getManualDevices());
@ -371,49 +431,81 @@ bool CubicSDR::OnInit() {
}
int CubicSDR::OnExit() {
shuttingDown.store(true);
#if USE_HAMLIB
if (rigIsActive()) {
std::cout << "Terminating Rig thread.." << std::endl;
std::cout << "Terminating Rig thread.." << std::endl << std::flush;
stopRig();
}
#endif
bool terminationSequenceOK = true;
//The thread feeding them all should be terminated first, so:
std::cout << "Terminating SDR thread.." << std::endl;
std::cout << "Terminating SDR thread.." << std::endl << std::flush ;
sdrThread->terminate();
sdrThread->isTerminated(3000);
if (t_SDR) {
t_SDR->join();
delete t_SDR;
t_SDR = nullptr;
terminationSequenceOK = terminationSequenceOK && sdrThread->isTerminated(3000);
//in case termination sequence goes wrong, kill App brutally now because it can get stuck.
if (!terminationSequenceOK) {
//no trace here because it could occur if the device is not started.
::exit(11);
}
std::cout << "Terminating SDR post-processing thread.." << std::endl;
std::cout << "Terminating SDR post-processing thread.." << std::endl << std::flush;
sdrPostThread->terminate();
std::cout << "Terminating All Demodulators.." << std::endl;
//Wait for termination for sdrPostThread second:: since it is doing
//mostly blocking push() to the other threads, they must stay alive
//so that sdrPostThread can complete a processing loop and die.
terminationSequenceOK = terminationSequenceOK && sdrPostThread->isTerminated(3000);
//in case termination sequence goes wrong, kill App brutally now because it can get stuck.
if (!terminationSequenceOK) {
std::cout << "Cannot terminate application properly, calling exit() now." << std::endl << std::flush;
::exit(12);
}
std::cout << "Terminating All Demodulators.." << std::endl << std::flush;
demodMgr.terminateAll();
std::cout << "Terminating Visual Processor threads.." << std::endl;
std::cout << "Terminating Visual Processor threads.." << std::endl << std::flush;
spectrumVisualThread->terminate();
if (demodVisualThread) {
demodVisualThread->terminate();
}
//Wait nicely
sdrPostThread->isTerminated(1000);
spectrumVisualThread->isTerminated(1000);
terminationSequenceOK = terminationSequenceOK && spectrumVisualThread->isTerminated(1000);
if (demodVisualThread) {
demodVisualThread->isTerminated(1000);
terminationSequenceOK = terminationSequenceOK && demodVisualThread->isTerminated(1000);
}
//in case termination sequence goes wrong, kill App brutally because it can get stuck.
if (!terminationSequenceOK) {
std::cout << "Cannot terminate application properly, calling exit() now." << std::endl << std::flush;
::exit(13);
}
//Then join the thread themselves:
if (t_SDR) {
t_SDR->join();
}
//Then join the thread themselves
t_PostSDR->join();
if (t_DemodVisual) t_DemodVisual->join();
if (t_DemodVisual) {
t_DemodVisual->join();
}
t_SpectrumVisual->join();
//Now only we can delete
//Now only we can delete:
delete t_SDR;
t_SDR = nullptr;
delete sdrThread;
sdrThread = nullptr;
@ -434,22 +526,14 @@ int CubicSDR::OnExit() {
delete demodVisualThread;
demodVisualThread = nullptr;
delete pipeIQVisualData;
pipeIQVisualData = nullptr;
delete pipeAudioVisualData;
pipeAudioVisualData = nullptr;
delete pipeSDRIQData;
pipeSDRIQData = nullptr;
delete m_glContext;
m_glContext = nullptr;
#ifdef __APPLE__
//
AudioThread::deviceCleanup();
#endif
std::cout << "Application termination complete." << std::endl << std::flush;
return wxApp::OnExit();
}
@ -457,27 +541,30 @@ int CubicSDR::OnExit() {
PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
PrimaryGLContext *glContext;
if (!m_glContext) {
m_glContext = new PrimaryGLContext(canvas, NULL);
m_glContext = new PrimaryGLContext(canvas, nullptr, GetContextAttributes());
}
glContext = m_glContext;
return *glContext;
}
wxGLContextAttrs* CubicSDR::GetContextAttributes() {
return m_glContextAttributes;
}
void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) {
parser.SetDesc (commandLineInfo);
parser.SetSwitchChars (wxT("-"));
}
bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
wxString *confName = new wxString;
auto *confName = new wxString;
if (parser.Found("c",confName)) {
if (confName) {
if (!confName->empty()) {
config.setConfigName(confName->ToStdString());
}
}
config.load();
#ifdef BUNDLE_SOAPY_MODS
if (parser.Found("b")) {
@ -489,10 +576,10 @@ bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
useLocalMod.store(true);
#endif
wxString *modPath = new wxString;
auto *modPath = new wxString;
if (parser.Found("m",modPath)) {
if (modPath) {
if (!modPath->empty()) {
modulePath = modPath->ToStdString();
} else {
modulePath = "";
@ -515,21 +602,26 @@ void CubicSDR::deviceSelector() {
return;
}
deviceSelectorOpen.store(true);
deviceSelectorDialog = new SDRDevicesDialog(appframe);
wxRect *winRect = getConfig()->getWindow();
wxPoint pos(wxDefaultPosition);
if (winRect != nullptr) {
pos = wxPoint(winRect->x, winRect->y);
}
deviceSelectorDialog = new SDRDevicesDialog(appframe, pos);
deviceSelectorDialog->Show();
}
void CubicSDR::addRemote(std::string remoteAddr) {
void CubicSDR::addRemote(const std::string& remoteAddr) {
SDREnumerator::addRemote(remoteAddr);
devicesReady.store(false);
t_SDREnum = new std::thread(&SDREnumerator::threadMain, sdrEnum);
}
void CubicSDR::removeRemote(std::string remoteAddr) {
void CubicSDR::removeRemote(const std::string& remoteAddr) {
SDREnumerator::removeRemote(remoteAddr);
}
void CubicSDR::sdrThreadNotify(SDRThread::SDRThreadState state, std::string message) {
void CubicSDR::sdrThreadNotify(SDRThread::SDRThreadState state, const std::string& message) {
std::lock_guard < std::mutex > lock(notify_busy);
@ -590,9 +682,37 @@ long long CubicSDR::getOffset() {
void CubicSDR::setOffset(long long ofs) {
offset = ofs;
sdrThread->setOffset(offset);
SDRDeviceInfo *dev = getDevice();
config.getDevice(dev->getDeviceId())->setOffset(ofs);
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->setOffset(offset);
}
}
void CubicSDR::setAntennaName(const std::string& name) {
antennaName = name;
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->setAntenna(antennaName);
}
}
const std::string& CubicSDR::getAntennaName() {
return antennaName;
}
void CubicSDR::setChannelizerType(SDRPostThreadChannelizerType chType) {
if (sdrPostThread && !sdrPostThread->isTerminated()) {
sdrPostThread->setChannelizerType(chType);
}
}
SDRPostThreadChannelizerType CubicSDR::getChannelizerType() {
if (sdrPostThread && !sdrPostThread->isTerminated()) {
return sdrPostThread->getChannelizerType();
}
return SDRPostThreadChannelizerType::SDRPostPFBCH;
}
long long CubicSDR::getFrequency() {
@ -615,24 +735,30 @@ bool CubicSDR::isFrequencyLocked() {
void CubicSDR::unlockFrequency() {
frequency_locked.store(false);
sdrThread->unlockFrequency();
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->unlockFrequency();
}
}
void CubicSDR::setSampleRate(long long rate_in) {
sampleRate = rate_in;
sdrThread->setSampleRate(sampleRate);
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->setSampleRate(sampleRate);
}
setFrequency(frequency);
if (rate_in <= CHANNELIZER_RATE_MAX / 8) {
appframe->setMainWaterfallFFTSize(512);
appframe->setMainWaterfallFFTSize(DEFAULT_FFT_SIZE / 4);
appframe->getWaterfallDataThread()->getProcessor()->setHideDC(false);
spectrumVisualThread->getProcessor()->setHideDC(false);
} else if (rate_in <= CHANNELIZER_RATE_MAX) {
appframe->setMainWaterfallFFTSize(1024);
appframe->setMainWaterfallFFTSize(DEFAULT_FFT_SIZE / 2);
appframe->getWaterfallDataThread()->getProcessor()->setHideDC(false);
spectrumVisualThread->getProcessor()->setHideDC(false);
} else if (rate_in > CHANNELIZER_RATE_MAX) {
appframe->setMainWaterfallFFTSize(2048);
appframe->setMainWaterfallFFTSize(DEFAULT_FFT_SIZE);
appframe->getWaterfallDataThread()->getProcessor()->setHideDC(true);
spectrumVisualThread->getProcessor()->setHideDC(true);
}
@ -640,7 +766,7 @@ void CubicSDR::setSampleRate(long long rate_in) {
void CubicSDR::stopDevice(bool store, int waitMsForTermination) {
//Firt we must stop the threads
//First we must stop the threads
sdrThread->terminate();
sdrThread->isTerminated(waitMsForTermination);
@ -711,13 +837,8 @@ void CubicSDR::setDevice(SDRDeviceInfo *dev, int waitMsForTermination) {
setPPM(devConfig->getPPM());
setOffset(devConfig->getOffset());
if (devConfig->getAGCMode()) {
setAGCMode(true);
} else {
setAGCMode(false);
}
setAGCMode(devConfig->getAGCMode());
setAntennaName(devConfig->getAntennaName());
t_SDR = new std::thread(&SDRThread::threadMain, sdrThread);
}
@ -749,24 +870,28 @@ SpectrumVisualProcessor *CubicSDR::getDemodSpectrumProcessor() {
}
}
DemodulatorThreadOutputQueue* CubicSDR::getAudioVisualQueue() {
DemodulatorThreadOutputQueuePtr CubicSDR::getAudioVisualQueue() {
return pipeAudioVisualData;
}
DemodulatorThreadInputQueue* CubicSDR::getIQVisualQueue() {
DemodulatorThreadInputQueuePtr CubicSDR::getIQVisualQueue() {
return pipeIQVisualData;
}
DemodulatorThreadInputQueue* CubicSDR::getWaterfallVisualQueue() {
DemodulatorThreadInputQueuePtr CubicSDR::getWaterfallVisualQueue() {
return pipeWaterfallIQVisualData;
}
BookmarkMgr &CubicSDR::getBookmarkMgr() {
return bookmarkMgr;
}
DemodulatorMgr &CubicSDR::getDemodMgr() {
return demodMgr;
}
BookmarkMgr &CubicSDR::getBookmarkMgr() {
return bookmarkMgr;
SessionMgr &CubicSDR::getSessionMgr() {
return sessionMgr;
}
SDRPostThread *CubicSDR::getSDRPostThread() {
@ -778,30 +903,21 @@ SDRThread *CubicSDR::getSDRThread() {
}
void CubicSDR::bindDemodulator(DemodulatorInstance *demod) {
if (!demod) {
return;
}
sdrPostThread->bindDemodulator(demod);
}
void CubicSDR::bindDemodulators(std::vector<DemodulatorInstance *> *demods) {
if (!demods) {
return;
}
sdrPostThread->bindDemodulators(demods);
void CubicSDR::notifyDemodulatorsChanged() {
sdrPostThread->notifyDemodulatorsChanged();
}
long long CubicSDR::getSampleRate() {
return sampleRate;
}
void CubicSDR::removeDemodulator(DemodulatorInstance *demod) {
void CubicSDR::removeDemodulator(const DemodulatorInstancePtr& demod) {
if (!demod) {
return;
}
demod->setActive(false);
sdrPostThread->removeDemodulator(demod);
sdrPostThread->notifyDemodulatorsChanged();
wxGetApp().getAppFrame()->notifyUpdateModemProperties();
}
@ -820,11 +936,8 @@ void CubicSDR::saveConfig() {
void CubicSDR::setPPM(int ppm_in) {
ppm = ppm_in;
sdrThread->setPPM(ppm);
SDRDeviceInfo *dev = getDevice();
if (dev) {
config.getDevice(dev->getDeviceId())->setPPM(ppm_in);
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->setPPM(ppm);
}
}
@ -836,7 +949,7 @@ int CubicSDR::getPPM() {
return ppm;
}
void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode, wxString initString) {
void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode, const wxString& initString) {
const wxString demodTitle("Set Demodulator Frequency");
const wxString freqTitle("Set Center Frequency");
const wxString bwTitle("Modem Bandwidth (150Hz - 500KHz)");
@ -845,11 +958,12 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
const wxString gainTitle("Gain Entry: "+wxGetApp().getActiveGainEntry());
wxString title;
auto activeModem = demodMgr.getActiveContextModem();
switch (targetMode) {
case FrequencyDialog::FDIALOG_TARGET_DEFAULT:
case FrequencyDialog::FDIALOG_TARGET_FREQ:
title = demodMgr.getActiveDemodulator()?demodTitle:freqTitle;
title = activeModem ?demodTitle:freqTitle;
break;
case FrequencyDialog::FDIALOG_TARGET_BANDWIDTH:
title = bwTitle;
@ -862,21 +976,21 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
break;
case FrequencyDialog::FDIALOG_TARGET_GAIN:
title = gainTitle;
if (wxGetApp().getActiveGainEntry() == "") {
if (wxGetApp().getActiveGainEntry().empty()) {
return;
}
break;
default:
break;
}
FrequencyDialog fdialog(appframe, -1, title, demodMgr.getActiveDemodulator(), wxPoint(-100,-100), wxSize(350, 75), wxDEFAULT_DIALOG_STYLE, targetMode, initString);
FrequencyDialog fdialog(appframe, -1, title, activeModem, wxPoint(-100,-100), wxSize(350, 75), wxDEFAULT_DIALOG_STYLE, targetMode, initString);
fdialog.ShowModal();
}
void CubicSDR::showLabelInput() {
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
DemodulatorInstancePtr activeDemod = wxGetApp().getDemodMgr().getActiveContextModem();
if (activeDemod != nullptr) {
@ -891,11 +1005,11 @@ AppFrame *CubicSDR::getAppFrame() {
return appframe;
}
void CubicSDR::setFrequencySnap(int snap) {
if (snap > 1000000) {
snap = 1000000;
void CubicSDR::setFrequencySnap(int snap_in) {
if (snap_in > 1000000) {
snap_in = 1000000;
}
this->snap = snap;
this->snap = snap_in;
}
int CubicSDR::getFrequencySnap() {
@ -906,6 +1020,14 @@ bool CubicSDR::areDevicesReady() {
return devicesReady.load();
}
void CubicSDR::notifyMainUIOfDeviceChange(bool forceRefreshOfGains) {
appframe->notifyDeviceChanged();
if (forceRefreshOfGains) {
appframe->refreshGainUI();
}
}
bool CubicSDR::areDevicesEnumerating() {
return !sdrEnum->isTerminated();
}
@ -932,7 +1054,10 @@ bool CubicSDR::isDeviceSelectorOpen() {
void CubicSDR::setAGCMode(bool mode) {
agcMode.store(mode);
sdrThread->setAGCMode(mode);
if (sdrThread && !sdrThread->isTerminated()) {
sdrThread->setAGCMode(mode);
}
}
bool CubicSDR::getAGCMode() {
@ -940,11 +1065,11 @@ bool CubicSDR::getAGCMode() {
}
void CubicSDR::setGain(std::string name, float gain_in) {
void CubicSDR::setGain(const std::string& name, float gain_in) {
sdrThread->setGain(name,gain_in);
}
float CubicSDR::getGain(std::string name) {
float CubicSDR::getGain(const std::string& name) {
return sdrThread->getGain(name);
}
@ -980,6 +1105,11 @@ bool CubicSDR::getSoloMode() {
return soloMode.load();
}
bool CubicSDR::isShuttingDown()
{
return shuttingDown.load();
}
int CubicSDR::FilterEvent(wxEvent& event) {
if (!appframe) {
return -1;
@ -1040,9 +1170,12 @@ void CubicSDR::stopRig() {
}
if (rigThread) {
rigThread->terminate();
rigThread->isTerminated(1000);
if (rigThread->getErrorState()) {
ActionDialog::showDialog(new ActionDialogRigError(rigThread->getErrorMessage()));
}
}
if (t_Rig && t_Rig->joinable()) {

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
//WX_GL_CORE_PROFILE 1
@ -9,13 +12,9 @@
#include "GLExt.h"
#include "PrimaryGLContext.h"
#include "ThreadQueue.h"
#ifdef USE_RTL_SDR
#include "SDRThread.h"
#else
#include "SoapySDRThread.h"
#include "SDREnumerator.h"
#endif
#include "ThreadBlockingQueue.h"
#include "SoapySDRThread.h"
#include "SDREnumerator.h"
#include "SDRPostThread.h"
#include "AudioThread.h"
#include "DemodulatorMgr.h"
@ -24,6 +23,7 @@
#include "FrequencyDialog.h"
#include "DemodLabelDialog.h"
#include "BookmarkMgr.h"
#include "SessionMgr.h"
#include "ScopeVisualProcessor.h"
#include "SpectrumVisualProcessor.h"
@ -34,6 +34,7 @@
#include "ModemFM.h"
#include "ModemNBFM.h"
#include "ModemFMStereo.h"
#include "ModemCW.h"
#include "ModemAM.h"
#include "ModemUSB.h"
#include "ModemLSB.h"
@ -45,9 +46,7 @@
#include "ModemASK.h"
#include "ModemBPSK.h"
#include "ModemDPSK.h"
#if ENABLE_LIQUID_EXPERIMENTAL
#include "ModemFSK.h"
#endif
#include "ModemGMSK.h"
#include "ModemOOK.h"
#include "ModemPSK.h"
@ -74,15 +73,16 @@ public:
CubicSDR();
PrimaryGLContext &GetContext(wxGLCanvas *canvas);
wxGLContextAttrs* GetContextAttributes();
virtual bool OnInit();
virtual int OnExit();
bool OnInit() override;
int OnExit() override;
virtual void OnInitCmdLine(wxCmdLineParser& parser);
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
void OnInitCmdLine(wxCmdLineParser& parser) override;
bool OnCmdLineParsed(wxCmdLineParser& parser) override;
void deviceSelector();
void sdrThreadNotify(SDRThread::SDRThreadState state, std::string message);
void sdrThreadNotify(SDRThread::SDRThreadState state, const std::string& message);
void sdrEnumThreadNotify(SDREnumerator::SDREnumState state, std::string message);
void setFrequency(long long freq);
@ -94,13 +94,18 @@ public:
void setOffset(long long ofs);
long long getOffset();
void setDBOffset(int ofs);
int getDBOffset();
void setAntennaName(const std::string& name);
const std::string& getAntennaName();
void setChannelizerType(SDRPostThreadChannelizerType chType);
SDRPostThreadChannelizerType getChannelizerType();
void setSampleRate(long long rate_in);
long long getSampleRate();
std::vector<SDRDeviceInfo *> *getDevices();
void setDevice(SDRDeviceInfo *dev, int waitMsForTermination);
void stopDevice(bool store, int waitMsForTermination);
@ -110,21 +115,22 @@ public:
SpectrumVisualProcessor *getSpectrumProcessor();
SpectrumVisualProcessor *getDemodSpectrumProcessor();
DemodulatorThreadOutputQueue* getAudioVisualQueue();
DemodulatorThreadInputQueue* getIQVisualQueue();
DemodulatorThreadInputQueue* getWaterfallVisualQueue();
DemodulatorThreadInputQueue* getActiveDemodVisualQueue();
DemodulatorThreadOutputQueuePtr getAudioVisualQueue();
DemodulatorThreadInputQueuePtr getIQVisualQueue();
DemodulatorThreadInputQueuePtr getWaterfallVisualQueue();
DemodulatorMgr &getDemodMgr();
BookmarkMgr &getBookmarkMgr();
SessionMgr &getSessionMgr();
SDRPostThread *getSDRPostThread();
SDRThread *getSDRThread();
void bindDemodulator(DemodulatorInstance *demod);
void bindDemodulators(std::vector<DemodulatorInstance *> *demods);
void removeDemodulator(DemodulatorInstance *demod);
void notifyDemodulatorsChanged();
void removeDemodulator(const DemodulatorInstancePtr& demod);
void setFrequencySnap(int snap);
void setFrequencySnap(int snap_in);
int getFrequencySnap();
AppConfig *getConfig();
@ -133,7 +139,7 @@ public:
void setPPM(int ppm_in);
int getPPM();
void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, wxString initString = "");
void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, const wxString& initString = "");
void showLabelInput();
AppFrame *getAppFrame();
@ -141,9 +147,11 @@ public:
bool areDevicesEnumerating();
bool areModulesMissing();
std::string getNotification();
void notifyMainUIOfDeviceChange(bool forceRefreshOfGains = false);
void addRemote(std::string remoteAddr);
void removeRemote(std::string remoteAddr);
void addRemote(const std::string& remoteAddr);
void removeRemote(const std::string& remoteAddr);
void setDeviceSelectorClosed();
void reEnumerateDevices();
@ -153,8 +161,8 @@ public:
void setAGCMode(bool mode);
bool getAGCMode();
void setGain(std::string name, float gain_in);
float getGain(std::string name);
void setGain(const std::string& name, float gain_in);
float getGain(const std::string& name);
void setStreamArgs(SoapySDR::Kwargs streamArgs_in);
void setDeviceArgs(SoapySDR::Kwargs settingArgs_in);
@ -167,6 +175,8 @@ public:
void setSoloMode(bool solo);
bool getSoloMode();
bool isShuttingDown();
#ifdef USE_HAMLIB
RigThread *getRigThread();
@ -176,21 +186,26 @@ public:
#endif
private:
int FilterEvent(wxEvent& event);
int FilterEvent(wxEvent& event) override;
AppFrame *appframe = nullptr;
AppConfig config;
PrimaryGLContext *m_glContext = nullptr;
wxGLContextAttrs *m_glContextAttributes = nullptr;
std::vector<SDRDeviceInfo *> *devs = nullptr;
DemodulatorMgr demodMgr;
BookmarkMgr bookmarkMgr;
SessionMgr sessionMgr;
std::atomic_llong frequency;
std::atomic_llong offset;
std::atomic_int ppm, snap;
std::atomic_llong sampleRate;
std::string antennaName;
std::atomic_bool agcMode;
std::atomic_bool shuttingDown;
SDRThread *sdrThread = nullptr;
SDREnumerator *sdrEnum = nullptr;
@ -198,12 +213,12 @@ private:
SpectrumVisualDataThread *spectrumVisualThread = nullptr;
SpectrumVisualDataThread *demodVisualThread = nullptr;
SDRThreadIQDataQueue* pipeSDRIQData = nullptr;
DemodulatorThreadInputQueue* pipeIQVisualData = nullptr;
DemodulatorThreadOutputQueue* pipeAudioVisualData = nullptr;
DemodulatorThreadInputQueue* pipeDemodIQVisualData = nullptr;
DemodulatorThreadInputQueue* pipeWaterfallIQVisualData = nullptr;
DemodulatorThreadInputQueue* pipeActiveDemodIQVisualData = nullptr;
SDRThreadIQDataQueuePtr pipeSDRIQData;
DemodulatorThreadInputQueuePtr pipeIQVisualData;
DemodulatorThreadOutputQueuePtr pipeAudioVisualData;
DemodulatorThreadInputQueuePtr pipeDemodIQVisualData;
DemodulatorThreadInputQueuePtr pipeWaterfallIQVisualData;
DemodulatorThreadInputQueuePtr pipeActiveDemodIQVisualData;
ScopeVisualProcessor scopeProcessor;
@ -237,13 +252,15 @@ private:
RigThread* rigThread = nullptr;
std::thread *t_Rig = nullptr;
#endif
void initAudioDevices() const;
};
static const wxCmdLineEntryDesc commandLineInfo [] =
{
{ wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
{ wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'", wxCMD_LINE_VAL_STRING, 0 },
{ wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'", wxCMD_LINE_VAL_STRING, 0 },
{ wxCMD_LINE_OPTION, "m", "modpath", "Load modules from supplied path, i.e. '-m ~/SoapyMods/'", wxCMD_LINE_VAL_STRING, 0 },
#ifdef BUNDLE_SOAPY_MODS
{ wxCMD_LINE_SWITCH, "b", "bundled", "Use bundled SoapySDR modules first instead of local.", wxCMD_LINE_VAL_NONE, 0 },
#endif

View File

@ -1,5 +1,12 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#if defined(__linux__) || defined(__FreeBSD__)
#include <sys/param.h>
#endif
#define CUBICSDR_TITLE "" CUBICSDR_BUILD_TITLE
#ifndef __BYTE_ORDER
@ -13,7 +20,11 @@
#ifdef __APPLE__
#include <machine/endian.h>
#else
#include <endian.h>
#ifdef __FreeBSD__
#include <sys/endian.h>
#else
#include <endian.h>
#endif
#endif
#endif
#endif
@ -28,13 +39,35 @@ const char filePathSeparator =
#define BUF_SIZE (16384*6)
#define DEFAULT_SAMPLE_RATE 2500000
//
#define DEFAULT_FFT_SIZE 2048
#define DEFAULT_DMOD_FFT_SIZE (DEFAULT_FFT_SIZE / 2)
#define DEFAULT_SCOPE_FFT_SIZE (DEFAULT_FFT_SIZE / 2)
//Both must be a power of 2 to prevent terrible OpenGL performance.
//TODO: Make the waterfall resolutions an option.
#define DEFAULT_MAIN_WATERFALL_LINES_NB 512 // 1024
#define DEFAULT_DEMOD_WATERFALL_LINES_NB 256
#define DEFAULT_DEMOD_TYPE "FM"
#define DEFAULT_DEMOD_BW 200000
#define DEFAULT_WATERFALL_LPS 30
//Dmod waterfall lines per second is adjusted
//so that the whole demod waterfall show DEMOD_WATERFALL_DURATION_IN_SECONDS
//seconds.
#define DEMOD_WATERFALL_DURATION_IN_SECONDS 4.0
#define CHANNELIZER_RATE_MAX 500000
#define MANUAL_SAMPLE_RATE_MIN 2000000 // 2MHz
#define MANUAL_SAMPLE_RATE_MAX 200000000 // 200MHz (We are 2017+ after all)
//Represents the amount of time to process in the FFT distributor.
#define FFT_DISTRIBUTOR_BUFFER_IN_SECONDS 0.250
//The maximum number of listed sample rates for a device, to be able to handle
//devices returning an insane amount because they have quasi-continuous ranges (UHD...)
#define DEVICE_SAMPLE_RATES_MAX_NB 25

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#include "DemodLabelDialog.h"
#include "wx/clipbrd.h"
@ -10,13 +13,13 @@ EVT_SHOW(DemodLabelDialog::OnShow)
wxEND_EVENT_TABLE()
DemodLabelDialog::DemodLabelDialog(wxWindow * parent, wxWindowID id, const wxString & title,
DemodulatorInstance *demod, const wxPoint & position,
DemodulatorInstancePtr demod, const wxPoint & position,
const wxSize & size, long style) :
wxDialog(parent, id, title, position, size, style) {
wxString labelStr;
//by construction, is allways != nullptr
//by construction, is always != nullptr
activeDemod = demod;
labelStr = activeDemod->getDemodulatorUserLabel();
@ -27,13 +30,20 @@ DemodLabelDialog::DemodLabelDialog(wxWindow * parent, wxWindowID id, const wxStr
}
dialogText = new wxTextCtrl(this, wxID_LABEL_INPUT, labelStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70),
wxTE_PROCESS_ENTER);
dialogText = new wxTextCtrl(this, wxID_LABEL_INPUT, labelStr, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
dialogText->SetFont(wxFont(15, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
// Set the textControl width to the [title + 100%] or the [content +100%],
// whichever's the greater.
int textCtrlX = dialogText->GetTextExtent(labelStr).GetWidth();
int titleX = this->GetTextExtent(title).GetWidth();
dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * textCtrlX)), -1));
auto* dialogsizer = new wxBoxSizer(wxALL);
dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
SetSizerAndFit(dialogsizer);
Centre();
dialogText->SetValue(labelStr);
dialogText->SetSelection(-1, -1);
}
@ -80,7 +90,7 @@ void DemodLabelDialog::OnChar(wxKeyEvent& event) {
}
else {
#ifdef __linux__
#if defined(__linux__) || defined(__FreeBSD__)
dialogText->OnChar(event);
event.Skip();
#else

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include "wx/dialog.h"
@ -13,7 +16,7 @@ class DemodLabelDialog : public wxDialog
public:
DemodLabelDialog( wxWindow * parent, wxWindowID id, const wxString & title,
DemodulatorInstance *demod = NULL,
DemodulatorInstancePtr demod = nullptr,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
@ -21,8 +24,7 @@ public:
wxTextCtrl * dialogText;
private:
DemodulatorInstance *activeDemod = nullptr;
void OnEnter ( wxCommandEvent &event );
DemodulatorInstancePtr activeDemod = nullptr;
void OnChar ( wxKeyEvent &event );
void OnShow(wxShowEvent &event);
DECLARE_EVENT_TABLE()

View File

@ -1,7 +1,11 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#include "FrequencyDialog.h"
#include "wx/clipbrd.h"
#include <sstream>
#include <algorithm>
#include "CubicSDR.h"
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog)
@ -9,13 +13,15 @@ EVT_CHAR_HOOK(FrequencyDialog::OnChar)
EVT_SHOW(FrequencyDialog::OnShow)
wxEND_EVENT_TABLE()
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstance *demod, const wxPoint & position,
const wxSize & size, long style, FrequencyDialogTarget targetMode, wxString initString) :
wxDialog(parent, id, title, position, size, style) {
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstancePtr demod, const wxPoint & /*position*/,
const wxSize & /*size*/, long style, FrequencyDialogTarget targetMode, wxString initString) :
wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, style) {
wxString freqStr;
activeDemod = demod;
this->targetMode = targetMode;
this->initialString = initString;
this->initialString = initString;
if (targetMode == FDIALOG_TARGET_DEFAULT) {
if (activeDemod) {
@ -24,7 +30,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
freqStr = frequencyToStr(wxGetApp().getFrequency());
}
}
if (targetMode == FDIALOG_TARGET_BANDWIDTH) {
std::string lastDemodType = activeDemod?activeDemod->getDemodulatorType():wxGetApp().getDemodMgr().getLastDemodulatorType();
if (lastDemodType == "USB" || lastDemodType == "LSB") {
@ -33,7 +39,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
freqStr = frequencyToStr(wxGetApp().getDemodMgr().getLastBandwidth());
}
}
if (targetMode == FDIALOG_TARGET_WATERFALL_LPS) {
freqStr = std::to_string(wxGetApp().getAppFrame()->getWaterfallDataThread()->getLinesPerSecond());
}
@ -43,23 +49,31 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
}
if (targetMode == FDIALOG_TARGET_GAIN) {
if (wxGetApp().getActiveGainEntry() != "") {
if (!wxGetApp().getActiveGainEntry().empty()) {
freqStr = std::to_string((int)wxGetApp().getGain(wxGetApp().getActiveGainEntry()));
}
}
dialogText = new wxTextCtrl(this, wxID_FREQ_INPUT, freqStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70),
wxTE_PROCESS_ENTER);
dialogText->SetFont(wxFont(20, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
dialogText = new wxTextCtrl(this, wxID_FREQ_INPUT, freqStr, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
dialogText->SetFont(wxFont(15, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
// Set the textControl width to the [title + 100%] or the [content +100%],
// whichever's the greater.
int textCtrlX = dialogText->GetTextExtent(freqStr).GetWidth();
int initTextCtrlX = dialogText->GetTextExtent(initString).GetWidth();
int titleX = this->GetTextExtent(title).GetWidth();
dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * std::max(textCtrlX, initTextCtrlX))), -1));
auto* dialogsizer = new wxBoxSizer(wxALL);
dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
SetSizerAndFit(dialogsizer);
Centre();
if (initString != "" && initString.length() == 1) {
if (!initString.empty() && initString.length() == 1) {
dialogText->SetValue(initString);
dialogText->SetSelection(2, 2);
dialogText->SetFocus();
} else {
if (initString != "") {
if (!initString.empty()) {
dialogText->SetValue(initString);
}
dialogText->SetSelection(-1, -1);
@ -73,11 +87,11 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
double dblval;
std::string lastDemodType = activeDemod?activeDemod->getDemodulatorType():wxGetApp().getDemodMgr().getLastDemodulatorType();
std::string strValue = dialogText->GetValue().ToStdString();
bool ranged = false;
bool ranged;
std::string strValue2;
size_t range_pos;
switch (c) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
@ -92,7 +106,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
}
}
if (targetMode == FDIALOG_TARGET_DEFAULT) {
if (targetMode == FDIALOG_TARGET_DEFAULT || targetMode == FDIALOG_TARGET_FREQ) {
if (ranged) {
freq = strToFrequency(strValue);
freq2 = strToFrequency(strValue2);
@ -100,10 +114,16 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
freq = strToFrequency(strValue);
}
if (activeDemod) {
activeDemod->setTracking(true);
activeDemod->setFollow(true);
activeDemod->setFrequency(freq);
activeDemod->updateLabel(freq);
freq_ctr = wxGetApp().getFrequency();
range_bw = wxGetApp().getSampleRate();
if (freq_ctr - (range_bw / 2) > freq || freq_ctr + (range_bw / 2) < freq) {
wxGetApp().setFrequency(freq);
}
} else {
if (ranged && (freq || freq2)) {
if (freq > freq2) {
@ -119,7 +139,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
}
if (freq == freq2) {
wxGetApp().setFrequency(freq_ctr);
wxGetApp().getAppFrame()->setViewState(freq_ctr);
wxGetApp().getAppFrame()->setViewState();
} else {
if (wxGetApp().getSampleRate()/4 > range_bw) {
wxGetApp().setFrequency(freq_ctr + wxGetApp().getSampleRate()/4);
@ -138,6 +158,9 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
if (lastDemodType == "USB" || lastDemodType == "LSB") {
freq *= 2;
}
if (freq > CHANNELIZER_RATE_MAX) {
freq = CHANNELIZER_RATE_MAX;
}
if (activeDemod) {
activeDemod->setBandwidth(freq);
} else {
@ -147,7 +170,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
if (targetMode == FDIALOG_TARGET_WATERFALL_LPS) {
try {
freq = std::stoi(strValue);
} catch (exception e) {
} catch (const exception &) {
Close();
break;
}
@ -162,7 +185,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
if (targetMode == FDIALOG_TARGET_SPECTRUM_AVG) {
try {
dblval = std::stod(strValue);
} catch (exception e) {
} catch (const exception &) {
Close();
break;
}
@ -174,16 +197,16 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
}
wxGetApp().getAppFrame()->setSpectrumAvgSpeed(dblval);
}
if (targetMode == FDIALOG_TARGET_GAIN) {
try {
freq = std::stoi(strValue);
} catch (exception e) {
} catch (const exception &) {
break;
}
SDRDeviceInfo *devInfo = wxGetApp().getDevice();
std::string gainName = wxGetApp().getActiveGainEntry();
if (gainName == "") {
if (gainName.empty()) {
break;
}
SDRRangeMap gains = devInfo->getGains(SOAPY_SDR_RX, 0);
@ -213,7 +236,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
if (allowed.find_first_of(c) != std::string::npos || c == WXK_DELETE || c == WXK_BACK || c == WXK_NUMPAD_DECIMAL
|| (c >= WXK_NUMPAD0 && c <= WXK_NUMPAD9)) {
#ifdef __linux__
#if defined(__linux__) || defined(__FreeBSD__)
dialogText->OnChar(event);
event.Skip();
#else
@ -235,7 +258,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
}
void FrequencyDialog::OnShow(wxShowEvent &event) {
if (initialString.length() == 1) {
if (initialString.length() == 1) {
dialogText->SetFocus();
dialogText->SetSelection(2, 2);
}

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include "wx/dialog.h"
@ -21,7 +24,7 @@ public:
FDIALOG_TARGET_GAIN
} FrequencyDialogTarget;
FrequencyDialog ( wxWindow * parent, wxWindowID id, const wxString & title,
DemodulatorInstance *demod = NULL,
DemodulatorInstancePtr demod = nullptr,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
@ -31,8 +34,7 @@ public:
wxTextCtrl * dialogText;
private:
DemodulatorInstance *activeDemod;
void OnEnter ( wxCommandEvent &event );
DemodulatorInstancePtr activeDemod;
void OnChar ( wxKeyEvent &event );
void OnShow(wxShowEvent &event);
FrequencyDialogTarget targetMode;

View File

@ -1,8 +1,8 @@
#include "IOThread.h"
#include <typeinfo>
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
std::mutex ReBufferGC::g_mutex;
std::set<ReferenceCounter *> ReBufferGC::garbage;
#include "IOThread.h"
#include <memory>
#define SPIN_WAIT_SLEEP_MS 5
@ -52,47 +52,51 @@ void IOThread::threadMain() {
terminated.store(true);
stopping.store(true);
};
}
#endif
void IOThread::setup() {
//redefined in subclasses
};
}
void IOThread::run() {
//redefined in subclasses
};
}
void IOThread::terminate() {
stopping.store(true);
};
}
void IOThread::onBindOutput(std::string /* name */, ThreadQueueBase* /* threadQueue */) {
void IOThread::onBindOutput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
}
void IOThread::onBindInput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
};
}
void IOThread::onBindInput(std::string /* name */, ThreadQueueBase* /* threadQueue */) {
};
void IOThread::setInputQueue(std::string qname, ThreadQueueBase *threadQueue) {
void IOThread::setInputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue) {
std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
input_queues[qname] = threadQueue;
this->onBindInput(qname, threadQueue);
};
}
ThreadQueueBase *IOThread::getInputQueue(std::string qname) {
ThreadQueueBasePtr IOThread::getInputQueue(const std::string& qname) {
std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
return input_queues[qname];
};
}
void IOThread::setOutputQueue(std::string qname, ThreadQueueBase *threadQueue) {
void IOThread::setOutputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue) {
std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
output_queues[qname] = threadQueue;
this->onBindOutput(qname, threadQueue);
};
}
ThreadQueueBase *IOThread::getOutputQueue(std::string qname) {
ThreadQueueBasePtr IOThread::getOutputQueue(const std::string& qname) {
std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
return output_queues[qname];
};
}
bool IOThread::isTerminated(int waitMs) {
@ -104,13 +108,12 @@ bool IOThread::isTerminated(int waitMs) {
}
//this is a stupid busy plus sleep loop
int nbCyclesToWait = 0;
int nbCyclesToWait;
if (waitMs < 0) {
nbCyclesToWait = std::numeric_limits<int>::max();
}
else {
nbCyclesToWait = (waitMs / SPIN_WAIT_SLEEP_MS) + 1;
}
@ -123,7 +126,7 @@ bool IOThread::isTerminated(int waitMs) {
}
}
std::cout << "ERROR: thread '" << typeid(*this).name() << "' has not terminated in time ! (> " << waitMs << " ms)" << std::endl;
std::cout << "ERROR: thread '" << typeid(*this).name() << "' has not terminated in time ! (> " << waitMs << " ms)" << std::endl << std::flush;
return terminated.load();
}

View File

@ -1,3 +1,6 @@
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include <mutex>
@ -8,11 +11,13 @@
#include <string>
#include <iostream>
#include <thread>
#include "ThreadQueue.h"
#include <memory>
#include <climits>
#include "ThreadBlockingQueue.h"
#include "Timer.h"
#include "SpinMutex.h"
struct map_string_less : public std::binary_function<std::string,std::string,bool>
struct map_string_less
{
bool operator()(const std::string& a,const std::string& b) const
{
@ -20,163 +25,133 @@ struct map_string_less : public std::binary_function<std::string,std::string,boo
}
};
class ReferenceCounter {
template <typename PtrType>
class ReBufferAge {
public:
//default constructor, initialized with refcont 1, sounds very natural
ReferenceCounter() {
refCount = 1;
}
// void setIndex(int idx) {
// std::lock_guard < std::recursive_mutex > lock(m_mutex);
// index = idx;
// }
// int getIndex() {
// std::lock_guard < std::recursive_mutex > lock(m_mutex);
// return index;
// }
void setRefCount(int rc) {
std::lock_guard < std::recursive_mutex > lock(m_mutex);
refCount = rc;
}
void decRefCount() {
std::lock_guard < std::recursive_mutex > lock(m_mutex);
refCount--;
}
int getRefCount() {
std::lock_guard < std::recursive_mutex > lock(m_mutex);
return refCount;
ReBufferAge(PtrType p, int a) {
ptr = p;
age = a;
}
// Access to the own mutex protecting the ReferenceCounter, i.e the monitor of the class
std::recursive_mutex& getMonitor() const {
return m_mutex;
}
PtrType ptr;
int age;
protected:
//this is a basic mutex for all ReferenceCounter derivatives operations INCLUDING the counter itself for consistency !
mutable std::recursive_mutex m_mutex;
private:
int refCount;
// int index;
virtual ~ReBufferAge() = default;;
};
#define REBUFFER_GC_LIMIT 100
#define REBUFFER_WARNING_THRESHOLD 2000
class ReBufferGC {
public:
static void garbageCollect() {
std::lock_guard < std::mutex > lock(g_mutex);
std::deque<ReferenceCounter *> garbageRemoval;
for (typename std::set<ReferenceCounter *>::iterator i = garbage.begin(); i != garbage.end(); i++) {
if ((*i)->getRefCount() <= 0) {
garbageRemoval.push_back(*i);
}
else {
// std::cout << "Garbage in queue buffer idx #" << (*i)->getIndex() << ", " << (*i)->getRefCount() << " usage(s)" << std::endl;
std::cout << "Garbage in queue buffer with " << (*i)->getRefCount() << " usage(s)" << std::endl;
}
}
if ( garbageRemoval.size() ) {
std::cout << "Garbage collecting " << garbageRemoval.size() << " ReBuffer(s)" << std::endl;
while (!garbageRemoval.empty()) {
ReferenceCounter *ref = garbageRemoval.back();
garbageRemoval.pop_back();
garbage.erase(ref);
delete ref;
}
}
}
static void addGarbage(ReferenceCounter *ref) {
std::lock_guard < std::mutex > lock(g_mutex);
garbage.insert(ref);
}
private:
static std::mutex g_mutex;
static std::set<ReferenceCounter *> garbage;
};
template<class BufferType = ReferenceCounter>
template<typename BufferType>
class ReBuffer {
typedef typename std::shared_ptr<BufferType> ReBufferPtr;
public:
ReBuffer(std::string bufferId) : bufferId(bufferId) {
// indexCounter.store(0);
//Virtual destructor to assure correct freeing of all descendants.
virtual ~ReBuffer() = default;
//constructor
explicit ReBuffer(std::string bufferId) : bufferId(bufferId) {
//nothing
}
BufferType *getBuffer() {
std::lock_guard < std::mutex > lock(m_mutex);
/// Return a new ReBuffer_ptr usable by the application.
ReBufferPtr getBuffer() {
BufferType* buf = nullptr;
for (outputBuffersI = outputBuffers.begin(); outputBuffersI != outputBuffers.end(); outputBuffersI++) {
if (buf == nullptr && (*outputBuffersI)->getRefCount() <= 0) {
buf = (*outputBuffersI);
buf->setRefCount(1);
} else if ((*outputBuffersI)->getRefCount() <= 0) {
(*outputBuffersI)->decRefCount();
std::lock_guard < SpinMutex > lock(m_mutex);
// iterate the ReBufferAge list: if the std::shared_ptr count == 1, it means
//it is only referenced in outputBuffers itself, so available for re-use.
//else if the std::shared_ptr count <= 1, make it age.
//else the ReBufferPtr is in use, don't use it.
ReBufferPtr buf = nullptr;
outputBuffersI it = outputBuffers.begin();
while (it != outputBuffers.end()) {
//careful here: take care of reading the use_count directly
//through the iterator, else it's value is wrong if a temp variable
//is used.
long use = it->ptr.use_count();
//1. If we encounter a ReBufferPtr with a use count of 0, this
//is a bug since it is supposed to be at least 1, because it is referenced here.
//in this case, purge it from here and trace.
if (use == 0) {
std::cout << "Warning: in ReBuffer '" << bufferId << "' count '" << outputBuffers.size() << "', found 1 dangling buffer !" << std::endl << std::flush;
it = outputBuffers.erase(it);
}
else if (use == 1) {
if (buf == nullptr) {
it->age = 1; //select this one.
buf = it->ptr;
// std::cout << "**" << std::flush;
it++;
}
else {
//make the other unused buffers age
it->age--;
it++;
}
}
}
if (buf != nullptr) {
if (outputBuffers.back()->getRefCount() < -REBUFFER_GC_LIMIT) {
BufferType *ref = outputBuffers.back();
else {
it++;
}
} //end while
//2.1 Garbage collect the oldest (last element) if it aged too much, and return the buffer
if (buf != nullptr) {
if (outputBuffers.back().age < -REBUFFER_GC_LIMIT) {
//by the nature of the shared_ptr, memory will ne deallocated automatically.
outputBuffers.pop_back();
delete ref;
//std::cout << "--" << std::flush;
}
// buf->setIndex(indexCounter++);
return buf;
}
#define REBUFFER_WARNING_THRESHOLD 100
if (outputBuffers.size() > REBUFFER_WARNING_THRESHOLD) {
std::cout << "Warning: ReBuffer '" << bufferId << "' count '" << outputBuffers.size() << "' exceeds threshold of '" << REBUFFER_WARNING_THRESHOLD << "'" << std::endl;
}
//by default created with refcount = 1
buf = new BufferType();
// buf->setIndex(indexCounter++);
outputBuffers.push_back(buf);
if (outputBuffers.size() > REBUFFER_WARNING_THRESHOLD) {
std::cout << "Warning: ReBuffer '" << bufferId << "' count '" << outputBuffers.size() << "' exceeds threshold of '" << REBUFFER_WARNING_THRESHOLD << "'" << std::endl << std::flush;
}
return buf;
//3.We need to allocate a new buffer.
ReBufferAge < ReBufferPtr > newBuffer(std::make_shared<BufferType>(), 1);
outputBuffers.push_back(newBuffer);
// std::cout << "++" << std::flush;
return newBuffer.ptr;
}
/// Purge the cache.
void purge() {
std::lock_guard < std::mutex > lock(m_mutex);
// if (bufferId == "DemodulatorThreadBuffers") {
// std::cout << "'" << bufferId << "' purging.. total indexes: " << indexCounter.load() << std::endl;
// }
while (!outputBuffers.empty()) {
BufferType *ref = outputBuffers.front();
outputBuffers.pop_front();
if (ref->getRefCount() <= 0) {
delete ref;
} else {
// Something isn't done with it yet; throw it on the pile.. keep this as a bug indicator for now..
std::cout << "'" << bufferId << "' pushed garbage.." << std::endl;
ReBufferGC::addGarbage(ref);
}
}
std::lock_guard < SpinMutex > lock(m_mutex);
// since outputBuffers are full std::shared_ptr,
//purging if will effectively loose the local reference,
// so the std::shared_ptr will naturally be deallocated
//when their time comes.
outputBuffers.clear();
}
private:
private:
//name of the buffer cache kind
std::string bufferId;
std::deque<BufferType*> outputBuffers;
typename std::deque<BufferType*>::iterator outputBuffersI;
mutable std::mutex m_mutex;
// std::atomic_int indexCounter;
//the ReBuffer cache: use a std:deque to also release
//memory when ReBufferPtr are GCed.
std::deque< ReBufferAge < ReBufferPtr > > outputBuffers;
typedef typename std::deque< ReBufferAge < ReBufferPtr > >::iterator outputBuffersI;
//mutex protecting access to outputBuffers.
SpinMutex m_mutex;
};
@ -207,18 +182,21 @@ public:
//If wait < 0, the wait in infinite until the thread dies.
bool isTerminated(int waitMs = 0);
virtual void onBindOutput(std::string name, ThreadQueueBase* threadQueue);
virtual void onBindInput(std::string name, ThreadQueueBase* threadQueue);
virtual void onBindOutput(std::string name, ThreadQueueBasePtr threadQueue);
virtual void onBindInput(std::string name, ThreadQueueBasePtr threadQueue);
void setInputQueue(std::string qname, ThreadQueueBase *threadQueue);
ThreadQueueBase *getInputQueue(std::string qname);
void setOutputQueue(std::string qname, ThreadQueueBase *threadQueue);
ThreadQueueBase *getOutputQueue(std::string qname);
void setInputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue);
ThreadQueueBasePtr getInputQueue(const std::string& qname);
void setOutputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue);
ThreadQueueBasePtr getOutputQueue(const std::string& qname);
protected:
std::map<std::string, ThreadQueueBase *, map_string_less> input_queues;
std::map<std::string, ThreadQueueBase *, map_string_less> output_queues;
std::map<std::string, ThreadQueueBasePtr, map_string_less> input_queues;
std::map<std::string, ThreadQueueBasePtr, map_string_less> output_queues;
//this protects against concurrent changes in input/output bindings: get/set/Input/OutPutQueue
std::mutex m_queue_bindings_mutex;
//true when a termination is ordered
std::atomic_bool stopping;
Timer gTimer;
@ -227,4 +205,5 @@ private:
//true when the thread has really ended, i.e run() from threadMain() has returned.
std::atomic_bool terminated;
};

Some files were not shown because too many files have changed in this diff Show More