Commit 683a207e authored by Andreas Bombe's avatar Andreas Bombe

New upstream version 0.2.4+dfsg

parent 5c6e0ed7
...@@ -6,7 +6,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") ...@@ -6,7 +6,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
SET(CUBICSDR_VERSION_MAJOR "0") SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "2") SET(CUBICSDR_VERSION_MINOR "2")
SET(CUBICSDR_VERSION_PATCH "3") SET(CUBICSDR_VERSION_PATCH "4")
SET(CUBICSDR_VERSION_SUFFIX "") SET(CUBICSDR_VERSION_SUFFIX "")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}${CUBICSDR_VERSION_SUFFIX}") SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}${CUBICSDR_VERSION_SUFFIX}")
......
...@@ -22,7 +22,7 @@ Utilizes: ...@@ -22,7 +22,7 @@ Utilizes:
Optional Libs: Optional Libs:
-------- --------
- FFTW3 (can be compiled into liquid-dsp if desired) (http://www.fftw.org/ -- https://github.com/FFTW/fftw3) - 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/) - hamlib (https://github.com/Hamlib/Hamlib)
Features and Status: Features and Status:
-------------------- --------------------
......
...@@ -88,10 +88,10 @@ AppFrame::AppFrame() : ...@@ -88,10 +88,10 @@ AppFrame::AppFrame() :
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL); wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 }; // OpenGL settings:
//wxGLAttributes attribList; //deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
//attribList.PlatformDefaults().RGBA().DoubleBuffer().EndList(); wxGLAttributes attribList;
//attribList.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(16).EndList(); attribList.PlatformDefaults().RGBA().MinRGBA(8, 8, 8, 8).DoubleBuffer().EndList();
mainSplitter = new wxSplitterWindow( this, wxID_MAIN_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE ); mainSplitter = new wxSplitterWindow( this, wxID_MAIN_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE );
mainSplitter->SetSashGravity(10.0f / 37.0f); mainSplitter->SetSashGravity(10.0f / 37.0f);
...@@ -2971,26 +2971,28 @@ void AppFrame::toggleAllActiveDemodRecording() { ...@@ -2971,26 +2971,28 @@ void AppFrame::toggleAllActiveDemodRecording() {
return; return;
} }
auto activeDemods = wxGetApp().getDemodMgr().getDemodulators(); // All demods, irrespective of their active state:
// recording will start eventually when a demod come in range.
auto allDemods = wxGetApp().getDemodMgr().getDemodulators();
//by default, do a false => true for all:
bool stateToSet = true; bool stateToSet = true;
for (auto i : activeDemods) { for (auto i : allDemods) {
if (i->isActive() && i->isRecording()) { if (i->isRecording()) {
stateToSet = false; stateToSet = false;
break; break;
} }
} }
for (auto i : activeDemods) { for (auto i : allDemods) {
if (i->isActive() && i->isRecording() != stateToSet) {
i->setRecording(stateToSet); i->setRecording(stateToSet);
}
} }
//this effectively refresh the BookmarkView buttons, including Recording buttons.
wxGetApp().getBookmarkMgr().updateActiveList();
} }
void AppFrame::setWaterfallLinesPerSecond(int lps) { void AppFrame::setWaterfallLinesPerSecond(int lps) {
waterfallSpeedMeter->setUserInputValue(sqrt(lps)); waterfallSpeedMeter->setUserInputValue(sqrt(lps));
} }
......
...@@ -15,12 +15,11 @@ BookmarkEntry::~BookmarkEntry() { ...@@ -15,12 +15,11 @@ BookmarkEntry::~BookmarkEntry() {
BookmarkMgr::BookmarkMgr() { BookmarkMgr::BookmarkMgr() {
rangesSorted = false; rangesSorted = false;
} }
//
//represents an empty BookMarkList that is returned by reference by some functions.
const BookmarkList BookmarkMgr::emptyResults;
void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpath) { void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpath) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
DataTree s("cubicsdr_bookmarks"); DataTree s("cubicsdr_bookmarks");
DataNode *header = s.rootNode()->newChild("header"); DataNode *header = s.rootNode()->newChild("header");
header->newChild("version")->element()->set(wxString(CUBICSDR_VERSION).ToStdWstring()); header->newChild("version")->element()->set(wxString(CUBICSDR_VERSION).ToStdWstring());
...@@ -100,6 +99,8 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpa ...@@ -100,6 +99,8 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpa
} }
bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFullpath) { bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFullpath) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
wxFileName loadFile; wxFileName loadFile;
wxFileName failFile; wxFileName failFile;
...@@ -129,7 +130,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull ...@@ -129,7 +130,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
// New instance of bookmark savefiles // New instance of bookmark savefiles
if (backup && !loadFile.FileExists() && !lastLoaded.FileExists() && !backupFile.FileExists()) { if (backup && !loadFile.FileExists() && !lastLoaded.FileExists() && !backupFile.FileExists()) {
wxGetApp().getAppFrame()->getBookmarkView()->loadDefaultRanges(); loadDefaultRanges();
return true; return true;
} }
...@@ -145,8 +146,8 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull ...@@ -145,8 +146,8 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
// Clear any active data // Clear any active data
bmData.clear(); bmData.clear();
clearRecents(); recents.clear();
clearRanges(); ranges.clear();
bmDataSorted.clear(); bmDataSorted.clear();
if (s.rootNode()->hasAnother("branches")) { if (s.rootNode()->hasAnother("branches")) {
...@@ -238,15 +239,31 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull ...@@ -238,15 +239,31 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
return loadStatusOk; return loadStatusOk;
} }
void BookmarkMgr::loadDefaultRanges() {
addRange(std::make_shared<BookmarkRangeEntry>(L"160 Meters", 1900000, 1800000, 2000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"80 Meters", 3750000, 3500000, 4000000));
addRange(std::make_shared<BookmarkRangeEntry>(L"60 Meters", 5368500, 5332000, 5405000));
addRange(std::make_shared<BookmarkRangeEntry>(L"40 Meters", 7150000, 7000000, 7300000));
addRange(std::make_shared<BookmarkRangeEntry>(L"30 Meters", 10125000, 10100000, 10150000));
addRange(std::make_shared<BookmarkRangeEntry>(L"20 Meters", 14175000, 14000000, 14350000));
addRange(std::make_shared<BookmarkRangeEntry>(L"17 Meters", 18068180, 17044180, 19092180));
addRange(std::make_shared<BookmarkRangeEntry>(L"15 Meters", 21225000, 21000000, 21450000));
addRange(std::make_shared<BookmarkRangeEntry>(L"12 Meters", 24940000, 24890000, 24990000));
addRange(std::make_shared<BookmarkRangeEntry>(L"10 Meters", 28850000, 28000000, 29700000));
}
void BookmarkMgr::resetBookmarks() { void BookmarkMgr::resetBookmarks() {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
// Clear any active data // Clear any active data
bmData.clear(); bmData.clear();
clearRecents(); recents.clear();
clearRanges(); ranges.clear();
bmDataSorted.clear(); bmDataSorted.clear();
wxGetApp().getAppFrame()->getBookmarkView()->loadDefaultRanges(); loadDefaultRanges();
} }
...@@ -280,9 +297,8 @@ void BookmarkMgr::addBookmark(std::string group, BookmarkEntryPtr be) { ...@@ -280,9 +297,8 @@ void BookmarkMgr::addBookmark(std::string group, BookmarkEntryPtr be) {
void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) { void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
if (bmData.find(group) == bmData.end()) { if (bmData.find(group) == bmData.end()) {
return; return;
} }
...@@ -296,8 +312,7 @@ void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) { ...@@ -296,8 +312,7 @@ void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) {
} }
void BookmarkMgr::removeBookmark(BookmarkEntryPtr be) { void BookmarkMgr::removeBookmark(BookmarkEntryPtr be) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
for (auto &bmd_i : bmData) { for (auto &bmd_i : bmData) {
BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be); BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
...@@ -308,8 +323,7 @@ void BookmarkMgr::removeBookmark(BookmarkEntryPtr be) { ...@@ -308,8 +323,7 @@ void BookmarkMgr::removeBookmark(BookmarkEntryPtr be) {
} }
void BookmarkMgr::moveBookmark(BookmarkEntryPtr be, std::string group) { void BookmarkMgr::moveBookmark(BookmarkEntryPtr be, std::string group) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
for (auto &bmd_i : bmData) { for (auto &bmd_i : bmData) {
BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be); BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
...@@ -367,11 +381,11 @@ void BookmarkMgr::renameGroup(std::string group, std::string ngroup) { ...@@ -367,11 +381,11 @@ void BookmarkMgr::renameGroup(std::string group, std::string ngroup) {
} }
} }
const BookmarkList& BookmarkMgr::getBookmarks(std::string group) { BookmarkList BookmarkMgr::getBookmarks(std::string group) {
std::lock_guard < std::recursive_mutex > lock(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (bmData.find(group) == bmData.end()) { if (bmData.find(group) == bmData.end()) {
return emptyResults; return BookmarkList();
} }
if (!bmDataSorted[group]) { if (!bmDataSorted[group]) {
...@@ -384,7 +398,7 @@ const BookmarkList& BookmarkMgr::getBookmarks(std::string group) { ...@@ -384,7 +398,7 @@ const BookmarkList& BookmarkMgr::getBookmarks(std::string group) {
void BookmarkMgr::getGroups(BookmarkNames &arr) { void BookmarkMgr::getGroups(BookmarkNames &arr) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) { for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
arr.push_back(i->first); arr.push_back(i->first);
...@@ -392,7 +406,7 @@ void BookmarkMgr::getGroups(BookmarkNames &arr) { ...@@ -392,7 +406,7 @@ void BookmarkMgr::getGroups(BookmarkNames &arr) {
} }
void BookmarkMgr::getGroups(wxArrayString &arr) { void BookmarkMgr::getGroups(wxArrayString &arr) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) { for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
arr.push_back(i->first); arr.push_back(i->first);
...@@ -401,11 +415,16 @@ void BookmarkMgr::getGroups(wxArrayString &arr) { ...@@ -401,11 +415,16 @@ void BookmarkMgr::getGroups(wxArrayString &arr) {
void BookmarkMgr::setExpandState(std::string groupName, bool state) { void BookmarkMgr::setExpandState(std::string groupName, bool state) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
expandState[groupName] = state; expandState[groupName] = state;
} }
bool BookmarkMgr::getExpandState(std::string groupName) { bool BookmarkMgr::getExpandState(std::string groupName) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (expandState.find(groupName) == expandState.end()) { if (expandState.find(groupName) == expandState.end()) {
return true; return true;
} }
...@@ -415,8 +434,6 @@ bool BookmarkMgr::getExpandState(std::string groupName) { ...@@ -415,8 +434,6 @@ bool BookmarkMgr::getExpandState(std::string groupName) {
void BookmarkMgr::updateActiveList() { void BookmarkMgr::updateActiveList() {
std::lock_guard < std::recursive_mutex > lockData(busy_lock);
if (wxGetApp().isShuttingDown()) { if (wxGetApp().isShuttingDown()) {
return; return;
} }
...@@ -430,8 +447,6 @@ void BookmarkMgr::updateActiveList() { ...@@ -430,8 +447,6 @@ void BookmarkMgr::updateActiveList() {
void BookmarkMgr::updateBookmarks() { void BookmarkMgr::updateBookmarks() {
std::lock_guard < std::recursive_mutex > lockData(busy_lock);
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView(); BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (bmv) { if (bmv) {
...@@ -441,8 +456,6 @@ void BookmarkMgr::updateBookmarks() { ...@@ -441,8 +456,6 @@ void BookmarkMgr::updateBookmarks() {
void BookmarkMgr::updateBookmarks(std::string group) { void BookmarkMgr::updateBookmarks(std::string group) {
std::lock_guard < std::recursive_mutex > lockData(busy_lock);
BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView(); BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
if (bmv) { if (bmv) {
...@@ -480,9 +493,10 @@ void BookmarkMgr::removeRecent(BookmarkEntryPtr be) { ...@@ -480,9 +493,10 @@ void BookmarkMgr::removeRecent(BookmarkEntryPtr be) {
} }
const BookmarkList& BookmarkMgr::getRecents() { BookmarkList BookmarkMgr::getRecents() {
std::lock_guard < std::recursive_mutex > lockData(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
return recents; //return a copy
return recents;
} }
...@@ -508,8 +522,6 @@ void BookmarkMgr::addRange(BookmarkRangeEntryPtr re) { ...@@ -508,8 +522,6 @@ void BookmarkMgr::addRange(BookmarkRangeEntryPtr re) {
rangesSorted = false; rangesSorted = false;
} }
void BookmarkMgr::removeRange(BookmarkRangeEntryPtr re) { void BookmarkMgr::removeRange(BookmarkRangeEntryPtr re) {
std::lock_guard < std::recursive_mutex > lock(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
...@@ -522,7 +534,7 @@ void BookmarkMgr::removeRange(BookmarkRangeEntryPtr re) { ...@@ -522,7 +534,7 @@ void BookmarkMgr::removeRange(BookmarkRangeEntryPtr re) {
} }
const BookmarkRangeList& BookmarkMgr::getRanges() { BookmarkRangeList BookmarkMgr::getRanges() {
std::lock_guard < std::recursive_mutex > lock(busy_lock); std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (!rangesSorted) { if (!rangesSorted) {
...@@ -610,8 +622,6 @@ std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstancePtr demod) { ...@@ -610,8 +622,6 @@ std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstancePtr demod) {
void BookmarkMgr::removeActive(DemodulatorInstancePtr demod) { void BookmarkMgr::removeActive(DemodulatorInstancePtr demod) {
std::lock_guard < std::recursive_mutex > lock(busy_lock);
if (demod == nullptr) { if (demod == nullptr) {
return; return;
} }
......
...@@ -16,8 +16,7 @@ class DataNode; ...@@ -16,8 +16,7 @@ class DataNode;
class BookmarkEntry { class BookmarkEntry {
public: public:
std::mutex busy_lock;
std::string type; std::string type;
//maps on the Demod user label. //maps on the Demod user label.
std::wstring label; std::wstring label;
...@@ -38,9 +37,7 @@ public: ...@@ -38,9 +37,7 @@ public:
} }
BookmarkRangeEntry(std::wstring label, long long freq, long long startFreq, long long endFreq) : label(label), freq(freq), startFreq(startFreq), endFreq(endFreq) { BookmarkRangeEntry(std::wstring label, long long freq, long long startFreq, long long endFreq) : label(label), freq(freq), startFreq(startFreq), endFreq(endFreq) {
} }
std::mutex busy_lock;
std::wstring label; std::wstring label;
long long freq; long long freq;
...@@ -97,7 +94,9 @@ public: ...@@ -97,7 +94,9 @@ public:
void addGroup(std::string group); void addGroup(std::string group);
void removeGroup(std::string group); void removeGroup(std::string group);
void renameGroup(std::string group, std::string ngroup); void renameGroup(std::string group, std::string ngroup);
const BookmarkList& getBookmarks(std::string group); //return an independent copy on purpose
BookmarkList getBookmarks(std::string group);
void getGroups(BookmarkNames &arr); void getGroups(BookmarkNames &arr);
void getGroups(wxArrayString &arr); void getGroups(wxArrayString &arr);
...@@ -111,22 +110,29 @@ public: ...@@ -111,22 +110,29 @@ public:
void addRecent(DemodulatorInstancePtr demod); void addRecent(DemodulatorInstancePtr demod);
void addRecent(BookmarkEntryPtr be); void addRecent(BookmarkEntryPtr be);
void removeRecent(BookmarkEntryPtr be); void removeRecent(BookmarkEntryPtr be);
const BookmarkList& getRecents();
//return an independent copy on purpose
BookmarkList getRecents();
void clearRecents(); void clearRecents();
void removeActive(DemodulatorInstancePtr demod); void removeActive(DemodulatorInstancePtr demod);
void addRange(BookmarkRangeEntryPtr re); void addRange(BookmarkRangeEntryPtr re);
void removeRange(BookmarkRangeEntryPtr re); void removeRange(BookmarkRangeEntryPtr re);
const BookmarkRangeList& getRanges();
void clearRanges(); //return an independent copy on purpose
BookmarkRangeList getRanges();
void clearRanges();
static std::wstring getBookmarkEntryDisplayName(BookmarkEntryPtr bmEnt); static std::wstring getBookmarkEntryDisplayName(BookmarkEntryPtr bmEnt);
static std::wstring getActiveDisplayName(DemodulatorInstancePtr demod); static std::wstring getActiveDisplayName(DemodulatorInstancePtr demod);
protected: protected:
void trimRecents(); void trimRecents();
void loadDefaultRanges();
BookmarkEntryPtr demodToBookmarkEntry(DemodulatorInstancePtr demod); BookmarkEntryPtr demodToBookmarkEntry(DemodulatorInstancePtr demod);
BookmarkEntryPtr nodeToBookmark(DataNode *node); BookmarkEntryPtr nodeToBookmark(DataNode *node);
...@@ -136,10 +142,8 @@ protected: ...@@ -136,10 +142,8 @@ protected:
BookmarkList recents; BookmarkList recents;
BookmarkRangeList ranges; BookmarkRangeList ranges;
bool rangesSorted; bool rangesSorted;
std::recursive_mutex busy_lock; std::recursive_mutex busy_lock;
BookmarkExpandState expandState; BookmarkExpandState expandState;
//represents an empty BookMarkList that is returned by reference by some functions.
static const BookmarkList emptyResults;
}; };
...@@ -206,6 +206,14 @@ CubicSDR::CubicSDR() : frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFA ...@@ -206,6 +206,14 @@ CubicSDR::CubicSDR() : frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFA
shuttingDown.store(false); shuttingDown.store(false);
fdlgTarget = FrequencyDialog::FDIALOG_TARGET_DEFAULT; fdlgTarget = FrequencyDialog::FDIALOG_TARGET_DEFAULT;
stoppedDev = nullptr; stoppedDev = nullptr;
//set OpenGL configuration:
m_glContextAttributes = new wxGLContextAttrs();
wxGLContextAttrs glSettings;
glSettings.PlatformDefaults().EndList();
*m_glContextAttributes = glSettings;
} }
bool CubicSDR::OnInit() { bool CubicSDR::OnInit() {
...@@ -484,11 +492,10 @@ int CubicSDR::OnExit() { ...@@ -484,11 +492,10 @@ int CubicSDR::OnExit() {
delete m_glContext; delete m_glContext;
m_glContext = nullptr; m_glContext = nullptr;
std::cout << "Application termination complete." << std::endl << std::flush; //
#ifdef __APPLE__
AudioThread::deviceCleanup(); AudioThread::deviceCleanup();
#endif
std::cout << "Application termination complete." << std::endl << std::flush;
return wxApp::OnExit(); return wxApp::OnExit();
} }
...@@ -496,13 +503,18 @@ int CubicSDR::OnExit() { ...@@ -496,13 +503,18 @@ int CubicSDR::OnExit() {
PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) { PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
PrimaryGLContext *glContext; PrimaryGLContext *glContext;
if (!m_glContext) { if (!m_glContext) {
m_glContext = new PrimaryGLContext(canvas, NULL); m_glContext = new PrimaryGLContext(canvas, NULL, GetContextAttributes());
} }
glContext = m_glContext; glContext = m_glContext;
return *glContext; return *glContext;
} }
wxGLContextAttrs* CubicSDR::GetContextAttributes() {
return m_glContextAttributes;
}
void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) { void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) {
parser.SetDesc (commandLineInfo); parser.SetDesc (commandLineInfo);
parser.SetSwitchChars (wxT("-")); parser.SetSwitchChars (wxT("-"));
......
...@@ -71,6 +71,7 @@ public: ...@@ -71,6 +71,7 @@ public:
CubicSDR(); CubicSDR();
PrimaryGLContext &GetContext(wxGLCanvas *canvas); PrimaryGLContext &GetContext(wxGLCanvas *canvas);
wxGLContextAttrs* GetContextAttributes();
virtual bool OnInit(); virtual bool OnInit();
virtual int OnExit(); virtual int OnExit();
...@@ -94,9 +95,7 @@ public: ...@@ -94,9 +95,7 @@ public:
void setAntennaName(const std::string& name); void setAntennaName(const std::string& name);
const std::string& getAntennaName(); const std::string& getAntennaName();
void setDBOffset(int ofs);
int getDBOffset();
void setSampleRate(long long rate_in); void setSampleRate(long long rate_in);
long long getSampleRate(); long long getSampleRate();
...@@ -114,7 +113,7 @@ public: ...@@ -114,7 +113,7 @@ public:
DemodulatorThreadOutputQueuePtr getAudioVisualQueue(); DemodulatorThreadOutputQueuePtr getAudioVisualQueue();
DemodulatorThreadInputQueuePtr getIQVisualQueue(); DemodulatorThreadInputQueuePtr getIQVisualQueue();
DemodulatorThreadInputQueuePtr getWaterfallVisualQueue(); DemodulatorThreadInputQueuePtr getWaterfallVisualQueue();
DemodulatorThreadInputQueuePtr getActiveDemodVisualQueue();
DemodulatorMgr &getDemodMgr(); DemodulatorMgr &getDemodMgr();
BookmarkMgr &getBookmarkMgr(); BookmarkMgr &getBookmarkMgr();
...@@ -186,6 +185,8 @@ private: ...@@ -186,6 +185,8 @@ private:
AppFrame *appframe = nullptr; AppFrame *appframe = nullptr;
AppConfig config; AppConfig config;
PrimaryGLContext *m_glContext = nullptr; PrimaryGLContext *m_glContext = nullptr;
wxGLContextAttrs *m_glContextAttributes = nullptr;
std::vector<SDRDeviceInfo *> *devs = nullptr; std::vector<SDRDeviceInfo *> *devs = nullptr;
DemodulatorMgr demodMgr; DemodulatorMgr demodMgr;
......
...@@ -106,7 +106,7 @@ bool AudioFileWAV::closeFile() ...@@ -106,7 +106,7 @@ bool AudioFileWAV::closeFile()
// Fix the data chunk header to contain the data size // Fix the data chunk header to contain the data size
outputFileStream.seekp(dataChunkPos + 4); outputFileStream.seekp(dataChunkPos + 4);
write_word(outputFileStream, file_length - dataChunkPos + 8); write_word(outputFileStream, file_length - (dataChunkPos + 8), 4);
// Fix the file header to contain the proper RIFF chunk size, which is (file size - 8) bytes // Fix the file header to contain the proper RIFF chunk size, which is (file size - 8) bytes
outputFileStream.seekp(0 + 4); outputFileStream.seekp(0 + 4);
......
This diff is collapsed.
...@@ -21,20 +21,20 @@ public: ...@@ -21,20 +21,20 @@ public:
int channels; int channels;
float peak; float peak;
int type; int type;
bool is_squelch_active; bool is_squelch_active;
std::vector<float> data; std::vector<float> data;
AudioThreadInput() : AudioThreadInput() :
frequency(0), inputRate(0), sampleRate(0), channels(0), peak(0), type(0), is_squelch_active(false) { frequency(0), inputRate(0), sampleRate(0), channels(0), peak(0), type(0), is_squelch_active(false) {
} }
AudioThreadInput(AudioThreadInput *copyFrom) { AudioThreadInput(AudioThreadInput *copyFrom) {
copy(copyFrom); copy(copyFrom);
} }
void copy(AudioThreadInput *copyFrom) { void copy(AudioThreadInput *copyFrom) {
frequency = copyFrom->frequency; frequency = copyFrom->frequency;
inputRate = copyFrom->inputRate; inputRate = copyFrom->inputRate;
...@@ -46,9 +46,9 @@ public: ...@@ -46,9 +46,9 @@ public:
data.assign(copyFrom->data.begin(), copyFrom->data.end()); data.assign(copyFrom->data.begin(), copyFrom->data.end());
} }
virtual ~AudioThreadInput() { virtual ~AudioThreadInput() {
} }
}; };
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
}; };
AudioThreadCommand() : AudioThreadCommand() :
cmd(AUDIO_THREAD_CMD_NULL), int_value(0)