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;
std::ifstream file(path.c_str());
config << file;
file >> config;
file.close();
}

View File

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

View File

@ -11,7 +11,7 @@ namespace icons {
GLuint loadTexture(std::string path) {
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;
glGenTextures(1, &texId);
glBindTexture(GL_TEXTURE_2D, texId);
@ -24,9 +24,9 @@ namespace icons {
}
void load() {
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");
LOGO = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/sdrpp.png");
PLAY = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/play.png");
STOP = (ImTextureID)(uintptr_t)loadTexture(config::getRootDirectory() + "/res/icons/stop.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);
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);
bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused();
@ -650,7 +650,6 @@ namespace ImGui {
}
void WaterfallVFO::setOffset(float offset) {
printf("WaterfallVFO::SetOffset: %p\n", this);
generalOffset = offset;
if (reference == REF_CENTER) {
centerOffset = offset;

View File

@ -116,7 +116,7 @@ namespace mod {
}
std::ifstream file(path.c_str());
json data;
data << file;
file >> data;
file.close();
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->setOffset(offset);
output = dspVFO->output;
printf("Created VFO: %p", wtfVFO);
gui::waterfall.vfos[name] = wtfVFO;
}

View File

@ -3,53 +3,14 @@ project(recorder)
if (MSVC)
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()
set(CMAKE_CXX_FLAGS "-O3 -std=c++17")
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)
set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive")
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 IMGUI "../core/src/imgui/*.cpp")
add_library(recorder SHARED ${SRC} ${IMGUI})
set_target_properties(recorder PROPERTIES PREFIX "")
if (MSVC)
# Glew
find_package(GLEW REQUIRED)
target_link_libraries(recorder PRIVATE GLEW::GLEW)
include_directories("src/")
# 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"
add_library(recorder SHARED ${SRC})
target_link_libraries(recorder PRIVATE sdrpp_core)
set_target_properties(recorder PROPERTIES PREFIX "")

View File

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

View File

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