Commit ac88baf7 authored by Andreas Bombe's avatar Andreas Bombe

New upstream version 0.2.0+dfsg

parents
build/
cmake_build/
dist/
This diff is collapsed.
This diff is collapsed.
CubicSDR
========
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.
Utilizes:
--------
- liquid-dsp (http://liquidsdr.org/ -- https://github.com/jgaeddert/liquid-dsp)
- SoapySDR (http://www.pothosware.com/ -- https://github.com/pothosware/SoapySDR)
- RtAudio (http://www.music.mcgill.ca/~gary/rtaudio/ -- http://github.com/thestk/rtaudio/)
- LodePNG (http://lodev.org/lodepng/)
- BMFont (http://www.angelcode.com/ -- http://www.angelcode.com/products/bmfont/)
- Bitstream Vera font (http://en.wikipedia.org/wiki/Bitstream_Vera)
- OpenGL (https://www.opengl.org/)
- wxWidgets (https://www.wxwidgets.org/)
- CMake (http://www.cmake.org/)
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.
Recommended minimum requirements:
--------------------
- Multi-core processor system with at least 1GB RAM.
- Graphics card with at least 128MB video memory and OpenGL 3.x or ES 2.0 support.
- 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
License:
-------
- GPL
[Desktop Entry]
Type=Application
Exec=CubicSDR %u
Icon=@CMAKE_INSTALL_PREFIX@/share/cubicsdr/CubicSDR.png
Terminal=false
Name=CubicSDR
GenericName=CubicSDR
Comment=Software-Defined Radio Application
Categories=Science;HamRadio;DataVisualization;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>
# Try to find JACK
# This will define the following variables:
#
# JACK_FOUND - Whether Jack was found.
# JACK_INCLUDE_DIRS - Jack include directories.
# JACK_LIBRARIES - Jack libraries.
include(FindPackageHandleStandardArgs)
if(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# in cache already
set(JACK_FOUND TRUE)
else()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_JACK jack)
endif(PKG_CONFIG_FOUND)
find_path(JACK_INCLUDE_DIR
NAMES
jack/jack.h
PATHS
${_JACK_INCLUDEDIR}
)
find_library(JACK_LIBRARY
NAMES
jack
PATHS
${_JACK_LIBDIR}
)
set(JACK_INCLUDE_DIRS
${JACK_INCLUDE_DIR}
)
set(JACK_LIBRARIES
${JACK_LIBRARY}
)
find_package_handle_standard_args(Jack DEFAULT_MSG JACK_LIBRARIES JACK_INCLUDE_DIRS)
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY JACK_INCLUDE_DIRS JACK_LIBRARIES)
endif()
# - Find LIQUID
# Find the native LIQUID includes and library
#
# LIQUID_INCLUDES - where to find LIQUID.h
# LIQUID_LIBRARIES - List of libraries when using LIQUID.
# LIQUID_FOUND - True if LIQUID found.
if (LIQUID_INCLUDES)
# Already in cache, be silent
set (LIQUID_FIND_QUIETLY TRUE)
endif (LIQUID_INCLUDES)
find_path (LIQUID_INCLUDES liquid/liquid.h)
find_library (LIQUID_LIBRARIES NAMES liquid)
# handle the QUIETLY and REQUIRED arguments and set LIQUID_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (LIQUID DEFAULT_MSG LIQUID_LIBRARIES LIQUID_INCLUDES)
#mark_as_advanced (LIQUID_LIBRARIES LIQUID_INCLUDES)
# - Try to find Hamlib
# Author: George L. Emigh - AB4BD
#
# Change Log: Charles J. Cliffe <cj@cubicproductions.com>
# Updates:
# Jan 2015 - Add /opt/ paths for OSX MacPorts
# - Fix HAMLIB_INCLUDE_DIR absolute search
# - Add static lib support
# TODO:
# Windows support
#
# HAMLIB_FOUND - system has Hamlib
# HAMLIB_LIBRARY - location of the library for hamlib
# HAMLIB_INCLUDE_DIR - location of the include files for hamlib
set(HAMLIB_FOUND FALSE)
find_path(HAMLIB_INCLUDE_DIR
NAMES hamlib/rig.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
)
find_library(HAMLIB_LIBRARY
NAMES hamlib
PATHS
/usr/lib64/hamlib
/usr/lib/hamlib
/usr/lib64
/usr/lib
/usr/local/lib64/hamlib
/usr/local/lib/hamlib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
/opt/local/lib/hamlib
)
find_library(HAMLIB_STATIC_LIBRARY
NAMES libhamlib.a
PATHS
/usr/lib64/hamlib
/usr/lib/hamlib
/usr/lib64
/usr/lib
/usr/local/lib64/hamlib
/usr/local/lib/hamlib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
/opt/local/lib/hamlib
)
GET_FILENAME_COMPONENT(HAMLIB_LIB_FOLDER ${HAMLIB_STATIC_LIBRARY} DIRECTORY)
file(GLOB HAMLIB_STATIC_MODS ${HAMLIB_LIB_FOLDER}/hamlib-*.a)
if(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
set(HAMLIB_FOUND TRUE)
# message(STATUS "Hamlib version: ${VERSION}")
message(STATUS "Found hamlib library at: ${HAMLIB_LIBRARY}")
message(STATUS "Found hamlib static library at: ${HAMLIB_STATIC_LIBRARY}")
message(STATUS "Found hamlib static modules: ${HAMLIB_STATIC_MODS}")
message(STATUS "Found hamlib include directory at: ${HAMLIB_INCLUDE_DIR}")
endif(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
IF(NOT HAMLIB_FOUND)
IF(NOT HAMLIB_FIND_QUIETLY)
MESSAGE(STATUS "HAMLIB was not found.")
ELSE(NOT HAMLIB_FIND_QUIETLY)
IF(HAMLIB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "HAMLIB was not found.")
ENDIF(HAMLIB_FIND_REQUIRED)
ENDIF(NOT HAMLIB_FIND_QUIETLY)
ENDIF(NOT HAMLIB_FOUND)
\ No newline at end of file
IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: '${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt'")
ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
STRING(REGEX REPLACE " " ";" files "${files}")
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling '$ENV{DESTDIR}${file}'")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"${CMAKE_COMMAND}" ARGS "-E remove '$ENV{DESTDIR}${file}'"
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing '$ENV{DESTDIR}${file}'")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File '$ENV{DESTDIR}${file}' does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)
\ No newline at end of file
#!/bin/bash
for f in ${APPS}/Contents/MacOS/*.dylib
do
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" $f
done
for f in ${APPS}/Contents/MacOS/modules/*.so
do
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" $f
done
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" ${APPS}
#!/bin/bash
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" CubicSDR-${CPACK_PACKAGE_VERSION}-Darwin.dmg
id ICON "icon/CubicSDR.ico"
frame_icon ICON "icon/CubicSDR.ico"
\ No newline at end of file
//
// aabb.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__aabb__
#define __CubicVR2__aabb__
#include <iostream>
#include "vec3.h"
namespace CubicVR {
enum aabb_enum { AABB_DISJOINT, AABB_A_INSIDE_B, AABB_B_INSIDE_A, AABB_INTERSECT };
struct aabb {
vec3 min, max;
aabb(vec3 min_in, vec3 max_in) {
min=min_in;
max=max_in;
}
aabb() {
min=max=vec3(0,0,0);
}
aabb engulf(aabb aabb, vec3 point) {
if (aabb.min[0] > point[0]) {
aabb.min[0] = point[0];
}
if (aabb.min[1] > point[1]) {
aabb.min[1] = point[1];
}
if (aabb.min[2] > point[2]) {
aabb.min[2] = point[2];
}
if (aabb.max[0] < point[0]) {
aabb.max[0] = point[0];
}
if (aabb.max[1] < point[1]) {
aabb.max[1] = point[1];
}
if (aabb.max[2] < point[2]) {
aabb.max[2] = point[2];
}
return aabb;
};
static aabb reset(aabb aabb, vec3 point=vec3(0.0f,0.0f,0.0f)) {
aabb.min[0] = point[0];
aabb.min[1] = point[1];
aabb.min[2] = point[2];
aabb.max[0] = point[0];
aabb.max[1] = point[1];
aabb.max[2] = point[2];
return aabb;
};
static vec3 size(aabb aabb) {
__float x = aabb.min[0] < aabb.max[0] ? aabb.max[0] - aabb.min[0] : aabb.min[0] - aabb.max[0];
__float y = aabb.min[1] < aabb.max[1] ? aabb.max[1] - aabb.min[1] : aabb.min[1] - aabb.max[1];
__float z = aabb.min[2] < aabb.max[2] ? aabb.max[2] - aabb.min[2] : aabb.min[2] - aabb.max[2];
return vec3(x,y,z);
};
/**
Returns positive integer if intersect between A and B, 0 otherwise.
For more detailed intersect result check value:
CubicVR.enums.aabb.INTERSECT if AABBs intersect
CubicVR.enums.aabb.A_INSIDE_B if boxA is inside boxB
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) {
// Disjoint
if( boxA.min[0] > boxB.max[0] || boxA.max[0] < boxB.min[0] ){
return AABB_DISJOINT;
}
if( boxA.min[1] > boxB.max[1] || boxA.max[1] < boxB.min[1] ){
return AABB_DISJOINT;
}
if( boxA.min[2] > boxB.max[2] || boxA.max[2] < boxB.min[2] ){
return 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;
}
// 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;
}
// Otherwise AABB's intersect.
return AABB_INTERSECT;
}
};
};
#endif /* defined(__CubicVR2__aabb__) */
//
// math.cpp
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#include "cubic_math.h"
namespace CubicVR {
std::ostream& operator<<(std::ostream &strm, const vec4 &v) {
return strm << "{" << v.x << ", " << v.y << ", " << v.z << ", " << v.w << "}";
}
std::ostream& operator<<(std::ostream &strm, const vec3 &v) {
return strm << "{" << v.x << ", " << v.y << ", " << v.z << "}";
}
std::ostream& operator<<(std::ostream &strm, const vec2 &v) {
return strm << "{" << v.x << ", " << v.y << "}";
}
std::ostream& operator<<(std::ostream &strm, const mat4 &m) {
return strm << "{ " << m[0] << ", " << m[1] << ", " << m[2] << ", " << m[3] << endl
<< " " << m[4] << ", " << m[5] << ", " << m[6] << ", " << m[7] << endl
<< " " << m[8] << ", " << m[9] << ", " << m[10] << ", " << m[11] << endl
<< " " << m[12] << ", " << m[13] << ", " << m[14] << ", " << m[15] << " }" << endl;
}
}
//
// math.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__math__
#define __CubicVR2__math__
#include <iostream>
#include "aabb.h"
#include "mat3.h"
#include "mat4.h"
#include "quaternion.h"
#include "transform.h"
#include "triangle.h"
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "plane.h"
#include "sphere.h"
#include "frustum.h"
namespace CubicVR {
std::ostream& operator<<(std::ostream &strm, const vec4 &v);
std::ostream& operator<<(std::ostream &strm, const vec3 &v);
std::ostream& operator<<(std::ostream &strm, const vec2 &v);
std::ostream& operator<<(std::ostream &strm, const mat4 &m);
}
#endif /* defined(__CubicVR2__math__) */
//
// types.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-21.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_types_h
#define CubicVR2_types_h
namespace CubicVR {
typedef double __float64;
typedef float __float32;
typedef __float32 __float;
#define COMBINE(x,y) x ## y
#define floatSG(c, x,y) \
__float COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(__float value) { y = value; return *this; }
#define intSG(c, x,y) \
int COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(int value) { y = value; return *this; }
#define uintSG(c, x,y) \
unsigned int COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(unsigned int value) { y = value; return *this; }
#define boolSG(c,x,y) \
bool COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(bool value) { y = value; return *this; }
#define stringSG(c,x,y) \
string COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(string value) { y = value; return *this; }
#define isBoolSG(c,x,y) \
bool COMBINE(is,x)() { return y; } \
c & COMBINE(set,x)(bool value) { y = value; return *this; }
}
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif
//
// frustum.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_frustum_h
#define CubicVR2_frustum_h
#include <vector>
#include "cubic_types.h"
#include "mat4.h"
#include "vec3.h"
#include "vec4.h"
#include "plane.h"
namespace CubicVR {
enum frustum_plane { PLANE_LEFT, PLANE_RIGHT, PLANE_TOP, PLANE_BOTTOM, PLANE_NEAR, PLANE_FAR };
struct frustum {
std::vector<vec4> planes;
vec4 sphere;
frustum() {
planes.resize(6);
for (int i = 0; i < 6; ++i) {
planes[i] = vec4(0, 0, 0, 0);
} //for
} //Frustum::Constructor
void extract(vec3 position, mat4 mvMatrix, mat4 pMatrix) {
mat4 comboMatrix = mat4::multiply(pMatrix, mvMatrix, true);
// Left clipping plane
planes[PLANE_LEFT][0] = comboMatrix[3] + comboMatrix[0];
planes[PLANE_LEFT][1] = comboMatrix[7] + comboMatrix[4];
planes[PLANE_LEFT][2] = comboMatrix[11] + comboMatrix[8];
planes[PLANE_LEFT][3] = comboMatrix[15] + comboMatrix[12];
// Right clipping plane
planes[PLANE_RIGHT][0] = comboMatrix[3] - comboMatrix[0];
planes[PLANE_RIGHT][1] = comboMatrix[7] - comboMatrix[4];
planes[PLANE_RIGHT][2] = comboMatrix[11] - comboMatrix[8];
planes[PLANE_RIGHT][3] = comboMatrix[15] - comboMatrix[12];
// Top clipping plane
planes[PLANE_TOP][0] = comboMatrix[3] - comboMatrix[1];
planes[PLANE_TOP][1] = comboMatrix[7] - comboMatrix[5];
planes[PLANE_TOP][2] = comboMatrix[11] - comboMatrix[9];
planes[PLANE_TOP][3] = comboMatrix[15] - comboMatrix[13];
// Bottom clipping plane
planes[PLANE_BOTTOM][0] = comboMatrix[3] + comboMatrix[1];
planes[PLANE_BOTTOM][1] = comboMatrix[7] + comboMatrix[5];
planes[PLANE_BOTTOM][2] = comboMatrix[11] + comboMatrix[9];
planes[PLANE_BOTTOM][3] = comboMatrix[15] + comboMatrix[13];
// Near clipping plane
planes[PLANE_NEAR][0] = comboMatrix[3] + comboMatrix[2];
planes[PLANE_NEAR][1] = comboMatrix[7] + comboMatrix[6];
planes[PLANE_NEAR][2] = comboMatrix[11] + comboMatrix[10];
planes[PLANE_NEAR][3] = comboMatrix[15] + comboMatrix[14];
// Far clipping plane
planes[PLANE_FAR][0] = comboMatrix[3] - comboMatrix[2];
planes[PLANE_FAR][1] = comboMatrix[7] - comboMatrix[6];
planes[PLANE_FAR][2] = comboMatrix[11] - comboMatrix[10];
planes[PLANE_FAR][3] = comboMatrix[15] - comboMatrix[14];
for (unsigned int i = 0; i < 6; ++i) {
planes[i] = vec4::normalize(planes[i]);
}
//Sphere
__float fov = 1 / pMatrix[5];
__float znear = -planes[PLANE_NEAR][3];
__float zfar = planes[PLANE_FAR][3];
__float view_length = zfar - znear;
__float height = view_length * fov;
__float width = height;
vec3 P(0, 0, znear + view_length * 0.5f);
vec3 Q(width, height, znear + view_length);
vec3 diff = vec3::subtract(P, Q);
__float diff_mag = vec3::length(diff);
vec3 look_v = vec3(comboMatrix[3], comboMatrix[9], comboMatrix[10]);
__float look_mag = vec3::length(look_v);
look_v = vec3::multiply(look_v, 1 / look_mag);
vec3 pos = vec3(position[0], position[1], position[2]);
pos = vec3::add(pos, vec3::multiply(look_v, view_length * 0.5f));
pos = vec3::add(pos, vec3::multiply(look_v, 1));