Fixed warnings on linux

This commit is contained in:
AlexandreRouma 2020-09-20 01:36:25 +02:00
parent 2aaf254565
commit ab8ce4c53f
9 changed files with 59 additions and 93 deletions

View File

@ -32,7 +32,7 @@ namespace config {
} }
_path = path; _path = path;
std::ifstream file(path.c_str()); std::ifstream file(path.c_str());
config << file; file >> config;
file.close(); file.close();
} }

View File

@ -71,7 +71,7 @@ namespace bandplan {
void loadBandPlan(std::string path) { void loadBandPlan(std::string path) {
std::ifstream file(path.c_str()); std::ifstream file(path.c_str());
json data; json data;
data << file; file >> data;
file.close(); file.close();
BandPlan_t plan = data.get<BandPlan_t>(); BandPlan_t plan = data.get<BandPlan_t>();
@ -114,7 +114,7 @@ namespace bandplan {
} }
std::ifstream file(path.c_str()); std::ifstream file(path.c_str());
json data; json data;
data << file; file >> data;
file.close(); file.close();
colorTable = data.get<std::map<std::string, BandPlanColor_t>>(); colorTable = data.get<std::map<std::string, BandPlanColor_t>>();

View File

@ -11,7 +11,7 @@ namespace icons {
GLuint loadTexture(std::string path) { GLuint loadTexture(std::string path) {
int w,h,n; int w,h,n;
stbi_uc* data = stbi_load(path.c_str(), &w, &h, &n, NULL); stbi_uc* data = stbi_load(path.c_str(), &w, &h, &n, 0);
GLuint texId; GLuint texId;
glGenTextures(1, &texId); glGenTextures(1, &texId);
glBindTexture(GL_TEXTURE_2D, texId); glBindTexture(GL_TEXTURE_2D, texId);
@ -24,9 +24,9 @@ namespace icons {
} }
void load() { void load() {
LOGO = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/sdrpp.png"); LOGO = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/sdrpp.png");
PLAY = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/play.png"); PLAY = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/play.png");
STOP = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/stop.png"); STOP = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/stop.png");
MENU = (ImTextureID)loadTexture(config::getRootDirectory() + "/res/icons/menu.png"); MENU = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/menu.png");
} }
} }

View File

@ -199,7 +199,7 @@ namespace ImGui {
ImVec2 dragOrigin(mousePos.x - drag.x, mousePos.y - drag.y); ImVec2 dragOrigin(mousePos.x - drag.x, mousePos.y - drag.y);
bool mouseHovered, mouseHeld; bool mouseHovered, mouseHeld;
bool mouseClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, fftAreaMax), ImGuiID("WaterfallID"), &mouseHovered, &mouseHeld, bool mouseClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, fftAreaMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld,
ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick); ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick);
bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused(); bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused();
@ -650,7 +650,6 @@ namespace ImGui {
} }
void WaterfallVFO::setOffset(float offset) { void WaterfallVFO::setOffset(float offset) {
printf("WaterfallVFO::SetOffset: %p\n", this);
generalOffset = offset; generalOffset = offset;
if (reference == REF_CENTER) { if (reference == REF_CENTER) {
centerOffset = offset; centerOffset = offset;

View File

@ -116,7 +116,7 @@ namespace mod {
} }
std::ifstream file(path.c_str()); std::ifstream file(path.c_str());
json data; json data;
data << file; file >> data;
file.close(); file.close();
std::map<std::string, std::string> list = data.get<std::map<std::string, std::string>>(); std::map<std::string, std::string> list = data.get<std::map<std::string, std::string>>();

View File

@ -9,7 +9,6 @@ VFOManager::VFO::VFO(std::string name, int reference, float offset, float bandwi
wtfVFO->setBandwidth(bandwidth); wtfVFO->setBandwidth(bandwidth);
wtfVFO->setOffset(offset); wtfVFO->setOffset(offset);
output = dspVFO->output; output = dspVFO->output;
printf("Created VFO: %p", wtfVFO);
gui::waterfall.vfos[name] = wtfVFO; gui::waterfall.vfos[name] = wtfVFO;
} }

View File

@ -3,53 +3,14 @@ project(recorder)
if (MSVC) if (MSVC)
set(CMAKE_CXX_FLAGS "-O2 /std:c++17") set(CMAKE_CXX_FLAGS "-O2 /std:c++17")
link_directories(recorder "C:/Program Files/PothosSDR/lib/")
include_directories(recorder "C:/Program Files/PothosSDR/include/volk/")
include_directories(recorder "C:/Program Files/PothosSDR/include/")
else() else()
set(CMAKE_CXX_FLAGS "-O3 -std=c++17") set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive")
include_directories(recorder "/usr/include/volk")
link_libraries(pthread)
link_libraries(GL)
link_libraries(GLEW)
link_libraries(glfw)
link_libraries(fftw3)
link_libraries(fftw3f)
link_libraries(portaudio)
link_libraries(X11)
link_libraries(Xxf86vm)
endif (MSVC) endif (MSVC)
link_libraries(volk)
link_libraries(SoapySDR)
# Main code
include_directories(recorder "src/")
include_directories(recorder "../core/src/")
include_directories(recorder "../core/src/imgui")
file(GLOB SRC "src/*.cpp") file(GLOB SRC "src/*.cpp")
file(GLOB IMGUI "../core/src/imgui/*.cpp")
add_library(recorder SHARED ${SRC} ${IMGUI}) include_directories("src/")
add_library(recorder SHARED ${SRC})
target_link_libraries(recorder PRIVATE sdrpp_core)
set_target_properties(recorder PROPERTIES PREFIX "") set_target_properties(recorder PROPERTIES PREFIX "")
if (MSVC)
# Glew
find_package(GLEW REQUIRED)
target_link_libraries(recorder PRIVATE GLEW::GLEW)
# GLFW3
find_package(glfw3 CONFIG REQUIRED)
target_link_libraries(recorder PRIVATE glfw)
# FFTW3
find_package(FFTW3 CONFIG REQUIRED)
target_link_libraries(recorder PRIVATE FFTW3::fftw3)
find_package(FFTW3f CONFIG REQUIRED)
target_link_libraries(recorder PRIVATE FFTW3::fftw3f)
# PortAudio
find_package(portaudio CONFIG REQUIRED)
target_link_libraries(recorder PRIVATE portaudio portaudio_static)
endif (MSVC)
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"

View File

@ -3,20 +3,26 @@
"Radio": { "Radio": {
"device": "Speakers (Realtek High Definiti", "device": "Speakers (Realtek High Definiti",
"sampleRate": 48000.0, "sampleRate": 48000.0,
"volume": 0.6666666865348816 "volume": 0.3655914068222046
} }
}, },
"bandPlan": "General", "bandPlan": "General",
"bandPlanEnabled": true, "bandPlanEnabled": true,
"fftHeight": 300, "fftHeight": 300,
"frequency": 103200000, "frequency": 96914040,
"max": 0.0, "max": 0.0,
"maximized": false, "maximized": false,
"menuWidth": 300, "menuWidth": 300,
"min": -52.20588302612305, "min": -51.47058868408203,
"showWaterfall": true, "showWaterfall": true,
"source": "HackRF One #0 901868dc282c8f8b", "source": "HackRF One #0 901868dc282c8f8b",
"sourceSettings": { "sourceSettings": {
"Generic RTL2832U OEM :: 00000001": {
"gains": {
"TUNER": 0.0
},
"sampleRate": 2560000
},
"HackRF One #0 901868dc282c8f8b": { "HackRF One #0 901868dc282c8f8b": {
"gains": { "gains": {
"AMP": 0.0, "AMP": 0.0,
@ -24,10 +30,13 @@
"VGA": 16.229999542236328 "VGA": 16.229999542236328
}, },
"sampleRate": 8000000 "sampleRate": 8000000
},
"PulseAudio": {
"sampleRate": 96000
} }
}, },
"windowSize": { "windowSize": {
"h": 726, "h": 1053,
"w": 1280 "w": 959
} }
} }

View File

@ -1,6 +1,4 @@
{ {
"Radio": "../build/radio/Release/radio.dll", "Radio": "./radio/radio.so",
"Recorder": "../build/recorder/Release/recorder.dll", "Recorder": "./recorder/recorder.so"
"Demo": "../build/demo/Release/demo.dll",
"Demo 2": "../build/demo/Release/demo.dll"
} }