kopia lustrzana https://gitlab.com/eliggett/wfview
Add local volume control for UDP connections.
rodzic
54daaccdfa
commit
c2091e9c4e
|
@ -827,8 +827,9 @@ bool audioHandler::init(const quint8 bits, const quint8 channels, const quint16
|
|||
return isInitialized;
|
||||
}
|
||||
|
||||
void audioHandler::setVolume(quint8 volume)
|
||||
void audioHandler::setVolume(unsigned char volume)
|
||||
{
|
||||
qDebug(logAudio()) << (isInput ? "Input" : "Output") << " setVolume: " << volume;
|
||||
if (audioOutput != Q_NULLPTR) {
|
||||
audioOutput->setVolume((qreal)(volume / 255.0));
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ public:
|
|||
bool setDevice(QAudioDeviceInfo deviceInfo);
|
||||
|
||||
void start();
|
||||
void setVolume(quint8 volume);
|
||||
void flush();
|
||||
void stop();
|
||||
|
||||
|
@ -64,6 +63,7 @@ public slots:
|
|||
private slots:
|
||||
void notified();
|
||||
void stateChanged(QAudio::State state);
|
||||
void setVolume(unsigned char volume);
|
||||
|
||||
signals:
|
||||
void audioMessage(QString message);
|
||||
|
|
|
@ -130,6 +130,7 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs)
|
|||
connect(ptty, SIGNAL(haveDataFromPort(QByteArray)), udp, SLOT(receiveDataFromUserToRig(QByteArray)));
|
||||
|
||||
connect(this, SIGNAL(haveChangeLatency(quint16)), udp, SLOT(changeLatency(quint16)));
|
||||
connect(this, SIGNAL(haveSetVolume(unsigned char)), udp, SLOT(setVolume(unsigned char)));
|
||||
|
||||
// Connect for errors/alerts
|
||||
connect(udp, SIGNAL(haveNetworkError(QString, QString)), this, SLOT(handleSerialPortError(QString, QString)));
|
||||
|
@ -1597,7 +1598,12 @@ void rigCommander::setRfGain(unsigned char level)
|
|||
|
||||
void rigCommander::setAfGain(unsigned char level)
|
||||
{
|
||||
sendLevelCmd(0x01, level);
|
||||
if (udp == Q_NULLPTR) {
|
||||
sendLevelCmd(0x01, level);
|
||||
}
|
||||
else {
|
||||
emit haveSetVolume(level);
|
||||
}
|
||||
}
|
||||
|
||||
void rigCommander::setRefAdjustCourse(unsigned char level)
|
||||
|
|
|
@ -216,6 +216,7 @@ signals:
|
|||
void haveDataForServer(QByteArray outData);
|
||||
void haveAudioData(audioPacket data);
|
||||
void initUdpHandler();
|
||||
void haveSetVolume(unsigned char level);
|
||||
|
||||
private:
|
||||
void setup();
|
||||
|
|
|
@ -119,6 +119,11 @@ void udpHandler::changeLatency(quint16 value)
|
|||
emit haveChangeLatency(value);
|
||||
}
|
||||
|
||||
void udpHandler::setVolume(unsigned char value)
|
||||
{
|
||||
emit haveSetVolume(value);
|
||||
}
|
||||
|
||||
void udpHandler::receiveFromCivStream(QByteArray data)
|
||||
{
|
||||
emit haveDataFromPort(data);
|
||||
|
@ -312,7 +317,8 @@ void udpHandler::dataReceived()
|
|||
|
||||
QObject::connect(civ, SIGNAL(receive(QByteArray)), this, SLOT(receiveFromCivStream(QByteArray)));
|
||||
QObject::connect(audio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket)));
|
||||
QObject::connect(this, SIGNAL(haveChangeLatency(quint16)), audio, SLOT(changeLatency(quint16)));
|
||||
QObject::connect(this, SIGNAL(haveChangeLatency(quint16)), audio, SLOT(changeLatency(quint16)));
|
||||
QObject::connect(this, SIGNAL(haveSetVolume(unsigned char)), audio, SLOT(setVolume(unsigned char)));
|
||||
|
||||
streamOpened = true;
|
||||
|
||||
|
@ -695,6 +701,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
qRegisterMetaType<audioPacket>();
|
||||
connect(this, SIGNAL(haveAudioData(audioPacket)), rxaudio, SLOT(incomingAudio(audioPacket)));
|
||||
connect(this, SIGNAL(haveChangeLatency(quint16)), rxaudio, SLOT(changeLatency(quint16)));
|
||||
connect(this, SIGNAL(haveSetVolume(unsigned char)), rxaudio, SLOT(setVolume(unsigned char)));
|
||||
connect(rxAudioThread, SIGNAL(finished()), rxaudio, SLOT(deleteLater()));
|
||||
|
||||
if (txCodec == 0x01)
|
||||
|
@ -815,7 +822,10 @@ void udpAudio::changeLatency(quint16 value)
|
|||
emit haveChangeLatency(value);
|
||||
}
|
||||
|
||||
|
||||
void udpAudio::setVolume(unsigned char value)
|
||||
{
|
||||
emit haveSetVolume(value);
|
||||
}
|
||||
|
||||
void udpAudio::dataReceived()
|
||||
{
|
||||
|
|
|
@ -179,9 +179,11 @@ signals:
|
|||
void setupRxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, QString port, quint8 resampleQuality);
|
||||
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
|
||||
public slots:
|
||||
void changeLatency(quint16 value);
|
||||
void setVolume(unsigned char value);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -238,14 +240,16 @@ public slots:
|
|||
void receiveFromCivStream(QByteArray);
|
||||
void receiveAudioData(const audioPacket &data);
|
||||
void changeLatency(quint16 value);
|
||||
void setVolume(unsigned char value);
|
||||
void init();
|
||||
|
||||
signals:
|
||||
void haveDataFromPort(QByteArray data); // emit this when we have data, connect to rigcommander
|
||||
void haveAudioData(audioPacket data); // emit this when we have data, connect to rigcommander
|
||||
void haveNetworkError(QString, QString);
|
||||
void haveNetworkStatus(QString);
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
void haveNetworkStatus(QString);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -2860,7 +2860,7 @@ void wfmain::on_rfGainSlider_valueChanged(int value)
|
|||
void wfmain::on_afGainSlider_valueChanged(int value)
|
||||
{
|
||||
// qDebug(logSystem()) << "Setting AF gain to " << value;
|
||||
emit setAfGain((unsigned char) value);
|
||||
emit setAfGain((unsigned char)value);
|
||||
}
|
||||
|
||||
void wfmain::receiveRfGain(unsigned char level)
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtInstall>msvc2019_64_5</QtInstall>
|
||||
<QtModules>core;opengl;network;gui;multimedia;widgets;serialport;printsupport</QtModules>
|
||||
<QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtInstall>msvc2019_64_5</QtInstall>
|
||||
|
|
|
@ -330,6 +330,7 @@
|
|||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="resources\install.sh">
|
||||
|
|
Ładowanie…
Reference in New Issue