From: wittend99 Date: Tue, 12 Jun 2012 12:30:44 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freetel/code@546 01035d8c-6547-0410-b346-abe4f9... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=fe6204d91b7b85c64d4408469672f30591846fd1;p=freetel-svn-tracking.git git-svn-id: https://svn.code.sf.net/p/freetel/code@546 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/FDMDV2.fbp b/fdmdv2/FDMDV2.fbp index e25a23de..04681507 100644 --- a/fdmdv2/FDMDV2.fbp +++ b/fdmdv2/FDMDV2.fbp @@ -71,7 +71,7 @@ Resizable 1 - 732,507 + 761,500 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER FDMDV2 @@ -484,7 +484,7 @@ wxGA_SMOOTH|wxGA_VERTICAL 0 - + Display signal to noise ratio. wxFILTER_NONE wxDefaultValidator @@ -580,7 +580,7 @@ wxTE_READONLY 0 - + Show S/N ratio numerically. wxFILTER_NONE wxDefaultValidator @@ -687,7 +687,7 @@ wxGA_SMOOTH|wxGA_VERTICAL 0 - + Display signal level. wxFILTER_NONE wxDefaultValidator @@ -729,16 +729,16 @@ 1 wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 4 - + centerSizer wxVERTICAL none - + 0 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_TOP|wxEXPAND 1 - + upperSizer wxVERTICAL @@ -771,7 +771,7 @@ 1 1 - + ,90,90,6,70,0 0 0 wxID_ANY @@ -1152,7 +1152,7 @@ 3 wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND - 3 + 2 wxID_ANY SQ @@ -1215,7 +1215,7 @@ wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL 0 - + Set Squelch level. wxFILTER_NONE wxDefaultValidator @@ -1332,7 +1332,7 @@ wxCHK_2STATE 0 - + Activate/Deactivate Squelch wxFILTER_NONE wxDefaultValidator @@ -1370,11 +1370,11 @@ - + 3 wxALIGN_CENTER|wxALL|wxEXPAND 2 - + wxID_ANY Control @@ -1382,11 +1382,109 @@ wxVERTICAL none - + + 1 + wxEXPAND + 0 + + + bSizer1511 + wxVERTICAL + none + + 1 + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Start + + 0 + + + 0 + + 1 + m_togBtnOnOff + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + Begin receiving data. + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + OnTogBtnOnOff + + + + + + 1 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + bSizer151 wxVERTICAL @@ -1443,7 +1541,7 @@ 0 - Toggle Split mode. + Toggle split frequency mode. wxFILTER_NONE wxDefaultValidator @@ -1639,7 +1737,7 @@ 0 - Toggle ALC Mode. + Toggle automatic level control mode. wxFILTER_NONE wxDefaultValidator @@ -1737,7 +1835,7 @@ 0 - + Switch between Receive and Transmit wxFILTER_NONE wxDefaultValidator @@ -2381,7 +2479,7 @@ - + 1 1 1 @@ -2428,7 +2526,7 @@ Resizable 1 - 553,381 + 555,419 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Audio Options @@ -2477,16 +2575,16 @@ - + bSizer32 wxVERTICAL none - + 1 wxEXPAND | wxALL 1 - + 1 1 1 @@ -2568,11 +2666,11 @@ - + Devices 1 - + 1 1 1 @@ -2650,46 +2748,49 @@ - + bSizer34 wxVERTICAL none - + 5 wxEXPAND 1 - + wxID_ANY PortAudio sbSizer10 - wxVERTICAL + wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizer41 wxHORIZONTAL none - + 5 - wxEXPAND + wxALL 0 - - - bSizer37 - wxVERTICAL + + 1 + 0 + 115,-1 + gSizer6 none - + 3 + 0 + 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL 1 - + 1 1 1 @@ -2773,25 +2874,395 @@ + + 5 + wxEXPAND + 0 + + 2 + 0 + 110,-1 + gSizer51 + none + 2 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,7,70,0 + 0 + 0 + wxID_ANY + # Ch Out: + + 0 + 80,-1 + + 0 + 80,-1 + 1 + m_staticText151 + 1 + + + protected + 1 + + Resizable + 1 + 80,-1 + wxALIGN_RIGHT + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,7,70,0 + 0 + 0 + wxID_ANY + + 0 + 30,-1 + 0 + + 0 + 30,-1 + 1 + m_textNumChOut + 1 + + + protected + 1 + + Resizable + 1 + 30,-1 + wxTE_READONLY + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,7,70,0 + 0 + 0 + wxID_ANY + # Ch In: + + 0 + 90,-1 + + 0 + 80,-1 + 1 + m_staticText141 + 1 + + + protected + 1 + + Resizable + 1 + 80,-1 + wxALIGN_RIGHT + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,7,70,0 + 0 + 0 + wxID_ANY + + 0 + 30,-1 + 0 + + 0 + 30,-1 + 1 + m_textNumChIn + 1 + + + protected + 1 + + Resizable + 1 + 30,-1 + wxTE_READONLY + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 5 - wxEXPAND - 1 - - 1 + wxALL|wxEXPAND + 0 + + 2 0 gSizer7 none 4 0 - + 5 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -2837,7 +3308,7 @@ Resizable 1 - wxALIGN_RIGHT + wxALIGN_RIGHT|wxST_NO_AUTORESIZE 0 @@ -2874,11 +3345,11 @@ - + 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL - 0 - + wxALL + 1 + 1 1 1 @@ -2892,6 +3363,7 @@ 1 0 + 1 1 @@ -2906,7 +3378,6 @@ 0 0 wxID_ANY - codec -> Radio Tx: 0 @@ -2914,7 +3385,7 @@ 0 1 - m_staticText15 + m_comboAudioCodec 1 @@ -2922,9 +3393,10 @@ 1 Resizable + -1 1 - wxALIGN_RIGHT + 0 @@ -2932,11 +3404,12 @@ wxFILTER_NONE wxDefaultValidator + <default> - -1 + @@ -2958,14 +3431,16 @@ + + - + 5 - wxALIGN_RIGHT|wxALL + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -2993,7 +3468,7 @@ 0 0 wxID_ANY - Radio Rx -> codec: + codec -> Radio Tx: 0 @@ -3001,7 +3476,7 @@ 0 1 - m_staticText16 + m_staticText15 1 @@ -3011,7 +3486,7 @@ Resizable 1 - wxALIGN_RIGHT + wxALIGN_RIGHT|wxST_NO_AUTORESIZE 0 @@ -3048,11 +3523,11 @@ - + 5 - wxALIGN_RIGHT|wxALL - 0 - + wxALL + 1 + 1 1 1 @@ -3066,6 +3541,7 @@ 1 0 + 1 1 @@ -3080,7 +3556,6 @@ 0 0 wxID_ANY - codec -> Audio out (spkr): 0 @@ -3088,7 +3563,7 @@ 0 1 - m_staticText17 + m_comboCodecTx 1 @@ -3096,9 +3571,10 @@ 1 Resizable + -1 1 - wxALIGN_RIGHT + 0 @@ -3106,11 +3582,12 @@ wxFILTER_NONE wxDefaultValidator + <default> - -1 + @@ -3132,28 +3609,16 @@ + + - - - - 5 - wxEXPAND - 1 - - 1 - 0 - - gSizer5 - none - 4 - 0 - + 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -3167,7 +3632,6 @@ 1 0 - 1 1 @@ -3182,6 +3646,7 @@ 0 0 wxID_ANY + Radio Rx -> codec: 0 @@ -3189,7 +3654,7 @@ 0 1 - m_comboBox1 + m_staticText16 1 @@ -3197,10 +3662,9 @@ 1 Resizable - -1 1 - + wxALIGN_RIGHT|wxST_NO_AUTORESIZE 0 @@ -3208,12 +3672,11 @@ wxFILTER_NONE wxDefaultValidator - Combo! + -1 - @@ -3235,16 +3698,14 @@ - - - + 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND - 0 - + wxALL + 1 + 1 1 1 @@ -3280,7 +3741,7 @@ 0 1 - m_comboBox2 + m_comboRadioRx 1 @@ -3299,7 +3760,7 @@ wxFILTER_NONE wxDefaultValidator - Combo! + <default> @@ -3331,11 +3792,11 @@ - + 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -3349,7 +3810,6 @@ 1 0 - 1 1 @@ -3364,6 +3824,7 @@ 0 0 wxID_ANY + codec -> Audio out (spkr): 0 @@ -3371,7 +3832,7 @@ 0 1 - m_comboBox11 + m_staticText17 1 @@ -3379,10 +3840,9 @@ 1 Resizable - -1 1 - + wxALIGN_RIGHT|wxST_NO_AUTORESIZE 0 @@ -3390,12 +3850,11 @@ wxFILTER_NONE wxDefaultValidator - Combo! + -1 - @@ -3417,16 +3876,14 @@ - - - + 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALL 0 - + 1 1 1 @@ -3462,7 +3919,7 @@ 0 1 - m_comboBox12 + m_comboCodecSpkr 1 @@ -3481,7 +3938,7 @@ wxFILTER_NONE wxDefaultValidator - Combo! + <default> @@ -3519,11 +3976,11 @@ - + 5 wxEXPAND 1 - + wxID_ANY File I/O @@ -3531,20 +3988,20 @@ wxHORIZONTAL none - + 5 wxEXPAND 0 - + bSizer38 wxVERTICAL none - + 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL 1 - + 1 1 1 @@ -3590,7 +4047,7 @@ Resizable 1 - wxRB_GROUP + 0 @@ -3630,22 +4087,22 @@ - + 5 wxEXPAND 1 - + bSizer45 wxVERTICAL none - + 5 wxEXPAND 1 - + bSizer46 wxVERTICAL @@ -3657,11 +4114,11 @@ - + Settings 0 - + 1 1 1 @@ -3739,7 +4196,7 @@ - + bSizer27 wxVERTICAL @@ -4163,7 +4620,7 @@ - + 1 wxEXPAND 1 @@ -4585,11 +5042,11 @@ - + Right Channel 0 - + 1 1 1 @@ -4667,7 +5124,7 @@ - + bSizer36 wxVERTICAL @@ -4677,11 +5134,11 @@ - + 5 wxEXPAND 0 - + bSizer28 wxVERTICAL @@ -4714,11 +5171,11 @@ - + 5 wxEXPAND 0 - + 15 protected 0 diff --git a/fdmdv2/Release/fdmdv2.exe b/fdmdv2/Release/fdmdv2.exe index d311d9d8..5bc52481 100644 Binary files a/fdmdv2/Release/fdmdv2.exe and b/fdmdv2/Release/fdmdv2.exe differ diff --git a/fdmdv2/dlg_audio.cpp b/fdmdv2/dlg_audio.cpp index 1062fddf..e7870224 100644 --- a/fdmdv2/dlg_audio.cpp +++ b/fdmdv2/dlg_audio.cpp @@ -11,59 +11,92 @@ //========================================================================== #include "dlg_audio.h" +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= +// Class AudioDlg( wxWindow* parent ) : DlgAudio( parent ) +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= AudioDlg::AudioDlg( wxWindow* parent ) : DlgAudio( parent ) { } +//------------------------------------------------------------------------- +// OnCancel() +//------------------------------------------------------------------------- void AudioDlg::OnCancel( wxCommandEvent& event ) { this->EndModal(wxID_OK); } +//------------------------------------------------------------------------- +// OnOK() +//------------------------------------------------------------------------- void AudioDlg::OnOK( wxCommandEvent& event ) { this->EndModal(wxID_OK); } +//------------------------------------------------------------------------- +// OnApply() +//------------------------------------------------------------------------- void AudioDlg::OnApply( wxCommandEvent& event ) { this->EndModal(wxID_OK); } +//------------------------------------------------------------------------- +// OnClose() +//------------------------------------------------------------------------- void AudioDlg::OnClose( wxCloseEvent& event ) { this->EndModal(wxID_OK); } +//------------------------------------------------------------------------- +// OnInitDialog() +//------------------------------------------------------------------------- void AudioDlg::OnInitDialog( wxInitDialogEvent& event ) { //wxMessageBox(wxT("got OnInitDialog()"), wxT("Select"), wxOK); populateAudioInfo(); } +//------------------------------------------------------------------------- +// OnRxInputSelect() +//------------------------------------------------------------------------- void AudioDlg::OnRxInputSelect( wxCommandEvent& event ) { wxMessageBox(wxT("got OnRxInputSelect()"), wxT("Select"), wxOK); } +//------------------------------------------------------------------------- +// OnTxOutputSelect() +//------------------------------------------------------------------------- void AudioDlg::OnTxOutputSelect( wxCommandEvent& event ) { wxMessageBox(wxT("got OnTxOutputSelect()"), wxT("Select"), wxOK); } +//------------------------------------------------------------------------- +// OnVoiceInputSelect() +//------------------------------------------------------------------------- void AudioDlg::OnVoiceInputSelect( wxCommandEvent& event ) { wxMessageBox(wxT("got OnVoiceInputSelect()"), wxT("Select"), wxOK); } +//------------------------------------------------------------------------- +// OnVoiceOutputSelect() +//------------------------------------------------------------------------- void AudioDlg::OnVoiceOutputSelect( wxCommandEvent& event ) { wxMessageBox(wxT("got OnVoiceOutputSelect()"), wxT("Select"), wxOK); } +//------------------------------------------------------------------------- +// populateStandardSampleRates() +//------------------------------------------------------------------------- void AudioDlg::populateStandardSampleRates( - wxListBox* target, + wxComboBox* target, const portaudio::DirectionSpecificStreamParameters &inputParameters, const portaudio::DirectionSpecificStreamParameters &outputParameters) { @@ -82,17 +115,20 @@ void AudioDlg::populateStandardSampleRates( if (tmp.isSupported()) { tStr.Printf("%i %8.2f", printCount, STANDARD_SAMPLE_RATES[i]); - target->InsertItems(1, &tStr, 0); + target->Append(tStr); ++printCount; } } if (printCount == 0) { tStr = "None\n"; - target->InsertItems(1, &tStr, 0); + target->Append(tStr); } } +//------------------------------------------------------------------------- +// OnActivate() +//------------------------------------------------------------------------- int AudioDlg::populateAudioInfo() { wxString tStr; @@ -100,7 +136,7 @@ int AudioDlg::populateAudioInfo() try { portaudio::AutoSystem autoSys; - portaudio::System &sys = portaudio::System::instance(); + portaudio::System &sys = portaudio::System::instance(); /* tStr.Printf("PortAudio version number: %i\n", sys.version()); @@ -118,9 +154,7 @@ int AudioDlg::populateAudioInfo() /* tStr.Printf("---------- device #: %i ----------\n", (*i).index()); m_textTopRight->AppendText(tStr); - bool defaultDisplayed = false; - if ((*i).isSystemDefaultInputDevice()) { tStr.Printf("[ System Default Input %s", (*i).hostApi().name()); @@ -149,13 +183,11 @@ int AudioDlg::populateAudioInfo() m_textTopRight->AppendText(tStr); defaultDisplayed = true; } - if (defaultDisplayed) { tStr = " ]\n"; m_textTopRight->AppendText(tStr); } - ttStr.Printf("Name : %s\n", (*i).name()); tStr += ttStr; ttStr.Printf("Host API : %s\n", (*i).hostApi().name()); @@ -164,7 +196,6 @@ int AudioDlg::populateAudioInfo() tStr += ttStr; ttStr.Printf("Max outputs : %i\n\n", (*i).maxOutputChannels()); tStr += ttStr; - ttStr.Printf("Default low input latency : %8.3f\n", (*i).defaultLowInputLatency()); tStr += ttStr; ttStr.Printf("Default low output latency : %8.3f\n", (*i).defaultLowOutputLatency()); @@ -180,11 +211,9 @@ int AudioDlg::populateAudioInfo() if ((*i).hostApi().typeId() == paASIO) { portaudio::AsioDeviceAdapter asioDevice((*i)); - //std::cout << "ASIO minimum buffer size = " << asioDevice.minBufferSize() << std::endl; //std::cout << "ASIO maximum buffer size = " << asioDevice.maxBufferSize() << std::endl; //std::cout << "ASIO preferred buffer size = " << asioDevice.preferredBufferSize() << std::endl; - if (asioDevice.granularity() == -1) { //std::cout << "ASIO buffer granularity = power of 2" << std::endl; @@ -198,33 +227,47 @@ int AudioDlg::populateAudioInfo() tStr.Printf("Default sample rate : %8.2f\n", (*i).defaultSampleRate()); m_textTopRight->AppendText(tStr); + wxComboBox* m_comboAudioCodec; + wxComboBox* m_comboCodecTx; + wxComboBox* m_comboRadioRx; + wxComboBox* m_comboCodecSpkr; */ // Poll for standard sample rates: portaudio::DirectionSpecificStreamParameters inputParameters((*i), (*i).maxInputChannels(), portaudio::INT16, true, 0.0, NULL); portaudio::DirectionSpecificStreamParameters outputParameters((*i), (*i).maxOutputChannels(), portaudio::INT16, true, 0.0, NULL); if (inputParameters.numChannels() > 0) { - tStr = "Supported standard Input sample rates\n"; - m_lbRxInput->InsertItems(1, &tStr, 0); - tStr.Printf(" for half-duplex 16 bit %i channel input = ", inputParameters.numChannels()); - m_lbRxInput->InsertItems(1, &tStr, 0); - populateStandardSampleRates(m_lbRxInput, inputParameters, portaudio::DirectionSpecificStreamParameters::null()); +// tStr = "Supported standard Input sample rates\n"; +// m_comboAudioCodec->Append(tStr); +// tStr.Printf(" for half-duplex 16 bit %i channel input = ", inputParameters.numChannels()); +// m_comboAudioCodec->InsertItems(1, &tStr, 0); +// m_comboAudioCodec->Append(tStr); + populateStandardSampleRates(m_comboAudioCodec, inputParameters, portaudio::DirectionSpecificStreamParameters::null()); } if (outputParameters.numChannels() > 0) { - tStr = "Supported standard Output sample rates\n"; - m_lbTxOutput->InsertItems(1, &tStr, 0); - tStr.Printf(" for half-duplex 16 bit %i channel output = ", outputParameters.numChannels()); - m_lbTxOutput->InsertItems(1, &tStr, 0); - populateStandardSampleRates(m_lbTxOutput, portaudio::DirectionSpecificStreamParameters::null(), outputParameters); +// tStr = "Supported standard Output sample rates\n"; +// m_comboRadioRx->Append(tStr); +// tStr.Printf(" for half-duplex 16 bit %i channel output = ", outputParameters.numChannels()); +// m_comboRadioRx->Append(tStr); + populateStandardSampleRates(m_comboRadioRx, portaudio::DirectionSpecificStreamParameters::null(), outputParameters); + } + if (inputParameters.numChannels() > 0 && inputParameters.numChannels() > 0) + { +// tStr = "Supported full-duplex sample rates\n"; +// m_comboCodecTx->Append(tStr); +// tStr.Printf(" for full-duplex 16 bit %i channel input, %i", inputParameters.numChannels(), outputParameters.numChannels()); +// m_comboCodecTx->InsertItems(1, &tStr, 0); +// m_comboCodecTx->Append(tStr); + populateStandardSampleRates(m_comboCodecTx, inputParameters, outputParameters); } - if (inputParameters.numChannels() > 0 && outputParameters.numChannels() > 0) + if (outputParameters.numChannels() > 0 && outputParameters.numChannels() > 0) { - tStr = "Supported full-duplex sample rates\n"; - m_lbVoiceInput->InsertItems(1, &tStr, 0); - tStr.Printf(" for full-duplex 16 bit %i channel input, %i", inputParameters.numChannels(), outputParameters.numChannels()); - m_lbVoiceInput->InsertItems(1, &tStr, 0); - populateStandardSampleRates(m_lbVoiceInput, inputParameters, outputParameters); +// tStr = "Supported full-duplex sample rates\n"; +// m_comboCodecSpkr->Append(tStr); +// tStr.Printf(" for full-duplex 16 bit %i channel input, %i", inputParameters.numChannels(), outputParameters.numChannels()); +// m_comboCodecTx->InsertItems(1, &tStr, 0); + populateStandardSampleRates(m_comboCodecSpkr, inputParameters, outputParameters); } } } diff --git a/fdmdv2/dlg_audio.h b/fdmdv2/dlg_audio.h index bfb988b6..23aa002f 100644 --- a/fdmdv2/dlg_audio.h +++ b/fdmdv2/dlg_audio.h @@ -30,7 +30,7 @@ class AudioDlg : public DlgAudio void OnInitDialog( wxInitDialogEvent& event ); void OnApply( wxCommandEvent& event ); void populateStandardSampleRates( - wxListBox* target, + wxComboBox* target, const portaudio::DirectionSpecificStreamParameters &inputParameters, const portaudio::DirectionSpecificStreamParameters &outputParameters); int populateAudioInfo(); diff --git a/fdmdv2/extern/include/portaudio.h b/fdmdv2/extern/include/portaudio.h index 79019abb..1dad5736 100644 --- a/fdmdv2/extern/include/portaudio.h +++ b/fdmdv2/extern/include/portaudio.h @@ -29,13 +29,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -50,7 +50,7 @@ extern "C" { #endif /* __cplusplus */ - + /** Retrieve the release number of the currently running PortAudio build, eg 1900. */ @@ -116,9 +116,9 @@ const char *Pa_GetErrorText( PaError errorCode ); and Pa_GetErrorText(), this function MUST be called before using any other PortAudio API functions. - If Pa_Initialize() is called multiple times, each successful - call must be matched with a corresponding call to Pa_Terminate(). - Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not + If Pa_Initialize() is called multiple times, each successful + call must be matched with a corresponding call to Pa_Terminate(). + Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not required to be fully nested. Note that if Pa_Initialize() returns an error code, Pa_Terminate() should @@ -145,7 +145,7 @@ PaError Pa_Initialize( void ); @return paNoError if successful, otherwise an error code indicating the cause of failure. - + @see Pa_Initialize */ PaError Pa_Terminate( void ); @@ -269,7 +269,7 @@ typedef struct PaHostApiInfo if no default output device is available. */ PaDeviceIndex defaultOutputDevice; - + } PaHostApiInfo; @@ -298,7 +298,7 @@ const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered. - + The paHostApiNotFound error code indicates that the host API specified by the type parameter is not available. @@ -325,7 +325,7 @@ PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter is out of range. - + @see PaHostApiInfo */ PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, @@ -357,8 +357,6 @@ typedef struct PaHostErrorInfo{ */ const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); - - /* Device enumeration and capabilities */ /** Retrieve the number of available devices. The number of available devices @@ -398,12 +396,12 @@ PaDeviceIndex Pa_GetDefaultInputDevice( void ); PaDeviceIndex Pa_GetDefaultOutputDevice( void ); -/** The type used to represent monotonic time in seconds. PaTime is - used for the fields of the PaStreamCallbackTimeInfo argument to the +/** The type used to represent monotonic time in seconds. PaTime is + used for the fields of the PaStreamCallbackTimeInfo argument to the PaStreamCallback and as the result of Pa_GetStreamTime(). PaTime values have unspecified origin. - + @see PaStreamCallback, PaStreamCallbackTimeInfo, Pa_GetStreamTime */ typedef double PaTime; @@ -421,7 +419,7 @@ typedef double PaTime; paUInt8 is an unsigned 8 bit format where 128 is considered "ground" - The paNonInterleaved flag indicates that audio data is passed as an array + The paNonInterleaved flag indicates that audio data is passed as an array of pointers to separate buffers, one buffer for each channel. Usually, when this flag is not used, audio data is passed as a single buffer with all channels interleaved. @@ -451,7 +449,7 @@ typedef struct PaDeviceInfo int structVersion; /* this is struct version 2 */ const char *name; PaHostApiIndex hostApi; /**< note this is a host API index, not a type id*/ - + int maxInputChannels; int maxOutputChannels; @@ -493,7 +491,7 @@ typedef struct PaStreamParameters This field must not be set to paNoDevice. */ PaDeviceIndex device; - + /** The number of channels of sound to be delivered to the stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). It can range from 1 to the value of maxInputChannels in the @@ -568,9 +566,9 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, A single PaStream can provide multiple channels of real-time streaming audio input and output to a client application. A stream provides access to audio hardware represented by one or more - PaDevices. Depending on the underlying Host API, it may be possible - to open multiple streams using the same device, however this behavior - is implementation defined. Portable applications should assume that + PaDevices. Depending on the underlying Host API, it may be possible + to open multiple streams using the same device, however this behavior + is implementation defined. Portable applications should assume that a PaDevice may be simultaneously used by at most one PaStream. Pointers to PaStream objects are passed between PortAudio functions that @@ -628,7 +626,7 @@ typedef unsigned long PaStreamFlags; /** Call the stream callback to fill initial output buffers, rather than the default behavior of priming the buffers with zeros (silence). This flag has no effect for input-only and blocking read/write streams. - + @see PaStreamFlags */ #define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) @@ -642,7 +640,7 @@ typedef unsigned long PaStreamFlags; Timing information for the buffers passed to the stream callback. Time values are expressed in seconds and are synchronised with the time base used by Pa_GetStreamTime() for the associated stream. - + @see PaStreamCallback, Pa_GetStreamTime */ typedef struct PaStreamCallbackTimeInfo{ @@ -713,41 +711,41 @@ typedef enum PaStreamCallbackResult active PortAudio stream. When a stream is running, PortAudio calls the stream callback periodically. - The callback function is responsible for processing buffers of audio samples + The callback function is responsible for processing buffers of audio samples passed via the input and output parameters. The PortAudio stream callback runs at very high or real-time priority. - It is required to consistently meet its time deadlines. Do not allocate - memory, access the file system, call library functions or call other functions + It is required to consistently meet its time deadlines. Do not allocate + memory, access the file system, call library functions or call other functions from the stream callback that may block or take an unpredictable amount of time to complete. In order for a stream to maintain glitch-free operation the callback must consume and return audio data faster than it is recorded and/or - played. PortAudio anticipates that each callback invocation may execute for - a duration approaching the duration of frameCount audio frames at the stream + played. PortAudio anticipates that each callback invocation may execute for + a duration approaching the duration of frameCount audio frames at the stream sample rate. It is reasonable to expect to be able to utilise 70% or more of - the available CPU time in the PortAudio callback. However, due to buffer size - adaption and other factors, not all host APIs are able to guarantee audio - stability under heavy CPU load with arbitrary fixed callback buffer sizes. - When high callback CPU utilisation is required the most robust behavior - can be achieved by using paFramesPerBufferUnspecified as the + the available CPU time in the PortAudio callback. However, due to buffer size + adaption and other factors, not all host APIs are able to guarantee audio + stability under heavy CPU load with arbitrary fixed callback buffer sizes. + When high callback CPU utilisation is required the most robust behavior + can be achieved by using paFramesPerBufferUnspecified as the Pa_OpenStream() framesPerBuffer parameter. - + @param input and @param output are either arrays of interleaved samples or; - if non-interleaved samples were requested using the paNonInterleaved sample - format flag, an array of buffer pointers, one non-interleaved buffer for + if non-interleaved samples were requested using the paNonInterleaved sample + format flag, an array of buffer pointers, one non-interleaved buffer for each channel. The format, packing and number of channels used by the buffers are determined by parameters to Pa_OpenStream(). - + @param frameCount The number of sample frames to be processed by the stream callback. @param timeInfo Timestamps indicating the ADC capture time of the first sample in the input buffer, the DAC output time of the first sample in the output buffer - and the time the callback was invoked. + and the time the callback was invoked. See PaStreamCallbackTimeInfo and Pa_GetStreamTime() @param statusFlags Flags indicating whether input and/or output buffers @@ -785,10 +783,10 @@ typedef int PaStreamCallback( /** Opens a stream for either input, output or both. - + @param stream The address of a PaStream pointer which will receive a pointer to the newly opened stream. - + @param inputParameters A structure that describes the input parameters used by the opened stream. See PaStreamParameters for a description of these parameters. inputParameters must be NULL for output-only streams. @@ -796,10 +794,10 @@ typedef int PaStreamCallback( @param outputParameters A structure that describes the output parameters used by the opened stream. See PaStreamParameters for a description of these parameters. outputParameters must be NULL for input-only streams. - + @param sampleRate The desired sampleRate. For full-duplex streams it is the sample rate for both input and output - + @param framesPerBuffer The number of frames passed to the stream callback function, or the preferred block granularity for a blocking read/write stream. The special value paFramesPerBufferUnspecified (0) may be used to request that @@ -811,11 +809,11 @@ typedef int PaStreamCallback( will be kept to the theoretical minimum however, it is strongly recommended that a non-zero framesPerBuffer value only be used when your algorithm requires a fixed number of frames per stream callback. - + @param streamFlags Flags which modify the behavior of the streaming process. This parameter may contain a combination of flags ORed together. Some flags may only be relevant to certain buffer formats. - + @param streamCallback A pointer to a client supplied function that is responsible for processing and filling input and output buffers. If this parameter is NULL the stream will be opened in 'blocking read/write' mode. In blocking mode, @@ -828,7 +826,7 @@ typedef int PaStreamCallback( function. It could for example, contain a pointer to instance data necessary for processing the audio buffers. This parameter is ignored if streamCallback is NULL. - + @return Upon success Pa_OpenStream() returns paNoError and places a pointer to a valid PaStream in the stream argument. The stream is inactive (stopped). @@ -853,7 +851,7 @@ PaError Pa_OpenStream( PaStream** stream, @param stream The address of a PaStream pointer which will receive a pointer to the newly opened stream. - + @param numInputChannels The number of channels of sound that will be supplied to the stream callback or returned by Pa_ReadStream. It can range from 1 to the value of maxInputChannels in the PaDeviceInfo record for the default input @@ -868,7 +866,7 @@ PaError Pa_OpenStream( PaStream** stream, provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. sampleFormat may be any of the formats described by the PaSampleFormat enumeration. - + @param sampleRate Same as Pa_OpenStream parameter of the same name. @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. @param streamCallback Same as Pa_OpenStream parameter of the same name. @@ -894,7 +892,7 @@ PaError Pa_OpenDefaultStream( PaStream** stream, PaError Pa_CloseStream( PaStream *stream ); -/** Functions of type PaStreamFinishedCallback are implemented by PortAudio +/** Functions of type PaStreamFinishedCallback are implemented by PortAudio clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback function. Once registered they are called when the stream becomes inactive (ie once a call to Pa_StopStream() will not block). @@ -903,7 +901,7 @@ PaError Pa_CloseStream( PaStream *stream ); output, if the stream callback returns paComplete, or Pa_StopStream is called, the stream finished callback will not be called until all generated sample data has been played. - + @param userData The userData parameter supplied to Pa_OpenStream() @see Pa_SetStreamFinishedCallback @@ -911,12 +909,12 @@ PaError Pa_CloseStream( PaStream *stream ); typedef void PaStreamFinishedCallback( void *userData ); -/** Register a stream finished callback function which will be called when the - stream becomes inactive. See the description of PaStreamFinishedCallback for +/** Register a stream finished callback function which will be called when the + stream becomes inactive. See the description of PaStreamFinishedCallback for further details about when the callback will be called. @param stream a pointer to a PaStream that is in the stopped state - if the - stream is not stopped, the stream's finished callback will remain unchanged + stream is not stopped, the stream's finished callback will remain unchanged and an error code will be returned. @param streamFinishedCallback a pointer to a function with the same signature @@ -929,7 +927,7 @@ typedef void PaStreamFinishedCallback( void *userData ); @see PaStreamFinishedCallback */ -PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); /** Commences audio processing. @@ -1014,7 +1012,7 @@ typedef struct PaStreamInfo parameter passed to Pa_OpenStream(). */ double sampleRate; - + } PaStreamInfo; @@ -1036,15 +1034,15 @@ const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); /** Returns the current time in seconds for a stream according to the same clock used to generate callback PaStreamCallbackTimeInfo timestamps. The time values are - monotonically increasing and have unspecified origin. - + monotonically increasing and have unspecified origin. + Pa_GetStreamTime returns valid time values for the entire life of the stream, from when the stream is opened until it is closed. Starting and stopping the stream does not affect the passage of time returned by Pa_GetStreamTime. - This time may be used for synchronizing other events to the audio stream, for + This time may be used for synchronizing other events to the audio stream, for example synchronizing audio to MIDI. - + @return The stream's current time in seconds, or 0 if an error occurred. @see PaTime, PaStreamCallback, PaStreamCallbackTimeInfo @@ -1059,7 +1057,7 @@ PaTime Pa_GetStreamTime( PaStream *stream ); This function may be called from the stream callback function or the application. - + @return A floating point value, typically between 0.0 and 1.0, where 1.0 indicates that the stream callback is consuming the maximum number of CPU cycles possible @@ -1076,12 +1074,12 @@ double Pa_GetStreamCpuLoad( PaStream* stream ); system to supply the data. @param stream A pointer to an open stream previously created with Pa_OpenStream. - + @param buffer A pointer to a buffer of sample frames. The buffer contains samples in the format specified by the inputParameters->sampleFormat field used to open the stream, and the number of channels specified by inputParameters->numChannels. If non-interleaved samples were requested using - the paNonInterleaved sample format flag, buffer is a pointer to the first element + the paNonInterleaved sample format flag, buffer is a pointer to the first element of an array of buffer pointers, one non-interleaved buffer for each channel. @param frames The number of frames to be read into buffer. This parameter @@ -1107,7 +1105,7 @@ PaError Pa_ReadStream( PaStream* stream, samples in the format specified by the outputParameters->sampleFormat field used to open the stream, and the number of channels specified by outputParameters->numChannels. If non-interleaved samples were requested using - the paNonInterleaved sample format flag, buffer is a pointer to the first element + the paNonInterleaved sample format flag, buffer is a pointer to the first element of an array of buffer pointers, one non-interleaved buffer for each channel. @param frames The number of frames to be written from buffer. This parameter diff --git a/fdmdv2/fdmdv2.mk b/fdmdv2/fdmdv2.mk index 5cba256e..7e6365db 100644 --- a/fdmdv2/fdmdv2.mk +++ b/fdmdv2/fdmdv2.mk @@ -2,10 +2,10 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=fdmdv2 -ConfigurationName :=Release -IntermediateDirectory :=./Release +ConfigurationName :=Debug +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) WorkspacePath := "C:\Users\wittend\Projects\Radio\fdmdv2" ProjectPath := "C:\Users\wittend\Projects\Radio\fdmdv2" @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=5/30/2012 +Date :=6/12/2012 CodeLitePath :="C:\Program Files\CodeLite" LinkerName :=g++ ArchiveTool :=ar rcus @@ -38,9 +38,9 @@ PreprocessOnlySwitch :=-E ObjectsFileList :="C:\Users\wittend\Projects\Radio\fdmdv2\fdmdv2.txt" PCHCompileFlags := MakeDirCommand :=makedir -CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -C_CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes) +CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +C_CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes) IncludePath := $(IncludeSwitch). $(IncludeSwitch)./extern/include IncludePCH := RcIncludePath := @@ -56,7 +56,7 @@ WXWIN:=C:\bin\wxWidgets-2.9.2 PATH:=$(WXWIN)\lib\gcc_dll;$(PATH) WXCFG:=gcc_dll\mswu UNIT_TEST_PP_SRC_DIR:=C:\bin\UnitTest++-1.3 -Objects=$(IntermediateDirectory)/topFrame$(ObjectSuffix) $(IntermediateDirectory)/dlg_about$(ObjectSuffix) $(IntermediateDirectory)/dlg_audio$(ObjectSuffix) $(IntermediateDirectory)/dlg_options$(ObjectSuffix) $(IntermediateDirectory)/dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix) +Objects=$(IntermediateDirectory)/topFrame$(ObjectSuffix) $(IntermediateDirectory)/dlg_about$(ObjectSuffix) $(IntermediateDirectory)/dlg_audio$(ObjectSuffix) $(IntermediateDirectory)/dlg_options$(ObjectSuffix) $(IntermediateDirectory)/dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/paclass$(ObjectSuffix) ## ## Main Build Targets @@ -71,7 +71,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -135,6 +135,14 @@ $(IntermediateDirectory)/fdmdv2_main$(DependSuffix): fdmdv2_main.cpp $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix): fdmdv2_main.cpp @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/fdmdv2_main.cpp" +$(IntermediateDirectory)/paclass$(ObjectSuffix): paclass.cpp $(IntermediateDirectory)/paclass$(DependSuffix) + $(CompilerName) $(IncludePCH) $(SourceSwitch) "C:/Users/wittend/Projects/Radio/fdmdv2/paclass.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/paclass$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/paclass$(DependSuffix): paclass.cpp + @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/paclass$(ObjectSuffix) -MF$(IntermediateDirectory)/paclass$(DependSuffix) -MM "C:/Users/wittend/Projects/Radio/fdmdv2/paclass.cpp" + +$(IntermediateDirectory)/paclass$(PreprocessSuffix): paclass.cpp + @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/paclass$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/paclass.cpp" + -include $(IntermediateDirectory)/*$(DependSuffix) ## @@ -162,8 +170,11 @@ clean: $(RM) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix) $(RM) $(IntermediateDirectory)/fdmdv2_main$(DependSuffix) $(RM) $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix) + $(RM) $(IntermediateDirectory)/paclass$(ObjectSuffix) + $(RM) $(IntermediateDirectory)/paclass$(DependSuffix) + $(RM) $(IntermediateDirectory)/paclass$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-release\fdmdv2" + $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-debug\fdmdv2" diff --git a/fdmdv2/fdmdv2.project b/fdmdv2/fdmdv2.project index 24882cce..97f3a779 100644 --- a/fdmdv2/fdmdv2.project +++ b/fdmdv2/fdmdv2.project @@ -15,26 +15,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -50,6 +31,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -68,11 +72,16 @@ + + + + + @@ -99,7 +108,7 @@ - + @@ -143,7 +152,7 @@ - + diff --git a/fdmdv2/fdmdv2.txt b/fdmdv2/fdmdv2.txt index 132b2279..fce2d890 100644 --- a/fdmdv2/fdmdv2.txt +++ b/fdmdv2/fdmdv2.txt @@ -1 +1 @@ -./Release/topFrame.o ./Release/dlg_about.o ./Release/dlg_audio.o ./Release/dlg_options.o ./Release/dlg_comports.o ./Release/fdmdv2_plot.o ./Release/fdmdv2_main.o +./Debug/topFrame.o ./Debug/dlg_about.o ./Debug/dlg_audio.o ./Debug/dlg_options.o ./Debug/dlg_comports.o ./Debug/fdmdv2_plot.o ./Debug/fdmdv2_main.o ./Debug/paclass.o diff --git a/fdmdv2/fdmdv2.workspace b/fdmdv2/fdmdv2.workspace index 1ac9a3cf..75a4c32d 100644 --- a/fdmdv2/fdmdv2.workspace +++ b/fdmdv2/fdmdv2.workspace @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/fdmdv2/fdmdv2_main.cpp b/fdmdv2/fdmdv2_main.cpp index f6c474ca..ae28ff61 100644 --- a/fdmdv2/fdmdv2_main.cpp +++ b/fdmdv2/fdmdv2_main.cpp @@ -19,7 +19,6 @@ // initialize the application IMPLEMENT_APP(MainApp); -// `Main program' equivalent: the program execution "starts" here //------------------------------------------------------------------------- // OnInit() //------------------------------------------------------------------------- @@ -53,23 +52,36 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent) // m_bitmap = bitmap; m_sound = NULL; m_zoom = 1.; + m_SquelchActive = false; } +//------------------------------------------------------------------------- +// ~MainFrame() +//------------------------------------------------------------------------- MainFrame::~MainFrame() { } +//------------------------------------------------------------------------- +// OnCloseFrame() +//------------------------------------------------------------------------- void MainFrame::OnCloseFrame(wxCloseEvent& event) { Destroy(); } +//------------------------------------------------------------------------- +// OnExitClick() +//------------------------------------------------------------------------- void MainFrame::OnExitClick(wxCommandEvent& event) { Destroy(); } +//------------------------------------------------------------------------- +// OnPaint() +//------------------------------------------------------------------------- void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -83,33 +95,59 @@ void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.DrawBitmap(m_bitmap, dc.DeviceToLogicalX((size.x - m_zoom * m_bitmap.GetWidth()) / 2), dc.DeviceToLogicalY((size.y - m_zoom * m_bitmap.GetHeight()) / 2), true); } +//------------------------------------------------------------------------- +// OnCmdSliderScroll() +//------------------------------------------------------------------------- void MainFrame::OnCmdSliderScroll(wxScrollEvent& event) { event.Skip(); } +//------------------------------------------------------------------------- +// OnCmdSliderScrollChanged() +//------------------------------------------------------------------------- void MainFrame::OnCmdSliderScrollChanged(wxScrollEvent& event) { event.Skip(); } +//------------------------------------------------------------------------- +// OnSliderScrollTop() +//------------------------------------------------------------------------- void MainFrame::OnSliderScrollTop(wxScrollEvent& event) { event.Skip(); } +//------------------------------------------------------------------------- +// OnSliderScrollBottom() +//------------------------------------------------------------------------- void MainFrame::OnSliderScrollBottom(wxScrollEvent& event) { wxMessageBox(wxT("Got Click!"), wxT("OnSliderScrollBottom"), wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnCheckSQClick() +//------------------------------------------------------------------------- void MainFrame::OnCheckSQClick(wxCommandEvent& event) { - wxMessageBox(wxT("Got Click!"), wxT("OnCheckSQClick"), wxOK); - event.Skip(); + if(!m_SquelchActive) + { + m_SquelchActive = true; + //wxMessageBox(wxT("Squelch On!"), wxT("Squelch On"), wxOK); + } + else + { + m_SquelchActive = false; + //wxMessageBox(wxT("Squelch Off!"), wxT("Squelch Off"), wxOK); + } } +//------------------------------------------------------------------------- +// OnTogBtnTXClick() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnTXClick(wxCommandEvent& event) { m_soundFile = wxT("./hts1a.wav"); @@ -117,161 +155,394 @@ void MainFrame::OnTogBtnTXClick(wxCommandEvent& event) m_sound->Play(); } +//------------------------------------------------------------------------- +// OnTogBtnRxID() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnRxID(wxCommandEvent& event) { wxMessageBox("Got Click!", "OnTogBtnRxID", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnTogBtnTxID() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnTxID(wxCommandEvent& event) { wxMessageBox("Got Click!", "OnTogBtnTxID", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnTogBtnSplitClick() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnSplitClick(wxCommandEvent& event) { wxMessageBox("Got Click!", "OnTogBtnSplitClick", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnTogBtnAnalogClick() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnAnalogClick (wxCommandEvent& event) { wxMessageBox("Got Click!", "OnTogBtnAnalogClick", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnTogBtnALCClick() +//------------------------------------------------------------------------- void MainFrame::OnTogBtnALCClick(wxCommandEvent& event) { wxMessageBox("Got Click!", "OnTogBtnALCClick", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// audioCallback() +//------------------------------------------------------------------------- +static int audioCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *outTime, + PaStreamCallbackFlags statusFlags, + void *userData + ) +{ + float *out = (float *) outputBuffer; + float *in = (float *) inputBuffer; + float leftInput; + float rightInput; + unsigned int i; + + if(inputBuffer == NULL) + { + return 0; + } + // Read input buffer, process data, and fill output buffer. + for(i = 0; i < framesPerBuffer; i++) + { + leftInput = *in++; // Get interleaved samples from input buffer. + rightInput = *in++; + *out++ = leftInput * rightInput; // ring modulation + *out++ = 0.5f * (leftInput + rightInput); // mixing + } + return paContinue; // 0; +} + +/* +#define FUZZ(x) CubicAmplifier(CubicAmplifier(CubicAmplifier(CubicAmplifier(x)))) +static int gNumNoInputs = 0; +//------------------------------------------------------------------------- +// fuzzCallback() +//------------------------------------------------------------------------- +static int fuzzCallback(const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData) +{ + SAMPLE *out = (SAMPLE*)outputBuffer; + const SAMPLE *in = (const SAMPLE*)inputBuffer; + unsigned int i; + (void) timeInfo; // Prevent unused variable warnings. + (void) statusFlags; + (void) userData; + + if(inputBuffer == NULL) + { + for(i = 0; i < framesPerBuffer; i++) + { + *out++ = 0; // left - silent + *out++ = 0; // right - silent + } + gNumNoInputs += 1; + } + else + { + for(i = 0; i < framesPerBuffer; i++) + { + *out++ = FUZZ(*in++); // left - distorted + *out++ = *in++; // right - clean + } + } + return paContinue; +} +*/ + +//------------------------------------------------------------------------- +// OnTogBtnOnOff() +//------------------------------------------------------------------------- +void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) +{ + PortAudioWrap pa; + if(!m_radioRunning) + { + m_radioRunning = true; + pa = PortAudioWrap(); + err = pa.init(); + + inputDevice = pa.getDefaultInputDevice(); // default input device + if(inputDevice == paNoDevice) + { + wxMessageBox("Error: No default input device.", "Error", wxOK); + return; + } + err = pa.setInputDevice(inputDevice); + err = pa.setInputChannelCount(2); // stereo input + err = pa.setInputSampleFormat(PA_SAMPLE_TYPE); + err = pa.setInputLatency(pa.getInputDefaultLowLatency()); + pa.setInputHostApiStreamInfo(NULL); + + outputDevice = pa.getDefaultOutputDevice(); // default output device + if (outputDevice == paNoDevice) + { + wxMessageBox("Error: No default output device.", "Error", wxOK); + return; + } + err = pa.setOutputDevice(outputDevice); + err = pa.setOutputChannelCount(2); // stereo input + err = pa.setOutputSampleFormat(PA_SAMPLE_TYPE); + + err = pa.setOutputLatency(pa.getOutputDefaultLowLatency()); + pa.setOutputHostApiStreamInfo(NULL); + + err = pa.setFramesPerBuffer(FRAMES_PER_BUFFER); + err = pa.setSampleRate(SAMPLE_RATE); + err = pa.setStreamFlags(0); + err = pa.setCallback(audioCallback); + err = pa.streamOpen(); + + if(err != paNoError) + { + wxMessageBox("Open/Setup error.", "Error", wxOK); + return; + } + err = pa.streamStart(); + if(err != paNoError) + { + wxMessageBox("Stream Start Error.", "Error", wxOK); + return; + } + m_togBtnOnOff->SetLabel(wxT("Stop")); + } + else + { + m_radioRunning = false; + pa.terminate(); + m_togBtnOnOff->SetLabel(wxT("Start")); + } +} + +//------------------------------------------------------------------------- +// OnOpen() +//------------------------------------------------------------------------- void MainFrame::OnOpen( wxCommandEvent& event ) { - wxMessageBox("Got Click!", "OnOpen", wxOK); - event.Skip(); + if(m_sound != NULL) + { + if (wxMessageBox(wxT("Current content has not been saved! Proceed?"),wxT("Please confirm"), wxICON_QUESTION | wxYES_NO, this) == wxNO ) + { + return; + } + } + wxFileDialog openFileDialog(this, + wxT("Open Sound file"), + wxEmptyString, + wxEmptyString, + wxT("WAV files (*.wav)|*.wav|") + wxT("RAW files (*.raw)|*.raw|") + wxT("SPEEX files (*.spx)|*.spx|") + wxT("FLAC files (*.flc)|*.flc|") + wxT("All files (*.*)|*.*|"), + wxFD_OPEN | wxFD_FILE_MUST_EXIST); + if (openFileDialog.ShowModal() == wxID_CANCEL) + { + return; // the user changed idea... + } + // proceed loading the file chosen by the user; + m_sound->Play(openFileDialog.GetPath()); +/* + // this can be done with e.g. wxWidgets input streams: + wxFileInputStream input_stream(openFileDialog.GetPath()); + if (!input_stream.IsOk()) + { + wxLogError("Cannot open file '%s'.", openFileDialog.GetPath()); + return; + } +*/ } +//------------------------------------------------------------------------- +// OnOpenUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnOpenUpdateUI( wxUpdateUIEvent& event ) { // wxMessageBox("Got Click!", "OnOpenUpdateUI", wxOK); // event.Skip(); } +//------------------------------------------------------------------------- +// OnSaveUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnSaveUpdateUI( wxUpdateUIEvent& event ) { // wxMessageBox("Got Click!", "OnSaveUpdateUI", wxOK); // event.Skip(); } +//------------------------------------------------------------------------- +// OnClose() +//------------------------------------------------------------------------- void MainFrame::OnClose( wxCommandEvent& event ) { if(m_sound != NULL) { // if(m_sound->IsPlaying()) // { - m_sound->Stop(); - m_sound = NULL; + m_sound->Stop(); + m_sound = NULL; // } } // wxMessageBox("Got Click!", "OnClose", wxOK); // event.Skip(); } +//------------------------------------------------------------------------- +// OnCloseUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnCloseUpdateUI( wxUpdateUIEvent& event ) { -// wxMessageBox("Got Click!", "OnCloseUpdateUI", wxOK); -// event.Skip(); } +//------------------------------------------------------------------------- +// OnExit() +//------------------------------------------------------------------------- void MainFrame::OnExit( wxCommandEvent& event ) { wxMessageBox("Got Click!", "OnExit", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnCopy() +//------------------------------------------------------------------------- void MainFrame::OnCopy( wxCommandEvent& event ) { wxMessageBox("Got Click!", "OnCopy", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnCopyUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnCopyUpdateUI( wxUpdateUIEvent& event ) { -// wxMessageBox("Got Click!", "OnCopyUpdateUI", wxOK); -// event.Skip(); } +//------------------------------------------------------------------------- +// OnCut() +//------------------------------------------------------------------------- void MainFrame::OnCut( wxCommandEvent& event ) { wxMessageBox("Got Click!", "OnCut", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnCutUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnCutUpdateUI( wxUpdateUIEvent& event ) { -// wxMessageBox("Got Click!", "OnCutUpdateUI", wxOK); -// event.Skip(); } +//------------------------------------------------------------------------- +// OnPaste() +//------------------------------------------------------------------------- void MainFrame::OnPaste( wxCommandEvent& event ) { wxMessageBox("Got Click!", "OnPaste", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnPasteUpdateUI() +//------------------------------------------------------------------------- void MainFrame::OnPasteUpdateUI( wxUpdateUIEvent& event ) { -// wxMessageBox("Got Click!", "OnPasteUpdateUI", wxOK); -// event.Skip(); } +//------------------------------------------------------------------------- +// OnToolsOptions() +//------------------------------------------------------------------------- void MainFrame::OnToolsOptions( wxCommandEvent& event ) { OptionsDlg *dlg = new OptionsDlg(NULL); dlg->ShowModal(); } +//------------------------------------------------------------------------- +// OnToolsOptionsUI() +//------------------------------------------------------------------------- void MainFrame::OnToolsOptionsUI( wxUpdateUIEvent& event ) { -// OptionsDlg *dlg = new OptionsDlg(NULL); -// dlg->ShowModal(); } +//------------------------------------------------------------------------- +// OnToolsAudio() +//------------------------------------------------------------------------- void MainFrame::OnToolsAudio( wxCommandEvent& event ) { AudioDlg *dlg = new AudioDlg(NULL); dlg->ShowModal(); } +//------------------------------------------------------------------------- +// OnToolsAudioUI() +//------------------------------------------------------------------------- void MainFrame::OnToolsAudioUI( wxUpdateUIEvent& event ) { -// OptionsDlg *dlg = new OptionsDlg(NULL); -// dlg->ShowModal(); } +//------------------------------------------------------------------------- +// OnToolsComCfg() +//------------------------------------------------------------------------- void MainFrame::OnToolsComCfg( wxCommandEvent& event ) { ComPortsDlg *dlg = new ComPortsDlg(NULL); dlg->ShowModal(); } +//------------------------------------------------------------------------- +// OnToolsComCfgUI() +//------------------------------------------------------------------------- void MainFrame::OnToolsComCfgUI( wxUpdateUIEvent& event ) { event.Enable(!m_radioRunning); } +//------------------------------------------------------------------------- +// OnHelpCheckUpdates() +//------------------------------------------------------------------------- void MainFrame::OnHelpCheckUpdates( wxCommandEvent& event ) { wxMessageBox("Got Click!", "OnHelpCheckUpdates", wxOK); event.Skip(); } +//------------------------------------------------------------------------- +// OnHelpCheckUpdatesUI() +//------------------------------------------------------------------------- void MainFrame::OnHelpCheckUpdatesUI( wxUpdateUIEvent& event ) { } +//------------------------------------------------------------------------- +// OnHelpAbout() +//------------------------------------------------------------------------- void MainFrame::OnHelpAbout( wxCommandEvent& event ) { AboutDlg *dlg = new AboutDlg(NULL); @@ -279,6 +550,9 @@ void MainFrame::OnHelpAbout( wxCommandEvent& event ) } +//------------------------------------------------------------------------- +// LoadUserImage() +//------------------------------------------------------------------------- wxString MainFrame::LoadUserImage(wxImage& image) { wxString filename; @@ -295,22 +569,21 @@ wxString MainFrame::LoadUserImage(wxImage& image) return filename; } +//------------------------------------------------------------------------- +// OnSave() +//------------------------------------------------------------------------- void MainFrame::OnSave(wxCommandEvent& WXUNUSED(event)) { wxImage image = m_bitmap.ConvertToImage(); - wxString savefilename = wxFileSelector(wxT("Save Image"), + wxString savefilename = wxFileSelector(wxT("Save Sound File"), wxEmptyString, wxEmptyString, (const wxChar *)NULL, - wxT("BMP files (*.bmp)|*.bmp|") - wxT("PNG files (*.png)|*.png|") - wxT("JPEG files (*.jpg)|*.jpg|") - wxT("GIF files (*.gif)|*.gif|") - wxT("TIFF files (*.tif)|*.tif|") - wxT("PCX files (*.pcx)|*.pcx|") - wxT("ICO files (*.ico)|*.ico|") - wxT("CUR files (*.cur)|*.cur"), + wxT("WAV files (*.wav)|*.wav|") + wxT("RAW files (*.raw)|*.raw|") + wxT("SPEEX files (*.spx)|*.spx|") + wxT("FLAC files (*.flc)|*.flc|"), wxFD_SAVE, this); diff --git a/fdmdv2/fdmdv2_main.h b/fdmdv2/fdmdv2_main.h index 28b8f7e0..097914e4 100644 --- a/fdmdv2/fdmdv2_main.h +++ b/fdmdv2/fdmdv2_main.h @@ -10,8 +10,8 @@ #ifndef __FDMDV2_MAIN__ #define __FDMDV2_MAIN__ -#include -#include "wx/image.h" +#include + #include "wx/file.h" #include "wx/filename.h" #include "wx/graphics.h" @@ -23,8 +23,13 @@ #include "wx/versioninfo.h" #include #include +#include "libsndfile/include/sndfile.h" +#include "extern/include/portaudio.h" +#include "paclass.h" +//#include "extern/include/portaudiocpp/PortAudioCpp.hxx" #include "topFrame.h" +#include "codec2.h" #include "dlg_about.h" #include "dlg_audio.h" #include "dlg_options.h" @@ -55,7 +60,7 @@ class MainApp : public wxApp return 0; } - protected: + protected: //void DeleteBitmaps(); //bool LoadImages(); }; @@ -71,11 +76,22 @@ class MainFrame : public TopFrame public: MainFrame(wxWindow *parent); virtual ~MainFrame(); - DrawPanel* m_panelSpectrum; - DrawPanel* m_panelWaterfall; - DrawPanel* m_panelExtra1; - DrawPanel* m_panelExtra2; - bool m_radioRunning; + DrawPanel* m_panelSpectrum; + DrawPanel* m_panelWaterfall; + DrawPanel* m_panelExtra1; + DrawPanel* m_panelExtra2; + bool m_radioRunning; + bool m_SquelchActive; + CODEC2 *m_RXCodec2; + CODEC2 *m_TXCodec2; + PaError err; + PaDeviceIndex inputDevice; + PaDeviceIndex outputDevice; + +// PortAudioWrap stream; +// portaudio::AutoSystem autoSys; +// portaudio::System *sys; // = portaudio::System::instance(); +// StreamParameters void DoStartThread(); void DoPauseThread(); @@ -126,7 +142,7 @@ class MainFrame : public TopFrame void OnTogBtnRxID( wxCommandEvent& event ); void OnTogBtnTxID( wxCommandEvent& event ); void OnTogBtnTXClick( wxCommandEvent& event ); - + void OnTogBtnOnOff( wxCommandEvent& event ); void OnPaint(wxPaintEvent& event); void OnClose( wxCloseEvent& event ); void OnSize( wxSizeEvent& event ); diff --git a/fdmdv2/fdmdv2_wsp.mk b/fdmdv2/fdmdv2_wsp.mk index 359a9f63..b319cb16 100644 --- a/fdmdv2/fdmdv2_wsp.mk +++ b/fdmdv2/fdmdv2_wsp.mk @@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo ----------Building project:[ fdmdv2 - Release ]---------- - @"mingw32-make.exe" -j 2 -f "fdmdv2.mk" + @echo ----------Building project:[ test_sndfile - Debug ]---------- + @cd "libsndfile\Projects\w32-mingw" && "mingw32-make.exe" -j 2 -f "test_sndfile.mk" clean: - @echo ----------Cleaning project:[ fdmdv2 - Release ]---------- - @"mingw32-make.exe" -j 2 -f "fdmdv2.mk" clean + @echo ----------Cleaning project:[ test_sndfile - Debug ]---------- + @cd "libsndfile\Projects\w32-mingw" && "mingw32-make.exe" -j 2 -f "test_sndfile.mk" clean diff --git a/fdmdv2/hamlib-3.0/test_hamlib/test_hamlib.mk b/fdmdv2/hamlib-3.0/test_hamlib/test_hamlib.mk index 3831fe3b..62c1be1e 100644 --- a/fdmdv2/hamlib-3.0/test_hamlib/test_hamlib.mk +++ b/fdmdv2/hamlib-3.0/test_hamlib/test_hamlib.mk @@ -2,10 +2,10 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=test_hamlib -ConfigurationName :=Release -IntermediateDirectory :=./Release +ConfigurationName :=Debug +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) WorkspacePath := "C:\Users\wittend\Projects\Radio\fdmdv2" ProjectPath := "C:\Users\wittend\Projects\Radio\fdmdv2\hamlib-3.0\test_hamlib" @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=5/13/2012 +Date :=6/12/2012 CodeLitePath :="C:\Program Files\CodeLite" LinkerName :=g++ ArchiveTool :=ar rcus @@ -38,9 +38,9 @@ PreprocessOnlySwitch :=-E ObjectsFileList :="C:\Users\wittend\Projects\Radio\fdmdv2\hamlib-3.0\test_hamlib\test_hamlib.txt" PCHCompileFlags := MakeDirCommand :=makedir -CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -C_CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -LinkOptions := -s $(shell wx-config --debug=no --libs --unicode=yes) +CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +C_CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +LinkOptions := $(shell wx-config --debug=yes --libs --unicode=yes) IncludePath := $(IncludeSwitch). $(IncludeSwitch)../include/ IncludePCH := RcIncludePath := @@ -71,7 +71,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -98,6 +98,6 @@ clean: $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-release\test_hamlib" + $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-debug\test_hamlib" diff --git a/fdmdv2/libsndfile/Projects/w32-mingw/test_sndfile.mk b/fdmdv2/libsndfile/Projects/w32-mingw/test_sndfile.mk index 229b530c..042ee3b7 100644 --- a/fdmdv2/libsndfile/Projects/w32-mingw/test_sndfile.mk +++ b/fdmdv2/libsndfile/Projects/w32-mingw/test_sndfile.mk @@ -2,10 +2,10 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=test_sndfile -ConfigurationName :=Release -IntermediateDirectory :=./Release +ConfigurationName :=Debug +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) WorkspacePath := "C:\Users\wittend\Projects\Radio\fdmdv2" ProjectPath := "C:\Users\wittend\Projects\Radio\fdmdv2\libsndfile\Projects\w32-mingw" @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=5/24/2012 +Date :=6/12/2012 CodeLitePath :="C:\Program Files\CodeLite" LinkerName :=g++ ArchiveTool :=ar rcus @@ -38,8 +38,8 @@ PreprocessOnlySwitch :=-E ObjectsFileList :="C:\Users\wittend\Projects\Radio\fdmdv2\libsndfile\Projects\w32-mingw\test_sndfile.txt" PCHCompileFlags := MakeDirCommand :=makedir -CmpOptions := -O2 -Wall $(Preprocessors) -C_CmpOptions := -O2 -Wall $(Preprocessors) +CmpOptions := -g -O0 -Wall $(Preprocessors) +C_CmpOptions := -g -O0 -Wall $(Preprocessors) LinkOptions := IncludePath := $(IncludeSwitch). $(IncludeSwitch). IncludePCH := @@ -71,7 +71,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -98,6 +98,6 @@ clean: $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-release\test_sndfile" + $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-debug\test_sndfile" diff --git a/fdmdv2/pa_cppbinding_test/pa_cppbinding_test.mk b/fdmdv2/pa_cppbinding_test/pa_cppbinding_test.mk index 13c340c7..f2c5c878 100644 --- a/fdmdv2/pa_cppbinding_test/pa_cppbinding_test.mk +++ b/fdmdv2/pa_cppbinding_test/pa_cppbinding_test.mk @@ -2,10 +2,10 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=pa_cppbinding_test -ConfigurationName :=Release -IntermediateDirectory :=./Release +ConfigurationName :=Debug +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) WorkspacePath := "C:\Users\wittend\Projects\Radio\fdmdv2" ProjectPath := "C:\Users\wittend\Projects\Radio\fdmdv2\pa_cppbinding_test" @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=5/29/2012 +Date :=6/12/2012 CodeLitePath :="C:\Program Files\CodeLite" LinkerName :=g++ ArchiveTool :=ar rcus @@ -38,13 +38,13 @@ PreprocessOnlySwitch :=-E ObjectsFileList :="C:\Users\wittend\Projects\Radio\fdmdv2\pa_cppbinding_test\pa_cppbinding_test.txt" PCHCompileFlags := MakeDirCommand :=makedir -CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -C_CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) -LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes) -IncludePath := $(IncludeSwitch). $(IncludeSwitch)./ $(IncludeSwitch)C:/bin/MinGW/msys/1.0/local/include $(IncludeSwitch)./portaudiocpp +CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +C_CmpOptions := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes) +IncludePath := $(IncludeSwitch). IncludePCH := RcIncludePath := -Libs := $(LibrarySwitch)portaudiocpp-0 $(LibrarySwitch)portaudio-2 +Libs := $(LibrarySwitch)portaudiocpp.la $(LibrarySwitch)portaudio.la LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch). @@ -71,7 +71,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -109,6 +109,6 @@ clean: $(RM) $(IntermediateDirectory)/main$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-release\pa_cppbinding_test" + $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-debug\pa_cppbinding_test" diff --git a/fdmdv2/pa_test/pa_class.cpp b/fdmdv2/pa_test/pa_class.cpp index 694ca7cf..1a815869 100644 --- a/fdmdv2/pa_test/pa_class.cpp +++ b/fdmdv2/pa_test/pa_class.cpp @@ -100,32 +100,32 @@ PaDeviceIndex PortAudioWrap::getDefaultOutputDevice() PaError PortAudioWrap::setInputChannelCount(int count) { - if(!isActive()) - { +// if(!isActive()) +// { inputBuffer.channelCount = count; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format) { - if(!isActive()) - { +// if(!isActive()) +// { inputBuffer.sampleFormat = format; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setInputLatency(PaTime latency) { - if(!isActive()) - { +// if(!isActive()) +// { inputBuffer.suggestedLatency = latency; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } void PortAudioWrap::setInputHostApiStreamInfo(void *info) @@ -140,32 +140,32 @@ PaTime PortAudioWrap::getInputDefaultLowLatency() PaError PortAudioWrap::setOutputChannelCount(int count) { - if(!isActive()) - { +// if(!isActive()) +// { outputBuffer.channelCount = count; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format) { - if(!isActive()) - { +// if(!isActive()) +// { outputBuffer.sampleFormat = format; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setOutputLatency(PaTime latency) { - if(!isOpen()) - { +// if(!isOpen()) +// { outputBuffer.suggestedLatency = latency; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } void PortAudioWrap::setOutputHostApiStreamInfo(void *info) @@ -180,62 +180,62 @@ PaTime PortAudioWrap::getOutputDefaultLowLatency() PaError PortAudioWrap::setFramesPerBuffer(unsigned long size) { - if(!isOpen()) - { +// if(!isOpen()) +// { framesPerBuffer = size; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setSampleRate(unsigned long rate) { - if(!isOpen()) - { +// if(!isOpen()) +// { samplerate = rate; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags) { - if(!isOpen()) - { +// if(!isOpen()) +// { statusFlags = flags; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setInputDevice(PaDeviceIndex flags) { - if(!isOpen()) - { +// if(!isOpen()) +// { inputDevice = flags; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setOutputDevice(PaDeviceIndex flags) { - if(!isOpen()) - { +// if(!isOpen()) +// { outputDevice = flags; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } PaError PortAudioWrap::setCallback(PaStreamCallback *callback) { - if(!isOpen()) - { +// if(!isOpen()) +// { streamCallback = callback; return paNoError; - } - return paStreamIsNotStopped; +// } +// return paStreamIsNotStopped; } diff --git a/fdmdv2/pa_test/pa_class.h b/fdmdv2/pa_test/pa_class.h index a1d29597..e565e9dd 100644 --- a/fdmdv2/pa_test/pa_class.h +++ b/fdmdv2/pa_test/pa_class.h @@ -20,18 +20,18 @@ class PortAudioWrap ~PortAudioWrap(); private: - PaStream *stream; - PaStreamParameters inputBuffer; - PaStreamParameters outputBuffer; - void *userData; - int samplerate; - unsigned long framesPerBuffer; - PaStreamCallbackFlags statusFlags; - PaStreamCallback *streamCallback; - PaStreamFinishedCallback *streamFinishedCallback; - const PaStreamCallbackTimeInfo* timeInfo; - PaDeviceIndex inputDevice; - PaDeviceIndex outputDevice; + PaStream *stream; + PaStreamParameters inputBuffer; + PaStreamParameters outputBuffer; + void *userData; + int samplerate; + unsigned long framesPerBuffer; + PaStreamCallbackFlags statusFlags; + PaStreamCallback *streamCallback; + PaStreamFinishedCallback *streamFinishedCallback; + const PaStreamCallbackTimeInfo *timeInfo; + PaDeviceIndex inputDevice; + PaDeviceIndex outputDevice; public: diff --git a/fdmdv2/pa_test/pa_test.mk b/fdmdv2/pa_test/pa_test.mk index 8306337d..9f7391ef 100644 --- a/fdmdv2/pa_test/pa_test.mk +++ b/fdmdv2/pa_test/pa_test.mk @@ -7,13 +7,13 @@ ProjectName :=pa_test ConfigurationName :=Debug IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) -WorkspacePath := "C:\Users\wittend\Projects\audio\portaudio_test\paEcho" -ProjectPath := "C:\Users\wittend\Projects\audio\portaudio_test\paEcho\pa_test" +WorkspacePath := "C:\Users\wittend\Projects\Radio\fdmdv2" +ProjectPath := "C:\Users\wittend\Projects\Radio\fdmdv2\pa_test" CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=5/15/2012 +Date :=6/12/2012 CodeLitePath :="C:\Program Files\CodeLite" LinkerName :=g++ ArchiveTool :=ar rcus @@ -35,13 +35,13 @@ Preprocessors := ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E -ObjectsFileList :="C:\Users\wittend\Projects\audio\portaudio_test\paEcho\pa_test\pa_test.txt" +ObjectsFileList :="C:\Users\wittend\Projects\Radio\fdmdv2\pa_test\pa_test.txt" PCHCompileFlags := MakeDirCommand :=makedir CmpOptions := -g -O0 -Wall $(Preprocessors) C_CmpOptions := -g -O0 -Wall $(Preprocessors) LinkOptions := -IncludePath := $(IncludeSwitch). $(IncludeSwitch). $(IncludeSwitch)../../../portaudio/include +IncludePath := $(IncludeSwitch). $(IncludeSwitch). $(IncludeSwitch)../extern/include $(IncludeSwitch)../../../portaudio/include IncludePCH := RcIncludePath := Libs := $(LibrarySwitch)portaudio @@ -80,12 +80,12 @@ PreBuild: ## Objects ## $(IntermediateDirectory)/pa_class$(ObjectSuffix): pa_class.cpp $(IntermediateDirectory)/pa_class$(DependSuffix) - $(CompilerName) $(IncludePCH) $(SourceSwitch) "C:/Users/wittend/Projects/audio/portaudio_test/paEcho/pa_test/pa_class.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/pa_class$(ObjectSuffix) $(IncludePath) + $(CompilerName) $(IncludePCH) $(SourceSwitch) "C:/Users/wittend/Projects/Radio/fdmdv2/pa_test/pa_class.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/pa_class$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/pa_class$(DependSuffix): pa_class.cpp - @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/pa_class$(ObjectSuffix) -MF$(IntermediateDirectory)/pa_class$(DependSuffix) -MM "C:/Users/wittend/Projects/audio/portaudio_test/paEcho/pa_test/pa_class.cpp" + @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/pa_class$(ObjectSuffix) -MF$(IntermediateDirectory)/pa_class$(DependSuffix) -MM "C:/Users/wittend/Projects/Radio/fdmdv2/pa_test/pa_class.cpp" $(IntermediateDirectory)/pa_class$(PreprocessSuffix): pa_class.cpp - @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/pa_class$(PreprocessSuffix) "C:/Users/wittend/Projects/audio/portaudio_test/paEcho/pa_test/pa_class.cpp" + @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/pa_class$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/pa_test/pa_class.cpp" -include $(IntermediateDirectory)/*$(DependSuffix) @@ -98,6 +98,6 @@ clean: $(RM) $(IntermediateDirectory)/pa_class$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\Users\wittend\Projects\audio\portaudio_test\paEcho\.build-debug\pa_test" + $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-debug\pa_test" diff --git a/fdmdv2/pa_test/pa_test.project b/fdmdv2/pa_test/pa_test.project index 1774f1d4..3c024018 100644 --- a/fdmdv2/pa_test/pa_test.project +++ b/fdmdv2/pa_test/pa_test.project @@ -13,6 +13,8 @@ + + @@ -26,8 +28,7 @@ - - + @@ -58,7 +59,7 @@ - + @@ -97,13 +98,11 @@ - + - - diff --git a/fdmdv2/paclass.cpp b/fdmdv2/paclass.cpp new file mode 100644 index 00000000..bac2f6dc --- /dev/null +++ b/fdmdv2/paclass.cpp @@ -0,0 +1,212 @@ +#include "paclass.h" + +PortAudioWrap::PortAudioWrap() +{ + stream = NULL; + userData = NULL; + samplerate = 0; + framesPerBuffer = 0; + statusFlags = 0; + streamCallback = NULL; + streamFinishedCallback = NULL; + timeInfo = 0; +} + +PortAudioWrap::~PortAudioWrap() +{ +} + +PaError PortAudioWrap::init() +{ + return Pa_Initialize(); +} + +PaError PortAudioWrap::streamOpen() +{ + return Pa_OpenStream( + &stream, + &inputBuffer, + &outputBuffer, + samplerate, + framesPerBuffer, + statusFlags, + *streamCallback, + userData + ); +} + +PaError PortAudioWrap::streamStart() +{ + return Pa_StartStream(this->stream); +} + +PaError PortAudioWrap::streamClose() +{ + if(isOpen()) + { + PaError rv = Pa_CloseStream(this->stream); + this->stream = NULL; + return rv; + } + else + { + return paNoError; + } +} + +void PortAudioWrap::terminate() +{ + if(Pa_IsStreamStopped(stream) != paNoError) + { + Pa_StopStream(stream); + } + Pa_Terminate(); +} + +void PortAudioWrap::stop() +{ + Pa_StopStream(stream); +} + +void PortAudioWrap::abort() +{ + Pa_AbortStream(stream); +} + +bool PortAudioWrap::isStopped() const +{ + PaError ret = Pa_IsStreamStopped(stream); + return ret; +} + +bool PortAudioWrap::isActive() const +{ + PaError ret = Pa_IsStreamActive(stream); + return ret; +} + +bool PortAudioWrap::isOpen() const +{ + return (stream != NULL); +} + +PaDeviceIndex PortAudioWrap::getDefaultInputDevice() +{ + return Pa_GetDefaultInputDevice(); +} + +PaDeviceIndex PortAudioWrap::getDefaultOutputDevice() +{ + return Pa_GetDefaultOutputDevice(); +} + +PaError PortAudioWrap::setInputChannelCount(int count) +{ + inputBuffer.channelCount = count; + return paNoError; +} + +PaError PortAudioWrap::getInputChannelCount() +{ + return inputBuffer.channelCount; +} + +PaError PortAudioWrap::setInputSampleFormat(PaSampleFormat format) +{ + inputBuffer.sampleFormat = format; + return paNoError; +} + +PaError PortAudioWrap::setInputLatency(PaTime latency) +{ + inputBuffer.suggestedLatency = latency; + return paNoError; +} + +void PortAudioWrap::setInputHostApiStreamInfo(void *info) +{ + inputBuffer.hostApiSpecificStreamInfo = info; +} + +PaTime PortAudioWrap::getInputDefaultLowLatency() +{ + return Pa_GetDeviceInfo(inputBuffer.device)->defaultLowInputLatency; +} + +PaError PortAudioWrap::setOutputChannelCount(int count) +{ + outputBuffer.channelCount = count; + return paNoError; +} + +int PortAudioWrap::getOutputChannelCount() +{ + return outputBuffer.channelCount; +} + +const char *PortAudioWrap::getDeviceName(PaDeviceIndex dev) +{ + const PaDeviceInfo *info; + info = Pa_GetDeviceInfo(dev); + return info->name; +} + +PaError PortAudioWrap::setOutputSampleFormat(PaSampleFormat format) +{ + outputBuffer.sampleFormat = format; + return paNoError; +} + +PaError PortAudioWrap::setOutputLatency(PaTime latency) +{ + outputBuffer.suggestedLatency = latency; + return paNoError; +} + +void PortAudioWrap::setOutputHostApiStreamInfo(void *info) +{ + outputBuffer.hostApiSpecificStreamInfo = info; +} + +PaTime PortAudioWrap::getOutputDefaultLowLatency() +{ + return Pa_GetDeviceInfo(outputBuffer.device)->defaultLowOutputLatency; +} + +PaError PortAudioWrap::setFramesPerBuffer(unsigned long size) +{ + framesPerBuffer = size; + return paNoError; +} + +PaError PortAudioWrap::setSampleRate(unsigned long rate) +{ + samplerate = rate; + return paNoError; +} + +PaError PortAudioWrap::setStreamFlags(PaStreamFlags flags) +{ + statusFlags = flags; + return paNoError; +} + +PaError PortAudioWrap::setInputDevice(PaDeviceIndex index) +{ +// inputDevice = index; + inputBuffer.device = index; + return paNoError; +} + +PaError PortAudioWrap::setOutputDevice(PaDeviceIndex index) +{ +// outputDevice = index; + outputBuffer.device = index; + return paNoError; +} + +PaError PortAudioWrap::setCallback(PaStreamCallback *callback) +{ + streamCallback = callback; + return paNoError; +} diff --git a/fdmdv2/paclass.h b/fdmdv2/paclass.h new file mode 100644 index 00000000..f7418f83 --- /dev/null +++ b/fdmdv2/paclass.h @@ -0,0 +1,78 @@ +#include +#include +#include "portaudio.h" + +// Note that many of the older ISA sound cards on PCs do NOT support +// full duplex audio (simultaneous record and playback). +// And some only support full duplex at lower sample rates. +#define SAMPLE_RATE (44100) +#define PA_SAMPLE_TYPE paFloat32 //paInt16 +#define FRAMES_PER_BUFFER (64) + +typedef float SAMPLE; + +float CubicAmplifier(float input); + +class PortAudioWrap +{ + public: + PortAudioWrap(); + ~PortAudioWrap(); + + private: + PaStream *stream; + PaStreamParameters inputBuffer; + PaStreamParameters outputBuffer; + void *userData; + int samplerate; + unsigned long framesPerBuffer; + PaStreamCallbackFlags statusFlags; + PaStreamCallback *streamCallback; + PaStreamFinishedCallback *streamFinishedCallback; + const PaStreamCallbackTimeInfo *timeInfo; + PaDeviceIndex inputDevice; + PaDeviceIndex outputDevice; + + public: + + PaError streamOpen(); + + PaDeviceIndex getDefaultInputDevice(); + PaDeviceIndex getDefaultOutputDevice(); + + PaStreamParameters *getDeviceInfo(PaDeviceIndex idx); + PaError setFramesPerBuffer(unsigned long size); + PaError setSampleRate(unsigned long size); + PaError setStreamFlags(PaStreamFlags flags); + PaError setCallback(PaStreamCallback *streamCallback); + PaError setStreamCallback(PaStream *stream, PaStreamCallback* callback ) { streamCallback = callback; return 0;} + PaError setStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); + + PaError setInputDevice(PaDeviceIndex dev); + PaError setInputChannelCount(int count); + int getInputChannelCount(); + PaError setInputSampleFormat(PaSampleFormat format); + PaError setInputSampleRate(PaSampleFormat format); + PaError setInputLatency(PaTime latency); + void setInputHostApiStreamInfo(void *info = NULL); + PaTime getInputDefaultLowLatency(); + const char *getDeviceName(PaDeviceIndex dev); + + PaError setOutputDevice(PaDeviceIndex dev); + PaError setOutputChannelCount(int count); + int getOutputChannelCount(); + PaError setOutputSampleFormat(PaSampleFormat format); + PaError setOutputLatency(PaTime latency); + void setOutputHostApiStreamInfo(void *info = NULL); + PaTime getOutputDefaultLowLatency(); + + PaError init(); + PaError streamStart(); + PaError streamClose(); + void terminate(); + bool isOpen() const; + void stop(); + void abort(); + bool isStopped() const; + bool isActive() const; +}; diff --git a/fdmdv2/thread_audio.cpp b/fdmdv2/thread_audio.cpp index d5c465c3..ff1795e0 100644 --- a/fdmdv2/thread_audio.cpp +++ b/fdmdv2/thread_audio.cpp @@ -1,7 +1,7 @@ //========================================================================== // Name: thread_audio.cpp // -// Purpose: Implements simple wxWidgets application with GUI. +// Purpose: Implements a thread for processing an audio data stream. // Created: May 11, 2012 // Initial author: David Witten // License: BSD License (other licenses may apply to other @@ -38,6 +38,33 @@ static int audioCallback( void *inputBuffer, void *outputBuffer, unsigned long f } return 0; } + +AudioThread::AudioThread() +{ +} + +AudioThread::~AudioThread() +{ +} + +void* AudioThread::Entry() +{ + return NULL; +} +void AudioThread::OnDelete() +{ +} +void AudioThread::OnExit() +{ +} +void AudioThread::OnKill() +{ +} + +// bool Fdmdv2ThreadAudio::TestDestroy() +// { +// } + #ifdef PORTAUDIO_MAIN /* Use a PortAudioStream to process audio data. */ int main(void) diff --git a/fdmdv2/thread_audio.h b/fdmdv2/thread_audio.h index fa2cc4f4..22069572 100644 --- a/fdmdv2/thread_audio.h +++ b/fdmdv2/thread_audio.h @@ -10,6 +10,9 @@ #include #include "fdmdv2_main.h" +#ifndef __THREAD_AUDIO__ +#define __THREAD_AUDIO__ + //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= // Class AudioThread //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= @@ -18,9 +21,187 @@ class AudioThread: public wxThread public: AudioThread(MainFrame *handler) : wxThread(wxTHREAD_DETACHED){ m_pHandler = handler; } ~AudioThread(); + void *Entry(); + void OnDelete(); + void OnExit(); + void OnKill(); + bool TestDestroy(); protected: - virtual ExitCode Entry(); + //ExitCode Entry(); MainFrame *m_pHandler; }; + // declare a new type of event, to be used by our MyThread class: + wxDECLARE_EVENT(wxEVT_COMMAND_MYTHREAD_COMPLETED, wxThreadEvent); + wxDECLARE_EVENT(wxEVT_COMMAND_MYTHREAD_UPDATE, wxThreadEvent); + class MyFrame; + + class MyThread : public wxThread + { + public: + MyThread(MyFrame *handler) + : wxThread(wxTHREAD_DETACHED) + { m_pHandler = handler } + ~MyThread(); + + protected: + virtual ExitCode Entry(); + MyFrame *m_pHandler; + }; + + class MyFrame : public wxFrame + { + public: + ... + ~MyFrame() + { + // it's better to do any thread cleanup in the OnClose() + // event handler, rather than in the destructor. + // This is because the event loop for a top-level window is not + // active anymore when its destructor is called and if the thread + // sends events when ending, they won't be processed unless + // you ended the thread from OnClose. + // See @ref overview_windowdeletion for more info. + } + ... + void DoStartThread(); + void DoPauseThread(); + + // a resume routine would be nearly identic to DoPauseThread() + void DoResumeThread() { ... } + + void OnThreadUpdate(wxThreadEvent&); + void OnThreadCompletion(wxThreadEvent&); + void OnClose(wxCloseEvent&); + + protected: + MyThread *m_pThread; + wxCriticalSection m_pThreadCS; // protects the m_pThread pointer + + wxDECLARE_EVENT_TABLE(); + }; + + wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_CLOSE(MyFrame::OnClose) + EVT_MENU(Minimal_Start, MyFrame::DoStartThread) + EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_MYTHREAD_UPDATE, MyFrame::OnThreadUpdate) + EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_MYTHREAD_COMPLETED, MyFrame::OnThreadCompletion) + wxEND_EVENT_TABLE() + + wxDEFINE_EVENT(wxEVT_COMMAND_MYTHREAD_COMPLETED, wxThreadEvent) + wxDEFINE_EVENT(wxEVT_COMMAND_MYTHREAD_UPDATE, wxThreadEvent) + + void MyFrame::DoStartThread() + { + m_pThread = new MyThread(this); + + if ( m_pThread->Create() != wxTHREAD_NO_ERROR ) + { + wxLogError("Can't create the thread!"); + delete m_pThread; + m_pThread = NULL; + } + else + { + if (m_pThread->Run() != wxTHREAD_NO_ERROR ) + { + wxLogError("Can't create the thread!"); + delete m_pThread; + m_pThread = NULL; + } + + // after the call to wxThread::Run(), the m_pThread pointer is "unsafe": + // at any moment the thread may cease to exist (because it completes its work). + // To avoid dangling pointers OnThreadExit() will set m_pThread + // to NULL when the thread dies. + } + } + + wxThread::ExitCode MyThread::Entry() + { + while (!TestDestroy()) + { + // ... do a bit of work... + + wxQueueEvent(m_pHandler, new wxThreadEvent(wxEVT_COMMAND_MYTHREAD_UPDATE)); + } + + // signal the event handler that this thread is going to be destroyed + // NOTE: here we assume that using the m_pHandler pointer is safe, + // (in this case this is assured by the MyFrame destructor) + wxQueueEvent(m_pHandler, new wxThreadEvent(wxEVT_COMMAND_MYTHREAD_COMPLETED)); + + return (wxThread::ExitCode)0; // success + } + + MyThread::~MyThread() + { + wxCriticalSectionLocker enter(m_pHandler->m_pThreadCS); + + // the thread is being destroyed; make sure not to leave dangling pointers around + m_pHandler->m_pThread = NULL; + } + + void MyFrame::OnThreadCompletion(wxThreadEvent&) + { + wxMessageOutputDebug().Printf("MYFRAME: MyThread exited!\n"); + } + + void MyFrame::OnThreadUpdate(wxThreadEvent&) + { + wxMessageOutputDebug().Printf("MYFRAME: MyThread update...\n"); + } + + void MyFrame::DoPauseThread() + { + // anytime we access the m_pThread pointer we must ensure that it won't + // be modified in the meanwhile; since only a single thread may be + // inside a given critical section at a given time, the following code + // is safe: + wxCriticalSectionLocker enter(m_pThreadCS); + + if (m_pThread) // does the thread still exist? + { + // without a critical section, once reached this point it may happen + // that the OS scheduler gives control to the MyThread::Entry() function, + // which in turn may return (because it completes its work) making + // invalid the m_pThread pointer + + if (m_pThread->Pause() != wxTHREAD_NO_ERROR ) + wxLogError("Can't pause the thread!"); + } + } + + void MyFrame::OnClose(wxCloseEvent&) + { + { + wxCriticalSectionLocker enter(m_pThreadCS); + + if (m_pThread) // does the thread still exist? + { + wxMessageOutputDebug().Printf("MYFRAME: deleting thread"); + + if (m_pThread->Delete() != wxTHREAD_NO_ERROR ) + wxLogError("Can't delete the thread!"); + } + } // exit from the critical section to give the thread + // the possibility to enter its destructor + // (which is guarded with m_pThreadCS critical section!) + + while (1) + { + { // was the ~MyThread() function executed? + wxCriticalSectionLocker enter(m_pThreadCS); + if (!m_pThread) break; + } + + // wait for thread completion + wxThread::This()->Sleep(1); + } + + Destroy(); + } + + +#endif // __THREAD_AUDIO__ diff --git a/fdmdv2/topFrame.cpp b/fdmdv2/topFrame.cpp index 30db3808..1f9f2b1c 100644 --- a/fdmdv2/topFrame.cpp +++ b/fdmdv2/topFrame.cpp @@ -94,12 +94,15 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons snrSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("SNR") ), wxVERTICAL ); m_gaugeSNR = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( 15,135 ), wxGA_SMOOTH|wxGA_VERTICAL ); + m_gaugeSNR->SetToolTip( _("Display signal to noise ratio.") ); + snrSizer->Add( m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10 ); wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxVERTICAL ); m_textSNR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxPoint( -1,-1 ), wxSize( 35,25 ), wxTE_READONLY ); + m_textSNR->SetToolTip( _("Show S/N ratio numerically.") ); m_textSNR->SetMinSize( wxSize( 35,25 ) ); bSizer29->Add( m_textSNR, 0, wxALIGN_CENTER|wxALL, 1 ); @@ -114,6 +117,8 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons levelSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Level") ), wxVERTICAL ); m_gaugeLevel = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( 15,135 ), wxGA_SMOOTH|wxGA_VERTICAL ); + m_gaugeLevel->SetToolTip( _("Display signal level.") ); + levelSizer->Add( m_gaugeLevel, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10 ); @@ -129,6 +134,8 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons upperSizer = new wxBoxSizer( wxVERTICAL ); m_auiNbookCtrl = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM|wxAUI_NB_DEFAULT_STYLE ); + m_auiNbookCtrl->SetFont( wxFont( 6, 70, 90, 90, false, wxEmptyString ) ); + upperSizer->Add( m_auiNbookCtrl, 1, wxALIGN_TOP|wxEXPAND, 1 ); @@ -172,28 +179,43 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("SQ") ), wxVERTICAL ); m_sliderSQ = new wxSlider( this, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize( -1,100 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_VERTICAL ); + m_sliderSQ->SetToolTip( _("Set Squelch level.") ); + sbSizer3->Add( m_sliderSQ, 2, wxALIGN_CENTER|wxALL, 1 ); wxBoxSizer* bSizer131; bSizer131 = new wxBoxSizer( wxVERTICAL ); m_ckboxSQ = new wxCheckBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + m_ckboxSQ->SetToolTip( _("Activate/Deactivate Squelch") ); + bSizer131->Add( m_ckboxSQ, 0, wxALIGN_CENTER|wxALL, 5 ); sbSizer3->Add( bSizer131, 0, wxALIGN_CENTER, 5 ); - rightSizer->Add( sbSizer3, 3, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3 ); + rightSizer->Add( sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3 ); wxStaticBoxSizer* sbSizer5; sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Control") ), wxVERTICAL ); + wxBoxSizer* bSizer1511; + bSizer1511 = new wxBoxSizer( wxVERTICAL ); + + m_togBtnOnOff = new wxToggleButton( this, wxID_ANY, _("Start"), wxDefaultPosition, wxDefaultSize, 0 ); + m_togBtnOnOff->SetToolTip( _("Begin receiving data.") ); + + bSizer1511->Add( m_togBtnOnOff, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1 ); + + + sbSizer5->Add( bSizer1511, 0, wxEXPAND, 1 ); + wxBoxSizer* bSizer151; bSizer151 = new wxBoxSizer( wxVERTICAL ); m_togBtnSplit = new wxToggleButton( this, wxID_ANY, _("Split"), wxDefaultPosition, wxDefaultSize, 0 ); - m_togBtnSplit->SetToolTip( _("Toggle Split mode.") ); + m_togBtnSplit->SetToolTip( _("Toggle split frequency mode.") ); bSizer151->Add( m_togBtnSplit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1 ); @@ -215,7 +237,7 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons bSizer14 = new wxBoxSizer( wxVERTICAL ); m_togBtnALC = new wxToggleButton( this, wxID_ANY, _("ALC"), wxDefaultPosition, wxDefaultSize, 0 ); - m_togBtnALC->SetToolTip( _("Toggle ALC Mode.") ); + m_togBtnALC->SetToolTip( _("Toggle automatic level control mode.") ); bSizer14->Add( m_togBtnALC, 0, wxALL, 1 ); @@ -226,6 +248,8 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons bSizer11 = new wxBoxSizer( wxVERTICAL ); m_btnTogTX = new wxToggleButton( this, wxID_ANY, _("TX"), wxDefaultPosition, wxDefaultSize, 0 ); + m_btnTogTX->SetToolTip( _("Switch between Receive and Transmit") ); + bSizer11->Add( m_btnTogTX, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1 ); @@ -284,6 +308,7 @@ TopFrame::TopFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons m_sliderSQ->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( TopFrame::OnCmdSliderScrollChanged ), NULL, this ); m_sliderSQ->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( TopFrame::OnSliderScrollTop ), NULL, this ); m_ckboxSQ->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( TopFrame::OnCheckSQClick ), NULL, this ); + m_togBtnOnOff->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnOnOff ), NULL, this ); m_togBtnSplit->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnSplitClick ), NULL, this ); m_togBtnAnalog->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnAnalogClick ), NULL, this ); m_togBtnALC->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnALCClick ), NULL, this ); @@ -334,6 +359,7 @@ TopFrame::~TopFrame() m_sliderSQ->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( TopFrame::OnCmdSliderScrollChanged ), NULL, this ); m_sliderSQ->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( TopFrame::OnSliderScrollTop ), NULL, this ); m_ckboxSQ->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( TopFrame::OnCheckSQClick ), NULL, this ); + m_togBtnOnOff->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnOnOff ), NULL, this ); m_togBtnSplit->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnSplitClick ), NULL, this ); m_togBtnAnalog->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnAnalogClick ), NULL, this ); m_togBtnALC->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( TopFrame::OnTogBtnALCClick ), NULL, this ); @@ -429,60 +455,92 @@ DlgAudio::DlgAudio( wxWindow* parent, wxWindowID id, const wxString& title, cons bSizer34 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer10; - sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( m_panelDevices, wxID_ANY, _("PortAudio") ), wxVERTICAL ); + sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( m_panelDevices, wxID_ANY, _("PortAudio") ), wxHORIZONTAL ); wxBoxSizer* bSizer41; bSizer41 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer37; - bSizer37 = new wxBoxSizer( wxVERTICAL ); + wxGridSizer* gSizer6; + gSizer6 = new wxGridSizer( 3, 1, 0, 0 ); + gSizer6->SetMinSize( wxSize( 115,-1 ) ); m_radioBtnPortAudio = new wxRadioButton( m_panelDevices, wxID_ANY, _("PortAudio"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_radioBtnPortAudio->SetValue( true ); - bSizer37->Add( m_radioBtnPortAudio, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gSizer6->Add( m_radioBtnPortAudio, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxGridSizer* gSizer51; + gSizer51 = new wxGridSizer( 2, 2, 0, 0 ); + + gSizer51->SetMinSize( wxSize( 110,-1 ) ); + m_staticText151 = new wxStaticText( m_panelDevices, wxID_ANY, _("# Ch Out:"), wxDefaultPosition, wxSize( 80,-1 ), wxALIGN_RIGHT ); + m_staticText151->Wrap( -1 ); + m_staticText151->SetFont( wxFont( 7, 70, 90, 90, false, wxEmptyString ) ); + m_staticText151->SetMinSize( wxSize( 80,-1 ) ); + m_staticText151->SetMaxSize( wxSize( 80,-1 ) ); + + gSizer51->Add( m_staticText151, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND, 5 ); + + m_textNumChOut = new wxTextCtrl( m_panelDevices, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 30,-1 ), wxTE_READONLY ); + m_textNumChOut->SetFont( wxFont( 7, 70, 90, 90, false, wxEmptyString ) ); + m_textNumChOut->SetMinSize( wxSize( 30,-1 ) ); + m_textNumChOut->SetMaxSize( wxSize( 30,-1 ) ); + + gSizer51->Add( m_textNumChOut, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 ); + m_staticText141 = new wxStaticText( m_panelDevices, wxID_ANY, _("# Ch In:"), wxDefaultPosition, wxSize( 80,-1 ), wxALIGN_RIGHT ); + m_staticText141->Wrap( -1 ); + m_staticText141->SetFont( wxFont( 7, 70, 90, 90, false, wxEmptyString ) ); + m_staticText141->SetMinSize( wxSize( 80,-1 ) ); + m_staticText141->SetMaxSize( wxSize( 90,-1 ) ); - bSizer41->Add( bSizer37, 0, wxEXPAND, 5 ); + gSizer51->Add( m_staticText141, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND, 5 ); + + m_textNumChIn = new wxTextCtrl( m_panelDevices, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 30,-1 ), wxTE_READONLY ); + m_textNumChIn->SetFont( wxFont( 7, 70, 90, 90, false, wxEmptyString ) ); + m_textNumChIn->SetMinSize( wxSize( 30,-1 ) ); + m_textNumChIn->SetMaxSize( wxSize( 30,-1 ) ); + + gSizer51->Add( m_textNumChIn, 0, wxALL, 4 ); + + + gSizer6->Add( gSizer51, 0, wxEXPAND, 5 ); + + + bSizer41->Add( gSizer6, 0, wxALL, 5 ); wxGridSizer* gSizer7; - gSizer7 = new wxGridSizer( 4, 1, 0, 0 ); + gSizer7 = new wxGridSizer( 4, 2, 0, 0 ); - m_staticText14 = new wxStaticText( m_panelDevices, wxID_ANY, _("Audio in (mic) -> codec:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_staticText14 = new wxStaticText( m_panelDevices, wxID_ANY, _("Audio in (mic) -> codec:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT|wxST_NO_AUTORESIZE ); m_staticText14->Wrap( -1 ); gSizer7->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - m_staticText15 = new wxStaticText( m_panelDevices, wxID_ANY, _("codec -> Radio Tx: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_comboAudioCodec = new wxComboBox( m_panelDevices, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + gSizer7->Add( m_comboAudioCodec, 1, wxALL, 5 ); + + m_staticText15 = new wxStaticText( m_panelDevices, wxID_ANY, _("codec -> Radio Tx:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT|wxST_NO_AUTORESIZE ); m_staticText15->Wrap( -1 ); gSizer7->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - m_staticText16 = new wxStaticText( m_panelDevices, wxID_ANY, _("Radio Rx -> codec:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); - m_staticText16->Wrap( -1 ); - gSizer7->Add( m_staticText16, 0, wxALIGN_RIGHT|wxALL, 5 ); + m_comboCodecTx = new wxComboBox( m_panelDevices, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + gSizer7->Add( m_comboCodecTx, 1, wxALL, 5 ); - m_staticText17 = new wxStaticText( m_panelDevices, wxID_ANY, _("codec -> Audio out (spkr):"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); - m_staticText17->Wrap( -1 ); - gSizer7->Add( m_staticText17, 0, wxALIGN_RIGHT|wxALL, 5 ); - - - bSizer41->Add( gSizer7, 1, wxEXPAND, 5 ); - - wxGridSizer* gSizer5; - gSizer5 = new wxGridSizer( 4, 1, 0, 0 ); - - m_comboBox1 = new wxComboBox( m_panelDevices, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - gSizer5->Add( m_comboBox1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + m_staticText16 = new wxStaticText( m_panelDevices, wxID_ANY, _("Radio Rx -> codec:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT|wxST_NO_AUTORESIZE ); + m_staticText16->Wrap( -1 ); + gSizer7->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - m_comboBox2 = new wxComboBox( m_panelDevices, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - gSizer5->Add( m_comboBox2, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + m_comboRadioRx = new wxComboBox( m_panelDevices, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + gSizer7->Add( m_comboRadioRx, 1, wxALL, 5 ); - m_comboBox11 = new wxComboBox( m_panelDevices, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - gSizer5->Add( m_comboBox11, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + m_staticText17 = new wxStaticText( m_panelDevices, wxID_ANY, _("codec -> Audio out (spkr):"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT|wxST_NO_AUTORESIZE ); + m_staticText17->Wrap( -1 ); + gSizer7->Add( m_staticText17, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - m_comboBox12 = new wxComboBox( m_panelDevices, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - gSizer5->Add( m_comboBox12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + m_comboCodecSpkr = new wxComboBox( m_panelDevices, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + gSizer7->Add( m_comboCodecSpkr, 0, wxALL, 5 ); - bSizer41->Add( gSizer5, 1, wxEXPAND, 5 ); + bSizer41->Add( gSizer7, 0, wxALL|wxEXPAND, 5 ); sbSizer10->Add( bSizer41, 1, wxEXPAND, 5 ); @@ -496,7 +554,7 @@ DlgAudio::DlgAudio( wxWindow* parent, wxWindowID id, const wxString& title, cons wxBoxSizer* bSizer38; bSizer38 = new wxBoxSizer( wxVERTICAL ); - m_radioBtnFileOnly = new wxRadioButton( m_panelDevices, wxID_ANY, _("File Only"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_radioBtnFileOnly = new wxRadioButton( m_panelDevices, wxID_ANY, _("File Only"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer38->Add( m_radioBtnFileOnly, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); diff --git a/fdmdv2/topFrame.h b/fdmdv2/topFrame.h index 28e05a19..1c96167f 100644 --- a/fdmdv2/topFrame.h +++ b/fdmdv2/topFrame.h @@ -74,6 +74,7 @@ class TopFrame : public wxFrame wxToggleButton* m_togTxID; wxSlider* m_sliderSQ; wxCheckBox* m_ckboxSQ; + wxToggleButton* m_togBtnOnOff; wxToggleButton* m_togBtnSplit; wxToggleButton* m_togBtnAnalog; wxToggleButton* m_togBtnALC; @@ -114,6 +115,7 @@ class TopFrame : public wxFrame virtual void OnCmdSliderScrollChanged( wxScrollEvent& event ) { event.Skip(); } virtual void OnSliderScrollTop( wxScrollEvent& event ) { event.Skip(); } virtual void OnCheckSQClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTogBtnOnOff( wxCommandEvent& event ) { event.Skip(); } virtual void OnTogBtnSplitClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnTogBtnAnalogClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnTogBtnALCClick( wxCommandEvent& event ) { event.Skip(); } @@ -123,7 +125,7 @@ class TopFrame : public wxFrame public: wxAuiNotebook* m_auiNbookCtrl; - TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FDMDV2"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 732,507 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); + TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FDMDV2"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 761,500 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); ~TopFrame(); @@ -165,14 +167,18 @@ class DlgAudio : public wxDialog wxNotebook* m_nbAudioOptions; wxPanel* m_panelDevices; wxRadioButton* m_radioBtnPortAudio; + wxStaticText* m_staticText151; + wxTextCtrl* m_textNumChOut; + wxStaticText* m_staticText141; + wxTextCtrl* m_textNumChIn; wxStaticText* m_staticText14; + wxComboBox* m_comboAudioCodec; wxStaticText* m_staticText15; + wxComboBox* m_comboCodecTx; wxStaticText* m_staticText16; + wxComboBox* m_comboRadioRx; wxStaticText* m_staticText17; - wxComboBox* m_comboBox1; - wxComboBox* m_comboBox2; - wxComboBox* m_comboBox11; - wxComboBox* m_comboBox12; + wxComboBox* m_comboCodecSpkr; wxRadioButton* m_radioBtnFileOnly; wxPanel* m_panelSettings; wxListBox* m_lbRxInput; @@ -203,7 +209,7 @@ class DlgAudio : public wxDialog public: - DlgAudio( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,381 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DlgAudio( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 555,419 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DlgAudio(); }; diff --git a/fdmdv2/topFrame.py b/fdmdv2/topFrame.py index 658ef40d..854c6421 100644 --- a/fdmdv2/topFrame.py +++ b/fdmdv2/topFrame.py @@ -31,7 +31,7 @@ ID_ABOUT = 1008 class TopFrame ( wx.Frame ): def __init__( self, parent ): - wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"FDMDV2"), pos = wx.DefaultPosition, size = wx.Size( 732,507 ), style = wx.DEFAULT_FRAME_STYLE|wx.RESIZE_BORDER|wx.TAB_TRAVERSAL ) + wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"FDMDV2"), pos = wx.DefaultPosition, size = wx.Size( 761,500 ), style = wx.DEFAULT_FRAME_STYLE|wx.RESIZE_BORDER|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) ) @@ -101,11 +101,14 @@ class TopFrame ( wx.Frame ): snrSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, _(u"SNR") ), wx.VERTICAL ) self.m_gaugeSNR = wx.Gauge( self, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 15,135 ), wx.GA_SMOOTH|wx.GA_VERTICAL ) + self.m_gaugeSNR.SetToolTipString( _(u"Display signal to noise ratio.") ) + snrSizer.Add( self.m_gaugeSNR, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10 ) bSizer29 = wx.BoxSizer( wx.VERTICAL ) self.m_textSNR = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.Point( -1,-1 ), wx.Size( 35,25 ), wx.TE_READONLY ) + self.m_textSNR.SetToolTipString( _(u"Show S/N ratio numerically.") ) self.m_textSNR.SetMinSize( wx.Size( 35,25 ) ) bSizer29.Add( self.m_textSNR, 0, wx.ALIGN_CENTER|wx.ALL, 1 ) @@ -119,6 +122,8 @@ class TopFrame ( wx.Frame ): levelSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, _(u"Level") ), wx.VERTICAL ) self.m_gaugeLevel = wx.Gauge( self, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 15,135 ), wx.GA_SMOOTH|wx.GA_VERTICAL ) + self.m_gaugeLevel.SetToolTipString( _(u"Display signal level.") ) + levelSizer.Add( self.m_gaugeLevel, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10 ) @@ -132,6 +137,8 @@ class TopFrame ( wx.Frame ): upperSizer = wx.BoxSizer( wx.VERTICAL ) self.m_auiNbookCtrl = wx.aui.AuiNotebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.aui.AUI_NB_BOTTOM|wx.aui.AUI_NB_DEFAULT_STYLE ) + self.m_auiNbookCtrl.SetFont( wx.Font( 6, 70, 90, 90, False, wx.EmptyString ) ) + upperSizer.Add( self.m_auiNbookCtrl, 1, wx.ALIGN_TOP|wx.EXPAND, 1 ) @@ -170,25 +177,39 @@ class TopFrame ( wx.Frame ): sbSizer3 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, _(u"SQ") ), wx.VERTICAL ) self.m_sliderSQ = wx.Slider( self, wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.Size( -1,100 ), wx.SL_AUTOTICKS|wx.SL_INVERSE|wx.SL_VERTICAL ) + self.m_sliderSQ.SetToolTipString( _(u"Set Squelch level.") ) + sbSizer3.Add( self.m_sliderSQ, 2, wx.ALIGN_CENTER|wx.ALL, 1 ) bSizer131 = wx.BoxSizer( wx.VERTICAL ) self.m_ckboxSQ = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.CHK_2STATE ) + self.m_ckboxSQ.SetToolTipString( _(u"Activate/Deactivate Squelch") ) + bSizer131.Add( self.m_ckboxSQ, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) sbSizer3.Add( bSizer131, 0, wx.ALIGN_CENTER, 5 ) - rightSizer.Add( sbSizer3, 3, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.EXPAND, 3 ) + rightSizer.Add( sbSizer3, 2, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.EXPAND, 3 ) sbSizer5 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, _(u"Control") ), wx.VERTICAL ) + bSizer1511 = wx.BoxSizer( wx.VERTICAL ) + + self.m_togBtnOnOff = wx.ToggleButton( self, wx.ID_ANY, _(u"Start"), wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_togBtnOnOff.SetToolTipString( _(u"Begin receiving data.") ) + + bSizer1511.Add( self.m_togBtnOnOff, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 1 ) + + + sbSizer5.Add( bSizer1511, 0, wx.EXPAND, 1 ) + bSizer151 = wx.BoxSizer( wx.VERTICAL ) self.m_togBtnSplit = wx.ToggleButton( self, wx.ID_ANY, _(u"Split"), wx.DefaultPosition, wx.DefaultSize, 0 ) - self.m_togBtnSplit.SetToolTipString( _(u"Toggle Split mode.") ) + self.m_togBtnSplit.SetToolTipString( _(u"Toggle split frequency mode.") ) bSizer151.Add( self.m_togBtnSplit, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 1 ) @@ -208,7 +229,7 @@ class TopFrame ( wx.Frame ): bSizer14 = wx.BoxSizer( wx.VERTICAL ) self.m_togBtnALC = wx.ToggleButton( self, wx.ID_ANY, _(u"ALC"), wx.DefaultPosition, wx.DefaultSize, 0 ) - self.m_togBtnALC.SetToolTipString( _(u"Toggle ALC Mode.") ) + self.m_togBtnALC.SetToolTipString( _(u"Toggle automatic level control mode.") ) bSizer14.Add( self.m_togBtnALC, 0, wx.ALL, 1 ) @@ -218,6 +239,8 @@ class TopFrame ( wx.Frame ): bSizer11 = wx.BoxSizer( wx.VERTICAL ) self.m_btnTogTX = wx.ToggleButton( self, wx.ID_ANY, _(u"TX"), wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_btnTogTX.SetToolTipString( _(u"Switch between Receive and Transmit") ) + bSizer11.Add( self.m_btnTogTX, 1, wx.ALIGN_CENTER|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 1 ) @@ -268,6 +291,7 @@ class TopFrame ( wx.Frame ): self.m_sliderSQ.Bind( wx.EVT_SCROLL_CHANGED, self.OnCmdSliderScrollChanged ) self.m_sliderSQ.Bind( wx.EVT_SCROLL_TOP, self.OnSliderScrollTop ) self.m_ckboxSQ.Bind( wx.EVT_CHECKBOX, self.OnCheckSQClick ) + self.m_togBtnOnOff.Bind( wx.EVT_TOGGLEBUTTON, self.OnTogBtnOnOff ) self.m_togBtnSplit.Bind( wx.EVT_TOGGLEBUTTON, self.OnTogBtnSplitClick ) self.m_togBtnAnalog.Bind( wx.EVT_TOGGLEBUTTON, self.OnTogBtnAnalogClick ) self.m_togBtnALC.Bind( wx.EVT_TOGGLEBUTTON, self.OnTogBtnALCClick ) @@ -377,6 +401,9 @@ class TopFrame ( wx.Frame ): def OnCheckSQClick( self, event ): event.Skip() + def OnTogBtnOnOff( self, event ): + event.Skip() + def OnTogBtnSplitClick( self, event ): event.Skip() @@ -475,7 +502,7 @@ class DlgAbout ( wx.Dialog ): class DlgAudio ( wx.Dialog ): def __init__( self, parent ): - wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Audio Options"), pos = wx.DefaultPosition, size = wx.Size( 553,381 ), style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER ) + wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Audio Options"), pos = wx.DefaultPosition, size = wx.Size( 555,419 ), style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -485,60 +512,92 @@ class DlgAudio ( wx.Dialog ): self.m_panelDevices = wx.Panel( self.m_nbAudioOptions, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) bSizer34 = wx.BoxSizer( wx.VERTICAL ) - sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( self.m_panelDevices, wx.ID_ANY, _(u"PortAudio") ), wx.VERTICAL ) + sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( self.m_panelDevices, wx.ID_ANY, _(u"PortAudio") ), wx.HORIZONTAL ) bSizer41 = wx.BoxSizer( wx.HORIZONTAL ) - bSizer37 = wx.BoxSizer( wx.VERTICAL ) + gSizer6 = wx.GridSizer( 3, 1, 0, 0 ) + gSizer6.SetMinSize( wx.Size( 115,-1 ) ) self.m_radioBtnPortAudio = wx.RadioButton( self.m_panelDevices, wx.ID_ANY, _(u"PortAudio"), wx.DefaultPosition, wx.DefaultSize, wx.RB_GROUP ) self.m_radioBtnPortAudio.SetValue( True ) - bSizer37.Add( self.m_radioBtnPortAudio, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + gSizer6.Add( self.m_radioBtnPortAudio, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + gSizer51 = wx.GridSizer( 2, 2, 0, 0 ) - bSizer41.Add( bSizer37, 0, wx.EXPAND, 5 ) + gSizer51.SetMinSize( wx.Size( 110,-1 ) ) + self.m_staticText151 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"# Ch Out:"), wx.DefaultPosition, wx.Size( 80,-1 ), wx.ALIGN_RIGHT ) + self.m_staticText151.Wrap( -1 ) + self.m_staticText151.SetFont( wx.Font( 7, 70, 90, 90, False, wx.EmptyString ) ) + self.m_staticText151.SetMinSize( wx.Size( 80,-1 ) ) + self.m_staticText151.SetMaxSize( wx.Size( 80,-1 ) ) - gSizer7 = wx.GridSizer( 4, 1, 0, 0 ) + gSizer51.Add( self.m_staticText151, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL|wx.EXPAND, 5 ) - self.m_staticText14 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"Audio in (mic) -> codec:"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) - self.m_staticText14.Wrap( -1 ) - gSizer7.Add( self.m_staticText14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) + self.m_textNumChOut = wx.TextCtrl( self.m_panelDevices, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 30,-1 ), wx.TE_READONLY ) + self.m_textNumChOut.SetFont( wx.Font( 7, 70, 90, 90, False, wx.EmptyString ) ) + self.m_textNumChOut.SetMinSize( wx.Size( 30,-1 ) ) + self.m_textNumChOut.SetMaxSize( wx.Size( 30,-1 ) ) - self.m_staticText15 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"codec -> Radio Tx: "), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) - self.m_staticText15.Wrap( -1 ) - gSizer7.Add( self.m_staticText15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) + gSizer51.Add( self.m_textNumChOut, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) - self.m_staticText16 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"Radio Rx -> codec:"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) - self.m_staticText16.Wrap( -1 ) - gSizer7.Add( self.m_staticText16, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) + self.m_staticText141 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"# Ch In:"), wx.DefaultPosition, wx.Size( 80,-1 ), wx.ALIGN_RIGHT ) + self.m_staticText141.Wrap( -1 ) + self.m_staticText141.SetFont( wx.Font( 7, 70, 90, 90, False, wx.EmptyString ) ) + self.m_staticText141.SetMinSize( wx.Size( 80,-1 ) ) + self.m_staticText141.SetMaxSize( wx.Size( 90,-1 ) ) - self.m_staticText17 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"codec -> Audio out (spkr):"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) - self.m_staticText17.Wrap( -1 ) - gSizer7.Add( self.m_staticText17, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) + gSizer51.Add( self.m_staticText141, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL|wx.EXPAND, 5 ) + + self.m_textNumChIn = wx.TextCtrl( self.m_panelDevices, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 30,-1 ), wx.TE_READONLY ) + self.m_textNumChIn.SetFont( wx.Font( 7, 70, 90, 90, False, wx.EmptyString ) ) + self.m_textNumChIn.SetMinSize( wx.Size( 30,-1 ) ) + self.m_textNumChIn.SetMaxSize( wx.Size( 30,-1 ) ) + + gSizer51.Add( self.m_textNumChIn, 0, wx.ALL, 4 ) + + + gSizer6.Add( gSizer51, 0, wx.EXPAND, 5 ) + + + bSizer41.Add( gSizer6, 0, wx.ALL, 5 ) + gSizer7 = wx.GridSizer( 4, 2, 0, 0 ) - bSizer41.Add( gSizer7, 1, wx.EXPAND, 5 ) + self.m_staticText14 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"Audio in (mic) -> codec:"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT|wx.ST_NO_AUTORESIZE ) + self.m_staticText14.Wrap( -1 ) + gSizer7.Add( self.m_staticText14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) + + m_comboAudioCodecChoices = [] + self.m_comboAudioCodec = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u""), wx.DefaultPosition, wx.DefaultSize, m_comboAudioCodecChoices, 0 ) + gSizer7.Add( self.m_comboAudioCodec, 1, wx.ALL, 5 ) + + self.m_staticText15 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"codec -> Radio Tx:"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT|wx.ST_NO_AUTORESIZE ) + self.m_staticText15.Wrap( -1 ) + gSizer7.Add( self.m_staticText15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) - gSizer5 = wx.GridSizer( 4, 1, 0, 0 ) + m_comboCodecTxChoices = [] + self.m_comboCodecTx = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u""), wx.DefaultPosition, wx.DefaultSize, m_comboCodecTxChoices, 0 ) + gSizer7.Add( self.m_comboCodecTx, 1, wx.ALL, 5 ) - m_comboBox1Choices = [] - self.m_comboBox1 = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u"Combo!"), wx.DefaultPosition, wx.DefaultSize, m_comboBox1Choices, 0 ) - gSizer5.Add( self.m_comboBox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 ) + self.m_staticText16 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"Radio Rx -> codec:"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT|wx.ST_NO_AUTORESIZE ) + self.m_staticText16.Wrap( -1 ) + gSizer7.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) - m_comboBox2Choices = [] - self.m_comboBox2 = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u"Combo!"), wx.DefaultPosition, wx.DefaultSize, m_comboBox2Choices, 0 ) - gSizer5.Add( self.m_comboBox2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 ) + m_comboRadioRxChoices = [] + self.m_comboRadioRx = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u""), wx.DefaultPosition, wx.DefaultSize, m_comboRadioRxChoices, 0 ) + gSizer7.Add( self.m_comboRadioRx, 1, wx.ALL, 5 ) - m_comboBox11Choices = [] - self.m_comboBox11 = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u"Combo!"), wx.DefaultPosition, wx.DefaultSize, m_comboBox11Choices, 0 ) - gSizer5.Add( self.m_comboBox11, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 ) + self.m_staticText17 = wx.StaticText( self.m_panelDevices, wx.ID_ANY, _(u"codec -> Audio out (spkr):"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT|wx.ST_NO_AUTORESIZE ) + self.m_staticText17.Wrap( -1 ) + gSizer7.Add( self.m_staticText17, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) - m_comboBox12Choices = [] - self.m_comboBox12 = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u"Combo!"), wx.DefaultPosition, wx.DefaultSize, m_comboBox12Choices, 0 ) - gSizer5.Add( self.m_comboBox12, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 ) + m_comboCodecSpkrChoices = [] + self.m_comboCodecSpkr = wx.ComboBox( self.m_panelDevices, wx.ID_ANY, _(u""), wx.DefaultPosition, wx.DefaultSize, m_comboCodecSpkrChoices, 0 ) + gSizer7.Add( self.m_comboCodecSpkr, 0, wx.ALL, 5 ) - bSizer41.Add( gSizer5, 1, wx.EXPAND, 5 ) + bSizer41.Add( gSizer7, 0, wx.ALL|wx.EXPAND, 5 ) sbSizer10.Add( bSizer41, 1, wx.EXPAND, 5 ) @@ -550,7 +609,7 @@ class DlgAudio ( wx.Dialog ): bSizer38 = wx.BoxSizer( wx.VERTICAL ) - self.m_radioBtnFileOnly = wx.RadioButton( self.m_panelDevices, wx.ID_ANY, _(u"File Only"), wx.DefaultPosition, wx.DefaultSize, wx.RB_GROUP ) + self.m_radioBtnFileOnly = wx.RadioButton( self.m_panelDevices, wx.ID_ANY, _(u"File Only"), wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer38.Add( self.m_radioBtnFileOnly, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) diff --git a/fdmdv2/topFrame.xrc b/fdmdv2/topFrame.xrc index 5702aa2a..f0bb74c0 100644 --- a/fdmdv2/topFrame.xrc +++ b/fdmdv2/topFrame.xrc @@ -2,7 +2,7 @@ - 732,507 + 761,500 #e3e3e3 #000000 FDMDV2 @@ -97,6 +97,7 @@ 15,135 + Display signal to noise ratio. 100 0 @@ -115,6 +116,7 @@ -1,-1 35,25 + Show S/N ratio numerically. 0 @@ -137,6 +139,7 @@ 15,135 + Display signal level. 100 0 @@ -225,7 +228,7 @@ wxVERTICAL - + wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 3 @@ -238,6 +241,7 @@ -1,100 + Set Squelch level. 50 0 100 @@ -255,6 +259,7 @@ 5 + Activate/Deactivate Squelch 0 @@ -270,6 +275,24 @@ wxVERTICAL + + + wxEXPAND + 1 + + wxVERTICAL + + + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL + 1 + + Begin receiving data. + + 0 + + + + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND @@ -281,7 +304,7 @@ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL 1 - Toggle Split mode. + Toggle split frequency mode. 0 @@ -317,7 +340,7 @@ wxALL 1 - Toggle ALC Mode. + Toggle automatic level control mode. 0 @@ -335,6 +358,7 @@ wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL 1 + Switch between Receive and Transmit 0 @@ -445,7 +469,7 @@ - 553,381 + 555,419 Audio Options 1 @@ -467,7 +491,7 @@ wxEXPAND 5 - wxVERTICAL + wxHORIZONTAL @@ -477,13 +501,17 @@ wxHORIZONTAL - wxEXPAND + wxALL 5 - - wxVERTICAL + + 115,-1 + 3 + 1 + 0 + 0 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL 5 @@ -491,15 +519,99 @@ 1 + + + wxEXPAND + 5 + + 110,-1 + 2 + 2 + 0 + 0 + + + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND + 5 + + + 80,-1 + + 7 + default + + normal + 0 + + + -1 + + + + + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL + 5 + + + 30,-1 + + 7 + default + + normal + 0 + + + 0 + + + + + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND + 5 + + + 80,-1 + + 7 + default + + normal + 0 + + + -1 + + + + + wxALL + 4 + + + 30,-1 + + 7 + default + + normal + 0 + + + 0 + + + + - - wxEXPAND + + wxALL|wxEXPAND 5 4 - 1 + 2 0 0 @@ -507,85 +619,74 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 5 - + -1 - - wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + + wxALL 5 - - - - -1 + + <default> + - wxALIGN_RIGHT|wxALL + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 5 - - - + + + -1 - - wxALIGN_RIGHT|wxALL + + wxALL 5 - - - - -1 + + <default> + - - - - - wxEXPAND - 5 - - 4 - 1 - 0 - 0 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 5 - - Combo! - + + + + -1 - - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + + wxALL 5 - - Combo! + + <default> - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 5 - - Combo! - + + + + -1 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALL 5 - - Combo! + + <default> @@ -613,7 +714,6 @@ wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL 5 - 0