mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-07-01 09:15:17 -04:00
Merge pull request #67 from cjcliffe/frequency_controls
Frequency controls
This commit is contained in:
commit
d4f613830e
@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8)
|
|||||||
|
|
||||||
SET(CUBICSDR_VERSION_MAJOR "0")
|
SET(CUBICSDR_VERSION_MAJOR "0")
|
||||||
SET(CUBICSDR_VERSION_MINOR "1")
|
SET(CUBICSDR_VERSION_MINOR "1")
|
||||||
SET(CUBICSDR_VERSION_PATCH "1")
|
SET(CUBICSDR_VERSION_PATCH "2")
|
||||||
SET(CUBICSDR_VERSION_REL "beta")
|
SET(CUBICSDR_VERSION_REL "beta")
|
||||||
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")
|
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ EVT_IDLE(AppFrame::OnIdle)
|
|||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
AppFrame::AppFrame() :
|
AppFrame::AppFrame() :
|
||||||
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
SetIcon(wxICON(cubicsdr));
|
SetIcon(wxICON(cubicsdr));
|
||||||
@ -50,13 +50,7 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
wxBoxSizer *demodTray = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *demodTray = new wxBoxSizer(wxHORIZONTAL);
|
||||||
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
int attribList[] = {
|
int attribList[] = { WX_GL_RGBA, WX_GL_STENCIL_SIZE, 8, WX_GL_BUFFER_SIZE, 24, WX_GL_DOUBLEBUFFER, 0 };
|
||||||
WX_GL_RGBA,
|
|
||||||
WX_GL_STENCIL_SIZE, 8,
|
|
||||||
WX_GL_BUFFER_SIZE, 24,
|
|
||||||
WX_GL_DOUBLEBUFFER,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
demodModeSelector = new ModeSelectorCanvas(this, attribList);
|
demodModeSelector = new ModeSelectorCanvas(this, attribList);
|
||||||
demodModeSelector->addChoice(DEMOD_TYPE_FM, "FM");
|
demodModeSelector->addChoice(DEMOD_TYPE_FM, "FM");
|
||||||
@ -164,7 +158,6 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
||||||
wxMenuItem *itm = menu->AppendRadioItem(wxID_RT_AUDIO_DEVICE + mdevices_i->first, mdevices_i->second.name, wxT("Description?"));
|
wxMenuItem *itm = menu->AppendRadioItem(wxID_RT_AUDIO_DEVICE + mdevices_i->first, mdevices_i->second.name, wxT("Description?"));
|
||||||
itm->SetId(wxID_RT_AUDIO_DEVICE + mdevices_i->first);
|
itm->SetId(wxID_RT_AUDIO_DEVICE + mdevices_i->first);
|
||||||
@ -232,31 +225,30 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
menuBar->Append(menu, wxT("Input &Device"));
|
menuBar->Append(menu, wxT("Input &Device"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
menu = new wxMenu;
|
menu = new wxMenu;
|
||||||
|
|
||||||
|
#define NUM_RATES_DEFAULT 4
|
||||||
#define NUM_RATES_DEFAULT 4
|
|
||||||
int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
|
int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
|
||||||
|
|
||||||
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
||||||
int desired_rate = 0;
|
int desired_rate = 0;
|
||||||
int desired_rank = NUM_RATES_DEFAULT+1;
|
int desired_rank = NUM_RATES_DEFAULT + 1;
|
||||||
|
|
||||||
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end(); srate++) {
|
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
|
||||||
for (i = 0; i < NUM_RATES_DEFAULT; i++) {
|
srate++) {
|
||||||
if (desired_rates[i] == (*srate)) {
|
for (i = 0; i < NUM_RATES_DEFAULT; i++) {
|
||||||
if (desired_rank > i) {
|
if (desired_rates[i] == (*srate)) {
|
||||||
desired_rank = i;
|
if (desired_rank > i) {
|
||||||
desired_rate = (*srate);
|
desired_rank = i;
|
||||||
}
|
desired_rate = (*srate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desired_rank > NUM_RATES_DEFAULT) {
|
if (desired_rank > NUM_RATES_DEFAULT) {
|
||||||
desired_rate = mdevices_i->second.sampleRates.back();
|
desired_rate = mdevices_i->second.sampleRates.back();
|
||||||
}
|
}
|
||||||
AudioThread::deviceSampleRate[mdevices_i->first] = desired_rate;
|
AudioThread::deviceSampleRate[mdevices_i->first] = desired_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,18 +256,19 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
new wxMenu;
|
new wxMenu;
|
||||||
int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
|
int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
|
||||||
wxMenu *subMenu = new wxMenu;
|
wxMenu *subMenu = new wxMenu;
|
||||||
menu->AppendSubMenu(subMenu,mdevices_i->second.name, wxT("Description?"));
|
menu->AppendSubMenu(subMenu, mdevices_i->second.name, wxT("Description?"));
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end(); srate++) {
|
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
|
||||||
|
srate++) {
|
||||||
std::stringstream srateName;
|
std::stringstream srateName;
|
||||||
srateName << ((float)(*srate)/1000.0f) << "kHz";
|
srateName << ((float) (*srate) / 1000.0f) << "kHz";
|
||||||
wxMenuItem *itm = subMenu->AppendRadioItem(menu_id+j, srateName.str(), wxT("Description?"));
|
wxMenuItem *itm = subMenu->AppendRadioItem(menu_id + j, srateName.str(), wxT("Description?"));
|
||||||
|
|
||||||
if ((*srate) == AudioThread::deviceSampleRate[mdevices_i->first]) {
|
if ((*srate) == AudioThread::deviceSampleRate[mdevices_i->first]) {
|
||||||
itm->Check(true);
|
itm->Check(true);
|
||||||
}
|
}
|
||||||
audioSampleRateMenuItems[menu_id+j] = itm;
|
audioSampleRateMenuItems[menu_id + j] = itm;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
@ -283,7 +276,6 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
|
|
||||||
menuBar->Append(menu, wxT("Audio &Bandwidth"));
|
menuBar->Append(menu, wxT("Audio &Bandwidth"));
|
||||||
|
|
||||||
|
|
||||||
SetMenuBar(menuBar);
|
SetMenuBar(menuBar);
|
||||||
|
|
||||||
CreateStatusBar();
|
CreateStatusBar();
|
||||||
@ -291,7 +283,6 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
|||||||
Centre();
|
Centre();
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
SetIcon(wxICON(frame_icon));
|
SetIcon(wxICON(frame_icon));
|
||||||
#endif
|
#endif
|
||||||
@ -398,7 +389,6 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||||||
wxGetApp().setDevice(event.GetId() - wxID_DEVICE_ID);
|
wxGetApp().setDevice(event.GetId() - wxID_DEVICE_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (event.GetId() >= wxID_AUDIO_BANDWIDTH_BASE) {
|
if (event.GetId() >= wxID_AUDIO_BANDWIDTH_BASE) {
|
||||||
int evId = event.GetId();
|
int evId = event.GetId();
|
||||||
std::vector<RtAudio::DeviceInfo>::iterator devices_i;
|
std::vector<RtAudio::DeviceInfo>::iterator devices_i;
|
||||||
@ -406,21 +396,22 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
||||||
int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
|
int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end(); srate++) {
|
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
|
||||||
|
srate++) {
|
||||||
|
|
||||||
if (evId == menu_id + j) {
|
if (evId == menu_id + j) {
|
||||||
//audioSampleRateMenuItems[menu_id+j];
|
//audioSampleRateMenuItems[menu_id+j];
|
||||||
//std::cout << "Would set audio sample rate on device " << mdevices_i->second.name << " (" << mdevices_i->first << ") to " << (*srate) << "Hz" << std::endl;
|
//std::cout << "Would set audio sample rate on device " << mdevices_i->second.name << " (" << mdevices_i->first << ") to " << (*srate) << "Hz" << std::endl;
|
||||||
AudioThread::setDeviceSampleRate(mdevices_i->first, *srate);
|
AudioThread::setDeviceSampleRate(mdevices_i->first, *srate);
|
||||||
}
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -463,12 +454,12 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
|
|||||||
|
|
||||||
if (demod->getDemodulatorType() == DEMOD_TYPE_USB) {
|
if (demod->getDemodulatorType() == DEMOD_TYPE_USB) {
|
||||||
demodBw /= 2;
|
demodBw /= 2;
|
||||||
centerFreq += demod->getBandwidth()/4;
|
centerFreq += demod->getBandwidth() / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (demod->getDemodulatorType() == DEMOD_TYPE_LSB) {
|
if (demod->getDemodulatorType() == DEMOD_TYPE_LSB) {
|
||||||
demodBw /= 2;
|
demodBw /= 2;
|
||||||
centerFreq -= demod->getBandwidth()/4;
|
centerFreq -= demod->getBandwidth() / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (demodBw > wxGetApp().getSampleRate() / 2) {
|
if (demodBw > wxGetApp().getSampleRate() / 2) {
|
||||||
@ -520,6 +511,10 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
|
|||||||
demodWaterfallCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
demodWaterfallCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
demodSpectrumCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
demodSpectrumCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
}
|
}
|
||||||
|
if (spectrumCanvas->getViewState() && abs(wxGetApp().getFrequency()-spectrumCanvas->getCenterFrequency()) > (wxGetApp().getSampleRate()/2)) {
|
||||||
|
spectrumCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
|
waterfallCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!waterfallCanvas->HasFocus()) {
|
if (!waterfallCanvas->HasFocus()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define CUBICSDR_TITLE "CubicSDR " CUBICSDR_VERSION " by Charles J. Cliffe (@ccliffe)"
|
#define CUBICSDR_TITLE "CubicSDR v" CUBICSDR_VERSION " by Charles J. Cliffe (@ccliffe) :: www.cubicsdr.com"
|
||||||
|
|
||||||
#ifndef __BYTE_ORDER
|
#ifndef __BYTE_ORDER
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -236,9 +236,9 @@ int DemodulatorInstance::getOutputDevice() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DemodulatorInstance::checkBandwidth() {
|
void DemodulatorInstance::checkBandwidth() {
|
||||||
if ((currentDemodType == DEMOD_TYPE_USB || currentDemodType == DEMOD_TYPE_LSB) && (getBandwidth() % 2)) {
|
// if ((currentDemodType == DEMOD_TYPE_USB || currentDemodType == DEMOD_TYPE_LSB) && (getBandwidth() % 2)) {
|
||||||
setBandwidth(getBandwidth()+1);
|
// setBandwidth(getBandwidth()+1);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemodulatorInstance::setDemodulatorType(int demod_type_in) {
|
void DemodulatorInstance::setDemodulatorType(int demod_type_in) {
|
||||||
@ -335,3 +335,11 @@ void DemodulatorInstance::setGain(float gain_in) {
|
|||||||
float DemodulatorInstance::getGain() {
|
float DemodulatorInstance::getGain() {
|
||||||
return audioThread->getGain();
|
return audioThread->getGain();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DemodulatorInstance::isFollow() {
|
||||||
|
return follow;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DemodulatorInstance::setFollow(bool follow) {
|
||||||
|
this->follow = follow;
|
||||||
|
}
|
||||||
|
@ -77,6 +77,8 @@ public:
|
|||||||
void setAudioSampleRate(int sampleRate);
|
void setAudioSampleRate(int sampleRate);
|
||||||
int getAudioSampleRate();
|
int getAudioSampleRate();
|
||||||
|
|
||||||
|
bool isFollow();
|
||||||
|
void setFollow(bool follow);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -96,4 +98,5 @@ private:
|
|||||||
int currentDemodType;
|
int currentDemodType;
|
||||||
int currentOutputDevice;
|
int currentOutputDevice;
|
||||||
int currentAudioSampleRate;
|
int currentAudioSampleRate;
|
||||||
|
bool follow;
|
||||||
};
|
};
|
||||||
|
@ -151,12 +151,10 @@ void DemodulatorPreThread::threadMain() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Requested frequency is not center, shift it into the center!
|
// Requested frequency is not center, shift it into the center!
|
||||||
if (inp->frequency != params.frequency) {
|
if ((params.frequency - inp->frequency) != shiftFrequency || rateChanged) {
|
||||||
if ((params.frequency - inp->frequency) != shiftFrequency || rateChanged) {
|
shiftFrequency = params.frequency - inp->frequency;
|
||||||
shiftFrequency = params.frequency - inp->frequency;
|
if (abs(shiftFrequency) <= (int) ((double) (wxGetApp().getSampleRate() / 2) * 1.5)) {
|
||||||
if (abs(shiftFrequency) <= (int) ((double) (wxGetApp().getSampleRate() / 2) * 1.5)) {
|
nco_crcf_set_frequency(freqShifter, (2.0 * M_PI) * (((double) abs(shiftFrequency)) / ((double) wxGetApp().getSampleRate())));
|
||||||
nco_crcf_set_frequency(freqShifter, (2.0 * M_PI) * (((double) abs(shiftFrequency)) / ((double) wxGetApp().getSampleRate())));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,15 +185,18 @@ void SDRPostThread::threadMain() {
|
|||||||
DemodulatorInstance *demod = *i;
|
DemodulatorInstance *demod = *i;
|
||||||
DemodulatorThreadInputQueue *demodQueue = demod->threadQueueDemod;
|
DemodulatorThreadInputQueue *demodQueue = demod->threadQueueDemod;
|
||||||
|
|
||||||
if (demod->getFrequency() != data_in->frequency
|
if (abs(data_in->frequency - demod->getFrequency()) > (wxGetApp().getSampleRate() / 2)) {
|
||||||
&& abs(data_in->frequency - demod->getFrequency()) > (wxGetApp().getSampleRate() / 2)) {
|
if (demod->isActive() && !demod->isFollow()) {
|
||||||
if (demod->isActive()) {
|
|
||||||
demod->setActive(false);
|
demod->setActive(false);
|
||||||
DemodulatorThreadIQData *dummyDataOut = new DemodulatorThreadIQData;
|
DemodulatorThreadIQData *dummyDataOut = new DemodulatorThreadIQData;
|
||||||
dummyDataOut->frequency = data_in->frequency;
|
dummyDataOut->frequency = data_in->frequency;
|
||||||
dummyDataOut->sampleRate = data_in->sampleRate;
|
dummyDataOut->sampleRate = data_in->sampleRate;
|
||||||
demodQueue->push(dummyDataOut);
|
demodQueue->push(dummyDataOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (demod->isFollow() && wxGetApp().getFrequency() != demod->getFrequency()) {
|
||||||
|
wxGetApp().setFrequency(demod->getFrequency());
|
||||||
|
}
|
||||||
} else if (!demod->isActive()) {
|
} else if (!demod->isActive()) {
|
||||||
demod->setActive(true);
|
demod->setActive(true);
|
||||||
if (wxGetApp().getDemodMgr().getLastActiveDemodulator() == NULL) {
|
if (wxGetApp().getDemodMgr().getLastActiveDemodulator() == NULL) {
|
||||||
@ -204,6 +207,9 @@ void SDRPostThread::threadMain() {
|
|||||||
if (!demod->isActive()) {
|
if (!demod->isActive()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (demod->isFollow()) {
|
||||||
|
demod->setFollow(false);
|
||||||
|
}
|
||||||
|
|
||||||
demodQueue->push(demodDataOut);
|
demodQueue->push(demodDataOut);
|
||||||
pushedData = true;
|
pushedData = true;
|
||||||
|
@ -48,7 +48,10 @@ DefaultColorTheme::DefaultColorTheme() {
|
|||||||
fftLine = RGBColor(0.9, 0.9, 0.9);
|
fftLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
fftHighlight = RGBColor(1, 1, 1);
|
fftHighlight = RGBColor(1, 1, 1);
|
||||||
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
tuningBar = RGBColor(0.2, 0.2, 0.9);
|
tuningBarLight = RGBColor(0.2, 0.2, 0.9);
|
||||||
|
tuningBarDark = RGBColor(0.0, 0.0, 0.35);
|
||||||
|
tuningBarUp = RGBColor(1.0, 139.0/255.0, 96.0/255.0);
|
||||||
|
tuningBarDown = RGBColor(148.0/255.0, 148.0/255.0, 1.0);
|
||||||
meterLevel = RGBColor(0.1, 0.75, 0.1);
|
meterLevel = RGBColor(0.1, 0.75, 0.1);
|
||||||
meterValue = RGBColor(0.75, 0.1, 0.1);
|
meterValue = RGBColor(0.75, 0.1, 0.1);
|
||||||
text = RGBColor(1, 1, 1);
|
text = RGBColor(1, 1, 1);
|
||||||
@ -76,7 +79,10 @@ RadarColorTheme::RadarColorTheme() {
|
|||||||
fftLine = RGBColor(0.8, 1.0, 0.8);
|
fftLine = RGBColor(0.8, 1.0, 0.8);
|
||||||
fftHighlight = RGBColor(1, 1, 1);
|
fftHighlight = RGBColor(1, 1, 1);
|
||||||
scopeLine = RGBColor(0.8, 1.0, 0.8);
|
scopeLine = RGBColor(0.8, 1.0, 0.8);
|
||||||
tuningBar = RGBColor(0.2, 0.9, 0.2);
|
tuningBarLight = RGBColor(0.0, 0.45, 0.0);
|
||||||
|
tuningBarDark = RGBColor(0.0, 0.1, 0.0);
|
||||||
|
tuningBarUp = RGBColor(1.0, 139.0/255.0, 96.0/255.0);
|
||||||
|
tuningBarDown = RGBColor(148.0/255.0, 0.0, 0.0);
|
||||||
meterLevel = RGBColor(0, 0.5, 0);
|
meterLevel = RGBColor(0, 0.5, 0);
|
||||||
meterValue = RGBColor(0, 0.5, 0);
|
meterValue = RGBColor(0, 0.5, 0);
|
||||||
text = RGBColor(0.8, 1.0, 0.8);
|
text = RGBColor(0.8, 1.0, 0.8);
|
||||||
@ -102,7 +108,10 @@ BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
|
|||||||
fftLine = RGBColor(0.9, 0.9, 0.9);
|
fftLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
fftHighlight = RGBColor(1, 1, 0.9);
|
fftHighlight = RGBColor(1, 1, 0.9);
|
||||||
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
tuningBar = RGBColor(0.4, 0.4, 0.4);
|
tuningBarLight = RGBColor(0.4, 0.4, 0.4);
|
||||||
|
tuningBarDark = RGBColor(0.1, 0.1, 0.1);
|
||||||
|
tuningBarUp = RGBColor(0.8, 0.8, 0.8);
|
||||||
|
tuningBarDown = RGBColor(0.4, 0.4, 0.4);
|
||||||
meterLevel = RGBColor(0.5, 0.5, 0.5);
|
meterLevel = RGBColor(0.5, 0.5, 0.5);
|
||||||
meterValue = RGBColor(0.5, 0.5, 0.5);
|
meterValue = RGBColor(0.5, 0.5, 0.5);
|
||||||
text = RGBColor(1, 1, 1);
|
text = RGBColor(1, 1, 1);
|
||||||
@ -137,7 +146,10 @@ SharpColorTheme::SharpColorTheme() {
|
|||||||
fftLine = RGBColor(0.9, 0.9, 1.0);
|
fftLine = RGBColor(0.9, 0.9, 1.0);
|
||||||
fftHighlight = RGBColor(0.9, 0.9, 1.0);
|
fftHighlight = RGBColor(0.9, 0.9, 1.0);
|
||||||
scopeLine = RGBColor(0.85, 0.85, 1.0);
|
scopeLine = RGBColor(0.85, 0.85, 1.0);
|
||||||
tuningBar = RGBColor(0.2, 0.2, 0.9);
|
tuningBarLight = RGBColor(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||||
|
tuningBarDark = RGBColor(14.0 / 255.0, 53.0 / 255.0, 89.5 / 255.0);
|
||||||
|
tuningBarUp = RGBColor(0.7, 0.7, 0.7);
|
||||||
|
tuningBarDown = RGBColor(1.0, 0.0, 0.0);
|
||||||
meterLevel = RGBColor(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
meterLevel = RGBColor(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||||
meterValue = RGBColor(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0);
|
meterValue = RGBColor(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0);
|
||||||
text = RGBColor(0.9, 0.9, 1);
|
text = RGBColor(0.9, 0.9, 1);
|
||||||
@ -165,7 +177,10 @@ RadColorTheme::RadColorTheme() {
|
|||||||
fftLine = RGBColor(1.0, 0.9, 0.9);
|
fftLine = RGBColor(1.0, 0.9, 0.9);
|
||||||
fftHighlight = RGBColor(1, 1, 1);
|
fftHighlight = RGBColor(1, 1, 1);
|
||||||
scopeLine = RGBColor(1.0, 0.9, 0.9);
|
scopeLine = RGBColor(1.0, 0.9, 0.9);
|
||||||
tuningBar = RGBColor(0.2, 0.2, 0.9);
|
tuningBarLight = RGBColor(0.0, 0.45, 0.0);
|
||||||
|
tuningBarDark = RGBColor(0.0, 0.1, 0.0);
|
||||||
|
tuningBarUp = RGBColor(1.0, 0.0, 0.0);
|
||||||
|
tuningBarDown = RGBColor(0.0, 0.5, 1.0);
|
||||||
meterLevel = RGBColor(0, 0.5, 0);
|
meterLevel = RGBColor(0, 0.5, 0);
|
||||||
meterValue = RGBColor(0.5, 0, 0);
|
meterValue = RGBColor(0.5, 0, 0);
|
||||||
text = RGBColor(1, 1, 1);
|
text = RGBColor(1, 1, 1);
|
||||||
@ -196,7 +211,10 @@ TouchColorTheme::TouchColorTheme() {
|
|||||||
fftLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
fftLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||||
fftHighlight = RGBColor(1.0, 1.0, 1.0);
|
fftHighlight = RGBColor(1.0, 1.0, 1.0);
|
||||||
scopeLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
scopeLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||||
tuningBar = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
tuningBarLight = RGBColor(0.2, 0.2, 0.7);
|
||||||
|
tuningBarDark = RGBColor(0.1, 0.1, 0.45);
|
||||||
|
tuningBarUp = RGBColor(0.5, 139.0/255.0, 96.0/255.0);
|
||||||
|
tuningBarDown = RGBColor(0.6, 108.0/255.0, 1.0);
|
||||||
meterLevel = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
meterLevel = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||||
meterValue = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
meterValue = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||||
text = RGBColor(1, 1, 1);
|
text = RGBColor(1, 1, 1);
|
||||||
@ -228,7 +246,10 @@ HDColorTheme::HDColorTheme() {
|
|||||||
fftLine = RGBColor(0.9, 0.9, 0.9);
|
fftLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
fftHighlight = RGBColor(1, 1, 1);
|
fftHighlight = RGBColor(1, 1, 1);
|
||||||
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
scopeLine = RGBColor(0.9, 0.9, 0.9);
|
||||||
tuningBar = RGBColor(0, 0.7, 0.7);
|
tuningBarLight = RGBColor(0.4, 0.4, 1.0);
|
||||||
|
tuningBarDark = RGBColor(0.1, 0.1, 0.45);
|
||||||
|
tuningBarUp = RGBColor(1.0, 139.0/255.0, 96.0/255.0);
|
||||||
|
tuningBarDown = RGBColor(148.0/255.0, 148.0/255.0, 1.0);
|
||||||
meterLevel = RGBColor(0, 0.5, 0);
|
meterLevel = RGBColor(0, 0.5, 0);
|
||||||
meterValue = RGBColor(0.0, 0.0, 1.0);
|
meterValue = RGBColor(0.0, 0.0, 1.0);
|
||||||
text = RGBColor(1, 1, 1);
|
text = RGBColor(1, 1, 1);
|
||||||
|
@ -47,7 +47,10 @@ public:
|
|||||||
RGBColor fftLine;
|
RGBColor fftLine;
|
||||||
RGBColor fftHighlight;
|
RGBColor fftHighlight;
|
||||||
RGBColor scopeLine;
|
RGBColor scopeLine;
|
||||||
RGBColor tuningBar;
|
RGBColor tuningBarLight;
|
||||||
|
RGBColor tuningBarDark;
|
||||||
|
RGBColor tuningBarUp;
|
||||||
|
RGBColor tuningBarDown;
|
||||||
RGBColor meterLevel;
|
RGBColor meterLevel;
|
||||||
RGBColor meterValue;
|
RGBColor meterValue;
|
||||||
RGBColor text;
|
RGBColor text;
|
||||||
|
@ -41,6 +41,10 @@ void InteractiveCanvas::disableView() {
|
|||||||
lastBandwidth = 0;
|
lastBandwidth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InteractiveCanvas::getViewState() {
|
||||||
|
return isView;
|
||||||
|
}
|
||||||
|
|
||||||
long long InteractiveCanvas::getFrequencyAt(float x) {
|
long long InteractiveCanvas::getFrequencyAt(float x) {
|
||||||
long long iqCenterFreq = getCenterFrequency();
|
long long iqCenterFreq = getCenterFrequency();
|
||||||
long long iqBandwidth = getBandwidth();
|
long long iqBandwidth = getBandwidth();
|
||||||
@ -73,6 +77,10 @@ unsigned int InteractiveCanvas::getBandwidth() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseTracker *InteractiveCanvas::getMouseTracker() {
|
||||||
|
return &mouseTracker;
|
||||||
|
}
|
||||||
|
|
||||||
void InteractiveCanvas::OnKeyUp(wxKeyEvent& event) {
|
void InteractiveCanvas::OnKeyUp(wxKeyEvent& event) {
|
||||||
shiftDown = event.ShiftDown();
|
shiftDown = event.ShiftDown();
|
||||||
altDown = event.AltDown();
|
altDown = event.AltDown();
|
||||||
|
@ -15,6 +15,7 @@ public:
|
|||||||
|
|
||||||
void setView(long long center_freq_in, int bandwidth_in);
|
void setView(long long center_freq_in, int bandwidth_in);
|
||||||
void disableView();
|
void disableView();
|
||||||
|
bool getViewState();
|
||||||
|
|
||||||
void setCenterFrequency(long long center_freq_in);
|
void setCenterFrequency(long long center_freq_in);
|
||||||
long long getCenterFrequency();
|
long long getCenterFrequency();
|
||||||
@ -22,6 +23,8 @@ public:
|
|||||||
void setBandwidth(unsigned int bandwidth_in);
|
void setBandwidth(unsigned int bandwidth_in);
|
||||||
unsigned int getBandwidth();
|
unsigned int getBandwidth();
|
||||||
|
|
||||||
|
MouseTracker *getMouseTracker();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnKeyDown(wxKeyEvent& event);
|
void OnKeyDown(wxKeyEvent& event);
|
||||||
void OnKeyUp(wxKeyEvent& event);
|
void OnKeyUp(wxKeyEvent& event);
|
||||||
|
@ -73,6 +73,19 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
|
|||||||
}
|
}
|
||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
|
|
||||||
|
|
||||||
|
GLint vp[4];
|
||||||
|
glGetIntegerv(GL_VIEWPORT, vp);
|
||||||
|
float viewHeight = (float) vp[3];
|
||||||
|
float hPos = (float) (13) / viewHeight;
|
||||||
|
|
||||||
|
glColor3f(0.65, 0.65, 0.65);
|
||||||
|
|
||||||
|
getFont(PrimaryGLContext::GLFONT_SIZE12).drawString("Frequency", -0.66, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
getFont(PrimaryGLContext::GLFONT_SIZE12).drawString("Bandwidth", 0.0, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
getFont(PrimaryGLContext::GLFONT_SIZE12).drawString("Center Frequency", 0.66, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
|
||||||
|
|
||||||
if (stereo) {
|
if (stereo) {
|
||||||
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
|
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
|
||||||
glBegin (GL_LINES);
|
glBegin (GL_LINES);
|
||||||
|
@ -25,9 +25,24 @@ EVT_ENTER_WINDOW(TuningCanvas::OnMouseEnterWindow)
|
|||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
TuningCanvas::TuningCanvas(wxWindow *parent, int *attribList) :
|
TuningCanvas::TuningCanvas(wxWindow *parent, int *attribList) :
|
||||||
InteractiveCanvas(parent, attribList), dragAccum(0) {
|
InteractiveCanvas(parent, attribList), dragAccum(0), top(false), bottom(false), uxDown(0) {
|
||||||
|
|
||||||
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
||||||
|
|
||||||
|
hoverIndex = 0;
|
||||||
|
downIndex = 0;
|
||||||
|
hoverState = TUNING_HOVER_NONE;
|
||||||
|
downState = TUNING_HOVER_NONE;
|
||||||
|
dragging = false;
|
||||||
|
|
||||||
|
freqDP = -1.0;
|
||||||
|
freqW = (1.0 / 3.0) * 2.0;
|
||||||
|
|
||||||
|
bwDP = -1.0 + (2.25 / 3.0);
|
||||||
|
bwW = (1.0 / 4.0) * 2.0;
|
||||||
|
|
||||||
|
centerDP = -1.0 + (2.0 / 3.0) * 2.0;
|
||||||
|
centerW = (1.0 / 3.0) * 2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TuningCanvas::~TuningCanvas() {
|
TuningCanvas::~TuningCanvas() {
|
||||||
@ -49,59 +64,139 @@ void TuningCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
|
|
||||||
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
|
||||||
|
long long freq = 0;
|
||||||
if (activeDemod != NULL) {
|
if (activeDemod != NULL) {
|
||||||
glContext->DrawDemodFreqBw(activeDemod->getFrequency(), activeDemod->getBandwidth(), wxGetApp().getFrequency());
|
freq = activeDemod->getFrequency();
|
||||||
} else {
|
|
||||||
glContext->DrawDemodFreqBw(0, wxGetApp().getDemodMgr().getLastBandwidth(), wxGetApp().getFrequency());
|
|
||||||
}
|
}
|
||||||
|
long long bw = wxGetApp().getDemodMgr().getLastBandwidth();
|
||||||
|
long long center = wxGetApp().getFrequency();
|
||||||
|
|
||||||
if (mouseTracker.mouseDown()) {
|
if (mouseTracker.mouseDown()) {
|
||||||
glContext->Draw(ThemeMgr::mgr.currentTheme->tuningBar.r, ThemeMgr::mgr.currentTheme->tuningBar.g, ThemeMgr::mgr.currentTheme->tuningBar.b,
|
glContext->Draw(ThemeMgr::mgr.currentTheme->tuningBarDark.r, ThemeMgr::mgr.currentTheme->tuningBarDark.g, ThemeMgr::mgr.currentTheme->tuningBarDark.b,
|
||||||
0.6, mouseTracker.getOriginMouseX(), mouseTracker.getMouseX());
|
0.75, mouseTracker.getOriginMouseX(), mouseTracker.getMouseX());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RGBColor clr = top ? ThemeMgr::mgr.currentTheme->tuningBarUp : ThemeMgr::mgr.currentTheme->tuningBarDown;
|
||||||
|
|
||||||
|
RGBColor clrDark = ThemeMgr::mgr.currentTheme->tuningBarDark;
|
||||||
|
RGBColor clrMid = ThemeMgr::mgr.currentTheme->tuningBarLight;
|
||||||
|
|
||||||
|
glContext->DrawTunerBarIndexed(1, 3, 11, freqDP, freqW, clrMid, 0.25, true, true); // freq
|
||||||
|
glContext->DrawTunerBarIndexed(4, 6, 11, freqDP, freqW, clrDark, 0.25, true, true);
|
||||||
|
glContext->DrawTunerBarIndexed(7, 9, 11, freqDP, freqW, clrMid, 0.25, true, true);
|
||||||
|
glContext->DrawTunerBarIndexed(10, 11, 11, freqDP, freqW, clrDark, 0.25, true, true);
|
||||||
|
|
||||||
|
glContext->DrawTunerBarIndexed(1, 3, 7, bwDP, bwW, clrMid, 0.25, true, true); // bw
|
||||||
|
glContext->DrawTunerBarIndexed(4, 6, 7, bwDP, bwW, clrDark, 0.25, true, true);
|
||||||
|
glContext->DrawTunerBarIndexed(7, 7, 7, bwDP, bwW, clrMid, 0.25, true, true);
|
||||||
|
|
||||||
|
glContext->DrawTunerBarIndexed(1, 3, 11, centerDP, centerW, clrMid, 0.25, true, true); // freq
|
||||||
|
glContext->DrawTunerBarIndexed(4, 6, 11, centerDP, centerW, clrDark, 0.25, true, true);
|
||||||
|
glContext->DrawTunerBarIndexed(7, 9, 11, centerDP, centerW, clrMid, 0.25, true, true);
|
||||||
|
glContext->DrawTunerBarIndexed(10, 11, 11, centerDP, centerW, clrDark, 0.25, true, true);
|
||||||
|
|
||||||
|
if (hoverIndex > 0 && !mouseTracker.mouseDown()) {
|
||||||
|
switch (hoverState) {
|
||||||
|
|
||||||
|
case TUNING_HOVER_FREQ:
|
||||||
|
glContext->DrawTunerBarIndexed(hoverIndex, hoverIndex, 11, freqDP, freqW, clr, 0.25, top, bottom); // freq
|
||||||
|
break;
|
||||||
|
case TUNING_HOVER_BW:
|
||||||
|
glContext->DrawTunerBarIndexed(hoverIndex, hoverIndex, 7, bwDP, bwW, clr, 0.25, top, bottom); // bw
|
||||||
|
break;
|
||||||
|
case TUNING_HOVER_CENTER:
|
||||||
|
glContext->DrawTunerBarIndexed(hoverIndex, hoverIndex, 11, centerDP, centerW, clr, 0.25, top, bottom); // center
|
||||||
|
break;
|
||||||
|
case TUNING_HOVER_NONE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
glContext->DrawTuner(freq, 11, freqDP, freqW);
|
||||||
|
glContext->DrawTuner(bw, 7, bwDP, bwW);
|
||||||
|
glContext->DrawTuner(center, 11, centerDP, centerW);
|
||||||
|
|
||||||
glContext->DrawEnd();
|
glContext->DrawEnd();
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnIdle(wxIdleEvent &event) {
|
void TuningCanvas::StepTuner(ActiveState state, int exponent, bool up) {
|
||||||
if (mouseTracker.mouseDown()) {
|
double exp = pow(10, exponent);
|
||||||
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
long long amount = up?exp:-exp;
|
||||||
|
|
||||||
float dragDelta = mouseTracker.getMouseX() - mouseTracker.getOriginMouseX();
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
if (state == TUNING_HOVER_FREQ && activeDemod) {
|
||||||
|
long long freq = activeDemod->getFrequency();
|
||||||
|
long long diff = abs(wxGetApp().getFrequency() - freq);
|
||||||
|
|
||||||
dragAccum += dragDelta;
|
if (shiftDown) {
|
||||||
|
bool carried = (long long)((freq) / (exp * 10)) != (long long)((freq + amount) / (exp * 10)) || (bottom && freq < exp);
|
||||||
float moveVal = dragAccum * 10.0;
|
freq += carried?(9*-amount):amount;
|
||||||
|
} else {
|
||||||
if (uxDown > 0.275) {
|
freq += amount;
|
||||||
wxGetApp().setFrequency(
|
|
||||||
wxGetApp().getFrequency()
|
|
||||||
+ (int) (dragAccum * fabs(dragAccum * 10.0) * fabs(dragAccum * 10.0) * (float) wxGetApp().getSampleRate()));
|
|
||||||
} else if (fabs(moveVal) >= 1.0) {
|
|
||||||
if (uxDown < -0.275) {
|
|
||||||
if (activeDemod != NULL) {
|
|
||||||
long long freq = activeDemod->getFrequency() + (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal));
|
|
||||||
activeDemod->setFrequency(freq);
|
|
||||||
activeDemod->updateLabel(freq);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int amt = (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal));
|
|
||||||
if (activeDemod != NULL) {
|
|
||||||
activeDemod->setBandwidth(activeDemod->getBandwidth() + amt);
|
|
||||||
} else {
|
|
||||||
wxGetApp().getDemodMgr().setLastBandwidth(wxGetApp().getDemodMgr().getLastBandwidth() + amt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (fabs(dragAccum * 10.0) >= 1.0) {
|
if (wxGetApp().getSampleRate() / 2 < diff) {
|
||||||
if (dragAccum > 0) {
|
wxGetApp().setFrequency(freq);
|
||||||
dragAccum -= 1.0 / 10.0;
|
}
|
||||||
} else {
|
|
||||||
dragAccum += 1.0 / 10.0;
|
activeDemod->setFrequency(freq);
|
||||||
|
activeDemod->updateLabel(freq);
|
||||||
|
activeDemod->setFollow(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == TUNING_HOVER_BW) {
|
||||||
|
long bw = wxGetApp().getDemodMgr().getLastBandwidth();
|
||||||
|
|
||||||
|
if (shiftDown) {
|
||||||
|
bool carried = (long)((bw) / (exp * 10)) != (long)((bw + amount) / (exp * 10)) || (bottom && bw < exp);
|
||||||
|
bw += carried?(9*-amount):amount;
|
||||||
|
} else {
|
||||||
|
bw += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bw > wxGetApp().getSampleRate()) {
|
||||||
|
bw = wxGetApp().getSampleRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGetApp().getDemodMgr().setLastBandwidth(bw);
|
||||||
|
|
||||||
|
if (activeDemod) {
|
||||||
|
activeDemod->setBandwidth(wxGetApp().getDemodMgr().getLastBandwidth());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == TUNING_HOVER_CENTER) {
|
||||||
|
long long ctr = wxGetApp().getFrequency();
|
||||||
|
if (shiftDown) {
|
||||||
|
bool carried = (long long)((ctr) / (exp * 10)) != (long long)((ctr + amount) / (exp * 10)) || (bottom && ctr < exp);
|
||||||
|
ctr += carried?(9*-amount):amount;
|
||||||
|
} else {
|
||||||
|
ctr += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGetApp().setFrequency(ctr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TuningCanvas::OnIdle(wxIdleEvent &event) {
|
||||||
|
if (mouseTracker.mouseDown()) {
|
||||||
|
if (downState != TUNING_HOVER_NONE) {
|
||||||
|
dragAccum += 5.0*mouseTracker.getOriginDeltaMouseX();
|
||||||
|
while (dragAccum > 1.0) {
|
||||||
|
StepTuner(downState, downIndex-1, true);
|
||||||
|
dragAccum -= 1.0;
|
||||||
|
dragging = true;
|
||||||
}
|
}
|
||||||
|
while (dragAccum < -1.0) {
|
||||||
|
StepTuner(downState, downIndex-1, false);
|
||||||
|
dragAccum += 1.0;
|
||||||
|
dragging = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dragAccum = 0;
|
||||||
|
dragging = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,16 +205,63 @@ void TuningCanvas::OnIdle(wxIdleEvent &event) {
|
|||||||
|
|
||||||
void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||||
InteractiveCanvas::OnMouseMoved(event);
|
InteractiveCanvas::OnMouseMoved(event);
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
top = mouseTracker.getMouseY() >= 0.5;
|
||||||
|
bottom = mouseTracker.getMouseY() <= 0.5;
|
||||||
|
|
||||||
|
index = glContext->GetTunerDigitIndex(mouseTracker.getMouseX(), 11, freqDP, freqW); // freq
|
||||||
|
if (index > 0) {
|
||||||
|
hoverIndex = index;
|
||||||
|
hoverState = TUNING_HOVER_FREQ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!index) {
|
||||||
|
index = glContext->GetTunerDigitIndex(mouseTracker.getMouseX(), 7, bwDP, bwW); // bw
|
||||||
|
if (index > 0) {
|
||||||
|
hoverIndex = index;
|
||||||
|
hoverState = TUNING_HOVER_BW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!index) {
|
||||||
|
index = glContext->GetTunerDigitIndex(mouseTracker.getMouseX(), 11, centerDP, centerW); // center
|
||||||
|
if (index > 0) {
|
||||||
|
hoverIndex = index;
|
||||||
|
hoverState = TUNING_HOVER_CENTER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!index) {
|
||||||
|
hoverIndex = 0;
|
||||||
|
hoverState = TUNING_HOVER_NONE;
|
||||||
|
} else {
|
||||||
|
switch (hoverState) {
|
||||||
|
case TUNING_HOVER_FREQ:
|
||||||
|
setStatusText("Click or drag a digit to change frequency. Hold shift to disable carry.");
|
||||||
|
break;
|
||||||
|
case TUNING_HOVER_BW:
|
||||||
|
setStatusText("Click or drag a digit to change bandwidth. Hold shift to disable carry.");
|
||||||
|
break;
|
||||||
|
case TUNING_HOVER_CENTER:
|
||||||
|
setStatusText("Click or drag a digit to change center frequency. Hold shift to disable carry.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnMouseDown(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseDown(wxMouseEvent& event) {
|
||||||
InteractiveCanvas::OnMouseDown(event);
|
InteractiveCanvas::OnMouseDown(event);
|
||||||
mouseTracker.setVertDragLock(true);
|
|
||||||
|
|
||||||
uxDown = 2.0 * (mouseTracker.getMouseX() - 0.5);
|
uxDown = 2.0 * (mouseTracker.getMouseX() - 0.5);
|
||||||
|
|
||||||
dragAccum = 0;
|
dragAccum = 0;
|
||||||
SetCursor(wxCURSOR_IBEAM);
|
|
||||||
|
mouseTracker.setVertDragLock(true);
|
||||||
|
downIndex = hoverIndex;
|
||||||
|
downState = hoverState;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||||
@ -127,19 +269,38 @@ void TuningCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnMouseReleased(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||||
|
GLint vp[4];
|
||||||
|
glGetIntegerv( GL_VIEWPORT, vp);
|
||||||
|
|
||||||
|
float viewHeight = (float) vp[3];
|
||||||
|
float viewWidth = (float) vp[2];
|
||||||
|
|
||||||
InteractiveCanvas::OnMouseReleased(event);
|
InteractiveCanvas::OnMouseReleased(event);
|
||||||
|
|
||||||
|
int hExponent = hoverIndex - 1;
|
||||||
|
|
||||||
|
if (hoverState != TUNING_HOVER_NONE && !dragging && (downState == hoverState) && (downIndex == hoverIndex)) {
|
||||||
|
StepTuner(hoverState, hExponent, top);
|
||||||
|
}
|
||||||
|
|
||||||
mouseTracker.setVertDragLock(false);
|
mouseTracker.setVertDragLock(false);
|
||||||
SetCursor(wxCURSOR_SIZEWE);
|
|
||||||
|
dragging = false;
|
||||||
|
SetCursor(wxCURSOR_ARROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||||
InteractiveCanvas::OnMouseLeftWindow(event);
|
InteractiveCanvas::OnMouseLeftWindow(event);
|
||||||
SetCursor(wxCURSOR_CROSS);
|
SetCursor(wxCURSOR_CROSS);
|
||||||
|
hoverIndex = 0;
|
||||||
|
hoverState = TUNING_HOVER_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
void TuningCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||||
InteractiveCanvas::mouseTracker.OnMouseEnterWindow(event);
|
InteractiveCanvas::mouseTracker.OnMouseEnterWindow(event);
|
||||||
SetCursor(wxCURSOR_SIZEWE);
|
SetCursor(wxCURSOR_ARROW);
|
||||||
|
hoverIndex = 0;
|
||||||
|
hoverState = TUNING_HOVER_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningCanvas::setHelpTip(std::string tip) {
|
void TuningCanvas::setHelpTip(std::string tip) {
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
class TuningCanvas: public InteractiveCanvas {
|
class TuningCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
|
enum ActiveState {
|
||||||
|
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_CENTER
|
||||||
|
};
|
||||||
TuningCanvas(wxWindow *parent, int *attribList = NULL);
|
TuningCanvas(wxWindow *parent, int *attribList = NULL);
|
||||||
~TuningCanvas();
|
~TuningCanvas();
|
||||||
|
|
||||||
@ -30,12 +33,31 @@ private:
|
|||||||
void OnMouseReleased(wxMouseEvent& event);
|
void OnMouseReleased(wxMouseEvent& event);
|
||||||
void OnMouseEnterWindow(wxMouseEvent& event);
|
void OnMouseEnterWindow(wxMouseEvent& event);
|
||||||
void OnMouseLeftWindow(wxMouseEvent& event);
|
void OnMouseLeftWindow(wxMouseEvent& event);
|
||||||
|
void StepTuner(ActiveState state, int factor, bool up = true);
|
||||||
|
|
||||||
TuningContext *glContext;
|
TuningContext *glContext;
|
||||||
|
|
||||||
std::string helpTip;
|
std::string helpTip;
|
||||||
float dragAccum;
|
float dragAccum;
|
||||||
float uxDown;
|
float uxDown;
|
||||||
|
ActiveState hoverState;
|
||||||
|
ActiveState downState;
|
||||||
|
int hoverIndex;
|
||||||
|
int downIndex;
|
||||||
|
bool dragging;
|
||||||
|
|
||||||
|
float freqDP;
|
||||||
|
float freqW;
|
||||||
|
|
||||||
|
float bwDP;
|
||||||
|
float bwW;
|
||||||
|
|
||||||
|
float centerDP;
|
||||||
|
float centerW;
|
||||||
|
|
||||||
|
bool top;
|
||||||
|
bool bottom;
|
||||||
|
|
||||||
//
|
//
|
||||||
wxDECLARE_EVENT_TABLE();
|
wxDECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
@ -24,11 +24,12 @@ TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext) :
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
comma_locale = std::locale(std::locale(), new comma_numpunct());
|
comma_locale = std::locale(std::locale(), new comma_numpunct());
|
||||||
freqStr.imbue(comma_locale);
|
freqStrFormatted.imbue(comma_locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningContext::DrawBegin() {
|
void TuningContext::DrawBegin() {
|
||||||
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
|
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g,
|
||||||
|
ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
@ -41,18 +42,18 @@ void TuningContext::Draw(float r, float g, float b, float a, float p1, float p2)
|
|||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_ONE, GL_ONE);
|
glBlendFunc(GL_ONE, GL_ONE);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glColor4f(r*0.5, g*0.5, b*0.5, a);
|
glColor4f(r * 0.5, g * 0.5, b * 0.5, a);
|
||||||
glVertex2f(-1.0+p2*2.0, 1.0);
|
glVertex2f(-1.0 + p2 * 2.0, 1.0);
|
||||||
glVertex2f(-1.0+p1*2.0, 1.0);
|
glVertex2f(-1.0 + p1 * 2.0, 1.0);
|
||||||
glColor4f(r, g, b, a);
|
glColor4f(r, g, b, a);
|
||||||
glVertex2f(-1.0+p1*2.0, 0.0);
|
glVertex2f(-1.0 + p1 * 2.0, 0.0);
|
||||||
glVertex2f(-1.0+p2*2.0, 0.0);
|
glVertex2f(-1.0 + p2 * 2.0, 0.0);
|
||||||
|
|
||||||
glVertex2f(-1.0+p2*2.0, 0.0);
|
glVertex2f(-1.0 + p2 * 2.0, 0.0);
|
||||||
glVertex2f(-1.0+p1*2.0, 0.0);
|
glVertex2f(-1.0 + p1 * 2.0, 0.0);
|
||||||
glColor4f(r*0.5, g*0.5, b*0.5, a);
|
glColor4f(r * 0.5, g * 0.5, b * 0.5, a);
|
||||||
glVertex2f(-1.0+p1*2.0, -1.0);
|
glVertex2f(-1.0 + p1 * 2.0, -1.0);
|
||||||
glVertex2f(-1.0+p2*2.0, -1.0);
|
glVertex2f(-1.0 + p2 * 2.0, -1.0);
|
||||||
glEnd();
|
glEnd();
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
@ -63,6 +64,100 @@ void TuningContext::DrawEnd() {
|
|||||||
CheckGLError();
|
CheckGLError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TuningContext::DrawTuner(long long freq, int count, float displayPos, float displayWidth) {
|
||||||
|
GLint vp[4];
|
||||||
|
glGetIntegerv( GL_VIEWPORT, vp);
|
||||||
|
|
||||||
|
float viewHeight = (float) vp[3];
|
||||||
|
float viewWidth = (float) vp[2];
|
||||||
|
|
||||||
|
freqStr.str("");
|
||||||
|
freqStr << freq;
|
||||||
|
std::string freqChars = freqStr.str();
|
||||||
|
|
||||||
|
PrimaryGLContext::GLFontSize fontSize = GLFONT_SIZE24;
|
||||||
|
int fontHeight = 24;
|
||||||
|
|
||||||
|
if (viewHeight < 28) {
|
||||||
|
fontSize = GLFONT_SIZE18;
|
||||||
|
fontHeight = 18;
|
||||||
|
}
|
||||||
|
if (viewHeight < 24) {
|
||||||
|
fontSize = GLFONT_SIZE16;
|
||||||
|
fontHeight = 16;
|
||||||
|
}
|
||||||
|
if (viewHeight < 18) {
|
||||||
|
fontSize = GLFONT_SIZE12;
|
||||||
|
fontHeight = 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
glColor3f(ThemeMgr::mgr.currentTheme->text.r, ThemeMgr::mgr.currentTheme->text.g, ThemeMgr::mgr.currentTheme->text.b);
|
||||||
|
int numChars = freqChars.length();
|
||||||
|
int ofs = count - numChars;
|
||||||
|
for (int i = ofs; i < count; i++) {
|
||||||
|
float xpos = displayPos + (displayWidth / (float) count) * (float) i + ((displayWidth / 2.0) / (float) count);
|
||||||
|
getFont(fontSize).drawString(freqStr.str().substr(i - ofs, 1), xpos, 0, fontHeight, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
glColor4f(0.65, 0.65, 0.65, 0.25);
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
glBegin(GL_LINES);
|
||||||
|
for (int i = count; i >= 0; i--) {
|
||||||
|
float xpos = displayPos + (displayWidth / (float) count) * (float) i;
|
||||||
|
glVertex2f(xpos, -1.0);
|
||||||
|
glVertex2f(xpos, 1.0);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TuningContext::GetTunerDigitIndex(float mPos, int count, float displayPos, float displayWidth) {
|
||||||
|
mPos -= 0.5;
|
||||||
|
mPos *= 2.0;
|
||||||
|
|
||||||
|
float delta = mPos - displayPos;
|
||||||
|
|
||||||
|
if (delta < 0 || delta > displayWidth) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = floor((delta / displayWidth) * (count));
|
||||||
|
|
||||||
|
return count - index;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TuningContext::DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGBColor color, float alpha, bool top,
|
||||||
|
bool bottom) {
|
||||||
|
float ofs = (displayWidth / (float) count);
|
||||||
|
float p2 = displayPos + ofs * (float) (count - start + 1);
|
||||||
|
float p1 = displayPos + ofs * (float) (count - end);
|
||||||
|
|
||||||
|
float r = color.r, g = color.g, b = color.b, a = 0.6;
|
||||||
|
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
if (top) {
|
||||||
|
glColor4f(r * 0.5, g * 0.5, b * 0.5, a);
|
||||||
|
glVertex2f(p2, 1.0);
|
||||||
|
glVertex2f(p1, 1.0);
|
||||||
|
glColor4f(r, g, b, a);
|
||||||
|
glVertex2f(p1, 0.0);
|
||||||
|
glVertex2f(p2, 0.0);
|
||||||
|
}
|
||||||
|
if (bottom) {
|
||||||
|
glColor4f(r, g, b, a);
|
||||||
|
glVertex2f(p2, 0.0);
|
||||||
|
glVertex2f(p1, 0.0);
|
||||||
|
glColor4f(r * 0.5, g * 0.5, b * 0.5, a);
|
||||||
|
glVertex2f(p1, -1.0);
|
||||||
|
glVertex2f(p2, -1.0);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
void TuningContext::DrawDemodFreqBw(long long freq, unsigned int bw, long long center) {
|
void TuningContext::DrawDemodFreqBw(long long freq, unsigned int bw, long long center) {
|
||||||
GLint vp[4];
|
GLint vp[4];
|
||||||
glGetIntegerv( GL_VIEWPORT, vp);
|
glGetIntegerv( GL_VIEWPORT, vp);
|
||||||
@ -70,54 +165,8 @@ void TuningContext::DrawDemodFreqBw(long long freq, unsigned int bw, long long c
|
|||||||
float viewHeight = (float) vp[3];
|
float viewHeight = (float) vp[3];
|
||||||
float viewWidth = (float) vp[2];
|
float viewWidth = (float) vp[2];
|
||||||
|
|
||||||
PrimaryGLContext::GLFontSize fontSize = GLFONT_SIZE16;
|
DrawTuner(freq, 11, -1.0, (1.0 / 3.0) * 2.0);
|
||||||
|
DrawTuner(bw, 7, -1.0 + (2.25 / 3.0), (1.0 / 4.0) * 2.0);
|
||||||
int fontHeight = 16;
|
DrawTuner(center, 11, -1.0 + (2.0 / 3.0) * 2.0, (1.0 / 3.0) * 2.0);
|
||||||
|
|
||||||
if (viewWidth < 400) {
|
|
||||||
fontSize = GLFONT_SIZE12;
|
|
||||||
fontHeight = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
glColor3f(ThemeMgr::mgr.currentTheme->text.r, ThemeMgr::mgr.currentTheme->text.g, ThemeMgr::mgr.currentTheme->text.b);
|
|
||||||
|
|
||||||
getFont(fontSize).drawString("Freq: ", -0.75, 0, fontHeight, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
if (freq) {
|
|
||||||
freqStr.str("");
|
|
||||||
freqStr << std::fixed << freq << " Hz";
|
|
||||||
} else {
|
|
||||||
freqStr.str("---");
|
|
||||||
}
|
|
||||||
getFont(fontSize).drawString(freqStr.str(), -0.75, 0, fontHeight, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
|
|
||||||
|
|
||||||
getFont(fontSize).drawString("BW: ", -0.10, 0, fontHeight, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
if (bw) {
|
|
||||||
freqStr.str("");
|
|
||||||
freqStr << std::fixed << bw << " Hz";
|
|
||||||
} else {
|
|
||||||
freqStr.str("---");
|
|
||||||
}
|
|
||||||
getFont(fontSize).drawString(freqStr.str(), -0.10, 0, fontHeight, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
|
|
||||||
|
|
||||||
getFont(fontSize).drawString("CTR: ", 0.50, 0, fontHeight, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
if (center) {
|
|
||||||
freqStr.str("");
|
|
||||||
freqStr << std::fixed << center << " Hz";
|
|
||||||
} else {
|
|
||||||
freqStr.str("---");
|
|
||||||
}
|
|
||||||
getFont(fontSize).drawString(freqStr.str(), 0.50, 0, fontHeight, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
|
||||||
|
|
||||||
|
|
||||||
glColor3f(0.65, 0.65, 0.65);
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
glVertex2f(-0.275, -1.0);
|
|
||||||
glVertex2f(-0.275, 1.0);
|
|
||||||
glVertex2f(0.275, -1.0);
|
|
||||||
glVertex2f(0.275, 1.0);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,10 +13,15 @@ public:
|
|||||||
|
|
||||||
void DrawBegin();
|
void DrawBegin();
|
||||||
void Draw(float r, float g, float b, float a, float p1, float p2);
|
void Draw(float r, float g, float b, float a, float p1, float p2);
|
||||||
|
void DrawTuner(long long freq, int count, float displayPos, float displayWidth);
|
||||||
|
int GetTunerDigitIndex(float mPos, int count, float displayPos, float displayWidth);
|
||||||
|
void DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGBColor color, float alpha, bool top, bool bottom);
|
||||||
|
|
||||||
void DrawDemodFreqBw(long long freq, unsigned int bw, long long center);
|
void DrawDemodFreqBw(long long freq, unsigned int bw, long long center);
|
||||||
void DrawEnd();
|
void DrawEnd();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::locale comma_locale;
|
std::locale comma_locale;
|
||||||
std::stringstream freqStr;
|
std::stringstream freqStr;
|
||||||
|
std::stringstream freqStrFormatted;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user