From 5c5c6d4b7ac5146d6bd43e99f49ebecb36ea2a5e Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 15 Apr 2018 18:48:59 +0200 Subject: [PATCH] Added server plugins for ATV, SSB modulators and UDP sink --- plugins/channeltx/modatv/atvmodplugin.cpp | 12 +++++- plugins/channeltx/modssb/ssbmodplugin.cpp | 12 +++++- plugins/channeltx/udpsink/udpsinkplugin.cpp | 14 ++++++- pluginssrv/channeltx/CMakeLists.txt | 3 ++ pluginssrv/channeltx/modatv/CMakeLists.txt | 45 +++++++++++++++++++++ pluginssrv/channeltx/modssb/CMakeLists.txt | 41 +++++++++++++++++++ pluginssrv/channeltx/udpsink/CMakeLists.txt | 45 +++++++++++++++++++++ 7 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 pluginssrv/channeltx/modatv/CMakeLists.txt create mode 100644 pluginssrv/channeltx/modssb/CMakeLists.txt create mode 100644 pluginssrv/channeltx/udpsink/CMakeLists.txt diff --git a/plugins/channeltx/modatv/atvmodplugin.cpp b/plugins/channeltx/modatv/atvmodplugin.cpp index 757f09c09..d9e3e26dd 100644 --- a/plugins/channeltx/modatv/atvmodplugin.cpp +++ b/plugins/channeltx/modatv/atvmodplugin.cpp @@ -15,10 +15,11 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "atvmodgui.h" +#endif #include "atvmod.h" #include "atvmodplugin.h" @@ -50,10 +51,19 @@ void ATVModPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI->registerTxChannel(ATVMod::m_channelIdURI, ATVMod::m_channelId, this); } +#ifdef SERVER_MODE +PluginInstanceGUI* ATVModPlugin::createTxChannelGUI( + DeviceUISet *deviceUISet __attribute__((unused)), + BasebandSampleSource *txChannel __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) { return ATVModGUI::create(m_pluginAPI, deviceUISet, txChannel); } +#endif BasebandSampleSource* ATVModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI) { diff --git a/plugins/channeltx/modssb/ssbmodplugin.cpp b/plugins/channeltx/modssb/ssbmodplugin.cpp index 4dd9a59f8..c19c2cc04 100644 --- a/plugins/channeltx/modssb/ssbmodplugin.cpp +++ b/plugins/channeltx/modssb/ssbmodplugin.cpp @@ -15,10 +15,11 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "ssbmodgui.h" +#endif #include "ssbmod.h" #include "ssbmodplugin.h" @@ -50,10 +51,19 @@ void SSBModPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI->registerTxChannel(SSBMod::m_channelIdURI, SSBMod::m_channelId, this); } +#ifdef SERVER_MODE +PluginInstanceGUI* SSBModPlugin::createTxChannelGUI( + DeviceUISet *deviceUISet __attribute__((unused)), + BasebandSampleSource *txChannel __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) { return SSBModGUI::create(m_pluginAPI, deviceUISet, txChannel); } +#endif BasebandSampleSource* SSBModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI) { diff --git a/plugins/channeltx/udpsink/udpsinkplugin.cpp b/plugins/channeltx/udpsink/udpsinkplugin.cpp index 60449a9b4..959feead3 100644 --- a/plugins/channeltx/udpsink/udpsinkplugin.cpp +++ b/plugins/channeltx/udpsink/udpsinkplugin.cpp @@ -20,11 +20,14 @@ #include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "udpsinkgui.h" +#endif +#include "udpsink.h" const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = { QString("UDP Channel Sink"), - QString("3.12.0"), + QString("3.14.2"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, @@ -50,10 +53,19 @@ void UDPSinkPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI->registerTxChannel(UDPSink::m_channelIdURI, UDPSink::m_channelId, this); } +#ifdef SERVER_MODE +PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI( + DeviceUISet *deviceUISet __attribute__((unused)), + BasebandSampleSource *txChannel __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) { return UDPSinkGUI::create(m_pluginAPI, deviceUISet, txChannel); } +#endif BasebandSampleSource* UDPSinkPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI) { diff --git a/pluginssrv/channeltx/CMakeLists.txt b/pluginssrv/channeltx/CMakeLists.txt index 661d661ee..6e54c0637 100644 --- a/pluginssrv/channeltx/CMakeLists.txt +++ b/pluginssrv/channeltx/CMakeLists.txt @@ -1,5 +1,8 @@ project(mod) add_subdirectory(modam) +add_subdirectory(modatv) add_subdirectory(modnfm) +add_subdirectory(modssb) add_subdirectory(modwfm) +add_subdirectory(udpsink) diff --git a/pluginssrv/channeltx/modatv/CMakeLists.txt b/pluginssrv/channeltx/modatv/CMakeLists.txt new file mode 100644 index 000000000..4338f70fb --- /dev/null +++ b/pluginssrv/channeltx/modatv/CMakeLists.txt @@ -0,0 +1,45 @@ +project(modatv) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/channeltx/modatv") + +set(modatv_SOURCES + ${PLUGIN_PREFIX}/atvmod.cpp + ${PLUGIN_PREFIX}/atvmodplugin.cpp + ${PLUGIN_PREFIX}/atvmodsettings.cpp +) + +set(modatv_HEADERS + ${PLUGIN_PREFIX}/atvmod.h + ${PLUGIN_PREFIX}/atvmodplugin.h + ${PLUGIN_PREFIX}/atvmodsettings.h +) + +# OpenCV variables defined in /usr/share/OpenCV/OpenCVConfig.cmake (Ubuntu) + +include_directories( + . + ${OpenCV_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(modatvsrv SHARED + ${modatv_SOURCES} + ${modatv_HEADERS_MOC} +) + +target_link_libraries(modatvsrv + ${OpenCV_LIBS} + ${QT_LIBRARIES} + sdrbase + swagger +) + +qt5_use_modules(modatvsrv Core) + +install(TARGETS modatvsrv DESTINATION lib/pluginssrv/channeltx) \ No newline at end of file diff --git a/pluginssrv/channeltx/modssb/CMakeLists.txt b/pluginssrv/channeltx/modssb/CMakeLists.txt new file mode 100644 index 000000000..4da444e3b --- /dev/null +++ b/pluginssrv/channeltx/modssb/CMakeLists.txt @@ -0,0 +1,41 @@ +project(modssb) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/channeltx/modssb") + +set(modssb_SOURCES + ${PLUGIN_PREFIX}/ssbmod.cpp + ${PLUGIN_PREFIX}/ssbmodplugin.cpp + ${PLUGIN_PREFIX}/ssbmodsettings.cpp +) + +set(modssb_HEADERS + ${PLUGIN_PREFIX}/ssbmod.h + ${PLUGIN_PREFIX}/ssbmodplugin.h + ${PLUGIN_PREFIX}/ssbmodsettings.h +) + +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(modssbsrv SHARED + ${modssb_SOURCES} + ${modssb_HEADERS_MOC} +) + +target_link_libraries(modssbsrv + ${QT_LIBRARIES} + sdrbase + swagger +) + +qt5_use_modules(modssbsrv Core) + +install(TARGETS modssbsrv DESTINATION lib/pluginssrv/channeltx) \ No newline at end of file diff --git a/pluginssrv/channeltx/udpsink/CMakeLists.txt b/pluginssrv/channeltx/udpsink/CMakeLists.txt new file mode 100644 index 000000000..bb7f3b0f3 --- /dev/null +++ b/pluginssrv/channeltx/udpsink/CMakeLists.txt @@ -0,0 +1,45 @@ +project(udpsink) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/channeltx/udpsink") + +set(udpsink_SOURCES + ${PLUGIN_PREFIX}/udpsink.cpp + ${PLUGIN_PREFIX}/udpsinkplugin.cpp + ${PLUGIN_PREFIX}/udpsinkudphandler.cpp + ${PLUGIN_PREFIX}/udpsinkmsg.cpp + ${PLUGIN_PREFIX}/udpsinksettings.cpp +) + +set(udpsink_HEADERS + ${PLUGIN_PREFIX}/udpsink.h + ${PLUGIN_PREFIX}/udpsinkplugin.h + ${PLUGIN_PREFIX}/udpsinkudphandler.h + ${PLUGIN_PREFIX}/udpsinkmsg.h + ${PLUGIN_PREFIX}/udpsinksettings.h +) + +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(modudpsinksrv SHARED + ${udpsink_SOURCES} + ${udpsink_HEADERS_MOC} +) + +target_link_libraries(modudpsinksrv + ${QT_LIBRARIES} + sdrbase + swagger +) + +qt5_use_modules(modudpsinksrv Core Network) + +install(TARGETS modudpsinksrv DESTINATION lib/pluginssrv/channeltx)