WSJT-X/devsetup.h

132 lines
3.3 KiB
C
Raw Normal View History

#ifndef DEVSETUP_H
#define DEVSETUP_H
#include "ui_devsetup.h"
#include <QDialog>
#include <QProcess>
#include <QMessageBox>
#include <QAudioDeviceInfo>
Qt 5 Audio replaces PortAudio. Currently only Qt5 or above is known to work with this code. It may be possible to backport it to Qt4 if required. Audio output goes back to a separate thread to try and minimize stutters in streaming on Windows particularly. A crash on Linux due to mishandling of stereo audio output has been fixed and both left and right channels are now correctly synthesised with identical contents. Rigs are enumerated directly from hamlib API rather than running a sub process reading output of rigctl -l. This was initially done to get rid of some GUI thread blocking in the configuration dialog, but is generally a better way of doing it anyway. Some refactoring in MainWindow to accomodate the audio streaming, modulation and detecting classes. Exit handling for application refactored to use signals rather than brute force event loop exit. This was required to get correct thread shutdown semantics. The GUI update timer is now stopped during application shutdown which is necessary to stop crashes when shutting down gracefully with signals and window close() calls. There is an outstanding issue with Linux audio streams; the QAudio Input/Output classes create a new stream name each time a stream is started. This doesn't play well with PulseAudio utilities such as pavucontrol to set stream volume as settings are lost every tx period. I have tried to keep a single stream for all output but there are problems restarting it that haven't been resolved yet. The QtCreator project file has been rearranged a little because it passes all the object files to the linker rather than using an archive library. Since the GNU linker is single pass; the object files need to be in a logical order with definitions appearing afer references to them. This was required to avoid a linking error. The lib/Makefile.linux has been enhanced to use the fortran compiler to locate the correct version of the Fortran library to use. This is necessary on the latest Linux distros because the unversioned symlink to compiler support libraries is no longer provided. This only an issue with mixed programming language links where the linker driver for one language has to link support libraraies for another language. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3532 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2013-08-07 19:09:13 -04:00
#include <hamlib/rig.h>
#include "rigclass.h"
Qt 5 Audio replaces PortAudio. Currently only Qt5 or above is known to work with this code. It may be possible to backport it to Qt4 if required. Audio output goes back to a separate thread to try and minimize stutters in streaming on Windows particularly. A crash on Linux due to mishandling of stereo audio output has been fixed and both left and right channels are now correctly synthesised with identical contents. Rigs are enumerated directly from hamlib API rather than running a sub process reading output of rigctl -l. This was initially done to get rid of some GUI thread blocking in the configuration dialog, but is generally a better way of doing it anyway. Some refactoring in MainWindow to accomodate the audio streaming, modulation and detecting classes. Exit handling for application refactored to use signals rather than brute force event loop exit. This was required to get correct thread shutdown semantics. The GUI update timer is now stopped during application shutdown which is necessary to stop crashes when shutting down gracefully with signals and window close() calls. There is an outstanding issue with Linux audio streams; the QAudio Input/Output classes create a new stream name each time a stream is started. This doesn't play well with PulseAudio utilities such as pavucontrol to set stream volume as settings are lost every tx period. I have tried to keep a single stream for all output but there are problems restarting it that haven't been resolved yet. The QtCreator project file has been rearranged a little because it passes all the object files to the linker rather than using an archive library. Since the GNU linker is single pass; the object files need to be in a logical order with definitions appearing afer references to them. This was required to avoid a linking error. The lib/Makefile.linux has been enhanced to use the fortran compiler to locate the correct version of the Fortran library to use. This is necessary on the latest Linux distros because the unversioned symlink to compiler support libraries is no longer provided. This only an issue with mixed programming language links where the linker driver for one language has to link support libraraies for another language. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3532 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2013-08-07 19:09:13 -04:00
int rigCallback (rig_caps const *, void *);
class DevSetup : public QDialog
{
Q_OBJECT
public:
DevSetup(QWidget *parent=0);
~DevSetup();
void initDlg();
qint32 m_idInt;
qint32 m_pttMethodIndex;
qint32 m_pttPort;
qint32 m_catPortIndex;
qint32 m_rig;
qint32 m_rigIndex;
qint32 m_serialRate;
qint32 m_serialRateIndex;
qint32 m_dataBits;
qint32 m_dataBitsIndex;
qint32 m_stopBits;
qint32 m_stopBitsIndex;
qint32 m_handshakeIndex;
qint32 m_test;
qint32 m_poll;
qint32 m_tmp;
typedef QList<QAudioDeviceInfo> AudioDevices;
AudioDevices m_audioInputDevices; /* available input devices */
AudioDevices m_audioOutputDevices; /* available output devices */
QAudioDeviceInfo m_audioInputDevice; /* selected input device */
QAudioDeviceInfo m_audioOutputDevice; /* selected output device */
bool m_restartSoundIn;
bool m_restartSoundOut;
bool m_pskReporter;
bool m_firstCall;
bool m_catEnabled;
bool m_After73;
bool m_bRigOpen;
bool m_bDTR;
bool m_bRTS;
bool m_pttData;
bool m_bSplit;
bool m_bXIT;
QString m_myCall;
QString m_myGrid;
QString m_saveDir;
QString m_azelDir;
QString m_catPort;
QString m_handshake;
QStringList m_macro;
QStringList m_dFreq; // per band frequency in MHz as a string
QStringList m_antDescription; // per band antenna description
QStringList m_bandDescription; // per band description
QMessageBox msgBox0;
public slots:
void accept();
void reject();
private slots:
void on_myCallEntry_editingFinished();
void on_myGridEntry_editingFinished();
void on_cbPSKReporter_clicked(bool checked);
void on_pttMethodComboBox_activated(int index);
void on_catPortComboBox_activated(int index);
void on_cbEnableCAT_toggled(bool checked);
void on_serialRateComboBox_activated(int index);
void on_handshakeComboBox_activated(int index);
void on_handshakeComboBox_currentIndexChanged(int index);
void on_dataBitsComboBox_activated(int index);
void on_stopBitsComboBox_activated(int index);
void on_rigComboBox_activated(int index);
void on_cbID73_toggled(bool checked);
void on_testCATButton_clicked();
void on_testPTTButton_clicked();
void on_DTRCheckBox_toggled(bool checked);
void on_RTSCheckBox_toggled(bool checked);
void on_rbData_toggled(bool checked);
void on_pollSpinBox_valueChanged(int n);
void on_pttComboBox_currentIndexChanged(int index);
void on_pttMethodComboBox_currentIndexChanged(int index);
void on_cbSplit_toggled(bool checked);
void on_cbXIT_toggled(bool checked);
private:
Qt 5 Audio replaces PortAudio. Currently only Qt5 or above is known to work with this code. It may be possible to backport it to Qt4 if required. Audio output goes back to a separate thread to try and minimize stutters in streaming on Windows particularly. A crash on Linux due to mishandling of stereo audio output has been fixed and both left and right channels are now correctly synthesised with identical contents. Rigs are enumerated directly from hamlib API rather than running a sub process reading output of rigctl -l. This was initially done to get rid of some GUI thread blocking in the configuration dialog, but is generally a better way of doing it anyway. Some refactoring in MainWindow to accomodate the audio streaming, modulation and detecting classes. Exit handling for application refactored to use signals rather than brute force event loop exit. This was required to get correct thread shutdown semantics. The GUI update timer is now stopped during application shutdown which is necessary to stop crashes when shutting down gracefully with signals and window close() calls. There is an outstanding issue with Linux audio streams; the QAudio Input/Output classes create a new stream name each time a stream is started. This doesn't play well with PulseAudio utilities such as pavucontrol to set stream volume as settings are lost every tx period. I have tried to keep a single stream for all output but there are problems restarting it that haven't been resolved yet. The QtCreator project file has been rearranged a little because it passes all the object files to the linker rather than using an archive library. Since the GNU linker is single pass; the object files need to be in a logical order with definitions appearing afer references to them. This was required to avoid a linking error. The lib/Makefile.linux has been enhanced to use the fortran compiler to locate the correct version of the Fortran library to use. This is necessary on the latest Linux distros because the unversioned symlink to compiler support libraries is no longer provided. This only an issue with mixed programming language links where the linker driver for one language has to link support libraraies for another language. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3532 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2013-08-07 19:09:13 -04:00
void enumerateRigs ();
Rig* rig;
void msgBox(QString t);
void setEnableAntennaDescriptions(bool enable);
void enableWidgets();
void openRig();
Ui::DialogSndCard ui;
Qt 5 Audio replaces PortAudio. Currently only Qt5 or above is known to work with this code. It may be possible to backport it to Qt4 if required. Audio output goes back to a separate thread to try and minimize stutters in streaming on Windows particularly. A crash on Linux due to mishandling of stereo audio output has been fixed and both left and right channels are now correctly synthesised with identical contents. Rigs are enumerated directly from hamlib API rather than running a sub process reading output of rigctl -l. This was initially done to get rid of some GUI thread blocking in the configuration dialog, but is generally a better way of doing it anyway. Some refactoring in MainWindow to accomodate the audio streaming, modulation and detecting classes. Exit handling for application refactored to use signals rather than brute force event loop exit. This was required to get correct thread shutdown semantics. The GUI update timer is now stopped during application shutdown which is necessary to stop crashes when shutting down gracefully with signals and window close() calls. There is an outstanding issue with Linux audio streams; the QAudio Input/Output classes create a new stream name each time a stream is started. This doesn't play well with PulseAudio utilities such as pavucontrol to set stream volume as settings are lost every tx period. I have tried to keep a single stream for all output but there are problems restarting it that haven't been resolved yet. The QtCreator project file has been rearranged a little because it passes all the object files to the linker rather than using an archive library. Since the GNU linker is single pass; the object files need to be in a logical order with definitions appearing afer references to them. This was required to avoid a linking error. The lib/Makefile.linux has been enhanced to use the fortran compiler to locate the correct version of the Fortran library to use. This is necessary on the latest Linux distros because the unversioned symlink to compiler support libraries is no longer provided. This only an issue with mixed programming language links where the linker driver for one language has to link support libraraies for another language. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3532 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2013-08-07 19:09:13 -04:00
friend int rigCallback (rig_caps const *, void *);
};
extern int ptt(int nport, int ntx, int* iptt, int* nopen);
#ifdef WIN32
extern "C" {
bool HRDInterfaceConnect(const wchar_t *host, const ushort);
void HRDInterfaceDisconnect();
bool HRDInterfaceIsConnected();
wchar_t* HRDInterfaceSendMessage(const wchar_t *msg);
void HRDInterfaceFreeString(const wchar_t *lstring);
}
#endif
#endif // DEVSETUP_H