$ wget http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0.tar.gz/\r
download\r
$ tar xvzf sox-14.4.0.tar.gz\r
-$ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp\r
- --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-\r
-waveaudio=no\r
+$ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-waveaudio=no\r
$ make && make install\r
\r
I couldn't find an install command line that worked, so manually copied the libs and include files.\r
CurrentFilePath :=\r
CurrentFileFullPath :=\r
User :=wittend\r
-Date :=11/30/2012\r
+Date :=12/3/2012\r
CodeLitePath :="D:\bin\CodeLite"\r
LinkerName :=g++\r
SharedObjectLinkerName :=g++ -shared -fPIC\r
IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/include \r
IncludePCH := \r
RcIncludePath := \r
-Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 \r
-ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" \r
+Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 $(LibrarySwitch)sox \r
+ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" "libsox" \r
LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/Radio/codec2-dev/src/.libs $(LibraryPathSwitch)d:/bin/MinGW-4.6.1/msys/1.0/local/lib $(LibraryPathSwitch)d:/Projects/Audio/libsndfile/lib \r
\r
##\r
AR := ar rcus\r
CXX := g++\r
CC := gcc\r
-CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1101\" $(Preprocessors)\r
-CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1101\" $(Preprocessors)\r
+CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors)\r
+CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors)\r
\r
\r
##\r
PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
WXCFG:=gcc_dll\mswu\r
UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3\r
-Objects=$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) \\r
- $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) \r
+Objects=$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) \\r
+ $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) \r
\r
##\r
## Main Build Targets \r
$(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix): ../src/fdmdv2_plot_scalar.cpp\r
@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scalar.cpp"\r
\r
-$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix): ../src/fdmdv2_hdw_ports.cpp $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix)\r
- $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) $(IncludePath)\r
-$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix): ../src/fdmdv2_hdw_ports.cpp\r
- @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp"\r
-\r
-$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix): ../src/fdmdv2_hdw_ports.cpp\r
- @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp"\r
-\r
$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix): ../src/fdmdv2_plot_waterfall_linux.cpp $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
$(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IncludePath)\r
$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix): ../src/fdmdv2_plot_waterfall_linux.cpp\r
$(IntermediateDirectory)/src_varicode$(PreprocessSuffix): ../src/varicode.c\r
@$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/varicode.c"\r
\r
+$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix): ../src/sox_biquad.c $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
+ $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/src_sox_biquad$(DependSuffix): ../src/sox_biquad.c\r
+ @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) -MF$(IntermediateDirectory)/src_sox_biquad$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/src/sox_biquad.c"\r
+\r
+$(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix): ../src/sox_biquad.c\r
+ @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c"\r
+\r
\r
-include $(IntermediateDirectory)/*$(DependSuffix)\r
##\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix)\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix)\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix)\r
- $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix)\r
- $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix)\r
- $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix)\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix)\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix)\r
$(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix)\r
$(RM) $(IntermediateDirectory)/src_varicode$(ObjectSuffix)\r
$(RM) $(IntermediateDirectory)/src_varicode$(DependSuffix)\r
$(RM) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix)\r
+ $(RM) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix)\r
+ $(RM) $(IntermediateDirectory)/src_sox_biquad$(DependSuffix)\r
+ $(RM) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix)\r
$(RM) $(OutputFile)\r
$(RM) $(OutputFile).exe\r
$(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\fdmdv2"\r
<File Name="../src/fdmdv2_plot_spectrum.cpp"/>
<File Name="../src/fdmdv2_pa_wrapper.cpp"/>
<File Name="../src/fdmdv2_plot_scalar.cpp"/>
- <File Name="../src/fdmdv2_hdw_ports.cpp"/>
<File Name="../src/fdmdv2_plot_waterfall_linux.cpp"/>
<File Name="../src/dlg_audiooptions.cpp"/>
<File Name="../src/dlg_filter.cpp"/>
<File Name="../src/varicode.c"/>
+ <File Name="../src/sox_biquad.c"/>
</VirtualDirectory>
<VirtualDirectory Name="include">
<File Name="../src/dlg_comports.h"/>
<File Name="../../codec2-dev/src/codec2.h"/>
<File Name="../../codec2-dev/src/fdmdv.h"/>
<File Name="../src/fdmdv2_defines.h"/>
- <File Name="../src/fdmdv2_hdw_ports.h"/>
<File Name="../../../Audio/portaudio/include/portaudio.h"/>
<File Name="../../../Audio/libsndfile/include/sndfile.h"/>
<File Name="../src/fdmdv2_plot_waterfall_linux.h"/>
<File Name="../src/dlg_filter.h"/>
<File Name="../src/varicode.h"/>
<File Name="../src/varicode_table.h"/>
+ <File Name="../src/sox_biquad.h"/>
+ <File Name="../../../../bin/MinGW-4.6.1/msys/1.0/local/include/sox.h"/>
+ <File Name="../../../../bin/MinGW-4.6.1/msys/1.0/local/include/ctb-0.16/ctb.h"/>
</VirtualDirectory>
<VirtualDirectory Name="resources">
<File Name="../src/FDMDV2.fbp"/>
<Library Value="libportaudiocpp.a"/>
<Library Value="libsamplerate.dll.a"/>
<Library Value="ctb-0.16.dll"/>
+ <Library Value="libsox"/>
</Linker>
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
<General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Debug" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
<Library Value="libportaudiocpp.a"/>
<Library Value="libsamplerate.dll.a"/>
<Library Value="ctb-0.16.dll"/>
+ <Library Value="libsox.la"/>
</Linker>
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
<General OutputFile="$(IntermediateDirectory)/freeDV" IntermediateDirectory="./Release" Command="./freeDV.exe" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no"/>
-./Debug/src_dlg_comports.o ./Debug/src_fdmdv2_main.o ./Debug/src_fdmdv2_plot.o ./Debug/src_topFrame.o ./Debug/src_fdmdv2_plot_scatter.o ./Debug/src_fdmdv2_plot_spectrum.o ./Debug/src_fdmdv2_pa_wrapper.o ./Debug/src_fdmdv2_plot_scalar.o ./Debug/src_fdmdv2_hdw_ports.o ./Debug/src_fdmdv2_plot_waterfall_linux.o ./Debug/src_dlg_audiooptions.o ./Debug/src_dlg_filter.o ./Debug/src_varicode.o \r
+./Debug/src_dlg_comports.o ./Debug/src_fdmdv2_main.o ./Debug/src_fdmdv2_plot.o ./Debug/src_topFrame.o ./Debug/src_fdmdv2_plot_scatter.o ./Debug/src_fdmdv2_plot_spectrum.o ./Debug/src_fdmdv2_pa_wrapper.o ./Debug/src_fdmdv2_plot_scalar.o ./Debug/src_fdmdv2_plot_waterfall_linux.o ./Debug/src_dlg_audiooptions.o ./Debug/src_dlg_filter.o ./Debug/src_varicode.o ./Debug/src_sox_biquad.o \r
<Project Name="pa_enum" Path="../tests/pa_enum/pa_enum.project" Active="No"/>
<Project Name="dialogTest" Path="dialogTest.project" Active="No"/>
<Project Name="bigButtonRig" Path="../../../code/SerialPortControl/bigButtonRig/bigButtonRig.project" Active="No"/>
+ <Project Name="libCTB" Path="libCTB/libCTB.project" Active="No"/>
+ <Project Name="enumSerial" Path="../tests/serial_enum/enumSerial.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Debug" Selected="yes">
<Project Name="fdmdv2" ConfigName="Debug"/>
<Project Name="appWithDlg" ConfigName="Debug"/>
<Project Name="dialogTest" ConfigName="Debug"/>
<Project Name="bigButtonRig" ConfigName="Debug"/>
+ <Project Name="libCTB" ConfigName="Debug"/>
+ <Project Name="enumSerial" ConfigName="Debug"/>
</WorkspaceConfiguration>
- <WorkspaceConfiguration Name="Release" Selected="no">
+ <WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="fdmdv2" ConfigName="Release"/>
<Project Name="rawbits" ConfigName="Release"/>
<Project Name="pa_enum" ConfigName="Release"/>
<Project Name="appWithDlg" ConfigName="Release"/>
<Project Name="dialogTest" ConfigName="Release"/>
<Project Name="bigButtonRig" ConfigName="Release"/>
+ <Project Name="libCTB" ConfigName="Release"/>
+ <Project Name="enumSerial" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
</CodeLite_Workspace>
// we have to be soundcard oriented at run time rather than
// Tx/Rx oriented as in this dialog.
// ---------------------------------------------------------------
-
g_nSoundCards = 0;
g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1;
return 0;
}
-/*
-//-------------------------------------------------------------------------
-// OnDeviceSelect()
-//-------------------------------------------------------------------------
-void AudioOptsDialog::OnDeviceSelect(wxListEvent& event)
-{
- wxListItem info;
- long item;
- item = m_listCtrlRxInDevices->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- wxMessageBox(m_listCtrlRxInDevices->GetItemText(item, 2), wxT("Item"), wxOK);
-}
-*/
-
//-------------------------------------------------------------------------
// buildListOfSupportedSampleRates()
//-------------------------------------------------------------------------
//==========================================================================
#include "dlg_comports.h"
#include "fdmdv2_main.h"
+#include <wx/msw/registry.h>
+#include <sstream>
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
// Class ComPortsDlg
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
{
-/*
- if(!bBitmapLoaded)
- {
- // We need to initialise the default bitmap handler
- wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
- wxC9ED9InitBitmapResources();
- bBitmapLoaded = true;
- }
-*/
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
this->SetSizer(mainSizer);
m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
m_ckUseSerialPTT->SetValue(false);
staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20);
-
+#ifdef __WXMSW__
wxArrayString m_listCtrlPortsArr;
m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE);
staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-
+#endif
+#ifdef __WXGTK__
+ wxBoxSizer* bSizer83;
+ bSizer83 = new wxBoxSizer(wxHORIZONTAL);
+ m_staticText12 = new wxStaticText(this, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0);
+ m_staticText12->Wrap(-1);
+ staticBoxSizer31->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5);
+ m_txtCtlDevicePath = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+ staticBoxSizer31->Add(m_txtCtlDevicePath, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL);
staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5);
wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL);
//-------------------------------------------------------------------------
void ComPortsDlg::populatePortList()
{
- int i = 0;
- wxListItem inf;
- wxString buf;
-
+#ifdef __WXMSW__
m_listCtrlPorts->Clear();
- std::vector<std::string>result;
wxArrayString aStr;
-
- ctb::GetAvailablePorts(result, false);
- for(int i = 0; i < result.size(); i++)
+ wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM"));
+ if(!key.Exists())
+ {
+ return;
+ }
+ else
{
- aStr.Add(result[i], 1);
+ // Get the number of subkeys and enumerate them.
+ if(!key.Open(wxRegKey::Read))
+ {
+ return;
+ }
+ size_t subkeys;
+ size_t values;
+ if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL))
+ {
+ return;
+ }
+ if(!key.HasValues())
+ {
+ return;
+ }
+ wxString key_name;
+ long el = 1;
+ key.GetFirstValue(key_name, el);
+ wxString valType;
+ wxString key_data;
+ for(unsigned int i = 0; i < values; i++)
+ {
+ key.QueryValue(key_name, key_data);
+ wxPrintf("Value: %s Data: %s\n", key_name, key_data);
+ aStr.Add(key_data, 1);
+ key.GetNextValue(key_name, el);
+ }
}
m_listCtrlPorts->Append(aStr);
+#endif
+#ifdef __WXGTK__
+#endif
}
//-------------------------------------------------------------------------
{
wxConfigBase *pConfig = wxConfigBase::Get();
wxString str;
- long l;
- int i;
if(inout == EXCHANGE_DATA_IN)
{
// m_ckUsePTTRtChan->SetValue(wxGetApp().m_boolUseTonePTT);
m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT);
str = wxGetApp().m_strRigCtrlPort;
+#ifdef __WXMSW__
m_listCtrlPorts->SetStringSelection(str);
+#endif
+#ifdef __WXGTK__
+ m_txtCtlDevicePath->SetValue(str);
+#endif
str = wxGetApp().m_strRigCtrlBaud;
// m_listCtrlBaudrates->SetStringSelection(str);
{
wxGetApp().m_boolUseSerialPTT = m_ckUseSerialPTT->IsChecked();
// wxGetApp().m_boolUseTonePTT = m_ckUsePTTRtChan->IsChecked();
+#ifdef __WXMSW__
wxGetApp().m_strRigCtrlPort = m_listCtrlPorts->GetStringSelection();
+#endif
+#ifdef __WXGTK__
+ wxGetApp().m_strRigCtrlPort = m_txtCtlDevicePath->GetValue();
+#endif
wxGetApp().m_boolUseRTS = m_rbUseRTS->GetValue();
wxGetApp().m_boolRTSPos = m_ckRTSPos->IsChecked();
wxGetApp().m_boolUseDTR = m_rbUseDTR->GetValue();
// pConfig->Write(wxT("/Rig/DataBits"), wxGetApp().m_strRigCtrlDatabits);
// pConfig->Write(wxT("/Rig/StopBits"), wxGetApp().m_strRigCtrlStopbits);
// pConfig->Write(wxT("/Rig/Parity"), wxGetApp().m_strRigCtrlParity);
- //m_textRigCtrlFlowControl
- pConfig->Flush();
+ pConfig->Flush();
}
delete wxConfigBase::Set((wxConfigBase *) NULL);
}
//-------------------------------------------------------------------------
void ComPortsDlg::DTRVPlusClicked(wxCommandEvent& event)
{
- //wxMessageBox(wxT("DTRVPlusClicked"));
}
//-------------------------------------------------------------------------
wxCheckBox* m_ckUsePTTRtChan;
wxListBox* m_listCtrlPorts;
wxCheckBox* m_ckUseSerialPTT;
+ wxTextCtrl *m_txtCtlDevicePath;
wxRadioButton* m_rbUseDTR;
wxCheckBox* m_ckRTSPos;
wxRadioButton* m_rbUseRTS;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
- protected:
+protected:
+ void ListAllPorts();
+
void populatePortList(void);
void PTTAudioClick(wxCommandEvent& event);
// void PTTPortSlelcted(wxCommandEvent& event);
this->Layout();
this->Centre(wxBOTH);
-
+
// Connect Events -------------------------------------------------------
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog));
+++ /dev/null
-//==========================================================================
-// Name: fdmdv2_enum_ports.cpp
-// Purpose: Tools to enumerate hardware ports (other than audio).
-// Created: Oct 2, 2012
-// Authors: David Rowe, David Witten
-//
-// License:
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General License version 2.1,
-// as published by the Free Software Foundation. This program is
-// distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-// License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#include "fdmdv2_hdw_ports.h"
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// class HdwPort()
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-HdwPort::HdwPort()
-{
- m_device_type = -1;
-}
-
-//#include <wx/arrimpl.cpp> // This is a magic incantation which must be done!
-//WX_DEFINE_OBJARRAY(ArrayOfPorts);
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-HdwPort::~HdwPort()
-{
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-void HdwPort::setType(int portType)
-{
- m_device_type = portType;
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-int HdwPort::getList()
-{
- int rv = 0;
-
- if(m_device_type != -1)
- {
- switch(m_device_type)
- {
- case PORT_TYPE_SERIAL:
- rv = getSerialPorts();
- break;
-
- case PORT_TYPE_USB:
- rv = getUSBPorts();
- break;
-
- case PORT_TYPE_VIRTUAL:
- rv = getVirtualPorts();
- break;
-
- case PORT_TYPE_PARALLEL:
- rv = getParallelPorts();
- break;
-
- case PORT_TYPE_IEEE1394:
- rv = getIEEE1394Ports();
- break;
-
- case PORT_TYPE_UNKNOWN:
- default:
- rv = 0;
- break;
- }
- }
- return rv;
-}
-
-//-------------------------------------------------------------------------
-// getSerialPorts()
-//-------------------------------------------------------------------------
-int HdwPort::getSerialPorts()
-{
- int rv = 0;
- return rv;
-}
-
-//-------------------------------------------------------------------------
-// getUSBPorts()
-//-------------------------------------------------------------------------
-int HdwPort::getUSBPorts()
-{
- int rv = 0;
- return rv;
-}
-
-//-------------------------------------------------------------------------
-// OnClose()
-//-------------------------------------------------------------------------
-int HdwPort::getVirtualPorts()
-{
- int rv = 0;
- return rv;
-}
-
-//-------------------------------------------------------------------------
-// getParallelPorts()
-//-------------------------------------------------------------------------
-int HdwPort::getParallelPorts()
-{
- int rv = 0;
- return rv;
-}
-
-//-------------------------------------------------------------------------
-// getIEEE1394Ports()
-//-------------------------------------------------------------------------
-int HdwPort::getIEEE1394Ports()
-{
- int rv = 0;
- return rv;
-}
-
-
+++ /dev/null
-//==========================================================================
-// Name: fdmdv2_enum_ports.h
-// Purpose: Tools to enumerate hardware ports (other than audio).
-// Created: Oct 2, 2012
-// Authors: David Rowe, David Witten
-//
-// License:
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.1,
-// as published by the Free Software Foundation. This program is
-// distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-// License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, see <http://www.gnu.org/licenses/>.
-//
-//==========================================================================
-#ifndef __FDMDV2_HDW_PORTS__
-#define __FDMDV2_HDW_PORTS__
-
-#include <string.h>
-#include "wx/wx.h"
-#include <wx/dynarray.h>
-#include "fdmdv2_main.h"
-
-enum
-{
- SER_PAR_NONE,
- SER_PAR_ODD,
- SER_PAR_EVEN,
- SER_PAR_MARK,
- SER_PAR_SPACE
-};
-
-enum
-{
- SER_FLOW_NONE,
- SER_FLOW_XONXOFF,
- SER_FLOW_RTSCTS,
- SER_FLOW_DSRDTR
-};
-
-enum
-{
- PORT_TYPE_SERIAL,
- PORT_TYPE_USB,
- PORT_TYPE_VIRTUAL,
- PORT_TYPE_PARALLEL,
- PORT_TYPE_IEEE1394,
- PORT_TYPE_UNKNOWN
-};
-
-enum
-{
- DEVICE_TYPE_SERIAL,
- DEVICE_TYPE_USB,
- DEVICE_TYPE_VIRTUAL,
- DEVICE_TYPE_PARALLEL,
- DEVICE_TYPE_BLUETOOTH,
- DEVICE_TYPE_NETWORK,
- DEVICE_TYPE_IEEE1394,
- DEVICE_TYPE_UNKNOWN
-};
-
-class HdwPort;
-
-WX_DECLARE_OBJARRAY(HdwPort, ArrayOfPorts);
-
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-// Class PortList
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-class HdwPort
-{
- public:
- HdwPort();
- ~HdwPort();
-
- protected:
- wxString m_name;
-
- private:
- int m_device_type;
- int m_device_emulation;
-
- void setType(int portType);
- int getList();
- int getSerialPorts();
- int getUSBPorts();
- int getVirtualPorts();
- int getParallelPorts();
- int getIEEE1394Ports();
-};
-
-
-#endif // __FDMDV2_HDW_PORTS__
wxGetApp().m_strRigCtrlStopbits = pConfig->Read(wxT("/Rig/StopBits"), wxT("1"));
wxGetApp().m_strRigCtrlParity = pConfig->Read(wxT("/Rig/Parity"), wxT("n"));
wxGetApp().m_boolUseTonePTT = pConfig->ReadBool(wxT("/Rig/UseTonePTT"), false);
- wxGetApp().m_boolUseSerialPTT = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"), true);
+ wxGetApp().m_boolUseSerialPTT = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"), false);
wxGetApp().m_boolUseRTS = pConfig->ReadBool(wxT("/Rig/UseRTS"), true);
wxGetApp().m_boolRTSPos = pConfig->ReadBool(wxT("/Rig/RTSPolarity"), false);
wxGetApp().m_boolUseDTR = pConfig->ReadBool(wxT("/Rig/UseDTR"), false);
m_togTxID->Disable();
m_togBtnAnalog->Disable();
//m_togBtnALC->Disable();
-
- SetupSerialPort();
+ SetupSerialPort();
+
// squelch settings
char sqsnr[15];
m_sliderSQ->SetValue((int)(g_SquelchLevel*2.0));
//----------------------------------------------------------------
void MainFrame::OnIdle(wxIdleEvent& event)
{
-
}
#endif // _USE_TIMER
}
g_tx = m_btnTogPTT->GetValue();
-
- // The following sets and clears may be exactly inverted.
- // I don't know and I'm not set up to tell yet.
- // If so, one just needs to invert the polarity selection
- // on the Tools>PTT configuration page.
- if(event.IsChecked())
- {
- if(wxGetApp().m_boolUseRTS) // Use RTS
- {
- if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateRts);
- }
- else // RTS asserted LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateRts);
- }
- }
- else // Use DTR
- {
- if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateDtr);
- }
- else // DTR asserted LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateDtr);
- }
- }
- }
- else // !isChecked() - so Clear
+ // Tortured and tortuous logic, it seems to me...
+ if(wxGetApp().m_boolUseSerialPTT && m_serialPort != NULL)
{
- if(wxGetApp().m_boolUseRTS) // Use RTS
+ if(event.IsChecked())
{
- if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+ if(wxGetApp().m_boolUseRTS) // Use RTS
{
- m_serialPort->ClrLineState(ctb::LinestateRts);
+ if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH
+ {
+ m_serialPort->SetLineState(ctb::LinestateRts);
+ }
+ else // RTS asserted LOW
+ {
+ m_serialPort->ClrLineState(ctb::LinestateRts);
+ }
}
- else // RTS cleared HIGH
+ else // Use DTR
{
- m_serialPort->SetLineState(ctb::LinestateRts);
+ if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH
+ {
+ m_serialPort->SetLineState(ctb::LinestateDtr);
+ }
+ else // DTR asserted LOW
+ {
+ m_serialPort->ClrLineState(ctb::LinestateDtr);
+ }
}
- }
- else // Use DTR
+ }
+ else // !isChecked() - so Clear
{
- if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+ if(wxGetApp().m_boolUseRTS) // Use RTS
{
- m_serialPort->ClrLineState(ctb::LinestateDtr);
+ if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
+ {
+ m_serialPort->ClrLineState(ctb::LinestateRts);
+ }
+ else // RTS cleared HIGH
+ {
+ m_serialPort->SetLineState(ctb::LinestateRts);
+ }
}
- else // DTR cleared HIGH
+ else // Use DTR
{
- m_serialPort->SetLineState(ctb::LinestateDtr);
+ if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
+ {
+ m_serialPort->ClrLineState(ctb::LinestateDtr);
+ }
+ else // DTR cleared HIGH
+ {
+ m_serialPort->SetLineState(ctb::LinestateDtr);
+ }
}
- }
- }
-
+ }
+ }
// reset level gauge
m_maxLevel = 0;
m_textLevel->SetLabel(wxT(""));
m_togTxID->Disable();
m_togBtnAnalog->Disable();
//m_togBtnALC->Disable();
- m_btnTogPTT->Disable();
+ //m_btnTogPTT->Disable();
CloseSerialPort();
Pa_Terminate();
Destroy();
//m_togRxID->Enable();
//m_togTxID->Enable();
m_togBtnAnalog->Enable();
+/*
if(m_serialPort != NULL)
{
m_btnTogPTT->Enable();
}
+*/
m_togBtnOnOff->SetLabel(wxT("Stop"));
// init modem and codec states
m_togRxID->Disable();
m_togTxID->Disable();
m_togBtnAnalog->Disable();
- m_btnTogPTT->Disable();
+ //m_btnTogPTT->Disable();
m_togBtnOnOff->SetLabel(wxT("Start"));
}
}
wxGetApp().m_strRigCtrlBaud.ToLong(&baudrate, 10);
if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
{
- wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits; //"8N1";
+ wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits;
m_serialPort = new ctb::SerialPort();
if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 )
{
{
m_serialPort->SetLineState(ctb::LinestateDtr);
}
- m_btnTogPTT->Enable(true);
+ //m_btnTogPTT->Enable(true);
m_btnTogPTT->SetValue(false);
}
else
{
m_serialPort = NULL;
m_device = NULL;
- m_btnTogPTT->Disable();
+ //m_btnTogPTT->Disable();
}
}
/*
## Auto Generated makefile by CodeLite IDE\r
## any manual changes will be erased \r
##\r
-## Release\r
+## Debug\r
ProjectName :=pa_enum\r
-ConfigurationName :=Release\r
+ConfigurationName :=Debug\r
WorkspacePath := "D:\Projects\Radio\fdmdv2\build"\r
ProjectPath := "D:\Projects\Radio\fdmdv2\tests\pa_enum"\r
-IntermediateDirectory :=./Release\r
+IntermediateDirectory :=./Debug\r
OutDir := $(IntermediateDirectory)\r
CurrentFileName :=\r
CurrentFilePath :=\r
CurrentFileFullPath :=\r
User :=wittend\r
-Date :=11/29/2012\r
+Date :=12/2/2012\r
CodeLitePath :="D:\bin\CodeLite"\r
LinkerName :=g++\r
SharedObjectLinkerName :=g++ -shared -fPIC\r
MakeDirCommand :=makedir\r
RcCmpOptions := $(shell wx-config --rcflags)\r
RcCompilerName :=windres\r
-LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes)\r
+LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes)\r
IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/ \r
IncludePCH := \r
RcIncludePath := \r
AR := ar rcus\r
CXX := g++\r
CC := gcc\r
-CXXFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1083\" $(Preprocessors)\r
-CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1083\" $(Preprocessors)\r
+CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors)\r
+CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors)\r
\r
\r
##\r
$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)\r
\r
$(IntermediateDirectory)/.d:\r
- @$(MakeDirCommand) "./Release"\r
+ @$(MakeDirCommand) "./Debug"\r
\r
PreBuild:\r
\r
$(RM) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix)\r
$(RM) $(OutputFile)\r
$(RM) $(OutputFile).exe\r
- $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\pa_enum"\r
+ $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\pa_enum"\r
\r
\r