14 changed files with 154 additions and 34 deletions
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
project(fcdlib) |
||||
|
||||
set(fcdlib_SOURCES |
||||
fcdtraits.cpp |
||||
) |
||||
|
||||
set(fcdlib_HEADERS |
||||
fcdtraits.h |
||||
) |
||||
|
||||
include_directories( |
||||
. |
||||
${CMAKE_CURRENT_BINARY_DIR} |
||||
${CMAKE_SOURCE_DIR}/include |
||||
${CMAKE_SOURCE_DIR}/include-gpl |
||||
) |
||||
|
||||
#add_definitions(-DQT_PLUGIN) |
||||
add_definitions(-DQT_SHARED) |
||||
|
||||
add_library(fcdlib SHARED |
||||
${fcdlib_SOURCES} |
||||
) |
||||
|
||||
target_link_libraries(fcdlib) |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* fcdtraits.cpp |
||||
* |
||||
* Created on: Sep 5, 2015 |
||||
* Author: f4exb |
||||
*/ |
||||
|
||||
#include "fcdtraits.h" |
||||
|
||||
const char *fcd_traits<Pro>::alsaDeviceName = "hw:CARD=V10"; |
||||
const char *fcd_traits<ProPlus>::alsaDeviceName = "hw:CARD=V20"; |
||||
|
||||
const char *fcd_traits<Pro>::interfaceIID = "org.osmocom.sdr.samplesource.fcdpro"; |
||||
const char *fcd_traits<ProPlus>::interfaceIID = "org.osmocom.sdr.samplesource.fcdproplus"; |
||||
|
||||
const char *fcd_traits<Pro>::displayedName = "FunCube Dongle Pro"; |
||||
const char *fcd_traits<ProPlus>::displayedName = "FunCube Dongle Pro+"; |
||||
|
||||
const char *fcd_traits<Pro>::pluginDisplayedName = "FunCube Pro Input"; |
||||
const char *fcd_traits<ProPlus>::pluginDisplayedName = "FunCube Pro+ Input"; |
||||
|
||||
const char *fcd_traits<Pro>::pluginVersion = "---"; |
||||
const char *fcd_traits<ProPlus>::pluginVersion = "---"; |
||||
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* fcdtraits.h |
||||
* |
||||
* Created on: 3 Sep 2015 |
||||
* Author: egriffiths |
||||
*/ |
||||
|
||||
#ifndef FCDLIB_FCDTRAITS_H_ |
||||
#define FCDLIB_FCDTRAITS_H_ |
||||
|
||||
#include <inttypes.h> |
||||
|
||||
typedef enum |
||||
{ |
||||
Pro, |
||||
ProPlus |
||||
} fcd_type; |
||||
|
||||
template <fcd_type FCDType> |
||||
struct fcd_traits |
||||
{ |
||||
static const uint16_t vendorId = 0x0; |
||||
static const uint16_t productId = 0x0; |
||||
static const int sampleRate = 48000; |
||||
static const int convBufSize = (1<<11); |
||||
static const char *alsaDeviceName; |
||||
static const char *interfaceIID; |
||||
static const char *displayedName; |
||||
static const char *pluginDisplayedName; |
||||
static const char *pluginVersion; |
||||
}; |
||||
|
||||
template<> |
||||
struct fcd_traits<Pro> |
||||
{ |
||||
static const uint16_t vendorId = 0x04D8; |
||||
static const uint16_t productId = 0xFB56; |
||||
static const int sampleRate = 96000; |
||||
static const int convBufSize = (1<<11); |
||||
static const char *alsaDeviceName; |
||||
static const char *interfaceIID; |
||||
static const char *displayedName; |
||||
static const char *pluginDisplayedName; |
||||
static const char *pluginVersion; |
||||
}; |
||||
|
||||
template<> |
||||
struct fcd_traits<ProPlus> |
||||
{ |
||||
static const uint16_t vendorId = 0x04D8; |
||||
static const uint16_t productId = 0xFB31; |
||||
static const int sampleRate = 192000; |
||||
static const int convBufSize = (1<<13); |
||||
static const char *alsaDeviceName; |
||||
static const char *interfaceIID; |
||||
static const char *displayedName; |
||||
static const char *pluginDisplayedName; |
||||
static const char *pluginVersion; |
||||
}; |
||||
|
||||
template <fcd_type FCDType> const char *fcd_traits<FCDType>::alsaDeviceName = ""; |
||||
template <fcd_type FCDType> const char *fcd_traits<FCDType>::interfaceIID = ""; |
||||
template <fcd_type FCDType> const char *fcd_traits<FCDType>::displayedName = ""; |
||||
template <fcd_type FCDType> const char *fcd_traits<FCDType>::pluginDisplayedName = ""; |
||||
template <fcd_type FCDType> const char *fcd_traits<FCDType>::pluginVersion = "---"; |
||||
|
||||
#endif /* FCDLIB_FCDTRAITS_H_ */ |
||||
Loading…
Reference in new issue