//==========================================================================
#include "dlg_filter.h"
-#define SLIDER_MAX 20
+#define SLIDER_MAX 100
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
// Class FilterDlg
bSizer30 = new wxBoxSizer(wxVERTICAL);
wxGridSizer* gSizer3;
- gSizer3 = new wxGridSizer(6, 2, 0, 0);
+ gSizer3 = new wxGridSizer(6, 3, 0, 0);
- m_staticText8 = new wxStaticText(this, wxID_ANY, _("Enable LPC Post Filter:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
- m_staticText8->Wrap(-1);
- gSizer3->Add(m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+ gSizer3->Add(new wxStaticText(this, wxID_ANY, _("")));
+
+ m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _("Enable LPC Post Filter"), wxDefaultPosition,wxDefaultSize , wxCHK_2STATE);
+ gSizer3->Add(m_codec2LPCPostFilterEnable, 2);
- m_codec2LPCPostFilterEnable = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
- gSizer3->Add(m_codec2LPCPostFilterEnable, 2, wxALL|wxEXPAND, 2);
+ gSizer3->Add(new wxStaticText(this, wxID_ANY, _("")));
+ gSizer3->Add(new wxStaticText(this, wxID_ANY, _("")));
- m_staticText9 = new wxStaticText(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
- m_staticText9->Wrap(-1);
- gSizer3->Add(m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
-
- m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
- gSizer3->Add(m_codec2LPCPostFilterBassBoost, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+ m_codec2LPCPostFilterBassBoost = new wxCheckBox(this, wxID_ANY, _("0-1 kHz 3dB Boost"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+ gSizer3->Add(m_codec2LPCPostFilterBassBoost, 2);
+
+ gSizer3->Add(new wxStaticText(this, wxID_ANY, _("")));
m_staticText91 = new wxStaticText(this, wxID_ANY, _("Beta:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
m_staticText91->Wrap(-1);
gSizer3->Add(m_staticText91, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
- m_codec2LPCPostFilterBeta = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX);
+ m_codec2LPCPostFilterBeta = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(155,wxDefaultCoord));
gSizer3->Add(m_codec2LPCPostFilterBeta, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+ m_staticTextBeta = new wxStaticText(this, wxID_ANY, _("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+ m_staticTextBeta->Wrap(-1);
+ //gSizer3->Add(m_staticTextBeta, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 2);
+ gSizer3->Add(m_staticTextBeta, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL);
+
m_staticText911 = new wxStaticText(this, wxID_ANY, _("Gamma:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
m_staticText911->Wrap(-1);
- gSizer3->Add(m_staticText911, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
+ gSizer3->Add(m_staticText911, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2);
- m_codec2LPCPostFilterGamma = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX);
+ m_codec2LPCPostFilterGamma = new wxSlider(this, wxID_ANY, 0, 0, SLIDER_MAX, wxDefaultPosition, wxSize(155,wxDefaultCoord));
gSizer3->Add(m_codec2LPCPostFilterGamma, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2);
+ m_staticTextGamma = new wxStaticText(this, wxID_ANY, _("0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+ m_staticTextGamma->Wrap(-1);
+ gSizer3->Add(m_staticTextGamma, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL);
+
bSizer30->Add(gSizer3, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5);
m_sdbSizer5 = new wxStdDialogButtonSizer();
m_sdbSizer5->AddButton(m_sdbSizer5Cancel);
m_sdbSizer5->Realize();
- bSizer30->Add(m_sdbSizer5, 0, wxEXPAND, 5);
-
+ bSizer30->Add(m_sdbSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
this->SetSizer(bSizer30);
this->Layout();
// Connect Events
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
- //m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnApply), NULL, this);
+ m_codec2LPCPostFilterBeta->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+ m_codec2LPCPostFilterGamma->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
- //m_listCtrlPortSelect->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(FilterDlg::OnListItemSelected), NULL, this);
}
//-------------------------------------------------------------------------
{
// Disconnect Events
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
- //m_listCtrlPortSelect->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(FilterDlg::OnListItemSelected), NULL, this);
- //m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnApply), NULL, this);
+ m_codec2LPCPostFilterBeta->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnBetaScroll), NULL, this);
+ m_codec2LPCPostFilterGamma->Disconnect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(FilterDlg::OnGammaScroll), NULL, this);
m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnCancel), NULL, this);
m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FilterDlg::OnOK), NULL, this);
}
-//-------------------------------------------------------------------------
-// OnListItemSelected()
-//-------------------------------------------------------------------------
-void FilterDlg::OnListItemSelected(wxListEvent& event)
-{
- // TODO: Implement OnListItemSelected
-}
-
//-------------------------------------------------------------------------
// ExchangeData()
//-------------------------------------------------------------------------
this->EndModal(wxID_OK);
}
-//-------------------------------------------------------------------------
-// OnApply()
-//-------------------------------------------------------------------------
-void FilterDlg::OnApply(wxCommandEvent& event)
-{
- ExchangeData(EXCHANGE_DATA_OUT);
-}
-
//-------------------------------------------------------------------------
// OnClose()
//-------------------------------------------------------------------------
ExchangeData(EXCHANGE_DATA_IN);
}
+void FilterDlg::OnBetaScroll(wxScrollEvent& event) {
+ float beta = (float)m_codec2LPCPostFilterBeta->GetValue()/SLIDER_MAX;
+ wxString buf;
+ buf.Printf(wxT("%3.2f"), beta);
+ m_staticTextBeta->SetLabel(buf);
+}
+
+void FilterDlg::OnGammaScroll(wxScrollEvent& event) {
+ float gamma = (float)m_codec2LPCPostFilterGamma->GetValue()/SLIDER_MAX;
+ wxString buf;
+ buf.Printf(wxT("%3.2f"), gamma);
+ m_staticTextGamma->SetLabel(buf);
+}
+