mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 14:04:47 -04:00
Init bookmark manager
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include "ModemProperties.h"
|
||||
//#include "UITestCanvas.h"
|
||||
#include "FrequencyDialog.h"
|
||||
#include "BookmarkMgr.h"
|
||||
#include "BookmarkView.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "BookmarkMgr.h"
|
||||
|
||||
|
||||
void BookmarkMgr::saveToFile(std::string bookmarkFn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void BookmarkMgr::loadFromFile(std::string bookmarkFn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BookmarkMgr::addBookmark(std::string group, DemodulatorInstance *demod) {
|
||||
std::lock_guard < std::mutex > lock(busy_lock);
|
||||
|
||||
}
|
||||
|
||||
BookmarkList BookmarkMgr::getBookmarks(std::string group, std::string folder) {
|
||||
std::lock_guard < std::mutex > lock(busy_lock);
|
||||
|
||||
BookmarkList results;
|
||||
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "DataTree.h"
|
||||
#include "DemodulatorInstance.h"
|
||||
|
||||
class BookmarkEntry {
|
||||
public:
|
||||
std::mutex busy_lock;
|
||||
|
||||
std::string folder;
|
||||
std::string type;
|
||||
std::string label;
|
||||
|
||||
long long frequency;
|
||||
int bandwidth;
|
||||
|
||||
DataNode *node;
|
||||
};
|
||||
|
||||
typedef std::vector<BookmarkEntry *> BookmarkList;
|
||||
typedef std::map<std::string, std::map<long long, BookmarkEntry *> > BookmarkMap;
|
||||
|
||||
class BookmarkMgr {
|
||||
public:
|
||||
void saveToFile(std::string bookmarkFn);
|
||||
void loadFromFile(std::string bookmarkFn);
|
||||
|
||||
void addBookmark(std::string group, DemodulatorInstance *demod);
|
||||
BookmarkList getBookmarks(std::string group, std::string folder = "");
|
||||
|
||||
protected:
|
||||
|
||||
BookmarkMap bmData;
|
||||
std::mutex busy_lock;
|
||||
};
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
#include "BookmarkPanel.h"
|
||||
|
||||
#include "BookmarkMgr.h"
|
||||
|
||||
class BookmarkView : public BookmarkPanel {
|
||||
public:
|
||||
BookmarkView( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1, -1 ), long style = wxTAB_TRAVERSAL );
|
||||
|
||||
void updateActiveList();
|
||||
void saveToFile(std::string bookmarkFn);
|
||||
void loadFromFile(std::string bookmarkFn);
|
||||
|
||||
protected:
|
||||
void onTreeBeginLabelEdit( wxTreeEvent& event );
|
||||
@@ -22,5 +22,6 @@ protected:
|
||||
void onBookmark( wxCommandEvent& event );
|
||||
void onActivate( wxCommandEvent& event );
|
||||
void onRemove( wxCommandEvent& event );
|
||||
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user