# src/Makefile.linux
# David Rowe 10 Oct 2012
#
-# Makefile for Linux - buils the less common libraries locally and
+# Makefile for Linux - builds the less common libraries locally and
# doesn't install them.
#
# $ make -f Makefile.linux
dlg_audiooptions.o \
dlg_comports.o \
dlg_filter.o \
+dlg_options.o \
varicode.o \
sox_biquad.o \
codec2-dev/src/golay23.c
-HDRS = ../version.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h varicode.h codec2-dev/src/golay23.h
+HDRS = ../version.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_filter.h dlg_options.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h varicode.h codec2-dev/src/golay23.h
all: $(LIBS_TO_BUILD) $(CODEC2)/.built $(CTB)/.built freedv
// Spectrum Plots -----------------------------------------------------------
long nb_style = wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS;
- m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,300), nb_style);
+ m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,200), nb_style);
m_auiNotebook->SetFont(wxFont(8, 70, 90, 90, false, wxEmptyString));
bSizer30->Add(m_auiNotebook, 0, wxEXPAND|wxALL, 3);
public:
FilterDlg( wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter,
wxWindowID id = wxID_ANY, const wxString& title = _("Filter"),
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1000, 700 ),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800, 550 ),
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~FilterDlg();
--- /dev/null
+//==========================================================================
+// Name: dlg_options.cpp
+// Purpose: Dialog for controlling misc FreeDV options
+// Date: May 24 2013
+// Authors: David Rowe, David Witten
+//
+// License:
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2.1,
+// as published by the Free Software Foundation. This program is
+// distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#include "dlg_options.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+{
+
+ this->SetSizeHints(wxDefaultSize, wxDefaultSize);
+
+ wxBoxSizer* bSizer30;
+ bSizer30 = new wxBoxSizer(wxVERTICAL);
+
+ //------------------------------
+ // Call Sign Text Box
+ //------------------------------
+
+ wxStaticBoxSizer* sbSizer_callSign;
+ sbSizer_callSign = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Call Sign")), wxVERTICAL);
+
+ m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+ m_txtCtrlCallSign->SetToolTip(_("Call Sign of your station"));
+ sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+ bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+ //------------------------------
+ // Test Frames check box
+ //------------------------------
+
+ wxStaticBoxSizer* sbSizer_testFrames;
+ sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
+
+ m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+ sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
+
+ bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
+ //------------------------------
+ // Cancel - OK Buttons
+ //------------------------------
+
+ wxBoxSizer* bSizer31 = new wxBoxSizer(wxHORIZONTAL);
+ m_sdbSizer5Cancel = new wxButton(this, wxID_CANCEL);
+ bSizer31->Add(m_sdbSizer5Cancel, 0, wxALL, 2);
+ m_sdbSizer5OK = new wxButton(this, wxID_OK);
+ bSizer31->Add(m_sdbSizer5OK, 0, wxALL, 2);
+
+ bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+
+ this->SetSizer(bSizer30);
+ this->Layout();
+
+ this->Centre(wxBOTH);
+
+ // Connect Events -------------------------------------------------------
+
+ this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+ m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+ m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+}
+
+//-------------------------------------------------------------------------
+// ~OptionsDlg()
+//-------------------------------------------------------------------------
+OptionsDlg::~OptionsDlg()
+{
+ // Disconnect Events
+
+ this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog));
+
+ m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnCancel), NULL, this);
+ m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsDlg::OnOK), NULL, this);
+}
+
+
+//-------------------------------------------------------------------------
+// ExchangeData()
+//-------------------------------------------------------------------------
+void OptionsDlg::ExchangeData(int inout, bool storePersistent)
+{
+ wxConfigBase *pConfig = wxConfigBase::Get();
+
+ if(inout == EXCHANGE_DATA_IN)
+ {
+ m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
+ m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+ }
+
+ if(inout == EXCHANGE_DATA_OUT)
+ {
+ // LPC Post filter
+
+ wxGetApp().m_callSign = m_txtCtrlCallSign->GetValue();
+ wxGetApp().m_testFrames = m_ckboxTestFrame->GetValue();
+
+ if (storePersistent) {
+ pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+ pConfig->Flush();
+ }
+ }
+ delete wxConfigBase::Set((wxConfigBase *) NULL);
+}
+
+//-------------------------------------------------------------------------
+// OnCancel()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnCancel(wxCommandEvent& event)
+{
+ this->EndModal(wxID_CANCEL);
+}
+
+//-------------------------------------------------------------------------
+// OnOK()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnOK(wxCommandEvent& event)
+{
+ ExchangeData(EXCHANGE_DATA_OUT, true);
+ this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnClose()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnClose(wxCloseEvent& event)
+{
+ this->EndModal(wxID_OK);
+}
+
+//-------------------------------------------------------------------------
+// OnInitDialog()
+//-------------------------------------------------------------------------
+void OptionsDlg::OnInitDialog(wxInitDialogEvent& event)
+{
+ ExchangeData(EXCHANGE_DATA_IN, false);
+}
--- /dev/null
+//==========================================================================
+// Name: dlg_options.h
+// Purpose: Dialog for controlling misc FreeDV options
+// Created: Nov 25 2012
+// Authors: David Rowe, David Witten
+//
+// License:
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2.1,
+// as published by the Free Software Foundation. This program is
+// distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, see <http://www.gnu.org/licenses/>.
+//
+//==========================================================================
+
+#ifndef __OPTIONS_DIALOG__
+#define __OPTIONS_DIALOG__
+
+#include "fdmdv2_main.h"
+
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+// Class OptionsDlg
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
+class OptionsDlg : public wxDialog
+{
+ public:
+ OptionsDlg( wxWindow* parent,
+ wxWindowID id = wxID_ANY, const wxString& title = _("Options"),
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,180),
+ long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~OptionsDlg();
+
+ void ExchangeData(int inout, bool storePersistent);
+
+ protected:
+ // Handlers for events.
+ void OnCancel(wxCommandEvent& event);
+ void OnOK(wxCommandEvent& event);
+ void OnClose(wxCloseEvent& event);
+ void OnInitDialog(wxInitDialogEvent& event);
+
+ wxTextCtrl *m_txtCtrlCallSign;
+ wxCheckBox *m_ckboxTestFrame;
+
+ wxButton* m_sdbSizer5OK;
+ wxButton* m_sdbSizer5Cancel;
+
+ private:
+};
+
+#endif // __OPTIONS_DIALOG__
g_test_frame_sync_state = 0;
g_total_bit_errors = 0;
g_total_bits = 0;
+ wxGetApp().m_testFrames = false;
}
//-------------------------------------------------------------------------
// Toggle test frame mode at run time
- if (!g_testFrames && m_ckboxTestFrame->GetValue()) {
+ if (!g_testFrames && wxGetApp().m_testFrames) {
// reset stats on check box off to on transition
g_total_bits = 0;
g_total_bit_errors = 0;
}
- g_testFrames = m_ckboxTestFrame->GetValue();
+ g_testFrames = wxGetApp().m_testFrames;
if (g_State) {
char bits[80], errors[80], ber[80];
// update stats on main page
- sprintf(bits, "Bits...: %d", g_total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
- sprintf(errors, "Errors: %d", g_total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
+ sprintf(bits, "Bits: %d", g_total_bits); wxString bits_string(bits); m_textBits->SetLabel(bits_string);
+ sprintf(errors, "Errs: %d", g_total_bit_errors); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
float b = (float)g_total_bit_errors/(1E-6+g_total_bits);
- sprintf(ber, "BER...: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+ sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
// update error plots
}
//-------------------------------------------------------------------------
-// OnToolsSetCallSign()
+// OnToolsOptions()
//-------------------------------------------------------------------------
-void MainFrame::OnToolsSetCallSign(wxCommandEvent& event)
+void MainFrame::OnToolsOptions(wxCommandEvent& event)
{
wxUnusedVar(event);
- printf("MainFrame::OnToolSetCallSign\n");
- wxGetApp().m_callSign = wxGetTextFromUser(wxT("Enter Callsign"),
- wxT("Enter Callsign"),
- wxGetApp().m_callSign);
+ OptionsDlg *dlg = new OptionsDlg(NULL);
+ dlg->ShowModal();
+ delete dlg;
}
//-------------------------------------------------------------------------
if(m_serialPort != NULL)
{
- int iLineState = m_serialPort->GetLineState();
CloseSerialPort();
}
ComPortsDlg *dlg = new ComPortsDlg(NULL);
m_rb1400old->Disable();
m_rb1600->Disable();
+ m_rb1600Wide->Disable();
#ifdef DISABLED_FEATURE
m_rb1400->Disable();
m_rb2000->Disable();
m_togBtnOnOff->SetLabel(wxT("Start"));
m_rb1400old->Enable();
m_rb1600->Enable();
+ m_rb1600Wide->Enable();
#ifdef DISABLED_FEATURE
m_rb1400->Enable();
m_rb2000->Enable();
#include "dlg_audiooptions.h"
#include "dlg_filter.h"
#include "dlg_about.h"
+#include "dlg_options.h"
#include "varicode.h"
#include "sox_biquad.h"
bool loadConfig();
bool saveConfig();
+ // misc
+
+ bool m_testFrames;
+
protected:
};
void OnToolsComCfg( wxCommandEvent& event );
void OnToolsComCfgUI( wxUpdateUIEvent& event );
void OnToolsFilter( wxCommandEvent& event );
- void OnToolsSetCallSign(wxCommandEvent& event);
+ void OnToolsOptions(wxCommandEvent& event);
void OnPlayFileToMicIn( wxCommandEvent& event );
void OnRecFileFromRadio( wxCommandEvent& event );
void* designAnEQFilter(const char filterType[], float freqHz, float gaindB, float Q = 0.0);
void designEQFilters(paCallBackData *cb);
void deleteEQFilters(paCallBackData *cb);
-
};
void txRxProcessing();
m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL);
tools->Append(m_menuItemRigCtrlCfg);
+ wxMenuItem* m_menuItemOptions;
+ m_menuItemOptions = new wxMenuItem(tools, wxID_ANY, wxString(_("Options")) , wxEmptyString, wxITEM_NORMAL);
+ tools->Append(m_menuItemOptions);
+
wxMenuItem* m_menuItemFilter;
m_menuItemFilter = new wxMenuItem(tools, wxID_ANY, wxString(_("&Filter")) , wxEmptyString, wxITEM_NORMAL);
tools->Append(m_menuItemFilter);
- wxMenuItem* m_menuItemSetCallSign;
- m_menuItemSetCallSign = new wxMenuItem(tools, wxID_ANY, wxString(_("Set Call Sign")) , wxEmptyString, wxITEM_NORMAL);
- tools->Append(m_menuItemSetCallSign);
-
wxMenuItem* m_menuItemCaptTxInStream;
m_menuItemCaptTxInStream = new wxMenuItem(tools, wxID_ANY, wxString(_("&Capture Tx Input Stream")), wxEmptyString, wxITEM_NORMAL);
m_BtnBerReset = new wxButton(this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0);
sbSizer_ber->Add(m_BtnBerReset, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
- m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits...: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ m_textBits = new wxStaticText(this, wxID_ANY, wxT("Bits: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
sbSizer_ber->Add(m_textBits, 0, wxALIGN_LEFT, 1);
- m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errors: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ m_textErrors = new wxStaticText(this, wxID_ANY, wxT("Errs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
sbSizer_ber->Add(m_textErrors, 0, wxALIGN_LEFT, 1);
- m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER...: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
rightSizer->Add(sbSizer_mode,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+ #ifdef MOVED_TO_OPTIONS_DIALOG
/* new --- */
//------------------------------
sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
rightSizer->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
+ #endif
//=====================================================
// Control Toggles box
this->Connect(m_menuItemFilter->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
this->Connect(m_menuItemRigCtrlCfg->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
- this->Connect(m_menuItemSetCallSign->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsSetCallSign));
- this->Connect(m_menuItemSetCallSign->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsSetCallSignUI));
+ this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+ this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsFilterUI));
this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsComCfg));
this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsComCfgUI));
+ this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
+ this->Disconnect(wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
this->Disconnect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));
wxStaticText* m_textSQ;
wxStatusBar* m_statusBar1;
- wxCheckBox *m_ckboxTestFrame;
-
wxButton* m_BtnBerReset;
wxStaticText *m_textBits;
wxStaticText *m_textErrors;
virtual void OnToolsAudioUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnToolsFilter( wxCommandEvent& event ) { event.Skip(); }
virtual void OnToolsFilterUI( wxUpdateUIEvent& event ) { event.Skip(); }
- virtual void OnToolsSetCallSign( wxCommandEvent& event ) { event.Skip(); }
- virtual void OnToolsSetCallSignUI( wxUpdateUIEvent& event ) { event.Skip(); }
+ virtual void OnToolsOptions( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnToolsOptionsUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnToolsComCfg( wxCommandEvent& event ) { event.Skip(); }
virtual void OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnPlayFileToMicIn( wxCommandEvent& event ) { event.Skip(); }
#ifndef FREEDV_VER_DOT_H
#define FREEDV_VER_DOT_H 1
-#define FREEDV_VERSION "0.961 Beta"
+#define FREEDV_VERSION "0.96.2 Beta"
#endif //FREEDV_VER_DOT_H