Linux re-tweak

This commit is contained in:
Charles J. Cliffe 2015-08-13 20:39:31 -04:00
parent b1f20de0e9
commit e04b12662f
4 changed files with 20 additions and 6 deletions

View File

@ -118,6 +118,7 @@ AppFrame::AppFrame() :
wxGetApp().getSpectrumProcesor()->attachOutput(spectrumCanvas->getVisualDataQueue());
spectrumAvgMeter = new MeterCanvas(this, attribList);
spectrumAvgMeter->setHelpTip("Spectrum averaging speed, click or drag to adjust.");
spectrumAvgMeter->setMax(1.0);
spectrumAvgMeter->setLevel(0.65);
spectrumAvgMeter->setShowUserInput(false);
@ -143,6 +144,7 @@ AppFrame::AppFrame() :
wxGetApp().getWaterfallProcesor()->attachOutput(waterfallCanvas->getVisualDataQueue());
waterfallSpeedMeter = new MeterCanvas(this, attribList);
waterfallSpeedMeter->setHelpTip("Waterfall speed, click or drag to adjust (max 1024 lines per second)");
waterfallSpeedMeter->setMax(sqrt(1024));
waterfallSpeedMeter->setLevel(sqrt(DEFAULT_WATERFALL_LPS));
waterfallSpeedMeter->setShowUserInput(false);
@ -263,7 +265,7 @@ AppFrame::AppFrame() :
// sampleRateMenuItems[wxID_BANDWIDTH_3000M] = menu->AppendRadioItem(wxID_BANDWIDTH_3000M, "3.0M");
sampleRateMenuItems[wxID_BANDWIDTH_3200M] = menu->AppendRadioItem(wxID_BANDWIDTH_3200M, "3.2M");
sampleRateMenuItems[wxID_BANDWIDTH_2048M]->Check(true);
sampleRateMenuItems[wxID_BANDWIDTH_2400M]->Check(true);
menuBar->Append(menu, wxT("&Input Bandwidth"));
@ -719,6 +721,8 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
float val = spectrumAvgMeter->getInputValue();
spectrumAvgMeter->setLevel(val);
proc->setFFTAverageRate(val);
GetStatusBar()->SetStatusText(wxString::Format(wxT("Spectrum averaging speed changed to %0.2f%%."),val*100.0));
}
proc->setView(spectrumCanvas->getViewState());
@ -750,6 +754,8 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
waterfallSpeedMeter->setLevel(val);
fftDistrib.setLinesPerSecond((int)ceil(val*val));
wxGetApp().getWaterfallVisualQueue()->set_max_num_items((int)ceil(val*val));
GetStatusBar()->SetStatusText(wxString::Format(wxT("Waterfall max speed changed to %d lines per second."),(int)ceil(val*val)));
}
fftDistrib.run();
@ -769,12 +775,13 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
if (this->IsVisible()) {
waterfallCanvas->DoPaint();
demodWaterfallCanvas->DoPaint();
}
} else {
#ifndef _WIN32
else {
usleep(15000);
}
#else
Sleep(15);
#endif
}
event.RequestMore();
}

View File

@ -27,10 +27,10 @@ const char filePathSeparator =
#define BUF_SIZE (16384*6)
#define DEFAULT_SAMPLE_RATE 2048000
#define DEFAULT_SAMPLE_RATE 2400000
#define DEFAULT_FFT_SIZE 2048
#define DEFAULT_DEMOD_TYPE 1
#define DEFAULT_DEMOD_BW 200000
#define DEFAULT_WATERFALL_LPS 30
#define DEFAULT_WATERFALL_LPS 30

View File

@ -17,6 +17,7 @@ void ScopeVisualProcessor::process() {
return;
}
audioInputData->busy_update.lock();
ScopeRenderData *renderData = outputBuffers.getBuffer();
renderData->channels = audioInputData->channels;
@ -44,6 +45,8 @@ void ScopeVisualProcessor::process() {
renderData->waveform_points[i * 2 + 1] = audioInputData->data[i] / peak;
}
}
distribute(renderData);
audioInputData->busy_update.unlock();
}
}

View File

@ -36,7 +36,11 @@ void initGLExtensions() {
std::cout << std::endl << "Supported GL Extensions: " << std::endl << extensions << std::endl << std::endl;
#ifdef __linux__
const GLint interval = 2;
#else
const GLint interval = 1;
#endif
#ifdef _WIN32
if (GLExtSupported("WGL_EXT_swap_control")) {