Push before merge
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
build/
|
||||
.vscode/
|
||||
*.old
|
||||
*.old
|
||||
*.dll
|
||||
*.exe
|
@ -1,6 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(sdrpp)
|
||||
|
||||
add_subdirectory("modules/radio")
|
||||
add_subdirectory("modules/recorder")
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS "-O2 /std:c++17")
|
||||
link_directories(sdrpp "C:/Program Files/PothosSDR/lib/")
|
||||
@ -38,7 +41,6 @@ if (MSVC)
|
||||
endif (MSVC)
|
||||
|
||||
add_executable(sdrpp ${SRC} ${IMGUI})
|
||||
# add_library(sdrpp ${SRC} ${IMGUI})
|
||||
|
||||
if (MSVC)
|
||||
# Glew
|
||||
@ -60,10 +62,4 @@ if (MSVC)
|
||||
target_link_libraries(sdrpp PRIVATE portaudio portaudio_static)
|
||||
endif (MSVC)
|
||||
|
||||
# # Copy resource directories
|
||||
# if (!MSVC)
|
||||
# add_custom_command(TARGET sdrpp POST_BUILD COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/res ${CMAKE_BINARY_DIR}/res)
|
||||
# add_custom_command(TARGET sdrpp POST_BUILD COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/bandplans ${CMAKE_BINARY_DIR}/bandplans)
|
||||
# endif (MSVC)
|
||||
|
||||
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"Radio": "../modules/radio/build/Release/radio.dll"
|
||||
}
|
@ -30,7 +30,7 @@ include_directories(demo "../../src/imgui")
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
file(GLOB IMGUI "../../src/imgui/*.cpp")
|
||||
add_library(demo SHARED ${SRC} ${IMGUI})
|
||||
set_target_properties(demo PROPERTIES OUTPUT_NAME demo)
|
||||
set_target_properties(demo PROPERTIES PREFIX "")
|
||||
|
||||
if (MSVC)
|
||||
# Glew
|
||||
|
@ -1,26 +1,38 @@
|
||||
#include <imgui.h>
|
||||
#include <module.h>
|
||||
#include <watcher.h>
|
||||
#include <wav.h>
|
||||
#include <dsp/types.h>
|
||||
#include <dsp/stream.h>
|
||||
#include <thread>
|
||||
#include <ctime>
|
||||
|
||||
mod::API_t* API;
|
||||
|
||||
struct DemoContext_t {
|
||||
struct ExampleContext_t {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
MOD_EXPORT void* _INIT_(mod::API_t* _API, ImGuiContext* imctx, std::string _name) {
|
||||
API = _API;
|
||||
DemoContext_t* ctx = new DemoContext_t;
|
||||
ExampleContext_t* ctx = new ExampleContext_t;
|
||||
ctx->name = _name;
|
||||
ImGui::SetCurrentContext(imctx);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DRAW_MENU_(DemoContext_t* ctx) {
|
||||
char buf[100];
|
||||
sprintf(buf, "I'm %s", ctx->name.c_str());
|
||||
ImGui::Button(buf);
|
||||
MOD_EXPORT void _NEW_FRAME_(ExampleContext_t* ctx) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_(DemoContext_t* ctx) {
|
||||
delete ctx;
|
||||
MOD_EXPORT void _DRAW_MENU_(ExampleContext_t* ctx) {
|
||||
ImGui::Text("Demo!");
|
||||
}
|
||||
|
||||
MOD_EXPORT void _HANDLE_EVENT_(ExampleContext_t* ctx, int eventId) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_(ExampleContext_t* ctx) {
|
||||
|
||||
}
|
@ -30,7 +30,7 @@ include_directories(radio "../../src/imgui")
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
file(GLOB IMGUI "../../src/imgui/*.cpp")
|
||||
add_library(radio SHARED ${SRC} ${IMGUI})
|
||||
set_target_properties(radio PROPERTIES OUTPUT_NAME radio)
|
||||
set_target_properties(radio PROPERTIES PREFIX "")
|
||||
|
||||
if (MSVC)
|
||||
# Glew
|
||||
|
@ -30,7 +30,7 @@ include_directories(recorder "../../src/imgui")
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
file(GLOB IMGUI "../../src/imgui/*.cpp")
|
||||
add_library(recorder SHARED ${SRC} ${IMGUI})
|
||||
set_target_properties(recorder PROPERTIES OUTPUT_NAME recorder)
|
||||
set_target_properties(recorder PROPERTIES PREFIX "")
|
||||
|
||||
if (MSVC)
|
||||
# Glew
|
||||
|
3
prepare_root.bat
Normal file
@ -0,0 +1,3 @@
|
||||
echo OFF
|
||||
copy /b/v/y build\modules\radio\Release\radio.dll root\modules\radio.dll
|
||||
copy /b/v/y build\modules\recorder\Release\recorder.dll root\modules\recorder.dll
|
2
prepare_root.sh
Normal file
@ -0,0 +1,2 @@
|
||||
cp modules/radio/build/radio.so root/modules/radio.so
|
||||
cp modules/recorder/build/recorder.so root/modules/recorder.so
|
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.2 KiB |
@ -1,18 +1,18 @@
|
||||
{
|
||||
"audio": {},
|
||||
"bandPlan": "General",
|
||||
"bandPlanEnabled": true,
|
||||
"fftHeight": 300,
|
||||
"frequency": 99000000,
|
||||
"max": 0.0,
|
||||
"maximized": false,
|
||||
"menuWidth": 300,
|
||||
"min": -70.0,
|
||||
"showWaterfall": true,
|
||||
"source": "",
|
||||
"sourceSettings": {},
|
||||
"windowSize": {
|
||||
"h": 720,
|
||||
"w": 1280
|
||||
}
|
||||
{
|
||||
"audio": {},
|
||||
"bandPlan": "General",
|
||||
"bandPlanEnabled": true,
|
||||
"fftHeight": 300,
|
||||
"frequency": 99000000,
|
||||
"max": 0.0,
|
||||
"maximized": false,
|
||||
"menuWidth": 300,
|
||||
"min": -70.0,
|
||||
"showWaterfall": true,
|
||||
"source": "",
|
||||
"sourceSettings": {},
|
||||
"windowSize": {
|
||||
"h": 720,
|
||||
"w": 1280
|
||||
}
|
||||
}
|
4
root/module_list.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"Radio": "./modules/radio.dll",
|
||||
"Recorder": "./modules/recorder.dll"
|
||||
}
|
0
root/modules/.gitkeep
Normal file
0
root/recordings/.gitkeep
Normal file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
root/sdrpp.zip
Normal file
@ -6,6 +6,7 @@ namespace config {
|
||||
bool autoSaveRunning = false;
|
||||
std::string _path;
|
||||
std::thread _workerThread;
|
||||
std::string rootDir;
|
||||
|
||||
void _autoSaveWorker() {
|
||||
while (autoSaveRunning) {
|
||||
@ -50,4 +51,12 @@ namespace config {
|
||||
autoSaveRunning = false;
|
||||
_workerThread.join();
|
||||
}
|
||||
|
||||
void setRootDirectory(std::string dir) {
|
||||
rootDir = dir;
|
||||
}
|
||||
|
||||
std::string getRootDirectory() {
|
||||
return rootDir;
|
||||
}
|
||||
};
|
@ -14,6 +14,8 @@ namespace config {
|
||||
void load(std::string path);
|
||||
void startAutoSave();
|
||||
void stopAutoSave();
|
||||
void setRootDirectory(std::string dir);
|
||||
std::string getRootDirectory();
|
||||
|
||||
extern bool configModified;
|
||||
extern json config;
|
||||
|
@ -9,9 +9,9 @@ namespace icons {
|
||||
ImTextureID STOP;
|
||||
ImTextureID MENU;
|
||||
|
||||
GLuint loadTexture(char* path) {
|
||||
GLuint loadTexture(std::string path) {
|
||||
int w,h,n;
|
||||
stbi_uc* data = stbi_load(path, &w, &h, &n, NULL);
|
||||
stbi_uc* data = stbi_load(path.c_str(), &w, &h, &n, NULL);
|
||||
GLuint texId;
|
||||
glGenTextures(1, &texId);
|
||||
glBindTexture(GL_TEXTURE_2D, texId);
|
||||
@ -24,9 +24,9 @@ namespace icons {
|
||||
}
|
||||
|
||||
void load() {
|
||||
LOGO = (ImTextureID)loadTexture("res/icons/sdrpp.png");
|
||||
PLAY = (ImTextureID)loadTexture("res/icons/play.png");
|
||||
STOP = (ImTextureID)loadTexture("res/icons/stop.png");
|
||||
MENU = (ImTextureID)loadTexture("res/icons/menu.png");
|
||||
LOGO = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/sdrpp.png");
|
||||
PLAY = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/play.png");
|
||||
STOP = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/stop.png");
|
||||
MENU = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/menu.png");
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
#include <imgui/imgui.h>
|
||||
#include <stdint.h>
|
||||
#include <GL/glew.h>
|
||||
#include <config.h>
|
||||
|
||||
namespace icons {
|
||||
extern ImTextureID LOGO;
|
||||
|
@ -11,6 +11,8 @@ namespace io {
|
||||
public:
|
||||
SoapyWrapper() {
|
||||
SoapySDR::registerLogHandler(_logHandler);
|
||||
SoapySDR::Device::make("");
|
||||
|
||||
output.init(64000);
|
||||
currentGains = new float[1];
|
||||
refresh();
|
||||
|
14
src/main.cpp
@ -44,9 +44,15 @@ int main() {
|
||||
|
||||
spdlog::info("SDR++ v" VERSION_STR);
|
||||
|
||||
#ifdef _WIN32
|
||||
config::setRootDirectory(".");
|
||||
#else
|
||||
config::setRootDirectory("/etc/sdrpp");
|
||||
#endif
|
||||
|
||||
// Load config
|
||||
spdlog::info("Loading config");
|
||||
config::load("config.json");
|
||||
config::load(config::getRootDirectory() + "/config.json");
|
||||
config::startAutoSave();
|
||||
|
||||
// Setup window
|
||||
@ -80,7 +86,7 @@ int main() {
|
||||
|
||||
// Load app icon
|
||||
GLFWimage icons[10];
|
||||
icons[0].pixels = stbi_load("res/icons/sdrpp.png", &icons[0].width, &icons[0].height, 0, 4);
|
||||
icons[0].pixels = stbi_load((config::getRootDirectory() + "/res/icons/sdrpp.png").c_str(), &icons[0].width, &icons[0].height, 0, 4);
|
||||
icons[1].pixels = (unsigned char*)malloc(16 * 16 * 4); icons[1].width = icons[1].height = 16;
|
||||
icons[2].pixels = (unsigned char*)malloc(24 * 24 * 4); icons[2].width = icons[2].height = 24;
|
||||
icons[3].pixels = (unsigned char*)malloc(32 * 32 * 4); icons[3].width = icons[3].height = 32;
|
||||
@ -127,10 +133,10 @@ int main() {
|
||||
icons::load();
|
||||
|
||||
spdlog::info("Loading band plans");
|
||||
bandplan::loadFromDir("bandplans");
|
||||
bandplan::loadFromDir(config::getRootDirectory() + "/bandplans");
|
||||
|
||||
spdlog::info("Loading band plans color table");
|
||||
bandplan::loadColorTable("band_colors.json");
|
||||
bandplan::loadColorTable(config::getRootDirectory() + "/band_colors.json");
|
||||
|
||||
windowInit();
|
||||
|
||||
|
@ -170,9 +170,9 @@ void windowInit() {
|
||||
|
||||
spdlog::info("Loading modules");
|
||||
mod::initAPI(&wtf);
|
||||
mod::loadFromList("module_list.json");
|
||||
mod::loadFromList(config::getRootDirectory() + "/module_list.json");
|
||||
|
||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF("res/fonts/Roboto-Medium.ttf", 128.0f);
|
||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF((config::getRootDirectory() + "/res/fonts/Roboto-Medium.ttf").c_str(), 128.0f);
|
||||
|
||||
// Load last source configuration
|
||||
uint64_t frequency = config::config["frequency"];
|
||||
@ -214,13 +214,10 @@ void windowInit() {
|
||||
// Finish the recorder module
|
||||
// Add squelsh
|
||||
// Bandwidth ajustment
|
||||
// DSB / CW and RAW modes;
|
||||
// CW and RAW modes;
|
||||
// Bring VFO to a visible place when changing sample rate if it's smaller
|
||||
// Have a proper root directory
|
||||
|
||||
// Fix issue of source name not set when source was not selected manually
|
||||
// Generate entire source config before saving a source property
|
||||
// ^ same for audio devices
|
||||
// Have a proper root directory
|
||||
|
||||
// And a module add/remove/change order menu
|
||||
// get rid of watchers and use if() instead
|
||||
|
@ -1 +1 @@
|
||||
IDR_MAINFRAME ICON "../res/icons/sdrpp.ico"
|
||||
IDR_MAINFRAME ICON "../root/res/icons/sdrpp.ico"
|