mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-20 02:52:00 -05:00
b6559fae7c
Audio input can be mono, left of stereo pair or, right of stereo pair. Audio output can be mono, left of stereo pair, right of stereo pair or, both of stereo pair (the same output goes to both channels in both mode). Settings are remembered between sessions. Stream channel suport is implemented mainly in the new AudioDevice class which is now the base class of Modulator and Detector. Audio channels are selected on the configuration screen. Only supported channel configurations per device can be selected. Audio output volume (actually attenuation) is now possible from the GUI. I have added a slider control to the main window; I don't necessarily propose this as a final release location for the widget as I understand that changes to the main screen are sensitive. This location is just a starting suggestion for a trial. The volume (attenuation) setting is remembered between sessions and is not device dependent. This addresses all issues of volume setting on *nix versions since there is no need to use pavucontrol to set audio levels. The volume (attenuation) action is logarithmic. Shaped CW keying has been implemented in Modulator although it is currently disabled as I am not 100% happy wth the implementation. If you want to try it define the C++ preprocessor macro WSJT_SOFT_KEYING in your build. The Modulator instance has been moved to the same thread as the SoundOutput instance as it should have been since the output callback already operates in that thread. Cross thread slots are now correctly called in a thread safe way as a result. A number of files where in the SVN repository with DOS line endings which I have removed. SVN users on Windows need set the config for native line endings so that DOS line endings are automatically stripped on checkin. The DevSetup class now holds it's UI o the heap to reduce imapact on build dependencies. The application settings are now passed to objects from the main.cpp file. Management of settings are moved to the responsible classes (top level windows). This has involved a few settings moving groups so users will see some settings reverting to default values on the first run of an update. Persistance of top level windows geometry and position is now handled in the recommened manner (constructor for load, closeEvent for store in modal windows and, hideEvent for store in modeless dialogs). The MainWindow class now holds its children as members rather than global variables. The LogQSO class now hides its implementation and takes responsibility for its own settings and widows rendering parameters. A new settings file group is implemented to persist the LogQSO class settings. The WideGraph class now hides its implementation and manages its own settings and window rendering parameters. --This line, and those below, will be ignored-- M Modulator.cpp M rigclass.cpp M widegraph.cpp M signalmeter.cpp M soundin.cpp M soundout.cpp M mainwindow.h M main.cpp M meterwidget.h M devsetup.cpp M mainwindow.ui M Detector.cpp M logqso.h M rigclass.h M mainwindow.cpp M meterwidget.cpp M soundin.h M devsetup.ui M wsjtx.pro M devsetup.h M logqso.cpp M Modulator.hpp M psk_reporter.cpp M killbyname.cpp M Detector.hpp M signalmeter.h M widegraph.h M psk_reporter.h M soundout.h M PSKReporter.h M lib/afc65b.f90 M lib/gran.c M lib/usleep.c M lib/afc9.f90 M lib/wrapkarn.c A AudioDevice.hpp git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3542 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
142 lines
3.6 KiB
C++
142 lines
3.6 KiB
C++
#ifndef DEVSETUP_H
|
|
#define DEVSETUP_H
|
|
|
|
#include <QDialog>
|
|
#include <QProcess>
|
|
#include <QMessageBox>
|
|
#include <QAudioDeviceInfo>
|
|
|
|
#include <hamlib/rig.h>
|
|
|
|
#include "rigclass.h"
|
|
#include "AudioDevice.hpp"
|
|
|
|
int rigCallback (rig_caps const *, void *);
|
|
|
|
namespace Ui {
|
|
class DevSetup;
|
|
}
|
|
|
|
class QComboBox;
|
|
|
|
class DevSetup : public QDialog
|
|
{
|
|
Q_OBJECT;
|
|
|
|
private:
|
|
Ui::DevSetup * ui;
|
|
|
|
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;
|
|
AudioDevice::Channel m_audioInputChannel;
|
|
AudioDevice::Channel m_audioOutputChannel;
|
|
|
|
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:
|
|
void loadAudioDevices (AudioDevices const&, QComboBox *);
|
|
void updateAudioChannels (QComboBox const *, int, QComboBox *, bool);
|
|
void enumerateRigs ();
|
|
Rig* rig;
|
|
void msgBox(QString t);
|
|
void setEnableAntennaDescriptions(bool enable);
|
|
void enableWidgets();
|
|
void openRig();
|
|
|
|
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
|