mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-12 23:26:10 -05:00
commit
cdaae140fd
@ -88,10 +88,10 @@ AppFrame::AppFrame() :
|
||||
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||
//wxGLAttributes attribList;
|
||||
//attribList.PlatformDefaults().RGBA().DoubleBuffer().EndList();
|
||||
//attribList.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(16).EndList();
|
||||
// OpenGL settings:
|
||||
//deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||
wxGLAttributes attribList;
|
||||
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->SetSashGravity(10.0f / 37.0f);
|
||||
|
@ -206,6 +206,14 @@ CubicSDR::CubicSDR() : frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFA
|
||||
shuttingDown.store(false);
|
||||
fdlgTarget = FrequencyDialog::FDIALOG_TARGET_DEFAULT;
|
||||
stoppedDev = nullptr;
|
||||
|
||||
//set OpenGL configuration:
|
||||
m_glContextAttributes = new wxGLContextAttrs();
|
||||
|
||||
wxGLContextAttrs glSettings;
|
||||
glSettings.PlatformDefaults().EndList();
|
||||
|
||||
*m_glContextAttributes = glSettings;
|
||||
}
|
||||
|
||||
bool CubicSDR::OnInit() {
|
||||
@ -495,13 +503,18 @@ int CubicSDR::OnExit() {
|
||||
PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
|
||||
PrimaryGLContext *glContext;
|
||||
if (!m_glContext) {
|
||||
m_glContext = new PrimaryGLContext(canvas, NULL);
|
||||
m_glContext = new PrimaryGLContext(canvas, NULL, GetContextAttributes());
|
||||
}
|
||||
glContext = m_glContext;
|
||||
|
||||
return *glContext;
|
||||
}
|
||||
|
||||
wxGLContextAttrs* CubicSDR::GetContextAttributes() {
|
||||
|
||||
return m_glContextAttributes;
|
||||
}
|
||||
|
||||
void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) {
|
||||
parser.SetDesc (commandLineInfo);
|
||||
parser.SetSwitchChars (wxT("-"));
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
CubicSDR();
|
||||
|
||||
PrimaryGLContext &GetContext(wxGLCanvas *canvas);
|
||||
wxGLContextAttrs* GetContextAttributes();
|
||||
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit();
|
||||
@ -94,9 +95,7 @@ public:
|
||||
|
||||
void setAntennaName(const std::string& name);
|
||||
const std::string& getAntennaName();
|
||||
|
||||
void setDBOffset(int ofs);
|
||||
int getDBOffset();
|
||||
|
||||
|
||||
void setSampleRate(long long rate_in);
|
||||
long long getSampleRate();
|
||||
@ -114,7 +113,7 @@ public:
|
||||
DemodulatorThreadOutputQueuePtr getAudioVisualQueue();
|
||||
DemodulatorThreadInputQueuePtr getIQVisualQueue();
|
||||
DemodulatorThreadInputQueuePtr getWaterfallVisualQueue();
|
||||
DemodulatorThreadInputQueuePtr getActiveDemodVisualQueue();
|
||||
|
||||
DemodulatorMgr &getDemodMgr();
|
||||
BookmarkMgr &getBookmarkMgr();
|
||||
|
||||
@ -186,6 +185,8 @@ private:
|
||||
AppFrame *appframe = nullptr;
|
||||
AppConfig config;
|
||||
PrimaryGLContext *m_glContext = nullptr;
|
||||
wxGLContextAttrs *m_glContextAttributes = nullptr;
|
||||
|
||||
std::vector<SDRDeviceInfo *> *devs = nullptr;
|
||||
|
||||
DemodulatorMgr demodMgr;
|
||||
|
@ -186,10 +186,14 @@ void BookmarkView::onUpdateTimer( wxTimerEvent& /* event */ ) {
|
||||
if (bmSel) {
|
||||
m_treeView->SelectItem(bmSel);
|
||||
}
|
||||
doUpdateBookmarks.store(false);
|
||||
doUpdateBookmarks.store(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool BookmarkView::skipUserEvents() {
|
||||
|
||||
return !this->IsShown() || doUpdateActive || doUpdateBookmarks;
|
||||
}
|
||||
|
||||
void BookmarkView::updateTheme() {
|
||||
wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground);
|
||||
@ -538,6 +542,11 @@ void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool searchState = (searchKeywords.size() != 0);
|
||||
|
||||
if (searchState) {
|
||||
@ -567,6 +576,11 @@ void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onTreeExpanded( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool searchState = (searchKeywords.size() != 0);
|
||||
|
||||
if (searchState) {
|
||||
@ -596,6 +610,7 @@ void BookmarkView::onTreeExpanded( wxTreeEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onTreeItemMenu( wxTreeEvent& /* event */ ) {
|
||||
|
||||
if (m_treeView->GetSelection() == bookmarkBranch) {
|
||||
wxMenu menu;
|
||||
menu.Append(wxCONTEXT_ADD_GROUP_ID, BOOKMARK_VIEW_STR_ADD_GROUP);
|
||||
@ -606,6 +621,7 @@ void BookmarkView::onTreeItemMenu( wxTreeEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onMenuItem(wxCommandEvent& event) {
|
||||
|
||||
if (event.GetId() == wxCONTEXT_ADD_GROUP_ID) {
|
||||
onAddGroup(event);
|
||||
}
|
||||
@ -683,10 +699,13 @@ wxButton *BookmarkView::makeButton(wxWindow *parent, std::string labelVal, wxObj
|
||||
nButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, handler, nullptr, this);
|
||||
|
||||
wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground);
|
||||
wxColour textColor(ThemeMgr::mgr.currentTheme->text);
|
||||
// wxColour fgColor(ThemeMgr::mgr.currentTheme->button);
|
||||
//Force white color:
|
||||
wxColour textColorWhite(RGBA4f(255,255,255));
|
||||
|
||||
nButton->SetBackgroundColour(bgColor);
|
||||
nButton->SetForegroundColour(textColor);
|
||||
nButton->SetForegroundColour(textColorWhite);
|
||||
|
||||
return nButton;
|
||||
}
|
||||
|
||||
@ -762,7 +781,7 @@ void BookmarkView::addBookmarkChoice(wxWindow *parent) {
|
||||
|
||||
|
||||
void BookmarkView::onBookmarkChoice( wxCommandEvent & /* event */ ) {
|
||||
|
||||
|
||||
TreeViewItem *tvi = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
int numSel = bookmarkChoice->GetCount();
|
||||
@ -823,15 +842,16 @@ void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
|
||||
|
||||
addBookmarkChoice(m_buttonPanel);
|
||||
|
||||
if (dsel->isActive() && !(dsel->isRecording())) {
|
||||
addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler( BookmarkView::onStartRecording ));
|
||||
} else {
|
||||
addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler( BookmarkView::onStopRecording ));
|
||||
if (dsel->isActive()) {
|
||||
if (!(dsel->isRecording())) {
|
||||
addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler(BookmarkView::onStartRecording));
|
||||
} else {
|
||||
addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler(BookmarkView::onStopRecording));
|
||||
}
|
||||
}
|
||||
|
||||
addButton(m_buttonPanel, "Remove Active", wxCommandEventHandler( BookmarkView::onRemoveActive ));
|
||||
|
||||
|
||||
showProps();
|
||||
showButtons();
|
||||
refreshLayout();
|
||||
@ -1053,6 +1073,7 @@ void BookmarkView::activeBranchSelection() {
|
||||
|
||||
|
||||
void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
||||
|
||||
wxTreeItemId itm = event.GetItem();
|
||||
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
||||
|
||||
@ -1097,11 +1118,17 @@ void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onTreeSelectChanging( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void BookmarkView::onLabelText( wxCommandEvent& /* event */ ) {
|
||||
|
||||
std::wstring newLabel = m_labelText->GetValue().ToStdWstring();
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
@ -1146,6 +1173,7 @@ void BookmarkView::onDoubleClickFreq( wxMouseEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onDoubleClickBandwidth( wxMouseEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
@ -1157,6 +1185,7 @@ void BookmarkView::onDoubleClickBandwidth( wxMouseEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveActive( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
@ -1168,6 +1197,7 @@ void BookmarkView::onRemoveActive( wxCommandEvent& /* event */ ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onStartRecording( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
@ -1180,6 +1210,7 @@ void BookmarkView::onStartRecording( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onStopRecording( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
|
||||
@ -1193,6 +1224,7 @@ void BookmarkView::onStopRecording( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveBookmark( wxCommandEvent& /* event */ ) {
|
||||
|
||||
if (editingLabel) {
|
||||
return;
|
||||
}
|
||||
@ -1206,6 +1238,7 @@ void BookmarkView::onRemoveBookmark( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onActivateBookmark( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
|
||||
@ -1215,6 +1248,7 @@ void BookmarkView::onActivateBookmark( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onActivateRecent( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
|
||||
@ -1230,6 +1264,7 @@ void BookmarkView::onActivateRecent( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveRecent ( wxCommandEvent& /* event */ ) {
|
||||
|
||||
if (editingLabel) {
|
||||
return;
|
||||
}
|
||||
@ -1247,6 +1282,7 @@ void BookmarkView::onRemoveRecent ( wxCommandEvent& /* event */ ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onClearRecents ( wxCommandEvent& /* event */ ) {
|
||||
|
||||
if (editingLabel) {
|
||||
return;
|
||||
}
|
||||
@ -1255,6 +1291,7 @@ void BookmarkView::onClearRecents ( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onAddGroup( wxCommandEvent& /* event */ ) {
|
||||
|
||||
wxString stringVal = wxGetTextFromUser(BOOKMARK_VIEW_STR_ADD_GROUP_DESC, BOOKMARK_VIEW_STR_ADD_GROUP, "");
|
||||
if (stringVal.ToStdString() != "") {
|
||||
wxGetApp().getBookmarkMgr().addGroup(stringVal.ToStdString());
|
||||
@ -1264,6 +1301,7 @@ void BookmarkView::onAddGroup( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveGroup( wxCommandEvent& /* event */ ) {
|
||||
|
||||
if (editingLabel) {
|
||||
return;
|
||||
}
|
||||
@ -1288,6 +1326,7 @@ void BookmarkView::onAddRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRemoveRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
if (editingLabel) {
|
||||
return;
|
||||
}
|
||||
@ -1301,6 +1340,7 @@ void BookmarkView::onRemoveRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
|
||||
void BookmarkView::onRenameRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (!curSel || curSel->type != TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
|
||||
@ -1319,6 +1359,7 @@ void BookmarkView::onRenameRange( wxCommandEvent& /* event */ ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onActivateRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE) {
|
||||
@ -1327,6 +1368,7 @@ void BookmarkView::onActivateRange( wxCommandEvent& /* event */ ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onUpdateRange( wxCommandEvent& /* event */ ) {
|
||||
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE) {
|
||||
@ -1335,6 +1377,7 @@ void BookmarkView::onUpdateRange( wxCommandEvent& /* event */ ) {
|
||||
}
|
||||
|
||||
void BookmarkView::onTreeBeginDrag( wxTreeEvent& event ) {
|
||||
|
||||
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(event.GetItem()));
|
||||
|
||||
dragItem = nullptr;
|
||||
@ -1439,6 +1482,10 @@ void BookmarkView::onTreeEndDrag( wxTreeEvent& event ) {
|
||||
|
||||
void BookmarkView::onTreeItemGetTooltip( wxTreeEvent& event ) {
|
||||
|
||||
if (skipUserEvents()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@ -1491,6 +1538,7 @@ TreeViewItem *BookmarkView::itemToTVI(wxTreeItemId item) {
|
||||
}
|
||||
|
||||
void BookmarkView::onSearchTextFocus( wxMouseEvent& event ) {
|
||||
|
||||
mouseTracker.OnMouseMoved(event);
|
||||
|
||||
//apparently needed ???
|
||||
@ -1515,6 +1563,7 @@ void BookmarkView::onSearchTextFocus( wxMouseEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onSearchText( wxCommandEvent& event ) {
|
||||
|
||||
std::wstring searchText = m_searchText->GetValue().Trim().Lower().ToStdWstring();
|
||||
|
||||
searchKeywords.clear();
|
||||
@ -1545,6 +1594,7 @@ void BookmarkView::onSearchText( wxCommandEvent& event ) {
|
||||
|
||||
|
||||
void BookmarkView::onClearSearch( wxCommandEvent& /* event */ ) {
|
||||
|
||||
m_clearSearchButton->Hide();
|
||||
m_searchText->SetValue(L"Search..");
|
||||
m_treeView->SetFocus();
|
||||
|
@ -161,6 +161,8 @@ protected:
|
||||
void onRenameRange( wxCommandEvent& event );
|
||||
void onActivateRange( wxCommandEvent& event );
|
||||
void onUpdateRange( wxCommandEvent& event );
|
||||
|
||||
bool skipUserEvents();
|
||||
|
||||
TreeViewItem *itemToTVI(wxTreeItemId item);
|
||||
|
||||
|
@ -27,10 +27,10 @@ EVT_LEAVE_WINDOW(UITestCanvas::OnMouseLeftWindow)
|
||||
EVT_ENTER_WINDOW(UITestCanvas::OnMouseEnterWindow)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
UITestCanvas::UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
UITestCanvas::UITestCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs) {
|
||||
|
||||
glContext = new UITestContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new UITestContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
}
|
||||
|
||||
UITestCanvas::~UITestCanvas() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
class UITestCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
UITestCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~UITestCanvas();
|
||||
|
||||
private:
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "UITestCanvas.h"
|
||||
#include "ColorTheme.h"
|
||||
|
||||
UITestContext::UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext), testMeter("TEST",0,100,50) {
|
||||
UITestContext::UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
|
||||
PrimaryGLContext(canvas, sharedContext, ctxAttrs), testMeter("TEST",0,100,50) {
|
||||
|
||||
testPanel.setPosition(0.0, 0.0);
|
||||
testPanel.setSize(1.0, 1.0);
|
||||
|
@ -11,7 +11,7 @@ class UITestCanvas;
|
||||
|
||||
class UITestContext: public PrimaryGLContext {
|
||||
public:
|
||||
UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext);
|
||||
UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
|
||||
|
||||
void DrawBegin();
|
||||
void Draw();
|
||||
|
@ -46,7 +46,8 @@ void initGLExtensions() {
|
||||
|
||||
#ifdef _WIN32
|
||||
if (GLExtSupported("WGL_EXT_swap_control")) {
|
||||
std::cout << "Initializing WGL swap control extensions.." << std::endl;
|
||||
std::cout << "Initializing WGL swap control extensions.." << std::endl << std::flush;
|
||||
|
||||
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT");
|
||||
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) wglGetProcAddress("wglGetSwapIntervalEXT");
|
||||
|
||||
|
@ -29,10 +29,10 @@ EVT_ENTER_WINDOW(GainCanvas::OnMouseEnterWindow)
|
||||
EVT_MOUSEWHEEL(GainCanvas::OnMouseWheelMoved)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
GainCanvas::GainCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
GainCanvas::GainCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs) {
|
||||
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
bgPanel.setCoordinateSystem(GLPanel::GLPANEL_Y_UP);
|
||||
bgPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
class GainCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
GainCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
GainCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~GainCanvas();
|
||||
|
||||
void setHelpTip(std::string tip);
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#include <wx/numformatter.h>
|
||||
|
||||
InteractiveCanvas::InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
wxGLCanvas(parent, wxID_ANY, dispAttrs.data(), wxDefaultPosition, wxDefaultSize,
|
||||
wxFULL_REPAINT_ON_RESIZE), parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
|
||||
InteractiveCanvas::InteractiveCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
wxGLCanvas(parent, dispAttrs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE),
|
||||
parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
|
||||
false) {
|
||||
mouseTracker.setTarget(this);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
class InteractiveCanvas: public wxGLCanvas {
|
||||
public:
|
||||
InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
InteractiveCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
virtual ~InteractiveCanvas();
|
||||
|
||||
long long getFrequencyAt(float x);
|
||||
|
@ -30,10 +30,10 @@ EVT_LEAVE_WINDOW(MeterCanvas::OnMouseLeftWindow)
|
||||
EVT_ENTER_WINDOW(MeterCanvas::OnMouseEnterWindow)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
MeterCanvas::MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
MeterCanvas::MeterCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs), level(0), level_min(0), level_max(1), inputValue(0), userInputValue(0), showUserInput(true) {
|
||||
|
||||
glContext = new MeterContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new MeterContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
}
|
||||
|
||||
MeterCanvas::~MeterCanvas() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
class MeterCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
MeterCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~MeterCanvas();
|
||||
|
||||
void setLevel(float level_in);
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "MeterCanvas.h"
|
||||
#include "ColorTheme.h"
|
||||
|
||||
MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
|
||||
PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
|
||||
}
|
||||
|
||||
void MeterContext::DrawBegin() {
|
||||
|
@ -12,7 +12,7 @@ class MeterCanvas;
|
||||
|
||||
class MeterContext: public PrimaryGLContext {
|
||||
public:
|
||||
MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext);
|
||||
MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
|
||||
|
||||
void DrawBegin();
|
||||
void Draw(float r, float g, float b, float a, float level);
|
||||
|
@ -27,10 +27,10 @@ EVT_LEAVE_WINDOW(ModeSelectorCanvas::OnMouseLeftWindow)
|
||||
EVT_ENTER_WINDOW(ModeSelectorCanvas::OnMouseEnterWindow)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs), numChoices(0), currentSelection(-1), toggleMode(false), inputChanged(false), padX(4.0), padY(4.0), highlightOverride(false) {
|
||||
|
||||
glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
|
||||
highlightColor = RGBA4f(1.0,1.0,1.0,1.0);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
|
||||
class ModeSelectorCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
ModeSelectorCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~ModeSelectorCanvas();
|
||||
|
||||
int getHoveredSelection();
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include "ColorTheme.h"
|
||||
|
||||
|
||||
ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
|
||||
PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
|
@ -12,7 +12,7 @@ class ModeSelectorCanvas;
|
||||
|
||||
class ModeSelectorContext: public PrimaryGLContext {
|
||||
public:
|
||||
ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext);
|
||||
ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
|
||||
|
||||
void DrawBegin();
|
||||
void DrawSelector(std::string label, int c, int cMax, bool on, float r, float g, float b, float a, float padx, float pady);
|
||||
|
@ -50,8 +50,11 @@ void PrimaryGLContext::CheckGLError() {
|
||||
}
|
||||
}
|
||||
|
||||
PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext) :
|
||||
wxGLContext(canvas, sharedContext), hoverAlpha(1.0) {
|
||||
PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs* ctxAttrs) :
|
||||
wxGLContext(canvas, sharedContext, (const wxGLContextAttrs*) ctxAttrs), hoverAlpha(1.0) {
|
||||
|
||||
|
||||
|
||||
//#ifndef __linux__
|
||||
// SetCurrent(*canvas);
|
||||
// // Pre-load fonts
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
class PrimaryGLContext: public wxGLContext {
|
||||
public:
|
||||
PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext);
|
||||
PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs* ctxAttrs);
|
||||
|
||||
static wxString glGetwxString(GLenum name);
|
||||
static void CheckGLError();
|
||||
|
@ -31,9 +31,9 @@ EVT_LEAVE_WINDOW(ScopeCanvas::OnMouseLeftWindow)
|
||||
EVT_ENTER_WINDOW(ScopeCanvas::OnMouseEnterWindow)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
ScopeCanvas::ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0), helpTip("") {
|
||||
ScopeCanvas::ScopeCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0), helpTip("") {
|
||||
|
||||
glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new ScopeContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
inputData->set_max_num_items(2);
|
||||
bgPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_Y);
|
||||
bgPanel.setSize(1.0, 0.5f);
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
class ScopeCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
ScopeCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~ScopeCanvas();
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include "ScopeCanvas.h"
|
||||
#include "ColorTheme.h"
|
||||
|
||||
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
|
||||
PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
|
||||
glDisable (GL_CULL_FACE);
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
|
||||
|
@ -12,7 +12,7 @@ class ScopeCanvas;
|
||||
|
||||
class ScopeContext: public PrimaryGLContext {
|
||||
public:
|
||||
ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext);
|
||||
ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
|
||||
|
||||
void DrawBegin(bool clear=true);
|
||||
void DrawTunerTitles(bool ppmMode=false);
|
||||
|
@ -32,10 +32,10 @@ EVT_RIGHT_DOWN(SpectrumCanvas::OnMouseRightDown)
|
||||
EVT_RIGHT_UP(SpectrumCanvas::OnMouseRightReleased)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
SpectrumCanvas::SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
SpectrumCanvas::SpectrumCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs), waterfallCanvas(NULL) {
|
||||
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
|
||||
visualDataQueue->set_max_num_items(1);
|
||||
|
||||
@ -215,6 +215,21 @@ void SpectrumCanvas::updateScaleFactor(float factor) {
|
||||
wp->setScaleFactor(factor);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::updateScaleFactorFromYMove(float yDeltaMouseMove) {
|
||||
|
||||
scaleFactor += yDeltaMouseMove * 2.0;
|
||||
|
||||
if (scaleFactor < 0.25) {
|
||||
scaleFactor = 0.25;
|
||||
}
|
||||
if (scaleFactor > 10.0) {
|
||||
scaleFactor = 10.0;
|
||||
}
|
||||
|
||||
resetScaleFactor = false;
|
||||
updateScaleFactor(scaleFactor);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseMoved(event);
|
||||
if (mouseTracker.mouseDown()) {
|
||||
@ -226,21 +241,11 @@ void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
}
|
||||
else if (scaleFactorEnabled && mouseTracker.mouseRightDown()) {
|
||||
|
||||
float yDelta = mouseTracker.getDeltaMouseY();
|
||||
updateScaleFactorFromYMove(mouseTracker.getDeltaMouseY());
|
||||
|
||||
scaleFactor += yDelta*2.0;
|
||||
if (scaleFactor < 0.25) {
|
||||
scaleFactor = 0.25;
|
||||
}
|
||||
if (scaleFactor > 10.0) {
|
||||
scaleFactor = 10.0;
|
||||
}
|
||||
|
||||
resetScaleFactor = false;
|
||||
updateScaleFactor(scaleFactor);
|
||||
} else {
|
||||
if (scaleFactorEnabled) {
|
||||
setStatusText("Drag horizontal to adjust center frequency. Right-drag or SHIFT+UP/DOWN to adjust vertical scale; right-click to reset. 'B' to toggle decibels display.");
|
||||
setStatusText("Drag horizontal to adjust center frequency. Arrow keys or wheel to navigate/zoom bandwith. Right-drag or SHIFT+UP/DOWN to adjust visual gain, right-click to reset it. 'B' to toggle decibels display.");
|
||||
} else {
|
||||
setStatusText("Displaying spectrum of active demodulator.");
|
||||
}
|
||||
@ -248,9 +253,9 @@ void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseDown(wxMouseEvent& event) {
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
mouseTracker.setVertDragLock(true);
|
||||
InteractiveCanvas::OnMouseDown(event);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
@ -263,12 +268,12 @@ void SpectrumCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
void SpectrumCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
mouseTracker.setVertDragLock(false);
|
||||
InteractiveCanvas::OnMouseReleased(event);
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseEnterWindow(event);
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
#ifdef _WIN32
|
||||
if (wxGetApp().getAppFrame()->canFocus()) {
|
||||
this->SetFocus();
|
||||
@ -278,7 +283,7 @@ void SpectrumCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
|
||||
void SpectrumCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseLeftWindow(event);
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::attachWaterfallCanvas(WaterfallCanvas* canvas_in) {
|
||||
@ -290,15 +295,19 @@ SpectrumVisualDataQueuePtr SpectrumCanvas::getVisualDataQueue() {
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseRightDown(wxMouseEvent& event) {
|
||||
SetCursor(wxCURSOR_SIZENS);
|
||||
mouseTracker.setHorizDragLock(true);
|
||||
mouseTracker.OnMouseRightDown(event);
|
||||
scaleFactor = wxGetApp().getSpectrumProcessor()->getScaleFactor();
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
mouseTracker.setHorizDragLock(false);
|
||||
|
||||
if (!mouseTracker.getOriginDeltaMouseY()) {
|
||||
resetScaleFactor = true;
|
||||
|
||||
wxGetApp().getSpectrumProcessor()->setPeakHold(wxGetApp().getSpectrumProcessor()->getPeakHold());
|
||||
|
||||
//make the peak hold act on the current dmod also, like a zoomed-in version.
|
||||
@ -306,6 +315,7 @@ void SpectrumCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
wxGetApp().getDemodSpectrumProcessor()->setPeakHold(wxGetApp().getSpectrumProcessor()->getPeakHold());
|
||||
}
|
||||
}
|
||||
|
||||
mouseTracker.OnMouseRightReleased(event);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class WaterfallCanvas;
|
||||
|
||||
class SpectrumCanvas: public InteractiveCanvas {
|
||||
public:
|
||||
SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
SpectrumCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~SpectrumCanvas();
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
@ -47,6 +47,9 @@ public:
|
||||
|
||||
SpectrumVisualDataQueuePtr getVisualDataQueue();
|
||||
|
||||
// called by Waterfall to forward the update of the vertical scale.
|
||||
void updateScaleFactorFromYMove(float yDeltaMouseMove);
|
||||
|
||||
private:
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
@ -60,7 +63,6 @@ private:
|
||||
void OnMouseLeftWindow(wxMouseEvent& event);
|
||||
void OnMouseRightDown(wxMouseEvent& event);
|
||||
void OnMouseRightReleased(wxMouseEvent& event);
|
||||
|
||||
|
||||
void updateScaleFactor(float factor);
|
||||
|
||||
|
@ -33,10 +33,10 @@ EVT_MOUSEWHEEL(TuningCanvas::OnMouseWheelMoved)
|
||||
//EVT_KEY_UP(TuningCanvas::OnKeyUp)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
TuningCanvas::TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
TuningCanvas::TuningCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs), dragAccum(0), uxDown(0), top(false), bottom(false), freq(-1), bw(-1), center(-1), halfBand(false) {
|
||||
|
||||
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new TuningContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
|
||||
hoverIndex = 0;
|
||||
downIndex = 0;
|
||||
@ -272,7 +272,6 @@ void TuningCanvas::OnIdle(wxIdleEvent &event) {
|
||||
if (mouseTracker.mouseInView() || changed()) {
|
||||
Refresh();
|
||||
}
|
||||
event.RequestMore();
|
||||
}
|
||||
|
||||
void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
enum ActiveState {
|
||||
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_PPM, TUNING_HOVER_CENTER
|
||||
};
|
||||
TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
TuningCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
~TuningCanvas();
|
||||
|
||||
void setHelpTip(std::string tip);
|
||||
|
@ -18,8 +18,8 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
|
||||
PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
|
@ -12,7 +12,7 @@ class TuningCanvas;
|
||||
|
||||
class TuningContext: public PrimaryGLContext {
|
||||
public:
|
||||
TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext);
|
||||
TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
|
||||
|
||||
void DrawBegin();
|
||||
void Draw(float r, float g, float b, float a, float p1, float p2);
|
||||
|
@ -39,11 +39,11 @@ EVT_ENTER_WINDOW(WaterfallCanvas::OnMouseEnterWindow)
|
||||
EVT_MOUSEWHEEL(WaterfallCanvas::OnMouseWheelMoved)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
|
||||
InteractiveCanvas(parent, dispAttrs), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), new_fft_size(0), waterfall_lines(0),
|
||||
dragOfs(0), mouseZoom(1), zoom(1), freqMoving(false), freqMove(0.0), hoverAlpha(1.0) {
|
||||
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
|
||||
linesPerSecond = DEFAULT_WATERFALL_LPS;
|
||||
lpsIndex = 0;
|
||||
preBuf = false;
|
||||
@ -486,7 +486,6 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||
void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
|
||||
processInputQueue();
|
||||
Refresh();
|
||||
event.RequestMore();
|
||||
}
|
||||
|
||||
void WaterfallCanvas::updateHoverState() {
|
||||
@ -583,7 +582,7 @@ void WaterfallCanvas::updateHoverState() {
|
||||
}
|
||||
else {
|
||||
setStatusText(
|
||||
"Click to set demodulator frequency or hold ALT to drag range; hold SHIFT to create new. Right drag or wheel to Zoom. Arrow keys to navigate/zoom, C to center. Shift-R record/stop all.");
|
||||
"Click to set demodulator frequency or hold ALT to drag range; hold SHIFT to create new. Arrow keys or wheel to navigate/zoom bandwith, C to center. Right-drag or SHIFT+UP/DOWN to adjust visual gain. Shift-R record/stop all.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -637,8 +636,11 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
demod->updateLabel(currentFreq);
|
||||
}
|
||||
}
|
||||
} else if (mouseTracker.mouseRightDown()) {
|
||||
mouseZoom = mouseZoom + ((1.0 - (mouseTracker.getDeltaMouseY() * 4.0)) - mouseZoom) * 0.1;
|
||||
} else if (mouseTracker.mouseRightDown() && spectrumCanvas) {
|
||||
|
||||
//Right-drag has the same effect on both Waterfall and Spectrum.
|
||||
spectrumCanvas->updateScaleFactorFromYMove(mouseTracker.getDeltaMouseY());
|
||||
|
||||
} else {
|
||||
updateHoverState();
|
||||
}
|
||||
@ -879,7 +881,6 @@ void WaterfallCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
mouseTracker.setVertDragLock(false);
|
||||
mouseTracker.setHorizDragLock(false);
|
||||
mouseZoom = 1.0;
|
||||
}
|
||||
|
||||
SpectrumVisualDataQueuePtr WaterfallCanvas::getVisualDataQueue() {
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE
|
||||
};
|
||||
|
||||
WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||
WaterfallCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
|
||||
void setup(unsigned int fft_size_in, int waterfall_lines_in);
|
||||
void setFFTSize(unsigned int fft_size_in);
|
||||
~WaterfallCanvas();
|
||||
|
Loading…
Reference in New Issue
Block a user